/* ==========================================================================
   Dhangaa Torbanii — program theater + share panel (Wave 4)
   The immersive shell AROUND the canonical player (docs/14 slab identity).
   ========================================================================== */

/* ---- theater shell ---- */
.dt-theater-shell {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #0a1f16, #05130d 82%);
  box-shadow: 0 34px 90px -40px rgba(0, 0, 0, 0.95);
}
.dt-theater-ambient {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  pointer-events: none;
  z-index: 0;
}
.dt-theater-shell .dt-player { position: relative; z-index: 1; }

.dt-theater-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 0 14px;
}
.dt-theater-topbar .dt-cinema-btn {
  display: none; /* revealed by theater.js when the capability is on */
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 19, 13, 0.6);
  color: #eef4f0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.dt-theater-topbar .dt-cinema-btn[aria-pressed="true"] {
  background: #d64e46;
  border-color: #d64e46;
  color: #0a1510;
}

/* cinema mode: the page recedes around the stage */
html.dt-cinema-on body { background: #030b07; }
html.dt-cinema-on main { filter: brightness(0.42) saturate(0.85); transition: filter 320ms ease; }
html.dt-cinema-on .dt-theater-shell { filter: none; }
@media (prefers-reduced-motion: reduce) {
  html.dt-cinema-on main { transition: none; }
}

/* ---- chapter strata rail ---- */
.dt-strata {
  --slab-w: 148px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 6px 10px;
  scroll-snap-type: x proximity;
  perspective: 700px;
  scrollbar-width: thin;
}
.dt-strata-slab {
  scroll-snap-align: center;
  flex: 0 0 auto;
  width: var(--slab-w);
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 56, 40, 0.42), rgba(7, 20, 14, 0.9));
  color: #dce8e2;
  text-align: left;
  cursor: pointer;
  transform: rotateX(14deg) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 200ms ease, background 200ms ease;
}
.dt-strata-slab:hover { border-color: rgba(143, 212, 176, 0.45); }
.dt-strata-slab:focus-visible { outline: 2px solid #4ea87f; outline-offset: 2px; }
.dt-strata-slab.is-active {
  transform: rotateX(0deg) translateZ(26px) scale(1.04);
  border-color: rgba(214, 78, 70, 0.65);
  background: linear-gradient(180deg, rgba(120, 40, 34, 0.5), rgba(20, 8, 7, 0.92));
  box-shadow: 0 24px 50px -22px rgba(214, 78, 70, 0.5);
}
.dt-strata-t {
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: #e08585;
}
.dt-strata-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .dt-strata-slab, .dt-strata-slab.is-active { transition: none; }
  .dt-strata-slab { transform: none; }
}

/* ---- share panel ---- */
.dt-share { position: relative; }
.dt-share-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dt-share-toggle svg { width: 16px; height: 16px; }
.dt-share-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 30;
  min-width: 236px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(6, 19, 13, 0.97);
  box-shadow: 0 24px 70px -18px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: none;
}
.dt-share-menu.dt-open { display: block; }
.dt-share-menu .dt-share-hint {
  padding: 6px 10px 8px;
  font-size: 11.5px;
  color: rgba(238, 244, 240, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}
.dt-share-menu a,
.dt-share-menu button.dt-share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #eef4f0;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.dt-share-menu a:hover,
.dt-share-menu button.dt-share-row:hover { background: rgba(255, 255, 255, 0.1); }
.dt-share-menu .dt-share-glyph {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.dt-share-menu .g-native { background: #4ea87f; color: #06251a; }
.dt-share-menu .g-x { background: #16181c; color: #fff; }
.dt-share-menu .g-tg { background: #2aabee; color: #fff; }
.dt-share-menu .g-wa { background: #25d366; color: #0b2d1c; }
.dt-share-menu .g-fb { background: #1877f2; color: #fff; }
.dt-share-menu .g-copy { background: rgba(255, 255, 255, 0.14); color: #eef4f0; }

/* ---- transcript × player fusion (Wave 4.1) ---- */
.dt-tr-row { position: relative; }
.dt-tr-row.dt-tr-active > a {
  background: linear-gradient(90deg, rgba(214, 78, 70, 0.10), rgba(78, 168, 127, 0.06));
  box-shadow: inset 3px 0 0 #d64e46;
}
.dt-tr-row.dt-tr-active > a .font-mono {
  background: #fff0ef;
  border-color: rgba(214, 78, 70, 0.45);
  color: #a13a34;
}
.dt-tr-row:focus-within { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .dt-tr-row, .dt-tr-share { transition: none; }
}

/* ---- Wave 4.10: kind-aware strata (moments, speaker turns) ---- */
.dt-strata-moment {
  border-color: rgba(84, 214, 158, 0.55);
  background: linear-gradient(180deg, rgba(84, 214, 158, 0.14), rgba(84, 214, 158, 0.05));
  text-decoration: none;
}
.dt-strata-moment:hover, .dt-strata-moment:focus-visible {
  border-color: rgba(84, 214, 158, 0.9);
  box-shadow: 0 0 14px rgba(84, 214, 158, 0.25);
}
.dt-strata-moment .dt-strata-t { color: #7fe3b8; }

/* Slim presence tick for speaker turns — navigable, never noisy. */
.dt-strata-turn {
  width: 0.35rem;
  min-width: 0.35rem;
  padding: 0;
  background: rgba(226, 232, 240, 0.35);
  border-color: transparent;
}
.dt-strata-turn .dt-strata-t, .dt-strata-turn .dt-strata-label { display: none; }
.dt-strata-turn:hover, .dt-strata-turn:focus-visible { background: rgba(226, 232, 240, 0.8); }
.dt-strata-event { border-color: rgba(255, 170, 90, 0.4); }

@media (prefers-reduced-motion: reduce) {
  .dt-strata-moment, .dt-strata-turn { transition: none; box-shadow: none; }
}
