/* The shell around the planner: header, footer, prose and forms.
 *
 * Everything colour and type is a token from tokens.css. Nothing here repeats
 * a hex, so a palette change is one file.
 */

/* ── Header ────────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(10px)) {
  .site-head { background: var(--paper); }
}
.site-head-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 12px;
  min-height: var(--head-h);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.site-brand:hover { color: var(--ink); }
.site-brand-mark { width: 24px; height: 24px; border-radius: 5px; }
.site-brand-tld { color: var(--teal); }

.site-year {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-left: 1px solid var(--line);
  padding-left: 20px;
  white-space: nowrap;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); background: var(--paper-2); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--teal); border-radius: 0; }

.site-cta {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--card);
  font-size: 0.78125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.site-cta:hover { background: var(--teal); border-color: var(--teal); color: var(--card); }

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-foot {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.site-foot-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 28px 40px;
  padding-block: 28px 34px;
  font-size: 0.78125rem;
  color: var(--ink-3);
  line-height: 1.6;
}
.site-foot h2 {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
}
.site-foot ul { margin: 0; padding: 0; list-style: none; }
.site-foot li + li { margin-top: 5px; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--pink); text-decoration: underline; }
/* A link inside a sentence needs more than colour to mark it (WCAG 1.4.1).
   A link list does not — the list is the affordance — which is why only the
   ones in a paragraph get the underline back. */
.site-foot p a { text-decoration: underline; text-underline-offset: 2px; }
.site-foot p { margin: 0 0 8px; }
.site-foot-made { color: var(--ink-3); }
.site-foot-heart { color: var(--pink); font-style: normal; }
.site-foot-bottom {
  border-top: 1px solid var(--line);
  padding-block: 8px 16px;
  font-size: 0.71875rem;
  color: var(--ink-4);
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  align-items: center;
}
/* A row of links, not links inside a sentence, so 2.5.8 applies in full: 24px
   of height each, made of padding rather than a bigger font. */
.site-foot-bottom > * {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-inline: 4px;
}

/* ── Prose ─────────────────────────────────────────────────────────────── */

.prose { max-width: 44rem; font-size: 1rem; line-height: 1.7; color: var(--ink-2); }
/* .shell centres its box at the page width; .prose narrows it to a reading
   measure. On one element the narrow max-width wins and .shell's auto margins
   then centre the whole column, so the prose drifts to the middle of the page
   while every heading outside it stays left — which looks like a bug and is
   one. So the shell keeps the page width and the measure moves to the children,
   and both classes can safely sit on the same element. */
.shell.prose { max-width: var(--shell); }
.shell.prose > * { max-width: 44rem; }
.shell.prose > .full-width { max-width: none; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font-size: 1.3125rem; margin-top: 2.25rem; color: var(--ink); }
.prose h3 { font-size: 1.0625rem; margin-top: 1.75rem; color: var(--ink); }
.prose p { margin: 0; }
.prose ul, .prose ol { margin: 0; padding-left: 1.25rem; }
.prose li + li { margin-top: 6px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose-lead { font-size: 1.0625rem; color: var(--ink); }

.page-head { padding-block: 34px 0; }
.page-eyebrow {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 10px;
}
.page-title {
  font-size: clamp(1.75rem, 1.15rem + 2.4vw, 2.375rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 22ch;
}
.page-standfirst {
  margin: 12px 0 0;
  max-width: 46ch;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink-3);
}

/* The one paragraph on each page written to survive being lifted out of
   context. Quiet, not loud — an answer engine reads the DOM, not the design. */
.page-abstract {
  margin: 22px 0 0;
  padding: 14px 16px;
  max-width: 46rem;
  border-left: 3px solid var(--teal);
  background: var(--teal-pale);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

.section { padding-block: 34px; }
.section-title { font-size: 1.3125rem; letter-spacing: -0.02em; margin-bottom: 14px; }

/* ── Cross links ───────────────────────────────────────────────────────── */

.tt-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tt-link-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
}
.tt-link-card:hover { border-color: var(--teal); color: var(--ink); }
.tt-link-card-name { display: block; font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; }
.tt-link-card-note { display: block; margin-top: 5px; font-size: 0.78125rem; color: var(--ink-3); line-height: 1.5; }

/* ── FAQ ───────────────────────────────────────────────────────────────── */

.tt-faq { display: flex; flex-direction: column; gap: 10px; max-width: 52rem; }
.tt-faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.tt-faq-q { font-size: 0.9375rem; letter-spacing: -0.01em; }
.tt-faq-a { margin: 8px 0 0; font-size: 0.875rem; line-height: 1.65; color: var(--ink-2); }
.tt-faq-a > * + * { margin-top: 8px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */

.tt-form { display: grid; gap: 18px; max-width: 34rem; margin-top: 26px; }
.tt-field { display: grid; gap: 5px; }
.tt-label { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
/* Margins zeroed rather than left to the browser: these are grid children and
   the gap owns the spacing. A stray 1em on a <p> reads as a broken field. */
.tt-hint { margin: 0; font-size: 0.75rem; color: var(--ink-3); line-height: 1.5; font-weight: 500; }
.tt-error { margin: 0; }
.tt-field + .tt-field { margin-top: 0; }
.tt-input,
.tt-textarea,
.tt-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-3);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.tt-textarea { min-height: 8rem; resize: vertical; }
.tt-input:focus-visible,
.tt-textarea:focus-visible,
.tt-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.tt-input[aria-invalid="true"],
.tt-textarea[aria-invalid="true"] { border-color: var(--pink); }
.tt-error { font-size: 0.75rem; color: var(--pink); font-weight: 700; }
.tt-error:empty { display: none; }
/* Off-screen rather than display:none: a hidden field a bot cannot see is the
   point, and display:none is the first thing a bot checks for. */
.tt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tt-submit {
  justify-self: start;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--card);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.tt-submit:hover { background: var(--teal); border-color: var(--teal); }
.tt-submit[disabled] { opacity: 0.6; cursor: progress; }
.tt-thanks {
  max-width: 34rem;
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid var(--w-exam-bd);
  background: var(--w-exam-bg);
  border-radius: var(--r-md);
}
.tt-thanks h2 { font-size: 1.0625rem; margin-bottom: 6px; }
.tt-thanks p { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }
[hidden] { display: none !important; }

/* ── Code ──────────────────────────────────────────────────────────────── */

.tt-code {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  font-family: var(--mono);
  font-size: 0.78125rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

/* ── Narrow ────────────────────────────────────────────────────────────── */

/* Not sticky below this. The nav wraps to a second row, so a pinned header is
   ~90px of the viewport permanently, and it is exactly the band keyboard focus
   lands behind (WCAG 2.2 2.4.11). The planner's control bar unsticks at the
   same width, in planner.css. */
@media (max-width: 52rem) {
  .site-head { backdrop-filter: none; background: var(--paper); }
  .site-head-inner { gap: 10px 12px; padding-block: 10px; flex-wrap: wrap; }
  .site-nav { margin-left: 0; }
  /* The year label is the first thing to go: it is the only item in the header
     that says nothing a reader cannot see on the page below it. */
  .site-year { display: none; }
}

@media (max-width: 45rem) {
  .site-year { display: none; }
  .site-nav { width: 100%; order: 3; gap: 2px 4px; flex-wrap: wrap; }
  .site-nav a { padding-inline: 8px; }
  .site-cta { margin-left: auto; }
  .site-foot-inner { gap: 22px; padding-block: 24px 26px; }
  .page-head { padding-block: 26px 0; }
  .page-abstract { font-size: 0.875rem; padding: 12px 14px; }
}

.tt-check {
  margin: 16px 0 0;
  padding: 12px 14px;
  max-width: 44rem;
  border: 1px solid var(--w-holiday-bd);
  background: var(--w-holiday-bg);
  border-radius: var(--r);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink);
}

.tt-impacts {
  max-width: 44rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.tt-impacts li {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--r);
  background: var(--card);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink);
}

.tt-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 12px;
  max-width: 44rem;
}
.tt-compare-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.tt-compare-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.tt-compare-value {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tt-compare-note { margin: 8px 0 0; font-size: 0.8125rem; line-height: 1.5; color: var(--ink-3); }

/* ── The embed builder ─────────────────────────────────────────────────── */

.embed-builder {
  max-width: 44rem;
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  display: grid;
  gap: 16px;
}
.embed-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 12px;
}
.embed-builder label { display: grid; gap: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.embed-builder-checks { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.embed-builder-checks legend {
  padding: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.embed-builder-checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--ink-2);
  cursor: pointer;
}
.embed-builder-checks input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal); flex-shrink: 0; }

.embed-preview-wrap {
  margin-block: 8px 0;
  /* border-box so the 1px border cannot push the frame past the viewport, which
     is exactly how this used to overflow by two pixels at 320px. */
  box-sizing: border-box;
}
.embed-preview-wrap iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 30rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.embed-copied { font-size: 0.8125rem; color: var(--teal); font-weight: 600; }
