/* The Cover Guide — simple, accessible, responsive CSS. No frameworks, no external fonts. */

:root {
  --bg: #f7f4ee;
  --bg-card: #fffdf8;
  --ink: #1c1b18;
  --ink-muted: #4a4740;
  --link: #0b3d82;
  --link-hover: #08285a;
  --line: #d4cfc4;
  --header-bg: #0c2340;
  --header-ink: #f7f4ee;
  --accent: #0c2340;
  --banner-draft-bg: #fff3c4;
  --banner-draft-ink: #3d3200;
  --banner-preview-bg: #e4eef8;
  --banner-preview-ink: #123152;
  --focus: #0b3d82;
  --measure: 46rem;
  --wide: 68rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--header-bg);
  color: #fff;
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 0.75rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* Header */

.site-header {
  background: var(--header-bg);
  color: var(--header-ink);
}

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-name {
  color: var(--header-ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.site-name:hover,
.site-name:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--header-ink);
  text-decoration: none;
  font-weight: 550;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  color: #fff;
}

/* Banners */

.preview-banner,
.draft-banner {
  padding: 0.55rem 1.25rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.preview-banner {
  background: var(--banner-preview-bg);
  color: var(--banner-preview-ink);
  border-bottom: 1px solid #c5d4e4;
}

.draft-banner {
  background: var(--banner-draft-bg);
  color: var(--banner-draft-ink);
  border-bottom: 1px solid #e0cd7a;
}

/* Main */

.site-main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Guides with wide tables can use the fuller width */
.page:has(table) {
  /* fallback: tables themselves scroll */
}

.breadcrumbs {
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.4rem;
  color: var(--ink-muted);
}

.breadcrumbs a {
  color: var(--ink-muted);
}

/* Article typography */

.page h1,
.page h2,
.page h3,
.page h4 {
  line-height: 1.25;
  color: var(--accent);
  font-weight: 700;
}

.page h1 {
  font-size: 1.85rem;
  margin: 0 0 0.8rem;
}

.page h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.6rem;
  padding-top: 0.25rem;
}

.page h3 {
  font-size: 1.12rem;
  margin: 1.5rem 0 0.4rem;
}

.page h4 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.35rem;
}

.page p,
.page ul,
.page ol {
  margin: 0 0 1rem;
}

.page ul,
.page ol {
  padding-left: 1.25rem;
}

.page li + li {
  margin-top: 0.3rem;
}

.page hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.page em {
  font-style: italic;
}

/* Opening "last checked" line often sits in italics under the H1 */
.page h1 + p em,
.page h1 + p:has(> em:only-child) {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  -webkit-overflow-scrolling: touch;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0;
}

.page th,
.page td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: break-word;
}

/* Hidden on desktop so screen readers use the column headers.
   Revealed in the small-screen card layout below. */
.td-label {
  display: none;
}

.page th {
  background: #ece8df;
  font-weight: 650;
  color: var(--accent);
}

.page tr:last-child td {
  border-bottom: 0;
}

.page tbody tr:nth-child(even) {
  background: #f3f0e9;
}

/* Footnotes and source-style references like [1] */

.page sup,
.page .source-ref {
  font-size: 0.75em;
  line-height: 0;
}

.page .source-ref a,
.page .footnote-ref {
  text-decoration: none;
}

.page .footnote,
.page .footnotes {
  font-size: 0.92rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
  margin-top: 2.5rem;
  padding-top: 1rem;
}

.page .footnotes ol {
  padding-left: 1.2rem;
}

/* FAQ questions rendered as h3 after the FAQ heading */

.guide-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.guide-list li {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.guide-list a {
  font-weight: 650;
  font-size: 1.05rem;
  text-decoration: none;
}

.guide-list a:hover {
  text-decoration: underline;
}

.guide-list .lede {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.badge-draft {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--banner-draft-ink);
  background: var(--banner-draft-bg);
  border-radius: var(--radius);
  vertical-align: middle;
}

/* Footer */

.site-footer {
  background: #eae6dc;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.25rem;
}

.footer-slot {
  margin-bottom: 1.25rem;
  max-width: 52rem;
}

.footer-slot h2 {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  color: var(--accent);
}

.footer-slot p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  list-style: none;
  margin: 1.25rem 0 0.75rem;
  padding: 0;
}

.footer-nav a {
  font-weight: 550;
}

.footer-credit {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* 404 */

.page-404 .site-main {
  text-align: left;
}

/* Print */

@media print {
  .skip-link,
  .site-nav,
  .preview-banner {
    display: none;
  }

  .site-header,
  .site-footer {
    background: none;
    color: #000;
  }

  .site-name,
  .site-nav a {
    color: #000;
  }

  a {
    color: #000;
  }

  .site-main {
    max-width: none;
  }
}

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  .page h1 {
    font-size: 1.55rem;
  }

  .page th,
  .page td {
    padding: 0.45rem 0.55rem;
    font-size: 0.9rem;
  }

  .header-inner {
    padding: 0.8rem 1rem;
  }
}

/* Stack each table row as a labelled card below 640px, so wide
   comparison tables stay readable without sideways scrolling. */
@media (max-width: 640px) {
  .table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .page thead {
    display: none;
  }

  .page table {
    border-collapse: separate;
    border-spacing: 0 0.85rem;
    background: transparent;
  }

  .page tbody tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .page tbody tr:nth-child(even) {
    background: var(--bg-card);
  }

  .page tbody tr td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 36%) 1fr;
    gap: 0.35rem 0.75rem;
    align-items: start;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
  }

  .page tbody tr td:last-child {
    border-bottom: 0;
  }

  .page td .td-label {
    display: block;
    font-weight: 650;
    color: var(--accent);
    line-height: 1.35;
  }

  .page td .td-value {
    min-width: 0;
  }

  /* First column with no header (used as a row title) spans the card width. */
  .page tbody tr td[data-label=""] {
    grid-template-columns: 1fr;
    font-weight: 650;
    color: var(--accent);
    background: #ece8df;
  }

  /* Fallback if a table was not run through the build-time label step. */
  .page td:not(:has(.td-label)):not([data-label=""])[data-label]::before {
    content: attr(data-label);
    font-weight: 650;
    color: var(--accent);
    line-height: 1.35;
  }
}
