/* The Franchise Record — hometownautodealers.org
   One stylesheet. Tokens are from the plan: paper, ink, rule, link, and
   two semantic colours that are a legend rather than decoration.
     --dead  = this is no longer good law (or has ceased). Never emphasis.
     --live  = this is a dated snapshot and it is still moving.
   Webfonts (Newsreader, IBM Plex Mono/Sans) are self-hosted when they
   land; until then the stacks fall back to Georgia and the system UI
   faces. No third-party font host, ever. */

:root {
  --paper:      #FBFAF7;
  --paper-sunk: #F4F1EA;
  --ink:        #16181C;
  --ink-muted:  #5B5F66;
  --rule:       #DCD8CE;
  --link:       #1B3A5B;
  --dead:       #8C2B22;
  --live:       #B07A1E;

  --font-heading: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body:    "Newsreader", Georgia, "Times New Roman", serif;
  --font-kicker:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-ui:      "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;

  --measure: 68ch;
  --shell:   980px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14161A;
    --paper-sunk: #1A1D22;
    --ink:        #E9E6DF;
    --ink-muted:  #9DA3AC;
    --rule:       #2C3039;
    --link:       #8FB3D9;
    --dead:       #D9776A;
    --live:       #D8A64A;
  }
}

*, *::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: 17px;
  line-height: 1.6;
  font-synthesis-weight: none;
}

@media (min-width: 700px) {
  body { font-size: 19px; line-height: 1.65; }
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- masthead ---------- */

.masthead {
  padding: 28px 0 0;
}

.masthead a.wordmark {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.wordmark-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0;
}

@media (min-width: 700px) {
  .wordmark-name { font-size: 38px; }
}

.wordmark-domain {
  font-family: var(--font-kicker);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-top: 6px;
}

.masthead-rule {
  border: 0;
  border-top: 2px solid var(--ink);
  margin: 12px 0 10px;
}

.tagline {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-muted);
  margin: 0 0 18px;
  font-size: 0.95em;
}

/* ---------- navigation ---------- */

.sections {
  font-family: var(--font-kicker);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  margin-bottom: 28px;
}

.sections ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.sections a { color: var(--link); text-decoration: none; }
.sections a:hover { text-decoration: underline; }

/* A section label with nothing published behind it yet is not a link and
   does not pretend to be one: muted, no underline, no pointer. */
.sections .pending {
  color: var(--ink-muted);
}

.sections .pending::after {
  content: " (in preparation)";
  text-transform: none;
  letter-spacing: 0.02em;
  font-style: italic;
  color: var(--ink-muted);
}

/* ---------- text ---------- */

main { padding-bottom: 8px; }

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

h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 6px;
}

@media (min-width: 700px) { h1 { font-size: 36px; } }

h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.25;
  margin: 40px 0 10px;
}

h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 19px;
  margin: 28px 0 8px;
}

p { margin: 0 0 1em; }

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

.kicker {
  font-family: var(--font-kicker);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 10px;
}

.standfirst {
  font-size: 1.06em;
  color: var(--ink);
  margin-bottom: 1.2em;
}

.dateline {
  font-family: var(--font-kicker);
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin: 0 0 26px;
}

.mono { font-family: var(--font-kicker); font-size: 0.86em; }

ul.plain { list-style: none; padding: 0; margin: 0 0 1em; }
ul.plain li { margin-bottom: 0.5em; }

/* ---------- standing components ---------- */

/* 4.1 status stamp */
.stamp {
  font-family: var(--font-kicker);
  font-size: 12px;
  line-height: 1.7;
  border: 1px solid var(--rule);
  padding: 12px 14px;
  margin: 0 0 24px;
  max-width: 340px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* A stamp whose rows are labelled fields is a <dl>. A stamp whose rows are
   bare lines of a citation has no terms to define, so it is a <div> — a <dl>
   with no <dt>/<dd> inside it is invalid, and announces a definition list
   with nothing in it to a screen reader. Both render identically. */
.stamp dl,
.stamp .stamp-lines { margin: 0; }
/* field and value sit on one line, the way a stamped form reads */
.stamp dt,
.stamp dd { display: inline; margin: 0; }
.stamp dt { margin-right: 0.4em; }
.stamp .stamp-title { color: var(--ink); letter-spacing: 0.06em; }
.stamp hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 8px 0;
}
.stamp .status-dead { color: var(--dead); }
.stamp .status-live { color: var(--live); }

/* 4.3 what the document says */
blockquote.document {
  margin: 24px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--link);
  font-style: italic;
  font-size: 1.06em;
  max-width: var(--measure);
}

blockquote.document .cite {
  display: block;
  font-family: var(--font-kicker);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 8px;
}

/* provenance / disclosure block (5.1) */
.provenance {
  border: 1px solid var(--rule);
  background: var(--paper-sunk);
  padding: 16px 18px;
  margin: 28px 0;
  font-size: 0.94em;
  max-width: var(--measure);
}

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

.provenance .label {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 8px;
}

/* the five doors */
.doors {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 8px 0 40px;
}

@media (min-width: 760px) {
  .doors { grid-template-columns: 1fr 1fr; }
}

.door {
  background: var(--paper);
  padding: 18px 20px 20px;
}

.door h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-family: var(--font-kicker);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.door p.door-note {
  color: var(--ink-muted);
  font-size: 0.9em;
  margin: 0 0 12px;
}

.door ol {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.94em;
}

.door li { margin-bottom: 0.55em; }

.state {
  font-family: var(--font-kicker);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--live);
  white-space: nowrap;
}

.state-dead { color: var(--dead); }

/* 4.2 § section numbers. The number is an anchor, mono and muted, and it
   sits inline below 1100px rather than in a rail that would crowd. */
.sec-num {
  font-family: var(--font-kicker);
  font-size: 0.62em;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  text-decoration: none;
  margin-right: 0.5em;
  vertical-align: 0.18em;
}

.sec-num:hover { color: var(--link); text-decoration: underline; }

/* format and topic tags */
.tags {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags .tag {
  border: 1px solid var(--rule);
  padding: 2px 8px;
  color: var(--ink-muted);
}

.tags .tag-format {
  border-color: var(--ink-muted);
  color: var(--ink);
}

/* inline status chip (4.1, one-line form) */
.chip {
  font-family: var(--font-kicker);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.chip .chip-live { color: var(--live); }
.chip .chip-dead { color: var(--dead); }

/* 4.4 where sources disagree */
.disagree {
  border: 1px solid var(--rule);
  border-top: 2px solid var(--live);
  padding: 16px 18px;
  margin: 28px 0;
  max-width: var(--measure);
  font-size: 0.94em;
}

.disagree > .label {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--live);
  display: block;
  margin-bottom: 10px;
}

.disagree .pair {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

@media (min-width: 640px) {
  .disagree .pair { grid-template-columns: 1fr 1fr; gap: 22px; }
}

.disagree .pair > div > .src {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
}

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

/* 4.5 document cards */
.doc-card {
  border: 1px solid var(--rule);
  padding: 14px 16px;
  margin: 24px 0;
  max-width: var(--measure);
  font-size: 0.92em;
}

.doc-card .doc-title { font-weight: 600; display: block; margin-bottom: 4px; }

.doc-card .doc-cite {
  font-family: var(--font-kicker);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 8px;
}

.doc-card p { margin: 0 0 0.6em; }
.doc-card > :last-child { margin-bottom: 0; }

/* the figure */
figure.plate {
  margin: 28px 0;
  max-width: 720px;
}

.figure-svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper-sunk);
  padding: 18px;
  border: 1px solid var(--rule);
}

/* hero plate: a raster illustration, framed like a printed plate */
figure.plate.hero { margin: 24px 0 30px; }

figure.plate.hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper-sunk);
}

@media (prefers-color-scheme: dark) {
  /* the plate is printed on paper; damp it so it does not glare on ink ground */
  figure.plate.hero img { filter: brightness(0.78) contrast(1.04); }
}

.figure-svg .c { fill: var(--ink); }
.figure-svg .r { fill: none; stroke: var(--ink-muted); stroke-width: 1; }

figure.plate figcaption {
  font-size: 0.84em;
  color: var(--ink-muted);
  margin-top: 10px;
  max-width: var(--measure);
}

figure.plate .key {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
  color: var(--ink-muted);
}

/* data tables */
table.record {
  border-collapse: collapse;
  width: 100%;
  max-width: 760px;
  margin: 22px 0;
  font-family: var(--font-ui);
  font-size: 0.86em;
}

table.record th,
table.record td {
  text-align: left;
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

table.record thead th {
  font-family: var(--font-kicker);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink);
}

table.record td.num {
  font-family: var(--font-kicker);
  white-space: nowrap;
}

table.record caption {
  caption-side: bottom;
  text-align: left;
  font-size: 0.86em;
  color: var(--ink-muted);
  padding-top: 8px;
}

/* 5.6 endnotes and the citation block */
.endnotes {
  border-top: 1px solid var(--rule);
  margin-top: 44px;
  padding-top: 8px;
  max-width: var(--measure);
  font-size: 0.86em;
}

.endnotes ol { padding-left: 1.6em; }
.endnotes li { margin-bottom: 0.7em; }
.endnotes li a { overflow-wrap: anywhere; }

.cite-page {
  border: 1px solid var(--rule);
  background: var(--paper-sunk);
  padding: 14px 16px;
  margin: 28px 0 0;
  max-width: var(--measure);
  font-size: 0.86em;
}

.cite-page .label {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 8px;
}

.cite-page p { margin: 0; }

/* article furniture */
.page-id {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* 4.2 section numbers. Mono, muted, in the margin above 1100px and inline
   below it. If a thing is set in mono it carries a citation. */
.secnum {
  font-family: var(--font-kicker);
  font-size: 0.62em;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-right: 0.6em;
}

@media (min-width: 1100px) {
  .secnum {
    position: absolute;
    margin-left: -3.4em;
    margin-right: 0;
  }
  .prose h2 { position: relative; }
}

/* 5.6 paragraph anchors. Statutes are cited by subsection; these pages
   should be too. Visible on hover, and only where there is margin for it. */
.prose p[id] { position: relative; }

a.pilcrow {
  position: absolute;
  left: -1.5em;
  top: 0;
  opacity: 0;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.8em;
  display: none;
}

@media (min-width: 1100px) {
  a.pilcrow { display: block; }
  p[id]:hover > a.pilcrow,
  a.pilcrow:focus { opacity: 1; }
}

/* 4.4 where sources disagree */
.disagree {
  border: 1px solid var(--rule);
  padding: 16px 18px 4px;
  margin: 28px 0;
  max-width: var(--measure);
}

.disagree .label {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--live);
  display: block;
  margin-bottom: 12px;
}

.disagree-cols { display: grid; gap: 4px 28px; }

@media (min-width: 640px) {
  .disagree-cols { grid-template-columns: 1fr 1fr; }
}

.disagree .src {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 6px;
}

.disagree .why {
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  font-size: 0.92em;
  color: var(--ink-muted);
}

/* tables are first-class: mono headers, hairlines, no zebra */
table.record {
  width: 100%;
  max-width: 960px;
  border-collapse: collapse;
  margin: 24px 0 28px;
  font-family: var(--font-ui);
  font-size: 0.82em;
}

table.record caption {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: left;
  padding-bottom: 10px;
}

table.record th,
table.record td {
  text-align: left;
  vertical-align: top;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--rule);
}

table.record thead th {
  font-family: var(--font-kicker);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink);
}

table.record tbody th {
  font-family: var(--font-kicker);
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
}

/* figures */
.figure { margin: 8px 0 32px; padding: 0; }

.figure svg { max-width: 100%; height: auto; display: block; }

.figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  background: var(--paper-sunk);
}

/* a light-paper plate on a dark page is a flashbulb; settle it down */
@media (prefers-color-scheme: dark) {
  .figure img { filter: brightness(0.78) contrast(1.03); }
}

.figure figcaption {
  max-width: var(--measure);
  margin-top: 14px;
  font-size: 0.86em;
  color: var(--ink-muted);
}

/* endnotes and the citation block */
a.note {
  font-family: var(--font-kicker);
  font-size: 0.62em;
  vertical-align: super;
  text-decoration: none;
  padding: 0 0.12em;
}

a.note:hover { text-decoration: underline; }

ol.endnotes {
  max-width: var(--measure);
  font-size: 0.88em;
  padding-left: 1.4em;
  margin: 0 0 32px;
}

ol.endnotes li { margin-bottom: 0.9em; }
ol.endnotes cite { font-style: italic; }
ol.endnotes a { word-break: break-word; }

.citeblock {
  border: 1px solid var(--rule);
  background: var(--paper-sunk);
  padding: 16px 18px;
  margin: 0 0 24px;
  max-width: var(--measure);
}

.citeblock .label {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 8px;
}

.citeblock p {
  font-family: var(--font-kicker);
  font-size: 0.78em;
  line-height: 1.7;
  margin: 0;
  word-break: break-word;
}

/* correction log */
.log { border-top: 1px solid var(--rule); margin-top: 24px; }
.log-entry {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  max-width: var(--measure);
}
.log-entry .when {
  font-family: var(--font-kicker);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.log-empty {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  color: var(--ink-muted);
  max-width: var(--measure);
}

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

.site-footer {
  margin-top: 56px;
  border-top: 2px solid var(--ink);
  padding: 20px 0 56px;
  font-size: 0.86em;
  color: var(--ink-muted);
}

.site-footer .utility {
  font-family: var(--font-kicker);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.site-footer .utility a { color: var(--link); text-decoration: none; }
.site-footer .utility a:hover { text-decoration: underline; }

.site-footer .disclaimer {
  max-width: var(--measure);
  margin: 0 0 12px;
}

.site-footer .notice {
  font-family: var(--font-kicker);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}

/* ---------- 404 ---------- */

.four-oh-four h1 { margin-bottom: 18px; }

/* ---------- accessibility ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  font-family: var(--font-ui);
  z-index: 10;
}

.skip:focus { left: 8px; top: 8px; }

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

@media print {
  .sections, .skip { display: none; }
  body { background: #fff; color: #000; }
}

/* long tables scroll rather than break the measure on narrow screens */
.table-wrap { max-width: 960px; margin: 24px 0 28px; overflow-x: auto; }
.table-wrap table.record { margin: 0; }
