/*
 * Styles for /articles/ pages (articles index and individual articles).
 * Tokens, base rules, header, footer and components are copied from index.html
 * so these pages match its visual language. See _design/guidelines.md.
 * index.html keeps its own inline styles; if you change a shared rule there,
 * mirror it here.
 * Fonts are the same EB Garamond and Manrope files index.html embeds, served
 * from /assets/fonts/ (licences in assets/fonts/LICENSE.txt).
 */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("fonts/eb-garamond-500-600.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/manrope-400-700.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --background: #f4efeb;
  --card: #fefaf7;
  --foreground: #10272c;
  --muted: #566b72;
  --border: #d9dfe0;
  --teal: #042628;
  --hero-text: #e3ded9;
  --hero-muted: #dcd8d3;
  --red: #cb3729;
  --red-hover: #b32e22;
  --ring: #358c86;
  --link: #214950;
  --radius: 10px;
  --font-heading: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-body: Manrope, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 16px/1.5 var(--font-body); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-heading); }
h2 { font-size: 30px; line-height: 1.2; font-weight: 600; }
a { color: inherit; text-underline-offset: 4px; }
summary { -webkit-tap-highlight-color: transparent; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; }
.container { width: 100%; max-width: 64rem; margin-inline: auto; padding-inline: clamp(16px, 5vw, 32px); }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 12px 18px; background: var(--card); border-radius: 6px; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

/* Header (same as index.html) */
.site-header { background: #152a2b; border-bottom: 1px solid rgb(220 216 211 / 12%); color: var(--hero-muted); }
.brand-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-block: 16px; }
.brand { display: inline-flex; flex-shrink: 0; max-width: 100%; text-decoration: none; }
.brand-logo { display: block; width: 228px; max-width: 100%; height: auto; }

/* Page hero on the dark teal band */
.page-hero { background: var(--teal); color: var(--hero-text); }
.page-hero-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-block: 30px 36px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; background: #25766f; color: #fff; font-size: 12px; font-weight: 600; line-height: 18px; }
h1 { max-width: 20ch; font-size: clamp(36px, 7vw, 48px); line-height: 1.05; font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
.page-hero-inner > p { max-width: 52ch; color: var(--hero-muted); line-height: 24px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--hero-text); font-size: 14px; font-weight: 600; padding-block: 8px; }
.article-meta { display: flex; flex-direction: column; gap: 4px; color: var(--hero-muted); font-size: 14px; line-height: 20px; }
.article-meta small { font-size: 13px; line-height: 20px; }

.section { padding-top: 43px; }

/* Articles index */
.article-list { display: grid; gap: 16px; max-width: 48rem; padding: 0; margin: 0; list-style: none; }
.article-card { padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.article-card h2 { font-size: 24px; line-height: 28px; font-weight: 600; }
.article-card h2 a { text-decoration: none; }
.article-card h2 a:hover { text-decoration: underline; }
.article-card-meta { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 20px; }
.article-card-summary { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 22px; }
.article-empty { max-width: 48rem; padding: 24px; border: 1px dashed #bdc8cb; border-radius: 12px; color: var(--muted); font-size: 14px; line-height: 22px; }

/* Article body */
.article-body { max-width: 68ch; }
.article-body > * + * { margin-top: 16px; }
.article-body h2 { margin-top: 40px; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin-top: 28px; font-size: 23px; line-height: 28px; font-weight: 600; }
.article-body p, .article-body li { line-height: 26px; }
.article-body ul, .article-body ol { padding-left: 1.25em; margin-bottom: 0; }
.article-body li + li { margin-top: 8px; }
.article-body a, .notice a, .questions a { color: var(--link); text-decoration: underline; }
.article-body blockquote { margin-inline: 0; margin-bottom: 0; padding: 16px; border: 1px solid var(--border); border-left: 4px solid var(--ring); border-radius: var(--radius); background: var(--card); }
.article-body blockquote > * + * { margin-top: 12px; }

/* Tables in the article body. Text wraps; if a table is still wider than the
   screen, it scrolls inside its own container so the page never scrolls sideways. */
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.article-body th, .article-body td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: break-word; hyphens: auto; }
.article-body th { font-weight: 600; }
.article-body tbody tr:last-child td { border-bottom: 0; }

/* Preformatted layouts in the article body. Lines wrap so the page never
   scrolls sideways at 360px; line breaks from the source are kept. */
.article-body pre.response-layout { margin-bottom: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 22px; }
.article-body pre.response-layout code { font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* FAQ (same as index.html) */
.questions { max-width: 48rem; margin-top: 16px; }
details { border-bottom: 1px solid var(--border); }
details:last-child { border-bottom: 0; }
summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding-block: 16px; list-style: none; cursor: pointer; font-size: 16px; line-height: 24px; font-weight: 500; }
summary::-webkit-details-marker { display: none; }
/* FAQ questions marked up as headings inside summary keep the summary's look. */
summary h3 { font: inherit; }
summary::after { content: ""; width: 8px; height: 8px; margin-right: 5px; flex-shrink: 0; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details[open] summary::after { transform: rotate(225deg); }
summary:hover { text-decoration: underline; text-underline-offset: 4px; }
details p { padding: 0 28px 16px 0; font-size: 14px; line-height: 22px; color: var(--muted); }

/* Notice (same as index.html) */
.notice { display: flex; gap: 12px; max-width: 48rem; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.notice > svg { margin-top: 2px; }
.notice h2 { font: 600 14px/20px var(--font-body); }
.notice p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 20px; }

/* Buttons and closing band (same as index.html) */
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 20px; border: 1px solid transparent; border-radius: var(--radius); font-size: 16px; line-height: 24px; font-weight: 600; text-decoration: none; transition: background-color .15s, border-color .15s; }
.button-outline { color: var(--card); border-color: var(--card); background: transparent; font-weight: 500; }
.button-outline:hover { background: rgb(254 250 247 / 10%); }
.closing { margin-top: 64px; background: var(--teal); color: var(--card); }
.closing-inner { padding-block: 48px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }

/* Footer (same as index.html) */
.site-footer { border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 24px 40px; color: var(--muted); font-size: 14px; line-height: 20px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.footer-logo { display: block; width: 144px; max-width: 100%; height: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--link); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-disclaimer { flex-basis: 100%; max-width: 68ch; color: var(--muted); font-size: 13px; line-height: 20px; }

/* Legal pages (terms/, privacy/, privacy-choices/) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.page-hero-inner .article-meta a { color: inherit; text-decoration: underline; }
.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.legal-layout > * { min-width: 0; }
.legal-toc { max-width: 68ch; padding: 20px 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.legal-toc h2 { font: 600 14px/20px var(--font-body); color: var(--muted); }
.legal-toc ol { margin: 12px 0 0; padding: 0; list-style: none; columns: 2 16rem; column-gap: 32px; font-size: 14px; line-height: 20px; }
.legal-toc li { break-inside: avoid; padding-block: 4px; }
.legal-toc a { color: var(--link); text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.legal-body h2 { scroll-margin-top: 24px; font-size: 26px; }
.legal-body [id] { scroll-margin-top: 24px; }
.legal-body .plain-english { padding: 12px 16px; border-radius: var(--radius); background: rgb(53 140 134 / 8%); color: var(--foreground); }
.legal-body blockquote p { font-size: 14px; line-height: 22px; }
.legal-body table { min-width: 600px; hyphens: manual; }
.legal-body table th, .legal-body table td { hyphens: manual; }
.legal-body table th[scope="row"] { font-weight: 600; }
.choices-card { padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.choices-card h2 { font-size: 24px; line-height: 28px; }
.choices-card > * + * { margin-top: 12px; }
.choices-status { font-weight: 600; }
.choices-gpc { color: var(--muted); font-size: 14px; line-height: 22px; }
.choices-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.choices-actions .button { cursor: pointer; font-family: inherit; }
.button-primary { background: var(--red); color: var(--card); }
.button-primary:hover { background: var(--red-hover); }
.button-secondary { background: transparent; color: var(--foreground); border-color: var(--foreground); font-weight: 500; }
.button-secondary:hover { background: rgb(16 39 44 / 6%); }
.privacy-choices-link { display: inline-flex; align-items: center; gap: 6px; }
.privacy-choices-icon { flex-shrink: 0; }
@media (min-width: 1000px) {
  .legal-layout { grid-template-columns: 15rem minmax(0, 68ch); align-items: start; gap: 48px; }
  .legal-toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; padding: 16px 20px; }
  .legal-toc ol { columns: auto; }
}

@media (max-width: 480px) {
  .brand-logo { width: 203px; }
}
@media (max-width: 380px) {
  .brand-row { gap: 4px 10px; }
  .article-card { padding: 20px; }
  .article-body th, .article-body td { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
