/* RTC public site (docs/design.md, Site and content). Colours, fonts and
   sizes from the 2026-11-04 spec (docs/reference/design/). Every colour below
   names one of the palette's six, and test/site.test.ts classifies every rule
   that sets one and checks its contrast. The layout is the spec's 1280px page:
   text up to 1110px wide between 85px margins, centred beyond 1280px; every
   spacing and graphic is the spec's own pixels there and text is two thirds
   of the spec's sizes (Tammy Savage, 2026-11-06), all scaling with the
   viewport below it, with floors kept at least 0.4 of each size so browser
   zoom can still double the text (WCAG 1.4.4). */
:root {
  --brick: #c32826;
  --dark-brick: #640103;
  --sand: #e5e1d6;
  --dark-sand: #d4d0c0;
  --white: #ffffff;
  --black: #000000;
  --display: "PTF Nordic Rnd", "Zilla Slab", Georgia, serif;
  --body: "Zilla Slab", Georgia, "Times New Roman", serif;
  /* The side margin: 85px at 1280px, in proportion below, never under 20px. */
  --side: clamp(1.25rem, calc(85 * 100vw / 1280), 5.3125rem);
  /* The text's width, at most the spec's 1110px. */
  --content: min(100vw - 2 * var(--side), 69.375rem);
  /* One spec pixel. */
  --px: calc(var(--content) / 1110);
  /* One type pixel: text is two thirds of the spec's sizes (Tammy Savage,
     2026-11-06). Each size is the spec's number of type pixels, never under
     its floor; the floors are the full-size design's, so phones are as
     before (operator, 2026-11-06), and --content stops growth past 1280px. */
  --type: calc(var(--px) * 2 / 3);
  --size-title: max(3rem, calc(120 * var(--type)));
  /* Section headings at the design PDF's size, not the spec table's 120px. */
  --size-section: max(1.9rem, calc(76 * var(--type)));
  --size-hero: max(1.55rem, calc(62 * var(--type)));
  --size-panel-heading: max(1.25rem, calc(46 * var(--type)));
  --size-judgment: max(1.0625rem, calc(38 * var(--type)));
  --size-body: max(1rem, calc(30 * var(--type)));
  /* The expand and collapse graphics, at the PDF's size (not text). */
  --size-button: clamp(2rem, calc(48 * var(--px)), 3rem);
  /* Dividers and Sand panels: 43px from the red's edge, 42px outside the text. */
  --inset: calc(42 * var(--px));
  /* The hero's space below its text, and the Final Judgment heading's space
     under the hero text (Duane Bray's 2026-11-05 measurement). */
  --hero-bottom: max(2rem, calc(100 * var(--px)));
  --fj-gap: max(1rem, calc(50 * var(--px)));
}

/* Supplied by RTC; one weight, so nothing may synthesize a bold. */
@font-face {
  font-family: "PTF Nordic Rnd";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/ptf-nordic-rnd.ttf") format("truetype");
}
@font-face {
  font-family: "Zilla Slab";
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url("fonts/zilla-slab-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-weight: 300;
  font-style: italic;
  font-display: swap;
  src: url("fonts/zilla-slab-latin-300-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/zilla-slab-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  src: url("fonts/zilla-slab-latin-700-italic.woff2") format("woff2");
}

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

body {
  margin: 0;
  background: var(--brick);
  color: var(--sand);
  font-family: var(--body);
  font-weight: 300;
  font-size: var(--size-body);
  line-height: 1.27;
  font-synthesis: none;
}

.column {
  max-width: calc(var(--content) + 2 * var(--side));
  margin: 0 auto;
  padding: 0 var(--side);
}

h1,
h2,
h3,
h4 {
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--sand);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 2px;
}

strong,
b {
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header: Sand, the black logo, a white rule */
.site-header {
  background: var(--sand);
  color: var(--dark-brick);
  border-bottom: 2px solid var(--white);
  padding: calc(18 * var(--px)) 0 calc(5 * var(--px));
}
.logo {
  display: block;
  width: auto;
  height: max(2.25rem, calc(120 * var(--px)));
}

/* Hero */
.hero {
  padding: max(1.5rem, calc(50 * var(--px))) 0 var(--hero-bottom);
}
.hero h1 {
  margin: 0 0 calc(30 * var(--px));
  color: var(--dark-brick);
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--size-title);
  line-height: 1;
}
.hero p {
  margin: 0 0 calc(27 * var(--px));
  font-size: var(--size-hero);
  line-height: 1.1;
}

/* The Final Judgment, always shown under the hero (Tammy Savage,
   2026-11-06): pulled up into the hero's bottom space so its heading sits
   --fj-gap below the hero text (the last paragraph's bottom margin is 27px);
   the next line is About the Remedies' divider. */
.panel {
  margin-top: calc(var(--fj-gap) - var(--hero-bottom) - 27 * var(--px));
  padding: 0 0 max(1.5rem, calc(50 * var(--px)));
  font-size: var(--size-judgment);
  line-height: 1.23;
}
/* The text follows its heading directly, as in Tammy Savage's mockup. */
.panel h2 {
  margin: 0 0 0.25em;
  font-size: var(--size-judgment);
  line-height: 1.15;
}
.panel h2 + p {
  margin-top: 0;
}

/* Accordion sections: a Sand divider and, when open, a Sand panel */
main > details {
  max-width: calc(var(--content) + 2 * var(--inset));
  /* Never below zero, so the sections never overflow the page. */
  margin-inline: max(
    0px,
    calc(var(--side) - var(--inset)),
    calc((100% - var(--content)) / 2 - var(--inset))
  );
  border-top: 1px solid var(--sand);
}
main > details:last-of-type {
  border-bottom: 1px solid var(--sand);
}
summary::-webkit-details-marker {
  display: none;
}
summary {
  position: relative;
  display: block;
  padding: max(1rem, calc(30 * var(--px)))
    calc(var(--inset) + var(--size-button) + 1rem)
    max(1rem, calc(30 * var(--px))) var(--inset);
  cursor: pointer;
  list-style: none;
}
summary h2 {
  margin: 0;
  color: var(--dark-brick);
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--size-section);
  line-height: 1;
}
.toggle {
  position: absolute;
  top: 50%;
  right: var(--inset);
  width: var(--size-button);
  height: var(--size-button);
  transform: translateY(-50%);
}
.toggle svg {
  display: block;
  width: 100%;
  height: 100%;
}
details[open] .toggle .expand,
details:not([open]) .toggle .collapse {
  display: none;
}
.section-body {
  background: var(--sand);
  color: var(--dark-brick);
  margin-bottom: max(1rem, calc(30 * var(--px)));
  padding: max(1.25rem, calc(50 * var(--px))) max(1rem, calc(50 * var(--px)));
}
.section-body > :first-child {
  margin-top: 0;
}
.section-body p {
  margin: 0 0 calc(27 * var(--px));
}
.section-body h3 {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--size-panel-heading);
  line-height: 1.15;
}
.section-body h4 {
  margin: 1.25rem 0 0.4rem;
  font-size: var(--size-body);
  line-height: 1.25;
}
.section-body a {
  color: var(--dark-brick);
}
.section-body :focus-visible,
.site-header :focus-visible,
.not-found :focus-visible {
  outline-color: var(--dark-brick);
}
.lead {
  font-size: 1.1em;
}

/* Source tables */
.section-body .source-table-heading {
  font-size: var(--size-body);
  letter-spacing: 0.06em;
}
.source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}
.source-table th {
  background: var(--sand);
  color: var(--dark-brick);
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--dark-brick);
}
.source-table td {
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}
.source-table tbody tr:nth-child(odd) {
  background: var(--sand);
}
.source-table tbody tr:nth-child(even) {
  background: var(--dark-sand);
}

/* Contact form (disabled until its script runs). The button is a field's
   height (same font, line height, vertical padding and border) with equal
   space above and below it. */
.contact-form {
  --field-gap: 0.35rem;
  --button-space: 1.1rem;
  margin: 0 0 var(--button-space);
}
.contact-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--field-gap);
}
.contact-form label {
  font-weight: 700;
  margin-top: 0.6rem;
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  color: var(--dark-brick);
  background: var(--white);
  border: 1px solid var(--dark-brick);
  border-radius: 2px;
  padding: 0.5rem 0.6rem;
}
.contact-form .counter {
  margin: 0;
  text-align: right;
  font-size: 0.9rem;
}
.contact-form button {
  justify-self: start;
  margin: calc(var(--button-space) - var(--field-gap)) 0 0;
  font: inherit;
  font-weight: 700;
  color: var(--sand);
  background: var(--dark-brick);
  border: 1px solid var(--dark-brick);
  border-radius: 2px;
  padding: 0.5rem 1.6rem;
  cursor: pointer;
}
.contact-form fieldset[disabled] input,
.contact-form fieldset[disabled] textarea,
.contact-form fieldset[disabled] button,
.contact-form button:disabled {
  cursor: not-allowed;
}
.contact-form button:disabled {
  opacity: 0.6;
}
.contact-form [aria-invalid="true"] {
  border-width: 3px;
  border-color: var(--dark-brick);
}
.form-status {
  margin: 0.25rem 0 0;
  font-weight: 700;
}

/* 404 */
body.not-found {
  background: var(--sand);
  color: var(--dark-brick);
}
body.not-found main {
  padding: 3rem var(--side);
}
body.not-found a {
  color: var(--dark-brick);
}

/* Windows high contrast: keep the Sand header so the black logo stays
   visible; the toggles follow the text colour already. */
@media (forced-colors: active) {
  .site-header {
    forced-color-adjust: none;
  }
}
