/* Know Your Auction - design system
   One quiet brand detail: a thin double rule under the article header and above the
   footer. Everything else is plain paper, high contrast, and a long reading measure. */

:root {
  --paper: #FCFBF8;
  --paper-2: #F3F0E8;
  --ink: #1A1A1A;
  --ink-2: #4C4841;
  --muted: #6E6A62;
  --rule: #D9D4C7;
  --accent: #0A5C75;
  --accent-ink: #063E50;
  --mark: #B8651B;
  --ok: #2E7D4F;
  --warn: #A33A2A;
  --font-head: "Newsreader", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Red Hat Mono", ui-monospace, Menlo, monospace;
  --measure: 68ch;
  --radius: 4px;
  --shadow: 0 1px 0 var(--rule);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- links and focus ---------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }

a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  z-index: 20;
}

.skip:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 64px;
  padding-block: 0.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark b { font-weight: 600; }
.wordmark svg { flex: none; }
.wordmark:hover { color: var(--accent-ink); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.65rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--mark);
}

@media (max-width: 700px) {
  .site-header__row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }
  /* horizontally scrolling nav row, no JS menu */
  .site-nav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
    border-top: 1px solid var(--rule);
  }
  .site-nav::-webkit-scrollbar { display: none; }
}

/* ---------- main and article ---------- */

main { display: block; padding-block: 2rem 3.5rem; }

.article { max-width: var(--measure); }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.breadcrumb a { color: var(--ink-2); }

h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  max-width: 30ch;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.byline {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin: 0 0 1.25rem;
}

.byline .updated, .updated-line .updated { font-family: var(--font-mono); font-size: 0.9em; }

/* the one brand detail: double rule closing the article header */
.byline, .updated-line {
  padding-bottom: 1.25rem;
  border-bottom: 3px double var(--rule);
}

.updated-line {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin: 0 0 1.5rem;
}

h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 2.5rem 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--mark);
}

h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 1.75rem 0 0.5rem;
}

p, ul, ol { margin: 0 0 1.1rem; }

main ul, main ol { padding-left: 1.35rem; }

li { margin-bottom: 0.4rem; }

strong { font-weight: 700; }

small, .small { font-size: 0.85rem; color: var(--muted); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

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

figure { margin: 2rem 0; }

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* ---------- answer block ---------- */

.answer {
  font-size: 1.15rem;
  line-height: 1.55;
  background: var(--paper-2);
  border-left: 4px solid var(--mark);
  padding: 1rem 1.25rem;
  margin: 0 0 1.75rem;
  max-width: var(--measure);
}

/* ---------- table of contents ---------- */

.toc {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.75rem;
  margin: 0 0 2rem;
}

.toc::before {
  content: "On this page";
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin-bottom: 0.3rem; }
.toc a { color: var(--ink-2); }

/* ---------- callouts ---------- */

.callout {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--muted);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
}

.callout > :last-child { margin-bottom: 0; }

.callout__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.callout--opinion { border-left-color: var(--accent); }
.callout--opinion .callout__label { color: var(--accent-ink); }

.callout--warning { border-left-color: var(--warn); }
.callout--warning .callout__label { color: var(--warn); }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

table.data {
  width: 100%;
  /* keeps columns readable on a phone: the .table-wrap scrolls instead of the
     cells collapsing to one word per line */
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--paper);
}

table.data caption {
  caption-side: top;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.75rem 0.85rem;
}

table.data th {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-align: left;
  vertical-align: bottom;
  padding: 0.65rem 0.85rem;
  white-space: nowrap;
}

table.data td {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--rule);
  vertical-align: top;
}

table.data tbody tr:nth-child(even) { background: var(--paper-2); }

table.data td.num, table.data th.num {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

table.data th.num { font-family: var(--font-body); }

/* ---------- diagrams ---------- */

.diagram { margin: 2rem 0; }

/* Below about 500px a wide process diagram would scale its labels down to a few
   pixels. Hold a floor and let the figure scroll sideways instead. */
.diagram__scroll { overflow-x: auto; }

.diagram svg {
  max-width: 100%;
  min-width: 480px;
  height: auto;
  display: block;
}

.diagram text { font-family: var(--font-body); }

/* ---------- inline FAQ ---------- */

.faq details {
  border-top: 1px solid var(--rule);
  padding: 0.35rem 0;
}

.faq details:last-of-type { border-bottom: 1px solid var(--rule); }

.faq summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  padding-right: 1rem;
}

.faq summary::marker { color: var(--mark); }

.faq details[open] summary { color: var(--accent-ink); }

.faq details > p { margin: 0.25rem 0 0.9rem; }

/* ---------- cards and hub lists (homepage) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--mark);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 1rem 1.15rem 1.15rem;
  margin: 0;
}

.card h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.card p { margin: 0; font-size: 0.95rem; color: var(--ink-2); }

.hub-list { list-style: none; padding-left: 0; max-width: var(--measure); }

.hub-list li {
  border-top: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin: 0;
}

.hub-list li:last-child { border-bottom: 1px solid var(--rule); }

.hub-list .note { color: var(--ink-2); font-size: 0.95rem; }

.dateline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- related, article footer ---------- */

.related {
  margin: 3rem 0 0;
  padding: 1.25rem 1.35rem 0.5rem;
  background: var(--paper-2);
  border-radius: var(--radius);
}

.related h2 {
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
  padding-left: 0;
  border-left: 0;
}

.related ul { padding-left: 1.2rem; }

.article-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink-2);
}

.article-footer p { margin-bottom: 0.5rem; }

/* ---------- buttons and pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.15rem;
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: var(--accent-ink); color: var(--paper); }

.pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ---------- checklist (print page) ---------- */

.checklist { list-style: none; padding-left: 0; }

.checklist li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.55rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink-2);
  background: var(--paper);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 3px double var(--rule);
  background: var(--paper-2);
  margin-top: 3rem;
  padding-block: 2.5rem 1.5rem;
  font-size: 0.95rem;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem 2.5rem;
}

.site-footer__h {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
  padding-left: 0;
  border-left: 0;
}

.site-footer ul { list-style: none; padding-left: 0; margin: 0; }

.site-footer li { margin-bottom: 0.15rem; }

.site-footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
}

.site-footer p { color: var(--ink-2); max-width: 42ch; }

.site-footer__legal {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- print ---------- */

@media print {
  .site-header, .site-footer, .related, .toc, .skip, .breadcrumb { display: none !important; }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.25;
  }
  .wrap { max-width: none; padding: 0; }
  .article { max-width: none; }
  main { padding: 0; }
  a { color: #000; text-decoration: none; }
  h1 { font-size: 18pt; margin-bottom: 0.4rem; }
  h2 { font-size: 12.5pt; border-left: 0; padding-left: 0; margin: 0.85rem 0 0.35rem; page-break-after: avoid; }
  p { margin-bottom: 0.5rem; }
  .answer { background: #fff; border-left: 2pt solid #000; padding: 0.6rem 0.75rem; margin-bottom: 0.75rem; }
  /* a long inspection checklist otherwise runs to 4+ pages; two columns per
     section and tighter row spacing bring it back to a 2-3 page printout */
  .checklist {
    column-count: 2;
    column-gap: 1.5rem;
    margin-bottom: 0.4rem;
  }
  .checklist li {
    page-break-inside: avoid;
    break-inside: avoid;
    padding-left: 16pt;
    margin-bottom: 0.2rem;
    font-size: 10pt;
  }
  .checklist li::before {
    width: 10px;
    height: 10px;
    top: 0.3em;
    border: 1px solid #000;
    background: #fff;
  }
  table.data th { background: #fff; color: #000; border-bottom: 1pt solid #000; }
  table.data tbody tr:nth-child(even) { background: #fff; }
  .table-wrap { overflow: visible; border: 0; }
}

/* Glossary */
.glossary dt { font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; margin-top: 1.5rem; scroll-margin-top: 1rem; }
.glossary dd { margin: .35rem 0 0 0; padding-left: 1rem; border-left: 2px solid var(--rule); }
