/* Spanish at Work · Hi-Vis brand. See BRAND.md for how these are meant to be used. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(/fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed-800.woff2) format("woff2"); }

:root {
  /* Brand colors (fixed, same in light and dark) */
  --brand-navy: #12223a;      /* Shift Navy */
  --brand-yellow: #ffc629;    /* Hi-Vis Yellow */
  --brand-steel: #eef1f4;     /* Steel */
  --brand-green: #1f7a4d;     /* Go Green */

  /* Roles (these change in dark mode) */
  --bg: var(--brand-steel);
  --surface: #ffffff;
  --ink: var(--brand-navy);
  --muted: #566275;
  --line: #d9dee5;
  --chip: #e3e8ee;
  --accent: var(--brand-yellow);     /* fills only: buttons, progress, highlights */
  --accent-ink: var(--brand-navy);   /* text/icons on top of yellow */
  --strong: var(--brand-navy);       /* navy panels: header, next-up card, mini player */
  --strong-ink: #ffffff;
  --strong-muted: #b9c4d3;
  --link: #1b4f9c;
  --ok: var(--brand-green);
  --focus: #1d5fd1;

  /* Type */
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --text-xs: .78rem;
  --text-sm: .9rem;
  --text-md: 1.05rem;
  --text-lg: 1.35rem;
  --text-xl: 2.4rem;

  /* Shape */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(18, 34, 58, .06), 0 6px 20px rgba(18, 34, 58, .07);
  --page: 760px;
  --mini-h: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1626;
    --surface: #13223a;
    --ink: #eef1f4;
    --muted: #9aa8bb;
    --line: #24364f;
    --chip: #1b2c46;
    --strong: #1d3150;
    --strong-muted: #b9c4d3;
    --link: var(--brand-yellow);
    --ok: #4cc38a;
    --focus: var(--brand-yellow);
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--font-body);
  overflow-x: hidden;
  padding-bottom: calc(var(--mini-h) + env(safe-area-inset-bottom));
}
body.has-mini { --mini-h: 88px; }
a { color: var(--link); }
h1, h2 { font-family: var(--font-display); font-weight: 800; line-height: 1.02; letter-spacing: .005em; text-transform: uppercase; text-wrap: balance; }
h1:focus { outline: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
svg { width: 24px; height: 24px; flex: none; }
svg:not([fill]) { fill: currentColor; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--surface); padding: 10px 14px; border-radius: 10px; z-index: 30; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-header { background: var(--brand-navy); color: #fff; padding-top: env(safe-area-inset-top); }
.site-header-inner {
  max-width: var(--page); margin: 0 auto; min-height: 60px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: #fff; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.wordmark { font: 800 1.35rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; }
.wordmark span { background: var(--brand-yellow); color: var(--brand-navy); padding: 1px 6px 0; border-radius: 4px; margin-left: 2px; }
.feed-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
  color: #c9d2de; text-decoration: none; font-weight: 600; font-size: var(--text-sm);
}
.feed-link:hover { color: #fff; }
.feed-link svg { width: 18px; height: 18px; color: var(--brand-yellow); }

main { max-width: var(--page); margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }

/* ---------- home ---------- */
.hero { padding: 18px 0 16px; }
.hero h1 { font-size: var(--text-xl); margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); max-width: 46ch; }

.next-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  background: var(--strong); color: var(--strong-ink); border-radius: var(--radius-lg);
  padding: 14px 16px 18px; overflow: hidden; box-shadow: var(--shadow);
}
.next-play {
  flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
}
.next-play svg { width: 26px; height: 26px; }
.next-play:active { transform: scale(.95); }
.next-link { display: grid; gap: 1px; min-width: 0; flex: 1; color: inherit; text-decoration: none; min-height: 44px; align-content: center; }
.next-link:hover .next-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.next-label { font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-yellow); }
.next-title { font: 800 1.55rem/1.05 var(--font-display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-meta { font-size: var(--text-sm); color: var(--strong-muted); }
.next-bar { position: absolute; left: 16px; right: 16px; bottom: 8px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.next-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; }
.next-card:not([data-mode="continue"]) { padding-bottom: 14px; }
.next-card:not([data-mode="continue"]) .next-bar { display: none; }

.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 28px 0 8px; }
.list-head h2 { margin: 0; font-size: var(--text-lg); }
.count { color: var(--muted); font-size: var(--text-sm); font-weight: 600; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding: 16px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--text-sm); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.ep-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.ep { position: relative; border-top: 1px solid var(--line); }
.ep:first-child { border-top: 0; }
.ep-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 60px; color: inherit; text-decoration: none; }
.ep-link:hover { background: color-mix(in srgb, var(--chip) 55%, transparent); }
.ep-link:hover .ep-title { text-decoration: underline; text-underline-offset: 3px; }
.ep-num {
  flex: none; width: 34px; text-align: center;
  font: 800 1.3rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink);
}
.ep.is-playing .ep-num { background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 5px 0; }
.ep-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ep-title { font-weight: 700; font-size: var(--text-md); line-height: 1.25; }
.ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--text-xs); color: var(--muted); }
.ep-status { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--muted); }
.ep-status:has(svg) { color: var(--ok); }
.ep.is-playing .ep-status { color: var(--ink); }
.ep-status svg { width: 15px; height: 15px; }
.ep-dur { flex: none; font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.ep-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none; }
.ep-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--ink);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .01em;
}
.empty { color: var(--muted); }

/* ---------- episode ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: 6px 0 0 -6px; font-weight: 600; color: var(--ink); text-decoration: none; }
.back svg { color: var(--muted); }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--muted); font-weight: 700; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: .06em; }
.eyebrow .tag { text-transform: none; letter-spacing: .01em; }
.episode h1 { font-size: 2.3rem; margin: 6px 0 10px; }
.summary { margin: 0 0 6px; font-size: var(--text-md); max-width: 60ch; }
.meta { margin: 0 0 18px; color: var(--muted); font-size: var(--text-sm); }

.player { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 16px 18px; box-shadow: var(--shadow); }
.scrub input[type="range"] {
  --fill: 0%;
  width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.scrub input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--ink) var(--fill), var(--line) var(--fill));
}
.scrub input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--line); }
.scrub input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--ink); }
.scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--ink);
}
.scrub input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--ink); }
.times { display: flex; justify-content: space-between; font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 10px 0 14px; }
.ctl {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--ink);
}
.ctl svg { width: 32px; height: 32px; }
.ctl:active { transform: scale(.95); }
.ctl.play { width: 80px; height: 80px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.ctl.play svg { width: 36px; height: 36px; }

.seg { display: inline-flex; background: var(--chip); border-radius: 999px; padding: 3px; }
.seg button {
  min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; background: transparent;
  border-radius: 999px; cursor: pointer; font-weight: 700; font-size: var(--text-sm); color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.speed { display: flex; width: max-content; margin: 0 auto; }
.resume { text-align: center; margin: 12px 0 0; color: var(--muted); font-size: var(--text-sm); }

.phrases h2 { font-size: var(--text-lg); margin: 32px 0 10px; }
.phrases ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.phrases li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; display: grid; gap: 1px;
}
.phrases .es { font-weight: 700; font-size: 1.12rem; }
.phrases .en { color: var(--muted); }

.prevnext { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 32px; }
.pn {
  display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
}
.pn:hover .pn-title { text-decoration: underline; text-underline-offset: 3px; }
.pn > span { display: grid; min-width: 0; }
.pn.next { justify-content: space-between; }
.pn-label { font-size: var(--text-xs); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pn-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn svg { color: var(--muted); }

/* ---------- mini player (floating) ---------- */
.mini {
  position: fixed; z-index: 20;
  left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right));
  bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: calc(var(--page) - 12px); margin: 0 auto;
  background: var(--strong); color: var(--strong-ink); border-radius: 18px; overflow: hidden;
  box-shadow: 0 8px 28px rgba(11, 22, 38, .3);
}
.mini[hidden] { display: none; }
.mini-inner { display: flex; align-items: center; gap: 8px; padding: 8px 8px 10px 10px; height: 68px; }
.mini .ctl { color: var(--strong-ink); }
.ctl.small { width: 46px; height: 46px; }
.ctl.small svg { width: 26px; height: 26px; }
.ctl.small.play { width: 48px; height: 48px; color: var(--accent-ink); box-shadow: none; }
.ctl.small.play svg { width: 22px; height: 22px; }
.mini-link { display: grid; min-width: 0; flex: 1; min-height: 44px; align-content: center; padding-left: 2px; color: inherit; text-decoration: none; }
.mini-num { font-size: var(--text-xs); color: var(--strong-muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-time { flex: none; font-size: var(--text-xs); color: var(--strong-muted); font-variant-numeric: tabular-nums; }
.mini-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .14); }
.mini-bar span { display: block; height: 100%; width: 0; background: var(--accent); }

.site-footer { max-width: var(--page); margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: var(--text-sm); }

/* ---------- small phones ---------- */
@media (max-width: 380px) {
  .feed-link span { display: none; }
  .mini-time { display: none; }
}

/* ---------- larger screens ---------- */
@media (min-width: 640px) {
  .hero { padding: 36px 0 22px; }
  .hero h1 { font-size: 3.4rem; }
  .episode h1 { font-size: 3rem; }
  .next-card { padding: 18px 22px 22px; }
  .next-card:not([data-mode="continue"]) { padding-bottom: 18px; }
  .next-bar { left: 22px; right: 22px; }
  .next-title { font-size: 1.9rem; }
  .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 4px 0 12px; }
  .ep-link { padding: 10px 18px; }
  .prevnext { grid-template-columns: 1fr 1fr; }
  .player { padding: 20px 26px 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  .chip, .seg button, .ctl, .next-play { transition: background-color .15s, color .15s, transform .1s; }
}
