/* ==========================================================
   THE PROS — episodes.css
   Episode cards, grids, and featured layouts
   ========================================================== */

/* ---- FEATURED EPISODES GRID (Homepage) ---- */
.episodes-featured-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.section-hero {
  padding: 40px 24px;
}

@media (min-width: 900px) {
  .section-hero {
    padding: 60px 36px;
  }
}

/* Large card occupies both rows */
.ep-card--large {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}

/* ---- BASE EPISODE CARD ---- */
.ep-card {
  background: var(--charcoal-2);
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.ep-card:hover {
  border-color: rgba(246, 78, 30, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.ep-card.ep-highlight {
  border-color: rgba(246, 78, 30, 0.25);
}

/* ---- EPISODE THUMBNAIL ---- */
.ep-thumb {
  position: relative;
  overflow: hidden;
  background: var(--charcoal-3);
  flex-shrink: 0;
}
.ep-card--large .ep-thumb {
  aspect-ratio: 16/9;
}
.ep-card:not(.ep-card--large) .ep-thumb {
  aspect-ratio: 16/9;
}

.ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
  display: block;
}
.ep-card:hover .ep-thumb img {
  transform: scale(1.05);
}

/* Fallback gradient when image missing */
.ep-thumb--fallback {
  background: linear-gradient(
    135deg,
    var(--charcoal-3) 0%,
    var(--charcoal-4) 40%,
    rgba(246, 78, 30, 0.1) 100%
  );
  min-height: 180px;
}

/* Overlay with play button */
.ep-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.ep-card:hover .ep-thumb-overlay {
  background: rgba(0, 0, 0, 0.45);
}

.ep-play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity var(--transition),
    transform var(--transition),
    background var(--transition);
  box-shadow: 0 4px 20px rgba(246, 78, 30, 0.5);
}
.ep-play-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}
.ep-card:hover .ep-play-btn {
  opacity: 1;
  transform: scale(1);
}
.ep-play-btn:hover {
  background: var(--orange-dark);
}

/* Episode number label */
.ep-number {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.65);
  padding: 3px 9px;
  border-radius: 3px;
  backdrop-filter: blur(4px);
}

/* Season badge */
.ep-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--orange);
  color: #fff;
  padding: 3px 9px;
  border-radius: 3px;
}
.ep-badge--new {
  background: var(--gold);
  color: var(--black);
}

/* ---- EPISODE INFO ---- */
.ep-info {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ep-card--large .ep-info {
  padding: 24px 28px 28px;
}

.ep-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.ep-season-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--white-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Episode tag/badge */
.ep-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(246, 78, 30, 0.12);
  border: 1px solid rgba(246, 78, 30, 0.2);
  padding: 3px 10px;
  border-radius: 3px;
}
.ep-tag--gold {
  color: var(--gold);
  background: rgba(232, 184, 75, 0.1);
  border-color: rgba(232, 184, 75, 0.2);
}

.ep-title {
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.25;
  font-family: var(--font-serif);
}
.ep-card--large .ep-title {
  font-size: 1.55rem;
  margin-bottom: 12px;
}

.ep-desc {
  font-size: 0.84rem;
  color: var(--white-dim);
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1;
  /* clamp to 3 lines on smaller cards */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-card--large .ep-desc {
  -webkit-line-clamp: 4;
  font-size: 0.9rem;
}

.ep-meta {
  margin-bottom: 16px;
}
.ep-cast {
  font-size: 0.75rem;
  color: rgba(247, 247, 247, 0.4);
  display: block;
  line-height: 1.5;
}
.ep-cast strong {
  color: rgba(247, 247, 247, 0.55);
  font-weight: 600;
}

/* ---- EPISODE BUTTON GROUP ---- */
.ep-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ---- FEATURED CTA ---- */
.featured-cta {
  text-align: center;
  margin-top: 44px;
}

/* ---- ALL EPISODES GRID (Episodes page) ---- */
.episodes-page {
  background: var(--charcoal);
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* List style episode cards */
.ep-list-card {
  flex-direction: row;
  align-items: stretch;
}
.ep-list-card .ep-thumb {
  width: 220px;
  flex-shrink: 0;
  aspect-ratio: unset;
  min-height: 148px;
}
.ep-list-card .ep-thumb img {
  height: 100%;
  object-fit: cover;
}
.ep-list-card .ep-thumb--fallback {
  min-height: 148px;
}
.ep-list-card .ep-info {
  padding: 18px 20px;
}
.ep-list-card .ep-title {
  font-size: 1.05rem;
}
.ep-list-card .ep-desc {
  font-size: 0.82rem;
  -webkit-line-clamp: 2;
}

/* Full-width list layout for episodes page */
@media (min-width: 900px) {
  .episodes-grid {
    grid-template-columns: 1fr;
  }
  .ep-list-card .ep-thumb {
    width: 260px;
    min-height: 160px;
  }
  .ep-list-card .ep-desc {
    -webkit-line-clamp: 3;
  }
}

/* EC-BTN-104 + EC-NAV-121: Re-assert hero / CTA text-white on buttons & links.
   Uses class~= (word match) not class*= (substring) to avoid matching hover:text-white etc. */
button[class~='text-white/90'],
a[class~='text-white/90'] {
  color: rgba(255, 255, 255, 0.9);
}
button[class~='text-white/80'],
a[class~='text-white/80'] {
  color: rgba(255, 255, 255, 0.8);
}
button[class~='text-white/70'],
a[class~='text-white/70'] {
  color: rgba(255, 255, 255, 0.7);
}
button[class~='text-white/60'],
a[class~='text-white/60'] {
  color: rgba(255, 255, 255, 0.6);
}
button[class~='text-white/50'],
a[class~='text-white/50'] {
  color: rgba(255, 255, 255, 0.5);
}
button[class~='text-white/40'],
a[class~='text-white/40'] {
  color: rgba(255, 255, 255, 0.4);
}
button[class~='text-white'],
a[class~='text-white'] {
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}

/* EC-ANIM-008b / EC-ANIM-009: carousel-only override — scroll-reveal elements animate via IO in functions.php */
.scroll-fade-up:has([aria-roledescription='carousel']),
.scroll-fade-left:has([aria-roledescription='carousel']),
.scroll-fade-right:has([aria-roledescription='carousel']),
.scroll-scale-in:has([aria-roledescription='carousel']) {
  opacity: 1 !important;
  transform: none !important;
}
