/* ═══════════════════════════════════════════════════════════════════════
   Teachings page — now playing (video + listen) and the series archive
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes tch-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
@keyframes tch-in { from { opacity: 0; } }

/* ── Now playing ──────────────────────────────────────────────────────── */
.tch-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: calc(var(--header-h) + var(--banner-h, 0px) + clamp(1.5rem, 4vw, 3rem));
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
/* The series art, blurred way down, behind everything (like the current site). */
.tch-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(70% 60% at 30% 10%, rgba(254, 204, 47, 0.1), transparent 70%);
}
.tch-hero__bg img {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(60px) saturate(1.25);
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.tch-hero__bg img.is-in { opacity: 0.5; }
.tch-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13, 14, 13, 0.35) 0%, rgba(13, 14, 13, 0.55) 60%, var(--bg) 100%);
}

.tch-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
  grid-template-areas:
    'player now'
    'more   more';
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: center;
}

/* Player: 16:9, a "play" button over the thumbnail until pressed. */
.player {
  grid-area: player;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.player.is-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--gold) 16%, var(--bg));
  animation: tch-pulse 1.6s ease-in-out infinite;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__facade {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: #111;
}
.player__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
  animation: tch-in 0.6s var(--ease);
}
.player__facade::after { /* gentle darkening so the button pops */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.05) 60%);
}
.player__cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem 0.85rem 1.1rem;
  border-radius: 999px;
  background: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s var(--ease);
}
.player__cta svg { width: 18px; height: 18px; }
.player__facade:hover .player__img { transform: scale(1.03); }
.player__facade:hover .player__cta { transform: scale(1.06); }
.player__facade:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.player__art { position: absolute; inset: 0; }
.player__art img { width: 100%; height: 100%; object-fit: cover; }
.player__note {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.5rem 1.25rem 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

/* The words next to the player. */
.now { grid-area: now; min-width: 0; }
.now__series {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.now__album img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.now__title {
  margin-top: 0.7rem;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.now__meta { margin-top: 0.8rem; color: var(--fg-muted); font-size: 1rem; }
.now__meta:empty { display: none; }
/* Speaker name → all of their teachings. */
.now__speaker {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--fg);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold) 55%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
.now__speaker:hover { color: var(--gold); text-decoration-color: var(--gold); }
.now__speaker:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.series-dlg__album[hidden] { display: none; }
.series-dlg__head:has(.series-dlg__album[hidden]) { grid-template-columns: 1fr auto; }
.ghost-line {
  display: block;
  width: 75%;
  height: 0.85em;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  animation: tch-pulse 1.6s ease-in-out infinite;
}
.now__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }
.now__actions .btn { gap: 0.55rem; }
.now__actions svg { width: 18px; height: 18px; }
.now__actions .btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
.now__audio {
  display: block;
  width: 100%;
  margin-top: 1rem;
  height: 44px;
  border-radius: 999px;
  color-scheme: dark;
}
.now__audio[hidden] { display: none; }
.subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.subscribe a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.subscribe a:hover { color: var(--fg); border-color: var(--gold); }

/* "More in this series": rows in columns under the player. */
.more { grid-area: more; }
.more[hidden] { display: none; }
.more__title,
.series-sec__title {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  letter-spacing: -0.015em;
}
.more .tlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 6px 18px;
  margin-top: 1rem;
}

/* ── Teaching rows ────────────────────────────────────────────────────── */
.tlist { list-style: none; margin: 0; padding: 0; }
.trow {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: tch-in 0.4s var(--ease);
}
.trow:hover { background: rgba(255, 255, 255, 0.09); }
.trow:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.trow.is-current { background: color-mix(in srgb, var(--gold) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent); }
.trow__date {
  flex: 0 0 auto;
  min-width: 3.2rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}
.trow__text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.trow__title, .trow__meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow__title { font-weight: 700; font-size: 0.98rem; }
.trow__meta { font-size: 0.8rem; color: var(--fg-muted); }
.trow__meta:empty { display: none; }
.trow__tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.tlist--years .trow__date { min-width: 4.9rem; }
.tlist__ghost {
  height: 58px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  animation: tch-pulse 1.6s ease-in-out infinite;
}
.tlist__ghost:nth-child(2) { animation-delay: 0.15s; }
.tlist__ghost:nth-child(3) { animation-delay: 0.3s; }

/* ── Previous series ──────────────────────────────────────────────────── */
.series-sec { padding-top: clamp(1rem, 3vw, 2rem); }
.series-sec__title { margin-top: 0.4rem; }
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(170px, 42vw), 1fr));
  gap: clamp(1rem, 2.2vw, 1.75rem) clamp(0.9rem, 2vw, 1.5rem);
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
}
.scard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  text-align: left;
  font: inherit;
  cursor: pointer;
  animation: tch-in 0.5s var(--ease);
}
.scard__art {
  display: block;
  aspect-ratio: 1;
  margin-bottom: 0.45rem;
  border-radius: 20px;
  overflow: hidden;
  background: #222;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.scard__art img { width: 100%; height: 100%; object-fit: cover; }
.scard__art--icon { background: #000; }
.scard__art--icon img { object-fit: contain; padding: 24%; }
.scard:hover .scard__art { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px color-mix(in srgb, var(--gold) 50%, transparent); }
.scard:focus-visible { outline: none; }
.scard:focus-visible .scard__art { outline: 3px solid var(--gold); outline-offset: 3px; }
.scard__title { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.scard__meta { font-size: 0.8rem; color: var(--fg-muted); }

.tch-error { margin-top: 1.5rem; color: var(--fg-muted); max-width: 60ch; }
.tch-error a { color: var(--gold); }
.is-error .series-sec { display: none; }
.is-error .player, .is-error .now__actions, .is-error .now__series { display: none; }
.is-error .tch-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'now'; }
.is-error .tch-error { font-size: 1.05rem; }

/* ── Series dialog ────────────────────────────────────────────────────── */
.series-dlg {
  width: min(640px, calc(100% - 32px));
  max-height: min(85vh, 860px);
  margin: auto; /* the site's reset clears the browser's centering */
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--bg-card);
  color: var(--fg);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.series-dlg[open] { display: flex; flex-direction: column; animation: tch-in 0.25s var(--ease); }
.series-dlg::backdrop { background: rgba(5, 5, 5, 0.65); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.series-dlg__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
}
.series-dlg__album { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; background: #000; }
.series-dlg__title { font-size: 1.45rem; line-height: 1.1; margin-top: 0.3rem; }
.series-dlg__close {
  align-self: start;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  cursor: pointer;
}
.series-dlg__close:hover { background: var(--gold); color: #111; }
.series-dlg__close svg { width: 18px; height: 18px; }
.series-dlg .tlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Smaller screens ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .tch-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'player' 'now' 'more';
  }
  .player { margin-inline: calc(var(--gutter) * -0.5); border-radius: 18px; }
}
@media (max-width: 600px) {
  .player { margin-inline: 0; }
  .now__actions .btn { flex: 1 1 auto; justify-content: center; }
  .series-dlg__album { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .player.is-loading::before, .ghost-line, .tlist__ghost { animation: none; opacity: 0.6; }
  .player__img, .trow, .scard, .series-dlg[open] { animation: none; }
  .scard__art, .player__img, .player__cta { transition: none; }
  .scard:hover .scard__art, .player__facade:hover .player__img, .player__facade:hover .player__cta { transform: none; }
}
