/* ============================================================================
   THE INTERLOCK — Season 1 Episode Guide (episodes.css)
   2-font editorial architecture (Newsreader + Plus Jakarta Sans), de-boxed
   hairline index rows, WCAG AA contrast, zero badge soup.
   ============================================================================ */

.episodes-page {
  background:
    radial-gradient(ellipse 75% 48% at 22% -4%, rgba(232, 168, 56, 0.11), transparent 64%),
    radial-gradient(ellipse 60% 42% at 88% 12%, rgba(217, 107, 67, 0.08), transparent 62%),
    var(--bg);
  color: var(--ivory);
  min-height: 100vh;
}

.ep-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 28px 128px;
}

.ep-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(244, 240, 230, 0.10);
}

.ep-hero-copy {
  width: 100%;
  min-width: 0;
  max-width: 680px;
}

.ep-kicker {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}

.ep-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ivory);
  margin: 0 0 16px;
}

.ep-lead {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

.ep-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.ep-text-link {
  color: var(--gold-bright);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ep-text-link:hover {
  color: var(--ivory);
  text-decoration: underline;
}

/* Filter & Search Bar */
.ep-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(244, 240, 230, 0.08);
}

.ep-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ep-filter {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ep-filter:hover {
  color: var(--ivory);
  background: rgba(244, 240, 230, 0.05);
}

.ep-filter.active {
  color: var(--gold-bright);
  background: rgba(232, 168, 56, 0.11);
  border-color: rgba(232, 168, 56, 0.35);
}

.ep-search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

#ep-search {
  width: 240px;
  padding: 8px 13px;
  border-radius: 8px;
  border: 1px solid rgba(244, 240, 230, 0.16);
  background: rgba(18, 20, 26, 0.72);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

#ep-search::placeholder {
  color: var(--dim);
}

#ep-search:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.ep-count {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  white-space: nowrap;
}

/* Hairline Editorial Episode Index */
.ep-index {
  display: flex;
  flex-direction: column;
}

.ep-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 268px;
  gap: 24px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid rgba(244, 240, 230, 0.08);
  scroll-margin-top: 86px;
  transition: background-color 240ms ease;
}

.ep-row:target {
  background: linear-gradient(90deg, rgba(232, 168, 56, 0.09), transparent 72%);
  border-radius: 10px;
  padding-left: 14px;
  padding-right: 14px;
  margin-left: -14px;
  margin-right: -14px;
}

.ep-row > div {
  min-width: 0;
  overflow-wrap: break-word;
}

.ep-num-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ep-num-link:hover .ep-num {
  color: var(--ivory);
  text-decoration: underline;
}

.ep-num-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 4px;
}

.ep-num {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.ep-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.ep-dot.terra {
  background: var(--terra);
}

.ep-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--dim);
  margin-bottom: 6px;
}

.ep-lineage-label {
  color: var(--gold-bright);
  font-weight: 500;
}

.ep-lineage-label.terra {
  color: var(--terra-bright);
}

.ep-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 500;
  line-height: 1.24;
  color: var(--ivory);
  margin: 0 0 6px;
}

.ep-artists {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(244, 240, 230, 0.84);
  margin: 0 0 8px;
}

.ep-hook {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 64ch;
}

.ep-links-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.ep-action-link {
  font-size: 0.84rem;
  font-weight: 500;
  color: rgba(244, 240, 230, 0.82);
  text-decoration: none;
  transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1);
  text-align: right;
}

.ep-action-link:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.ep-action-link.primary-link {
  color: var(--gold-bright);
}

.ep-spin-btn {
  appearance: none;
  background: rgba(244, 240, 230, 0.04);
  border: 1px solid rgba(244, 240, 230, 0.16);
  color: rgba(244, 240, 230, 0.88);
  font-family: var(--font-sans);
  font-size: 0.81rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 4px;
  text-align: right;
  transition: border-color 180ms cubic-bezier(0.22, 1, 0.36, 1), color 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ep-spin-btn:hover {
  border-color: rgba(232, 168, 56, 0.55);
  color: var(--gold-bright);
  background: rgba(232, 168, 56, 0.10);
}

.ep-spin-btn.is-playing {
  border-color: rgba(232, 168, 56, 0.72);
  background: rgba(232, 168, 56, 0.18);
  color: var(--gold-bright);
  font-weight: 600;
}

.ep-empty {
  padding: 56px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Bottom Ecosystem Strip */
.ep-ecosystem-band {
  margin-top: 56px;
  padding: 36px 0 12px;
  border-top: 1px solid rgba(232, 168, 56, 0.25);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.ep-ecosystem-band h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 500;
  color: var(--ivory);
  margin: 0 0 10px;
}

.ep-band-sub {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

.ep-band-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ep-footer {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 96px;
  border-top: 1px solid rgba(244, 240, 230, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--dim);
}

.ep-footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.ep-footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.ep-footer-links a:hover {
  color: var(--gold-bright);
}

@media (max-width: 860px) {
  .ep-shell {
    padding: 28px 18px 116px;
  }
  .ep-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .ep-hero-actions {
    align-items: flex-start;
  }
  .ep-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px 16px;
  }
  .ep-links-col {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding-top: 6px;
  }
  .ep-action-link {
    text-align: left;
  }
  #ep-search {
    width: 100%;
    flex: 1;
  }
  .ep-search-wrap {
    width: 100%;
  }
}
