/* Episode template page */
.episode-page .page-top .lead {
  margin-top: 1.25rem;
}

.episode-page .page-top.card {
  padding: clamp(1rem, 2.8vw, 1.4rem);
  border-radius: 18px;
}

.episode-page .episode-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.25rem 0 0;
}

.episode-page .hero-actions {
  margin: 1.5rem 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.episode-page .episode-tag {
  background: var(--surface-2, #e8eaed);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 0.85em;
  font-weight: 500;
}

.episode-page .episode-section {
  margin-top: 3.5rem;
}

.episode-page .episode-section h2 {
  margin-bottom: 1.25rem;
}

.episode-page .takeaways-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
}

.episode-page .takeaways-list li {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  line-height: 1.6;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.episode-page .takeaways-list li:last-child {
  border-bottom: none;
}

.episode-page .takeaway-num {
  font-weight: 800;
  font-size: 1.5em;
  color: #1a1a1a;
  opacity: 0.35;
  flex-shrink: 0;
  min-width: 1.75rem;
  line-height: 1.4;
}

.episode-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted, #888);
  font-size: 0.9em;
  text-decoration: none;
  margin-bottom: 2rem;
}

.episode-page .back-link:hover {
  color: var(--text, #1a1a1a);
}

.episode-page .page-top {
  position: relative;
}

.episode-page .ep-share-btn {
  position: absolute;
  top: clamp(1rem, 2.8vw, 1.4rem);
  right: clamp(1rem, 2.8vw, 1.4rem);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: rgba(0, 0, 0, 0.5);
}

.episode-page .ep-share-btn:hover {
  background: rgba(0, 0, 0, 0.11);
  color: #1a1a1a;
}

.episode-page .ep-share-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 0.85em;
  padding: 8px 18px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
  z-index: 999;
}

.episode-page .ep-share-toast.show {
  opacity: 1;
}

.episode-page .ep-cta {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  white-space: nowrap;
}

.episode-page .episode-player {
  flex: 1;
  min-width: 180px;
  border-radius: 8px;
  display: block;
  accent-color: #1a1a1a;
  height: 40px;
}

.episode-player-wrap {
  flex: 1;
  min-width: 0;
}



.episode-page .cf-wrap {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.episode-page .cf-stage {
  overflow: hidden;
}

.episode-page .cf-track {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 14px;
  padding: 28px 24px 20px;
}

.episode-page .cf-track::-webkit-scrollbar {
  display: none;
}

.episode-page .cf-item {
  flex-shrink: 0;
  width: clamp(260px, 56vw, 380px);
  scroll-snap-align: start;
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  user-select: text;
}

.episode-page .cf-quote p {
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.65;
  margin: 0 0 0.6rem;
  color: #1a1a1a;
}

.episode-page .cf-quote footer {
  font-size: 0.82em;
  color: #888;
}

.episode-page .cf-badge {
  font-size: 0.75em;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.episode-page .cf-resource-name {
  font-size: 0.95em;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #1a1a1a;
}

.episode-page .cf-resource-desc {
  font-size: 0.82em;
  line-height: 1.5;
  color: #444;
  margin: 0 0 0.5rem;
}

.episode-page .cf-resource-by {
  font-size: 0.75em;
  color: #999;
  margin: 0;
}

.episode-page .cf-reflection {
  display: none;
}

.episode-page .cf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 16px;
}

.episode-page .cf-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.07);
  border: none;
  color: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}

.episode-page .cf-btn:hover {
  background: rgba(0, 0, 0, 0.13);
}

.episode-page .cf-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.episode-page .cf-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  transition: background 0.2s, transform 0.2s;
}

.episode-page .cf-dot.active {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.4);
}

.episode-page .res-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.episode-page .res-tab {
  padding: 6px 16px;
  border-radius: 100px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  background: transparent;
  cursor: pointer;
  font-size: 0.875em;
  font-weight: 500;
  font-family: inherit;
  color: rgba(0, 0, 0, 0.5);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.episode-page .res-tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.18);
}

.episode-page .res-tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.episode-page .res-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  transition: opacity 0.28s ease-in-out;
}

.episode-page .res-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  display: none;
}

.episode-page .res-card.visible {
  display: block;
}

@media (max-width: 780px) {
  .episode-page .page-top h1 {
    font-size: clamp(1.45rem, 6.5vw, 1.85rem);
  }

  .episode-page .page-top.card {
    padding: 0.95rem;
    border-radius: 14px;
  }

  .episode-page .noise-layer {
    display: none;
  }

  .episode-page .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(247, 250, 255, 0.94);
  }

  .episode-page .cf-wrap {
    border-radius: 16px;
  }

  .episode-page .cf-item {
    width: min(84vw, 340px);
    padding: 18px 18px 20px;
  }

  .episode-page .cf-btn {
    width: 34px;
    height: 34px;
  }

  .episode-page .cf-dot {
    width: 6px;
    height: 6px;
  }

  .episode-page .res-grid {
    grid-template-columns: 1fr;
  }

  .episode-page .episode-topics {
    display: none;
  }
}

/* ===== Episode recommendations ("What to listen next") ===== */

.episode-page .episode-section.episode-recommendations {
  margin-top: 4.5rem;
}

.episode-recommendations__header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.episode-recommendations__header h2 {
  margin: 0;
}

.episode-recommendations__header p {
  margin: 0;
}

.episode-recommendations__track {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: stretch;
}

.episode-rec-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  flex: 1 1 18rem;
  max-width: 22rem;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.episode-rec-card:hover,
.episode-rec-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(16, 17, 20, 0.12);
}

.episode-rec-card__cover-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(18, 20, 25, 0.06);
  overflow: hidden;
}

.episode-rec-card__cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-rec-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.2rem 1.25rem;
  flex: 1;
}

.episode-rec-card__title {
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
}

.episode-rec-card__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.episode-rec-card__cta {
  margin-top: auto;
  padding-top: 0.4rem;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
}

.episode-rec-card .episode-meta {
  font-size: 0.78rem;
}

.episode-rec-chip {
  align-self: flex-start;
  display: inline-block;
  padding: 0.28rem 0.65rem;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .episode-page .episode-section.episode-recommendations {
    margin-top: 3rem;
  }
  .episode-recommendations__track {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.85rem;
    padding: 0.05rem 0.1rem 0.6rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .episode-recommendations__track::-webkit-scrollbar {
    display: none;
  }
  .episode-rec-card {
    flex: 0 0 min(19rem, 86%);
    max-width: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}
