/* ==========================================================================
   episodes.css — loads after site.css, only on the episode index
   Sections: 1 breadcrumb · 2 review bar · 3 head · 4 facets · 5 grid
             6 card · 7 empty · 8 pager · 9 responsive
   ========================================================================== */

/* 1. BREADCRUMB ===========================================================
   Same rules as episode.css so the two pages line up. Duplicated rather than
   moved to site.css because site.css is loaded by pages that have no crumbs;
   consolidate both copies when the static generator lands. */
.crumbs {
  font-family: var(--font-util);
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--type-3);
  padding-block: 1rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crumbs a { border-bottom: 1px solid transparent; }
.crumbs a:hover, .crumbs a:focus-visible { border-bottom-color: var(--line-2); color: var(--navy); }
.crumbs__now { color: var(--type-2); }

/* 2. REVIEW BAR ===========================================================
   Only rendered with a valid token. Deliberately loud — it must never be
   mistaken for the public page. */
.reviewbar {
  background: var(--gold-deep);
  color: var(--gold-lit);
  border-left: 3px solid var(--gold);
  border-radius: var(--r);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: var(--step--1);
  line-height: 1.55;
}

.reviewbar strong { color: #fff; }

.reviewbar code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.09);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* 3. PAGE HEAD ============================================================ */

/* The index has no full-bleed section before the footer the way the episode
   page does, so the content sat flush against it. */
.eps { padding-bottom: 3.25rem; }

.epsHead { padding-block: 0.25rem 1.5rem; }

.epsHead__title {
  font-size: var(--step-3);
  line-height: 1.15;
}

.epsHead__count {
  font-family: var(--font-util);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--type-3);
  margin-top: 0.5rem;
}

/* 4. SEASON FACETS ========================================================
   Horizontally scrollable on narrow screens rather than wrapping to four
   rows — twenty seasons would otherwise push the grid below the fold. */
.facets {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.facet {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-util);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--type-2);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
}

.facet:hover, .facet:focus-visible { background: var(--line); color: var(--navy); }

.facet--on {
  background: var(--navy);
  color: var(--on-dark);
}

.facet--on:hover, .facet--on:focus-visible { background: var(--navy-3); color: var(--on-dark); }

.facet__n {
  font-size: 0.6875rem;
  font-weight: 300;
  color: var(--type-3);
}

.facet--on .facet__n { color: var(--on-dark-2); }

/* 5. GRID ================================================================= */
.epsGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem 1.25rem;
}

.epsGrid__item { min-width: 0; }

/* 6. CARD =================================================================
   Extends the homepage .card idea with a real thumbnail, teaser and status
   flag. Named separately so changing the index never disturbs the homepage. */
.epcard {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.epcard__thumb {
  position: relative;
  display: block;
  background: var(--surface);
  border-radius: var(--r);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.epcard__img {
  position: relative;   /* stacks above the fallback plate */
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}

.epcard:hover .epcard__img,
.epcard:focus-visible .epcard__img { transform: scale(1.035); }

/* Fallback for records with no thumbnail. A dated plate is more useful than
   an empty grey box, and distinguishes cards when the catalog reuses one
   stadium image. */
.epcard__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy-3) 100%);
  color: var(--on-dark);
  font-family: var(--font-util);
  line-height: 1;
}

.epcard__fallbackDate { font-size: 1.05rem; letter-spacing: 0.06em; }
.epcard__fallbackYear { font-size: 0.7rem; letter-spacing: 0.18em; color: var(--gold-lit); }

.epcard__dur {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: rgba(12, 35, 64, 0.88);
  color: var(--on-dark);
  font-family: var(--font-util);
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  padding: 0.16rem 0.44rem;
  border-radius: 3px;
}

.epcard__flag {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  background: var(--navy-3);
  color: var(--on-dark);
  font-family: var(--font-util);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.16rem 0.46rem;
  border-radius: 3px;
}

.epcard__flag--draft { background: var(--gold); color: var(--gold-deep); }

.epcard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 0.7rem;
}

.epcard__kicker {
  font-family: var(--font-util);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.epcard__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.28;
  transition: color 0.18s var(--ease);
}

.epcard:hover .epcard__title { color: var(--navy-3); }

/* Teasers vary in length. Clamping keeps the grid rows even without forcing
   a fixed card height that would clip long titles. */
.epcard__teaser {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--type-2);
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epcard__meta {
  font-family: var(--font-util);
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--type-3);
  margin-top: auto;
  padding-top: 0.55rem;
}

.epcard__audio { color: var(--type-2); }

/* 7. EMPTY STATE ========================================================== */
.epsEmpty {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 2.25rem 1.5rem;
  text-align: center;
}

.epsEmpty__lead {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--type);
}

.epsEmpty__body {
  font-size: 0.9375rem;
  color: var(--type-2);
  margin-top: 0.6rem;
  max-width: 46ch;
  margin-inline: auto;
}

.epsEmpty__body a { border-bottom: 1px solid var(--line-2); color: var(--navy); }
.epsEmpty__body a:hover, .epsEmpty__body a:focus-visible { border-bottom-color: var(--navy); }

/* 8. PAGER ================================================================ */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-util);
  letter-spacing: 0.07em;
}

.pager__step {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 2px;
  white-space: nowrap;
}

.pager__step:hover, .pager__step:focus-visible { border-bottom-color: var(--navy); }

.pager__step--off { color: var(--type-3); border-bottom-color: transparent; }

.pager__list {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pager__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding-inline: 0.4rem;
  border-radius: var(--r);
  font-size: 0.8125rem;
  color: var(--type-2);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.pager__n:hover, .pager__n:focus-visible { background: var(--surface); color: var(--navy); }

.pager__n--on { background: var(--navy); color: var(--on-dark); }
.pager__n--on:hover { background: var(--navy); }

.pager__gap { color: var(--type-3); padding-inline: 0.15rem; }

/* 9. RESPONSIVE ===========================================================
   Breakpoints match site.css so the index reflows in step with the rest of
   the site rather than at its own widths. */
@media (max-width: 900px) {
  .epsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .epsGrid { grid-template-columns: 1fr; gap: 1.5rem; }

  .epsHead__title { font-size: var(--step-2); }

  /* Bleed the facet strip to the viewport edge so it reads as scrollable. */
  .facets {
    margin-inline: calc(var(--gut) * -1);
    padding-inline: var(--gut);
  }

  .pager { flex-wrap: wrap; justify-content: center; }
  .pager__list { order: -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .epcard__thumb img { transition: none; }
  .epcard:hover .epcard__thumb img { transform: none; }
}
