/*
 * picoisland.pt: the design system
 * --------------------------------
 * Plain and photo-led: a white page, one sans family, big readable type, cards that carry a photo
 * where a page has one, and the source of every figure one click away. The accent is still verdelho
 * green, for links and affirmative state; amber is advisory; red is reserved for cancelled/closed.
 *
 * The token NAMES predate this look (they come from the "Basalt" system it replaced) and are kept so
 * that every stylesheet and the few inline styles that read them did not all have to change at once.
 * Read them as roles: --ink is the page, --bone the body text, --spark the accent.
 *
 * Files: this one is the base (tokens, type, layout, controls, site header and footer, shared
 * components). guide.css is the reading surface (breadcrumbs, answer box, stat bar, cards, hubs,
 * homepage). ferry.css, whale_calendar.css, blog.css and highlight.css are page-specific.
 *
 * With Propshaft, `stylesheet_link_tag :app` bundles every file in this directory.
 */

/* ---------------------------------------------------------------- Tokens --- */
:root {
  color-scheme: light dark;

  /* Surfaces */
  --ink:        oklch(0.995 0.002 95);   /* page background */
  --surface:    oklch(0.972 0.006 210);  /* alternating bands */
  --card:       oklch(1 0 0);            /* cards */
  --well:       oklch(0.955 0.007 210);  /* wells, inputs, nested */

  /* Lines */
  --border:        oklch(0.25 0.015 235 / 0.13);
  --border-soft:   oklch(0.25 0.015 235 / 0.08);
  --border-input:  oklch(0.25 0.015 235 / 0.28);

  /* Accent: verdelho green. Darkened from the old value so link text passes WCAG AA on white. */
  --spark:        oklch(0.50 0.11 155);
  --spark-hover:  oklch(0.42 0.11 155);
  --spark-border: oklch(0.50 0.11 155 / 0.35);
  --spark-tint:   oklch(0.96 0.03 155);
  --on-spark:     oklch(0.99 0 0);

  /* Status */
  --ok:          oklch(0.52 0.11 155);
  --warn:        oklch(0.58 0.13 65);
  --warn-tint:   oklch(0.96 0.04 85);
  --warn-border: oklch(0.62 0.13 65 / 0.4);
  --warn-ink:    oklch(0.38 0.08 65);
  --danger:      oklch(0.50 0.17 27);

  /* Text */
  --bone:        oklch(0.28 0.012 235);  /* body copy */
  --bone-bright: oklch(0.17 0.012 235);  /* headings */
  --muted:       oklch(0.47 0.015 235);  /* secondary */
  --muted-2:     oklch(0.54 0.012 235);  /* tertiary, captions (still AA on white) */

  /* The deep Atlantic band: footer, hero scrim, next-ferry box. Same in both themes. */
  --deep:        oklch(0.22 0.035 245);
  --deep-2:      oklch(0.27 0.035 245);
  --deep-text:   oklch(0.97 0.005 245);
  --deep-muted:  oklch(0.78 0.02 245);
  --deep-border: oklch(1 0 0 / 0.14);

  /* Status dots */
  --tl-red:    var(--danger);
  --tl-yellow: var(--warn);
  --tl-green:  var(--ok);
  --tl-grey:   oklch(0.75 0.006 235);

  /* Type: one family. Mono is the system stack, for code only. */
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Rhythm */
  --container: 1180px;
  --measure: 720px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(48px, 7vw, 88px);
  --section-x: var(--gutter);
  --header-h: 68px;

  /* Radii and depth */
  --r-card: 14px;
  --r-btn: 999px;
  --r-input: 10px;
  --r-pill: 999px;
  --r-chip: 8px;
  --shadow-card: 0 1px 2px oklch(0.2 0.02 235 / 0.06), 0 8px 24px oklch(0.2 0.02 235 / 0.06);
  --shadow-pop:  0 18px 48px oklch(0.2 0.02 235 / 0.18);
}

/* Dark mode re-points tokens and nothing else, so a component never needs a dark variant. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:        oklch(0.17 0.01 240);
    --surface:    oklch(0.20 0.012 240);
    --card:       oklch(0.215 0.012 240);
    --well:       oklch(0.25 0.012 240);

    --border:       oklch(1 0 0 / 0.12);
    --border-soft:  oklch(1 0 0 / 0.07);
    --border-input: oklch(1 0 0 / 0.24);

    --spark:        oklch(0.74 0.13 155);
    --spark-hover:  oklch(0.82 0.12 155);
    --spark-border: oklch(0.74 0.13 155 / 0.4);
    --spark-tint:   oklch(0.27 0.04 155);
    --on-spark:     oklch(0.16 0.02 155);

    --ok:          oklch(0.74 0.13 155);
    --warn:        oklch(0.78 0.13 75);
    --warn-tint:   oklch(0.27 0.04 75);
    --warn-border: oklch(0.78 0.13 75 / 0.4);
    --warn-ink:    oklch(0.88 0.08 80);
    --danger:      oklch(0.68 0.17 27);

    --bone:        oklch(0.88 0.008 240);
    --bone-bright: oklch(0.97 0.004 240);
    --muted:       oklch(0.74 0.012 240);
    --muted-2:     oklch(0.66 0.012 240);

    --deep:        oklch(0.13 0.02 245);
    --deep-2:      oklch(0.19 0.025 245);

    --shadow-card: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-pop:  0 18px 48px oklch(0 0 0 / 0.55);
  }
}

/* ------------------------------------------------------------------ Base --- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--spark); color: var(--on-spark); }

a { color: var(--spark); text-decoration: none; }
a:hover { color: var(--spark-hover); }
:focus-visible { outline: 2px solid var(--spark); outline-offset: 2px; border-radius: 4px; }

img, svg { max-width: 100%; display: block; }

/* Skip straight past the header to the page's own content. */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-input);
  background: var(--spark); color: var(--on-spark); font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--on-spark); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ Typography --- */
h1, h2, h3, h4 {
  color: var(--bone-bright);
  font-weight: 750;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; letter-spacing: -0.01em; font-weight: 700; }
h4 { font-size: 17px; letter-spacing: normal; font-weight: 700; }

/* Every number a reader might compare: departure times, metres, counts. */
.figure, .tabular-nums { font-variant-numeric: tabular-nums; }

p { margin: 0 0 1em; max-width: var(--measure); }

/* A short label above a heading. Sentence case and readable, not a tracked mono caption. */
.eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--spark);
  margin: 0 0 10px;
}

.lede { font-size: 19px; line-height: 1.6; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
code { font-family: var(--font-mono); font-size: 0.9em; }

/* ------------------------------------------------------------- Layout ------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; }

.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.section--well { background: var(--well); }
.section--bordered { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.grid { display: grid; gap: 24px; }
@media (min-width: 860px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Two columns that stack on a phone. minmax(0, …) so a wide table scrolls inside its column instead
   of pushing the page wider than the screen. */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; }
}

.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  padding: 13px 22px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.btn--primary { background: var(--spark); color: var(--on-spark); }
.btn--primary:hover { background: var(--spark-hover); color: var(--on-spark); }
.btn--secondary { background: transparent; color: var(--bone-bright); border-color: var(--border-input); }
.btn--secondary:hover { border-color: var(--spark); color: var(--spark); }
.btn--ghost { padding-inline: 0; color: var(--spark); background: transparent; }
.btn--ghost:hover { color: var(--spark-hover); }
.btn--block { width: 100%; justify-content: center; }
.btn--sm { padding: 9px 16px; font-size: 14px; }

/* Social sign-in buttons: fill colours are brand-mandated (Google, Apple), not theme tokens. */
.provider-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.provider-btns form.button_to { margin: 0; width: 100%; }
.provider-btn { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; padding: 13px; border-radius: var(--r-btn); border: 1px solid var(--border-input); background: #fff; color: #1f1f1f; font-weight: 600; font-size: 15px; cursor: pointer; font-family: inherit; transition: filter 120ms ease; }
.provider-btn:hover { filter: brightness(0.96); }
.provider-btn--apple { border-color: #000; background: #000; color: #fff; }
.provider-btn--apple:hover { filter: brightness(1.4); }
.provider-btn__logo { flex: 0 0 auto; display: block; }
.provider-caption { text-align: center; color: var(--muted-2); font-size: 13px; margin: 4px 0 0; }

/* Pills and chips */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--spark);
  border: 1px solid var(--spark-border); border-radius: var(--r-pill); padding: 6px 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 600; color: var(--bone);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 6px 14px;
}
a.chip:hover { border-color: var(--spark); color: var(--spark); }
.chip.is-active, a.chip[aria-current] { background: var(--bone-bright); border-color: var(--bone-bright); color: var(--ink); }

/* --------------------------------------------------------------- Forms ----- */
label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="number"], input[type="password"],
input[type="search"], input[type="date"], textarea, select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--bone-bright);
  background: var(--card);
  border: 1px solid var(--border-input);
  border-radius: var(--r-input);
  padding: 12px 15px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--spark); box-shadow: 0 0 0 3px var(--spark-tint); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }

.field { margin-bottom: 16px; }
.field-hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 14px; color: var(--warn); margin-top: 6px; }

/* --------------------------------------------------------------- Cards ----- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
}
.card__kicker { font-size: 14px; font-weight: 700; color: var(--spark); margin-bottom: 8px; }
.card__title { font-size: 18px; color: var(--bone-bright); margin: 0 0 8px; }
.card__body { font-size: 15px; color: var(--muted); margin: 0; }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-left: 26px; margin-bottom: 8px; font-size: 15px; color: var(--muted); }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.checks--x li::before { content: "✕"; color: var(--tl-red); }

/* A plain inset panel. Kept for the signed-in pages and the honest empty states. */
.well-block {
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px 20px;
  font-size: 15px;
}
.well-block__body { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-x: auto; }
.well-block__body .cmd::before { content: "$ "; color: var(--spark); }
.well-block__body .ok { color: var(--ok); }
.well-block__body .dim { color: var(--muted-2); }

/* Collapsed help. A native <details>, so it toggles with no JS under the enforced CSP. */
.disclosure { background: var(--well); border: 1px solid var(--border-soft); border-radius: var(--r-input); }
.disclosure > summary { padding: 13px 16px; color: var(--muted); font-size: 15px; cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "▸ "; color: var(--spark); }
.disclosure[open] > summary { color: var(--bone); border-bottom: 1px solid var(--border-soft); }
.disclosure[open] > summary::before { content: "▾ "; }
.disclosure__body { padding: 6px 16px 16px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.disclosure__body ol { margin: 0; padding-left: 20px; }
.disclosure__body li { margin: 12px 0; }
.disclosure__body code { color: var(--bone-bright); overflow-wrap: anywhere; }

.callout {
  background: var(--warn-tint); border: 1px solid var(--warn-border); border-radius: var(--r-input);
  padding: 18px 20px; color: var(--warn-ink); font-size: 15px;
}
.callout__label { font-size: 14px; font-weight: 700; }

/* ------------------------------------------------------- Status and trust --- */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; flex: none; }
.status-dot--ok { background: var(--ok); }
.status-dot--warn { background: var(--warn); }
.status-dot--danger { background: var(--danger); }
.status-dot--unknown { background: var(--tl-grey); }

/* The "Last verified" line. Reads an editor's `reviewed:` date and nothing else. */
.verified-stamp { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 4px; font-size: 14px; color: var(--muted); }
.verified-stamp a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-input); text-underline-offset: 2px; }
.verified-stamp--fresh .status-dot { background: var(--ok); }
.verified-stamp--stale { color: var(--warn-ink); }
.verified-stamp--stale .status-dot { background: var(--warn); }

/* Not dismissible: no close button, ever. */
.advisory-band {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warn-tint); border: 1px solid var(--warn-border); border-radius: var(--r-input);
  padding: 16px 18px; color: var(--warn-ink); font-size: 15px;
}
.advisory-band .status-dot { margin-top: 7px; }
.advisory-band strong { display: block; font-weight: 700; color: var(--bone-bright); }
.advisory-band p { margin: 4px 0 0; color: var(--warn-ink); }
.advisory-band--danger { background: color-mix(in oklch, var(--danger) 10%, var(--card)); border-color: color-mix(in oklch, var(--danger) 50%, transparent); }
.advisory-band--danger p { color: var(--bone); }

.offline-banner {
  display: flex; align-items: center; gap: 9px; background: var(--well); border: 1px solid var(--border);
  border-radius: var(--r-input); padding: 12px 14px; font-size: 15px; color: var(--muted);
}

/* ------------------------------------------------------------- Flash ------- */
.flash { border-radius: var(--r-input); padding: 12px 16px; margin-bottom: 16px; font-size: 15px; border: 1px solid var(--border); }
.flash--notice { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 40%, var(--border)); }
.flash--alert { color: var(--warn-ink); border-color: var(--warn-border); background: var(--warn-tint); }

/* ------------------------------------------------------------ Tables ------- */
/* A long address or url still has to go somewhere. Scroll the table, never the page. */
.table-scroll { overflow-x: auto; }

/* Label, value, source. A row with no source link is designed to look incomplete. */
.key-facts { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.key-facts th {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-align: left; padding: 8px 12px 8px 0; border-bottom: 2px solid var(--border);
}
.key-facts td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.key-facts td:first-child { color: var(--muted); }
.key-facts td:nth-child(2) { color: var(--bone-bright); font-weight: 600; }
.key-facts td:last-child { font-size: 14px; white-space: nowrap; }

/* ----------------------------------------------------------------- Prose --- */
/* Rendered markdown: guide bodies and blog posts. One definition for both. */
.prose { font-size: 17px; line-height: 1.75; color: var(--bone); max-width: var(--measure); }
@media (min-width: 860px) { .prose { font-size: 18px; } }
.prose h2 { font-size: clamp(23px, 2.6vw, 28px); line-height: 1.25; margin: 1.9em 0 0.55em; }
.prose h3 { font-size: 20px; margin: 1.6em 0 0.5em; }
.prose h4 { font-size: 17px; margin: 1.4em 0 0.5em; }
.prose > :first-child { margin-top: 0; }
.prose p { max-width: none; margin: 0 0 1.15em; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.35em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--spark); }
.prose a { text-decoration: underline; text-decoration-color: var(--spark-border); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--bone-bright); font-weight: 700; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--spark-border); color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose img { border-radius: var(--r-card); margin: 1.6em 0; }
.prose code { background: var(--well); border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 5px; font-size: 0.875em; }
.prose pre {
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  background: var(--well); border: 1px solid var(--border-soft); border-radius: var(--r-input);
  padding: 16px 18px; margin: 1.4em 0; overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--well); color: var(--bone-bright); font-weight: 700; }

/* ----------------------------------------------------------- Photography --- */
/* A photo here is a sourced claim, so the credit line is part of the component: most Commons files
   are CC BY-SA and require it, and so does the Unsplash API. */
.figure { margin: 0 0 28px; }
.figure img {
  display: block; width: 100%; height: auto;
  border-radius: var(--r-card); background: var(--well);
}
.figure__caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 10px; }
.figure__text { font-size: 15px; line-height: 1.5; color: var(--muted); }
.figure__credit { font-size: 13px; line-height: 1.5; color: var(--muted-2); }
.figure__credit a { color: var(--muted-2); text-decoration: underline; text-underline-offset: 2px; }
.figure__credit a:hover { color: var(--spark); }

/* --------------------------------------------------------- Site header ----- */
/* White, sticky, and short. Built on <details>, not on a Stimulus disclosure: it works with JS off,
   which under the enforced CSP is the failure to design for. */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--ink) 90%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }

.logo {
  display: inline-flex; align-items: baseline; gap: 1px; flex: none;
  font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--bone-bright);
}
.logo:hover { color: var(--bone-bright); }
.logo .dot { color: var(--spark); }

.site-nav { display: none; align-items: center; gap: 2px; margin-left: 8px; }
.site-nav__disc { position: relative; }
.site-nav__label {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  padding: 8px 11px; border-radius: var(--r-input);
  font-size: 15px; font-weight: 600; color: var(--bone); white-space: nowrap;
}
.site-nav__label::-webkit-details-marker { display: none; }
.site-nav__label::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: 0.6; transition: transform 120ms ease;
}
.site-nav__label:hover, .site-nav__disc[open] .site-nav__label { background: var(--well); color: var(--bone-bright); }
.site-nav__disc[open] .site-nav__label::after { transform: rotate(225deg); margin-top: 3px; }
.site-nav__label.is-active { color: var(--spark); }

.site-nav__menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 240px; padding: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
}
/* The last sections anchor their panel to the right, or it runs off the screen. */
.site-nav__disc:nth-last-child(-n+2) .site-nav__menu { left: auto; right: 0; }
.site-nav__link { display: block; padding: 9px 12px; border-radius: 8px; font-size: 15px; color: var(--bone); white-space: nowrap; }
.site-nav__link:hover { background: var(--well); color: var(--bone-bright); }
.site-nav__link--overview { font-weight: 700; color: var(--spark); }

/* Search, in the header. The form works without JS: a GET to /search. */
.site-search { position: relative; flex: 1 1 auto; max-width: 260px; margin-left: auto; }
.site-search input[type="search"] {
  padding: 9px 14px 9px 38px; font-size: 15px; border-radius: var(--r-pill);
  background: var(--well); border-color: transparent;
}
.site-search input[type="search"]:focus { background: var(--card); border-color: var(--spark); }
.site-search__icon { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.site-header .site-search { display: none; }

/* The phone sheet: one burger, the search box first, then every section. */
.site-sheet { margin-left: auto; }
.site-sheet__burger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 14px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 700; color: var(--bone-bright);
  border: 1px solid var(--border-input); border-radius: var(--r-btn);
}
.site-sheet__burger::-webkit-details-marker { display: none; }
.site-sheet__burger svg { width: 18px; height: 18px; }
.site-sheet__panel {
  position: absolute; left: 0; right: 0; top: var(--header-h); z-index: 60;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 16px var(--gutter) 28px;
  background: var(--ink); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-pop);
}
.site-sheet__panel .site-search { display: block; max-width: none; margin: 0 0 12px; }
.site-sheet__group { padding: 12px 0; border-top: 1px solid var(--border-soft); }
.site-sheet__section { display: block; font-size: 17px; font-weight: 800; color: var(--bone-bright); padding: 4px 0; }
.site-sheet__links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.site-sheet__link { font-size: 15px; color: var(--muted); padding: 4px 0; }
.site-sheet__link:hover { color: var(--spark); }

@media (min-width: 1024px) {
  .site-nav { display: flex; }
  .site-header .site-search { display: block; }
  .site-sheet { display: none; }
}

/* Signed-in pages: the same bar, carrying the account menu instead of the sections. */
.account { position: relative; display: inline-flex; margin-left: auto; }
.account__trigger {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
  background: transparent; border: 1px solid var(--border-input); border-radius: var(--r-btn);
  color: var(--bone-bright); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.account__trigger:hover { border-color: var(--spark); color: var(--spark); }
.account__label { display: none; }
.account__caret { width: 14px; height: 14px; display: none; transition: transform 0.15s; }
.account__trigger[aria-expanded="true"] .account__caret { transform: rotate(180deg); }
.account__burger { width: 20px; height: 20px; }
@media (min-width: 860px) {
  .account__label, .account__caret { display: inline-flex; }
  .account__burger { display: none; }
}
.account__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 232px; z-index: 60;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
}
.account__menu[hidden] { display: none; }
.account__email {
  padding: 8px 10px 10px; font-size: 13px; color: var(--muted-2);
  border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis;
}
.account__menu form { margin: 0; }
.account__item {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: var(--r-chip);
  background: transparent; color: var(--bone); font-family: inherit; font-size: 15px; cursor: pointer;
}
.account__item:hover { background: var(--well); color: var(--bone-bright); }
body.nav-locked { overflow: hidden; }

/* --------------------------------------------------------- Site footer ----- */
/* Real navigation, not legal boilerplate: the same table of contents the header renders. */
.site-footer { margin-top: var(--section-y); background: var(--deep); color: var(--deep-muted); font-size: 15px; }
.site-footer a { color: var(--deep-muted); }
.site-footer a:hover { color: var(--deep-text); }

.site-footer__news {
  display: grid; gap: 16px 40px; align-items: center;
  padding-block: 40px; border-bottom: 1px solid var(--deep-border);
}
@media (min-width: 860px) { .site-footer__news { grid-template-columns: 1.2fr 1fr; } }
.site-footer__news h2 { color: var(--deep-text); font-size: 24px; margin: 0 0 6px; }
.site-footer__news p { margin: 0; }
.site-footer__form { display: flex; gap: 8px; }
.site-footer__form input[type="email"] { background: var(--deep-2); border-color: var(--deep-border); color: var(--deep-text); }
.site-footer__form input[type="email"]::placeholder { color: var(--deep-muted); }

.site-footer__cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px;
  padding-block: 40px 32px;
}
@media (min-width: 860px) { .site-footer__cols { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.site-footer__col { display: flex; flex-direction: column; gap: 8px; }
.site-footer__title { font-size: 15px; font-weight: 800; color: var(--deep-text); margin-bottom: 2px; }
.site-footer__title a { color: inherit; }

.site-footer__bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-block: 20px 28px; border-top: 1px solid var(--deep-border); font-size: 14px;
}
.site-footer__bottom p { margin: 0; }
.site-footer .logo { color: var(--deep-text); }

/* --------------------------------------------------------- Utilities ------- */
.auth-card { max-width: 440px; margin: 64px auto; }

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .lede { font-size: 17px; }
  .auth-card { margin: 32px auto; }
  .btn { padding: 12px 18px; }
}
