/*
===============================================================================
 FILE    : styles.css
 PROJECT : Better Than You Heard (BTYH) public website
 SUMMARY : The one shared stylesheet for every page of betterthanyouheard.com.
           Plain CSS, no frameworks, no web fonts (web fonts would mean a
           third-party request, which the privacy policy promises not to make).
           Colors are defined once as variables, with a dark-mode set that
           follows the visitor's system setting. Text and link colors meet
           WCAG AA contrast in both modes.
===============================================================================
*/

/* ---- Color and spacing tokens (light mode) ---------------------------------- */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1f1d;
  --muted: #555d58;
  --line: #dfe3df;
  --accent: #1d6b4f;
  --accent-soft: #e5f2ec;
  --receipt: #fffdf6;
  --measure: 42rem;
  --radius: 10px;
  color-scheme: light dark;
}

/* ---- Dark mode: same tokens, darker values ---------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121513;
    --surface: #1a1e1b;
    --text: #e8ece9;
    --muted: #a7b0aa;
    --line: #2d332f;
    --accent: #6fd3a8;
    --accent-soft: #1d2e26;
    --receipt: #1d211e;
  }
}

/* ---- Base page ------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* Centered reading column with a comfortable line length. */
.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* Visible keyboard focus on every link. */
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.1rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.5rem;
}

p, li {
  max-width: 65ch;
}

/* ---- Skip link for keyboard and screen-reader users ------------------------- */
.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

/* ---- Header and navigation --------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}

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

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

/* Marks the current page in the navigation. */
nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: none;
}

/* ---- Main content -------------------------------------------------------------- */
main {
  padding: 2.5rem 0 3rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
  margin-top: 0;
}

.updated {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- "Receipt" card: used for the Truth Rules and the channel promise --------- */
.receipt {
  background: var(--receipt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.receipt ol {
  margin: 0;
  padding-left: 1.4rem;
}

.receipt li + li {
  margin-top: 0.75rem;
}

.promise {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

/* ---- Three-up "what you'll find" list ------------------------------------------ */
.formats {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.formats li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  max-width: none;
}

.formats strong {
  display: block;
}

/* ---- Buttons (plain links styled as buttons) ------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.button {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.button.primary {
  background: var(--accent);
  color: var(--bg);
}

/* ---- Corrections table ------------------------------------------------------------ */
.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--accent-soft);
}

.empty {
  color: var(--muted);
  font-style: italic;
}

/* ---- Footer ------------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 0 2.5rem;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0;
  margin: 0 0 0.75rem;
}
