/* =============================================================================
 * Weekly Family Broadcast — light-only, phone-first, print-ready.
 *
 * Tokens and layout language are lifted from the family surface next door
 * (curriculum/family-connections/family-foundation.css + family.css) so the two
 * pages read as one place. LIGHT-ONLY SITE: this file deliberately contains no
 * dark-scheme media query of any kind, and must never grow one.
 *
 * Contrast notes (all against --paper-bright #fffdf8):
 *   --ink #173b47 ~ 11:1, --muted #586a70 ~ 5.4:1, --teal #1a746f ~ 4.9:1,
 *   --coral-dark #c74734 ~ 4.9:1. Plain --coral is used for fills and rules
 *   only, never for text, because it does not clear 4.5:1.
 * ========================================================================== */

:root {
  --ink: #173b47;
  --ink-deep: #0d2932;
  --paper: #f7f3e9;
  --paper-bright: #fffdf8;
  --line: #d7d4c8;
  --coral: #ee6b52;
  --coral-dark: #c74734;
  --teal: #1a746f;
  --teal-pale: #dcece6;
  --gold: #e5b44a;
  --muted: #586a70;
  --shadow: 0 18px 50px rgb(23 59 71 / 10%);
  --radius: 1.25rem;
  --content: 46rem;
  --font-display: "Outfit", "Fraunces", Georgia, serif;
  --font-body: "Hanken Grotesk", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
  font: 400 1rem/1.6 var(--font-body);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

a,
button,
input {
  font: inherit;
}

button,
input {
  min-height: 3rem;
}

:focus-visible {
  outline: 0.2rem solid var(--gold);
  outline-offset: 0.2rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 30;
  inset: 0.75rem auto auto 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: var(--ink-deep);
  color: #fff;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.bc-header {
  width: min(calc(100% - 1.5rem), var(--content));
  margin-inline: auto;
  padding-block: 0.9rem 0.4rem;
}

.bc-header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.bc-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.bc-mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--coral-dark);
  color: #fff;
  font: 700 1.25rem/1 var(--font-display);
}

.bc-brand strong,
.bc-brand small {
  display: block;
  line-height: 1.15;
}

.bc-brand small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* The language toggle is the largest control on the page on purpose:
   Spanish is a first-class way to read this, not a footnote. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.5rem 1.4rem;
  border: 2px solid var(--teal);
  border-radius: 999px;
  background: var(--teal-pale);
  color: var(--ink-deep);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.lang-toggle:hover {
  background: #cfe4dc;
}

.lang-globe {
  font-size: 1.15rem;
}

.bc-back {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 700;
}

/* -------------------------------------------------------------------- gate */

.bc-main {
  width: min(calc(100% - 1.5rem), var(--content));
  margin: 0 auto 3rem;
}

.gate {
  margin-top: 0.75rem;
  padding: clamp(1.25rem, 5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gate h1 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.gate p {
  margin: 0 0 1rem;
  max-width: 40ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.gate-privacy {
  padding: 0.9rem 1rem;
  border-left: 0.3rem solid var(--teal);
  border-radius: 0 0.6rem 0.6rem 0;
  background: var(--teal-pale);
  color: var(--ink-deep) !important;
  font-size: 0.95rem !important;
}

.gate-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.gate-form label {
  font-weight: 700;
}

.gate-form input {
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--ink);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate-form input:focus {
  border-color: var(--teal);
}

.gate-hint {
  margin: 0 !important;
  color: var(--muted);
  font-size: 0.88rem !important;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--coral-dark);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary:hover {
  background: #a83a2a;
}

.bc-message {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-bright);
}

.bc-message h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.bc-message p {
  margin: 0;
  color: var(--muted);
}

/* ------------------------------------------------------------------- stage */

.stage-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin: 0.5rem 0 0.6rem;
}

.window-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.progress-step {
  position: relative;
  flex: 1;
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--teal);
}

.progress-step.is-done .progress-fill {
  width: 100%;
}

/* Cards ------------------------------------------------------------------- */

.cards {
  display: grid;
  gap: 1rem;
}

.card {
  padding: clamp(1.25rem, 5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}

.mode-story .card {
  display: none;
  min-height: min(62svh, 34rem);
}

.mode-story .card.is-current {
  display: block;
  animation: card-in 0.35s ease-out;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-story .card.is-current {
    animation: none;
  }
}

.card-kicker {
  margin: 0 0 0.7rem;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.card h2:focus-visible {
  outline: 0.2rem solid var(--gold);
  outline-offset: 0.35rem;
}

.card p {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
}

.card .lede {
  color: var(--muted);
}

.card ul,
.card ol {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
}

.card li {
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.card li:last-child {
  margin-bottom: 0;
}

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

.item-list li {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--paper);
}

.item-list a {
  color: var(--ink-deep);
  font-weight: 700;
}

.item-note {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--teal-pale);
  color: var(--ink-deep);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chip-warm {
  background: var(--gold);
  color: #3b2a05;
}

.callout {
  margin: 0 0 0.9rem;
  padding: 0.9rem 1rem;
  border-left: 0.3rem solid var(--coral);
  border-radius: 0 0.7rem 0.7rem 0;
  background: #fdf0ec;
}

.callout strong {
  display: block;
  margin-bottom: 0.2rem;
}

.callout p {
  margin: 0;
  font-size: 1rem;
}

.class-context {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.class-context strong {
  display: block;
  color: var(--ink);
}

/* Controls ---------------------------------------------------------------- */

.controls {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.65rem 0.5rem;
  border-top: 1px solid var(--line);
  background: rgb(247 243 233 / 96%);
}

.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 3.5rem;
  min-height: 3rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-bright);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.ctrl:hover {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.ctrl-play {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.ctrl-play:hover {
  background: #145b57;
  color: #fff;
}

.ctrl[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.ctrl-wide {
  flex-basis: 100%;
  justify-content: center;
}

.mode-all .story-only {
  display: none;
}

.footnote {
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (min-width: 40rem) {
  .ctrl-wide {
    flex-basis: auto;
  }
}

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

@media print {
  :root {
    --paper: #fff;
    --paper-bright: #fff;
    font-size: 9.5pt;
  }

  body {
    background: #fff;
  }

  .skip-link,
  .lang-toggle,
  .controls,
  .progress,
  .gate,
  .bc-back,
  .footnote,
  .bc-message {
    display: none !important;
  }

  .bc-main,
  .bc-header {
    width: 100%;
  }

  .cards {
    display: block;
  }

  .card,
  .mode-story .card,
  .mode-story .card.is-current {
    display: block;
    min-height: 0;
    margin-bottom: 0.35rem;
    padding: 0.35rem 0;
    border: 0;
    border-bottom: 1pt solid #999;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
    animation: none;
  }

  .card h2 {
    margin-bottom: 0.2rem;
    font-size: 12pt;
  }

  .card p,
  .card li {
    margin-bottom: 0.15rem;
    font-size: 9.5pt;
  }

  .card-kicker {
    margin-bottom: 0.15rem;
    font-size: 7.5pt;
  }

  .item-list li,
  .callout,
  .class-context {
    padding: 0.1rem 0;
    border: 0;
    background: none;
  }

  a[href^="/"]::after {
    content: " (eduwonderlab.com" attr(href) ")";
    font-size: 8pt;
  }
}
