/*
 * Base: element defaults, typography, links, focus, selection.
 * Loaded after Bootstrap, so these win over its reboot at equal specificity.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
  overflow-x: clip;
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  text-wrap: balance;
  /* Plus Jakarta Sans has a narrow word space; with tight tracking words
     visually run together at display sizes. */
  word-spacing: 0.06em;
}

h1, .h1 { font-size: var(--text-4xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
h2, .h2 { font-size: var(--text-3xl); line-height: 1.15; }
h3, .h3 { font-size: var(--text-xl); }
h4, .h4 { font-size: var(--text-lg); }
h5, .h5 { font-size: var(--text-md); }
h6, .h6 { font-size: var(--text-base); }

p { text-wrap: pretty; }

strong, b { font-weight: 650; color: inherit; }

small, .small { font-size: var(--text-sm); }

/* ---------- Links ---------- */
a {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

a:hover { color: var(--color-primary-dark); }

/* Body-copy links get a real underline (WCAG 1.4.1: don't rely on colour). */
.prose a,
.post-body a,
.legal a,
.tab-content p a,
.accordion-body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.prose a:hover,
.post-body a:hover,
.legal a:hover,
.tab-content p a:hover,
.accordion-body a:hover {
  text-decoration-color: currentColor;
}

/* ---------- Media ---------- */
img, svg, video, picture {
  max-width: 100%;
  height: auto;
}

img { display: block; }

iframe { max-width: 100%; }

/* ---------- Focus ---------- */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--color-primary-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--rose-200);
  color: var(--ink-900);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--duration-base) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); color: #fff; }

/* ---------- Layout primitives ---------- */
.main { display: block; }

/* base.html wraps every page in .container-fluid; remove its gutters so
   sections can run full-bleed and manage their own containers. */
.main > .container-fluid { padding-left: 0; padding-right: 0; }

.container,
.container-xl {
  --bs-gutter-x: calc(var(--gutter) * 2);
  max-width: var(--container-max);
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  opacity: 1;
}

/* Shared "eyebrow" label style */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-primary-strong);
}

/* Utility used by scripts to hide things accessibly */
[hidden] { display: none !important; }
