/* ──────────────────────────────────────────────────────────────────────────
   Reelopedia — shared styles for the public legal pages.

   Palette is warm paper + deep teal ink: the app is an archive, so the pages
   read like a document rather than a product landing page. Neutrals carry a
   slight green bias toward the accent so they look chosen, not defaulted.

   Every colour is a token defined on bare :root, redefined under both
   prefers-color-scheme and [data-theme]. Nothing may declare a colour only
   inside a media query — that renders one theme's text on the other's ground.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --paper:      #FAF8F4;
  --paper-sunk: #F1EEE7;
  --ink:        #14201F;
  --ink-soft:   #3D4A48;
  --muted:      #6B7975;
  --rule:       #E2DED6;
  --accent:     #0E6B62;
  --accent-strong:#0A5049;
  --accent-wash:#E6F0EE;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #101716;
    --paper-sunk: #182220;
    --ink:        #E8EDEB;
    --ink-soft:   #C2CECB;
    --muted:      #8FA09C;
    --rule:       #263331;
    --accent:     #5CC9B8;
    --accent-strong:#7FDCCC;
    --accent-wash:#16302C;
  }
}

:root[data-theme="dark"] {
  --paper:      #101716;
  --paper-sunk: #182220;
  --ink:        #E8EDEB;
  --ink-soft:   #C2CECB;
  --muted:      #8FA09C;
  --rule:       #263331;
  --accent:     #5CC9B8;
  --accent-strong:#7FDCCC;
  --accent-wash:#16302C;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ── Masthead ── */

.masthead {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span { color: var(--accent); }

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
}

.masthead nav a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--accent); }

/* ── Document head ── */

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.effective {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2.25rem;
}

.lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--accent);
  padding-left: 1.125rem;
  margin: 0 0 2.75rem;
}

/* ── Sections ── */

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  text-wrap: balance;
}

h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 1.75rem 0 0.5rem;
  color: var(--ink);
}

p { margin: 0 0 1rem; }

ul { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }

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

strong { color: var(--ink); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--paper-sunk);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ── Tables ── */

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

table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0.7rem 0.9rem;
  background: var(--paper-sunk);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
}

tr:last-child td { border-bottom: none; }

/* ── Callout ── */

.note {
  background: var(--accent-wash);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.note p:last-child { margin-bottom: 0; }

/* ── Footer ── */

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
