/* GuideBurrow editorial theme.
   Goals: calm and trustworthy for general readers, comfortable on phones and tablets,
   no web fonts or third-party assets (system fonts keep the page fast and private). */

body.editorial {
  --accent: #0e5a5c;
  --accent-strong: #0a4547;
  --tint: #e5f0ee;
  --warm: #fbf1e2;
  --warm-line: #efd9b8;
  --line: #dde3e0;
  --ink: #1c2a2e;
  --muted: #4f5f63;
  --paper: #fbf9f5;
  --card: #ffffff;
  --radius: .75rem;
  --shadow: 0 1px 2px rgb(20 40 40 / 6%), 0 4px 14px rgb(20 40 40 / 6%);
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-text-size-adjust: 100%;
}
body.editorial.sage { --accent: #315a43; --accent-strong: #244533; --tint: #e9f1e7; }
body.editorial.teal { --accent: #145a58; --accent-strong: #0f4442; --tint: #e3f1ee; }
body.editorial.terracotta { --accent: #8a402c; --accent-strong: #6d3222; --tint: #f7ebe4; }

.editorial *, .editorial *::before, .editorial *::after { box-sizing: border-box; }
.editorial a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .07em; }
.editorial a:hover { color: var(--accent-strong); text-decoration-thickness: .14em; }
.editorial a:focus-visible, .editorial summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: .2rem; }
.editorial [hidden] { display: none !important; }
.editorial .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.editorial .icon { flex: none; }
.editorial p, .editorial li, .editorial dd { overflow-wrap: break-word; }

.editorial h1, .editorial h2, .editorial h3 { line-height: 1.2; letter-spacing: -.015em; font-weight: 750; color: var(--ink); }
.editorial h1 { max-width: 24ch; margin: 0 0 .5em; font-size: clamp(1.9rem, 5vw, 3rem); }
.editorial h2 { font-size: clamp(1.4rem, 3.2vw, 1.75rem); margin: 0 0 .65em; }
.editorial h3 { font-size: 1.15rem; margin: 0 0 .4em; }

/* Layout shell */
.editorial main, .editorial .masthead, .editorial .site-footer {
  max-width: 72rem; width: 100%; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem);
}
.editorial main { min-height: 65vh; padding-block: clamp(1.25rem, 4vw, 2.75rem); }
.editorial .skip { position: absolute; inset: .5rem auto auto .5rem; background: #fff; padding: .5rem .75rem; z-index: 3; border-radius: .4rem; }
.editorial .skip:not(:focus-within) { clip-path: inset(50%); }

/* Header */
.editorial .site-header { max-width: none; margin: 0; padding: 0; background: var(--card); border: 0; border-bottom: 1px solid var(--line); }
.editorial .masthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .75rem 0; }
.editorial .logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); min-height: 44px; }
.editorial .logo:hover { color: var(--ink); }
.editorial .logo-mark { color: var(--accent); }
.editorial .logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.editorial .logo-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.editorial .logo-tagline { font-size: .82rem; color: var(--muted); }
.editorial .search-link a { display: inline-flex; align-items: center; min-height: 44px; padding: .25em .9em; border-radius: 999px; background: var(--tint); font-weight: 650; font-size: .95rem; text-decoration: none; }
.editorial .masthead nav { flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * clamp(1rem, 4vw, 2.5rem)); padding-inline: clamp(1rem, 4vw, 2.5rem); }
.editorial .masthead nav::-webkit-scrollbar { display: none; }
.editorial .masthead nav ul { display: flex; gap: .25rem 1.4rem; margin: 0; padding: 0; list-style: none; white-space: nowrap; flex-wrap: nowrap; }
.editorial .masthead nav a { display: inline-block; padding: .55rem 0 .7rem; font-size: .97rem; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.editorial .masthead nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Home */
.editorial .home-hero {
  background: linear-gradient(135deg, var(--tint), #f3f7f4 60%, var(--warm));
  border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5);
  padding: clamp(1.5rem, 5vw, 3.5rem); margin-block-end: 2.5rem;
}
.editorial .home-hero h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); max-width: 20ch; }
.editorial .lede { font-size: clamp(1.1rem, 2vw, 1.25rem); color: var(--muted); max-width: 56ch; margin-top: 0; }
.editorial .home-search { display: flex; gap: .5rem; max-width: 36rem; margin-block: 1.5rem 1.25rem; }
.editorial .home-search input { flex: 1 1 auto; min-width: 0; min-height: 52px; padding: .6rem 1rem; font-size: 1.05rem; border: 2px solid var(--line); border-radius: 999px; background: #fff; }
.editorial .home-search input:focus { border-color: var(--accent); outline: none; }
.editorial .home-search button { min-height: 52px; padding: 0 1.4rem; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }
.editorial .home-search button:hover { background: var(--accent-strong); }
.editorial .trust-points { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; padding: 0; margin: 0; font-size: .95rem; color: var(--muted); }
.editorial .trust-points li { display: flex; align-items: center; gap: .4rem; }
.editorial .trust-points .icon, .editorial .checked .icon { color: var(--accent); width: 1.2em; height: 1.2em; }
.editorial .language-picker { margin-top: 1rem; }
.editorial .language-picker h2 { font-size: .85rem; font-weight: 600; margin: 0 0 .35rem; text-transform: uppercase; letter-spacing: .04em; }
.editorial .language-picker ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.editorial .language-picker a, .editorial .language-picker span { display: inline-block; min-height: 44px; line-height: 44px; }
.editorial .language-picker [aria-current] { font-weight: 600; }
.editorial .language-suggest { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .4rem 1rem; background: var(--tint); font-size: .95rem; }
.editorial .language-suggest[hidden] { display: none; }
.editorial .language-suggest a { font-weight: 600; }
.editorial .language-suggest button { min-height: 44px; padding: 0 .75rem; border: 1px solid currentColor; border-radius: var(--radius); background: transparent; color: inherit; font: inherit; cursor: pointer; }

/* Cards */
.editorial .card-grid { list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.editorial .card { position: relative; padding: 1.25rem 1.35rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.editorial .card:hover, .editorial .card:focus-within { border-color: var(--accent); transform: translateY(-2px); }
.editorial .card h2, .editorial .card h3 { font-size: 1.15rem; margin: 0 0 .35em; }
.editorial .card a { text-decoration: none; }
.editorial .card a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.editorial .card p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.editorial .card-icon { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .7rem; background: var(--tint); color: var(--accent); margin-bottom: .75rem; }
.editorial .card-icon .icon { width: 1.5rem; height: 1.5rem; }

/* Topic hub hero */
.editorial .section-hero { display: flex; gap: 1.25rem; align-items: flex-start; padding: clamp(1.25rem, 4vw, 2.5rem); background: var(--tint); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5); margin-block-end: 2rem; }
.editorial .section-hero p { margin-bottom: 0; }
.editorial .section-hero h1 { margin-bottom: .3em; }
.editorial .hero-icon { flex: none; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: #fff; color: var(--accent); box-shadow: var(--shadow); }
.editorial .hero-icon .icon { width: 2rem; height: 2rem; }

/* Article */
.editorial .breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .92rem; margin: 0 0 1.25rem; color: var(--muted); }
.editorial .guide { max-width: 46rem; }
.editorial .guide-title { padding: 0 0 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.editorial .byline { font-size: .93rem; color: var(--muted); margin: .6rem 0 0; }
.editorial .byline a { font-weight: 650; }
.editorial .checked { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .93rem; color: var(--muted); margin: .4rem 0; }
.editorial .preview-status { display: inline-block; font-size: .85rem; margin: .4rem 0; padding: .15rem .6rem; border-radius: 999px; background: var(--warm); border: 1px solid var(--warm-line); }
.editorial .guide-body { max-width: 68ch; position: relative; }
/* Read-depth markers added by measure.js; invisible and outside the reading flow. */
.editorial .depth-marker { position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; }
.editorial .depth-25 { top: 25%; } .editorial .depth-50 { top: 50%; } .editorial .depth-75 { top: 75%; } .editorial .depth-100 { top: calc(100% - 1px); }
.editorial .guide-body > section { margin-block: 2.5rem; scroll-margin-block-start: 1rem; }
.editorial .guide-body p { margin: .6rem 0 1rem; }
.editorial .guide-body ul { padding-left: 1.35rem; }
.editorial .guide-body li { margin-block: .3rem; }
.editorial .contents { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; font-size: .97rem; }
.editorial .contents h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.editorial .contents ul, .editorial .contents-mobile ul { list-style: none; padding: 0; margin: 0; }
.editorial .contents li, .editorial .contents-mobile li { margin-block: .15rem; }
.editorial .contents a, .editorial .contents-mobile a { display: block; padding: .3rem 0; text-decoration: none; line-height: 1.35; }
.editorial .contents-mobile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.5rem; }
.editorial .contents-mobile summary { cursor: pointer; padding: .8rem 1.1rem; min-height: 44px; font-weight: 700; }
.editorial .contents-mobile ul { padding: 0 1.1rem .8rem; }
.editorial .contents { display: none; }
.editorial .editor-note { color: var(--muted); font-size: .95rem; border-left: 3px solid var(--line); padding-left: .9rem; }
.editorial .sources { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; }
.editorial .sources h2 { font-size: 1.2rem; }
.editorial .source-list { list-style: none; padding: 0 !important; margin: 0; }
.editorial .source-list li { padding: .55rem 0; border-top: 1px solid var(--line); }
.editorial .source-list li:first-child { border-top: 0; }
.editorial .source-list a { display: block; line-height: 1.4; }
.editorial .source-host { display: inline-flex; align-items: center; gap: .3rem; margin-top: .2rem; font-size: .82rem; color: var(--muted); }
.editorial .source-host::before { content: "Official"; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); background: var(--tint); padding: .05rem .45rem; border-radius: 999px; }
.editorial .related { margin-top: 3rem; }
.editorial .related .card-grid { margin-bottom: 0; }

/* Article blocks (spec 005) */
.editorial .at-a-glance { margin-block: 0 2.5rem; }
.editorial .summary { font-size: 1.12em; line-height: 1.65; margin-top: 0; }
.editorial .key-facts { background: var(--warm); border: 1px solid var(--warm-line); border-radius: var(--radius); padding: 1.15rem 1.35rem; }
.editorial .key-facts h2 { margin: 0 0 .75rem; font-size: 1.1rem; }
.editorial .key-facts dl, .editorial .glossary dl { margin: 0; display: grid; gap: .8rem; }
.editorial .key-facts dl > div, .editorial .glossary dl > div { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr; gap: .15rem 1rem; }
.editorial .key-facts dl > div + div { border-top: 1px solid var(--warm-line); padding-top: .8rem; }
.editorial dt { font-weight: 700; }
.editorial dd { margin: 0; }
.editorial .glossary dl { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.35rem; }
.editorial .glossary dl > div + div { border-top: 1px solid var(--line); padding-top: .8rem; }
.editorial .glossary dt { font-style: italic; color: var(--accent-strong); }
.editorial .glossary .note { display: block; font-size: .92em; color: var(--muted); margin-top: .15rem; }
.editorial .steps { counter-reset: step; list-style: none; padding: 0 !important; margin: 1.25rem 0; }
.editorial .steps > li { counter-increment: step; position: relative; padding: 0 0 1.5rem 3.25rem; margin: 0; }
.editorial .steps > li::before { content: counter(step); position: absolute; left: 0; top: -.1rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 1rem; }
.editorial .steps > li:not(:last-child)::after { content: ""; position: absolute; left: calc(1.125rem - 1px); top: 2.4rem; bottom: .3rem; width: 2px; background: var(--line); }
.editorial .steps h3 { margin: 0; font-size: 1.1rem; line-height: 1.4; }
.editorial .steps p { margin: .3rem 0 .3rem; }
.editorial .step-source { font-size: .92em; color: var(--muted); }
.editorial .checklist { list-style: none; padding: 0 !important; margin: 1rem 0; }
.editorial .checklist li { position: relative; padding: .5rem 0 .5rem 2.1rem; margin: 0; border-bottom: 1px solid var(--line); }
.editorial .checklist li:last-child { border-bottom: 0; }
.editorial .checklist li::before { content: ""; position: absolute; left: 0; top: .78em; width: 1.2rem; height: 1.2rem; border: 2px solid var(--accent); border-radius: .3rem; background: #fff; }
.editorial .callout { border-radius: var(--radius); padding: .9rem 1.15rem; margin-block: 1.25rem; background: var(--tint); border: 1px solid var(--line); border-left: 5px solid var(--accent); }
.editorial .callout.warning { background: #fdf0ea; border-color: #f0d2c4; border-left-color: #b4472a; }
.editorial .callout.experience { background: var(--warm); border-color: var(--warm-line); border-left-color: #a86f1e; }
.editorial .callout p { margin: .2rem 0; }
.editorial .callout-label { font-weight: 750; }
.editorial .next-links { list-style: none; padding: 0 !important; display: grid; gap: .5rem; }
.editorial .next-links a { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .55rem .9rem; background: var(--card); border: 1px solid var(--line); border-radius: .6rem; text-decoration: none; font-weight: 600; line-height: 1.35; }
.editorial .next-links a::after { content: "→"; margin-left: auto; }
.editorial .next-links a:hover { border-color: var(--accent); }
.editorial .table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); -webkit-overflow-scrolling: touch; }
.editorial table { border-collapse: collapse; width: 100%; font-size: .97rem; line-height: 1.5; }
.editorial caption { text-align: left; font-weight: 750; padding: .85rem 1rem .4rem; }
.editorial th, .editorial td { border-top: 1px solid var(--line); padding: .65rem 1rem; text-align: left; vertical-align: top; }
.editorial thead th { background: var(--tint); border-top: 0; font-size: .9rem; }
.editorial tbody th { font-weight: 700; min-width: 8rem; }
.editorial table:has(thead th:nth-child(3)) td { min-width: 13rem; }
.editorial .faq h3 { font-size: 1.08rem; margin: 1.4rem 0 .25rem; }

/* Footer */
.editorial .site-footer { margin-top: 0; display: flex; flex-wrap: wrap; gap: .6rem 2rem; align-items: baseline; padding-block: 2rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.editorial .site-footer p { margin: 0; }
.editorial .footer-links { flex-basis: 100%; }
.editorial .footer-links ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; padding: 0; list-style: none; }
.editorial .footer-links a { display: inline-block; min-height: 44px; line-height: 44px; }

/* Search page */
.editorial .search-form { max-width: 40rem; }
.editorial .search-form div { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.editorial input, .editorial button { font: inherit; }
.editorial :is(.search-form) :is(button, input[type=search]) { min-height: 44px; background: #fff; color: var(--ink); border: 1px solid var(--accent); border-radius: .5rem; padding: .5rem .85rem; }
.editorial .search-form input[type=search] { flex: 1 1 13rem; min-width: 0; }
.editorial button { cursor: pointer; font-weight: 650; }
.editorial .search-form button { color: var(--accent); }
.editorial .search-form button:hover { background: var(--tint); }
.editorial :is(button, input):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Tablet and up: sticky contents sidebar */
@media (min-width: 60rem) {
  .editorial .guide:has(> .contents) {
    display: grid;
    grid-template-columns: minmax(0, 44rem) minmax(14rem, 1fr);
    column-gap: clamp(1.5rem, 5vw, 4rem);
    max-width: none;
  }
  .editorial .guide-title { grid-column: 1 / -1; }
  .editorial .guide-body { grid-column: 1; grid-row: 2; }
  .editorial .guide-body > :first-child { margin-block-start: 0; }
  .editorial .contents { display: block; position: sticky; top: 1rem; grid-column: 2; grid-row: 2; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; }
  .editorial .contents-mobile { display: none; }
}

/* Small phones */
@media (max-width: 30rem) {
  body.editorial { font-size: 1.0625rem; }
  .editorial .logo-tagline { display: none; }
  .editorial .home-search { flex-direction: column; }
  .editorial .key-facts dl > div, .editorial .glossary dl > div { grid-template-columns: 1fr; }
  .editorial .section-hero { flex-direction: column; gap: .75rem; }
  .editorial .steps > li { padding-left: 2.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .editorial .card { transition: none; }
  .editorial .card:hover, .editorial .card:focus-within { transform: none; }
}

/* Staging-only review index */
.editorial .review { max-width: none; }
.editorial .review td:nth-child(2), .editorial .review td:nth-child(3), .editorial .review td:nth-child(4) { white-space: nowrap; }
