/* =====================================================================
   ZAPFLIX — TITLE PAGE (movie / series details)
   Cinematic trailer hero, title logo, episodes rail/list, cast rail.
   Same palette as the liquid-glass theme. Loaded after the page's inline
   styles and zapflix-hero.css (shared .zf-hero-* copy/button classes).
   ===================================================================== */

.zf-title-hero,
.zf-title-section {
  --zf-hero-bg: var(--zfx-bg, #050506);
  --zf-hero-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --zf-t-gutter: 4%;
  --zf-t-h: min(94vh, 1080px);
}

/* ---------- hero shell ---------- */
.movie-hero.zf-title-hero {
  position: relative;
  display: block;
  height: var(--zf-t-h);
  min-height: 620px;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--zf-hero-bg);
}
.zf-title-media { position: absolute; inset: 0; overflow: hidden; }

.zf-title-hero .hero-bg {
  position: absolute;
  inset: 0;
  opacity: 1;
  z-index: 1;
  background: #0b0b0d;
  transition: opacity 1.4s var(--zf-hero-ease);
}
.zf-title-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.9s var(--zf-hero-ease), transform 12s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.zf-title-bg-img.is-loaded { opacity: 1; transform: scale(1); }
.zf-title-hero.is-portrait .zf-title-bg-img { object-position: center 18%; }

/* Trailer: always covers the hero; slight overscan hides YouTube's edge chrome
   and letterboxing, and a large player makes YouTube stream its top quality. */
.zf-title-hero .hero-video-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, calc(var(--zf-t-h) * 16 / 9));
  height: max(56.25vw, var(--zf-t-h));
  min-width: 0;
  min-height: 0;
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 0;
  pointer-events: none;
}
.zf-title-hero .hero-video,
.zf-title-hero #heroTrailer { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; pointer-events: none; transition: opacity 0.18s ease-out; }
/* js/zf-trailer.js: the trailer covers the art only while it really plays (sharp, not
   paused, not buffering); otherwise the art comes back, never YouTube's own overlays.
   Slow fade in, near-instant cut back: YouTube's title/pause icon appear within ~0.2s. */
.zf-title-hero.is-trailer-on #heroTrailer { opacity: 1; transition-duration: 1.2s; transition-timing-function: var(--zf-hero-ease); }
.zf-title-hero.is-trailer-on .hero-bg { opacity: 0; }
.zf-title-hero:not(.is-trailer-on) .hero-bg { transition-duration: 0.18s; }

.zf-title-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 5, 6, 0.88) 0%, rgba(5, 5, 6, 0.55) 28%, rgba(5, 5, 6, 0.1) 55%, rgba(5, 5, 6, 0) 70%),
    linear-gradient(0deg, var(--zf-hero-bg) 0%, rgba(5, 5, 6, 0.75) 14%, rgba(5, 5, 6, 0.2) 34%, rgba(5, 5, 6, 0) 48%),
    linear-gradient(180deg, rgba(5, 5, 6, 0.65) 0%, rgba(5, 5, 6, 0) 18%);
}
html[dir="rtl"] .zf-title-scrim {
  background:
    linear-gradient(270deg, rgba(5, 5, 6, 0.88) 0%, rgba(5, 5, 6, 0.55) 28%, rgba(5, 5, 6, 0.1) 55%, rgba(5, 5, 6, 0) 70%),
    linear-gradient(0deg, var(--zf-hero-bg) 0%, rgba(5, 5, 6, 0.75) 14%, rgba(5, 5, 6, 0.2) 34%, rgba(5, 5, 6, 0) 48%),
    linear-gradient(180deg, rgba(5, 5, 6, 0.65) 0%, rgba(5, 5, 6, 0) 18%);
}

/* ---------- copy ---------- */
.zf-title-hero .hero-content.zf-title-content {
  position: absolute;
  z-index: 3;
  inset-inline-start: var(--zf-t-gutter);
  bottom: clamp(56px, 11vh, 128px);
  width: min(50%, 720px);
  max-width: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
}
.zf-title-content > * { animation: zfTitleRise 0.8s var(--zf-hero-ease) both; }
.zf-title-content > :nth-child(2) { animation-delay: 0.08s; }
.zf-title-content > :nth-child(3) { animation-delay: 0.16s; }
.zf-title-content > :nth-child(4) { animation-delay: 0.24s; }
.zf-title-content > :nth-child(5) { animation-delay: 0.32s; }
@keyframes zfTitleRise { from { opacity: 0; transform: translate3d(0, 20px, 0); } to { opacity: 1; transform: none; } }

.zf-title-heading { margin-bottom: 20px; }
.zf-title-heading .zf-hero-logo { max-height: clamp(110px, 21vh, 230px); max-width: min(100%, 520px); }

.zf-title-meta { margin-bottom: 10px; }
.zf-title-badges { display: inline-flex; align-items: center; gap: 8px; }
.zf-title-badges::before { display: none !important; }
.zf-title-meta > .zf-title-badges { margin-inline-start: 14px; }
.zf-title-cert,
.zf-title-hd {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.75);
  text-shadow: none;
}
.zf-title-hd { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.85); }

.zf-title-genres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.zf-title-genres span + span::before { content: '·'; margin: 0 9px; color: rgba(255, 255, 255, 0.4); }

.zf-title-overview { -webkit-line-clamp: 3; margin-bottom: 26px; max-width: 58ch; }
.zf-title-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* Add to List state */
.zf-title-list-btn .zf-ic-added { display: none; }
.zf-title-list-btn.is-added .zf-ic-add { display: none; }
.zf-title-list-btn.is-added .zf-ic-added { display: block; }
.zf-title-list-btn.is-added { background: rgba(229, 9, 20, 0.22); box-shadow: inset 0 0 0 1px rgba(229, 9, 20, 0.7), 0 10px 30px rgba(0, 0, 0, 0.3); }
.zf-title-list-btn.is-busy { opacity: 0.7; pointer-events: none; }
.zf-title-list-btn.is-added .zf-ic-added { animation: zfTitlePop 0.4s var(--zf-hero-ease); }
@keyframes zfTitlePop { 0% { transform: scale(0.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- mute ---------- */
.volume-toggle.zf-title-mute {
  position: absolute;
  z-index: 6;
  top: auto;
  bottom: clamp(56px, 11vh, 128px);
  right: var(--zf-t-gutter);
  left: auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 10, 12, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 10px 30px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s var(--zf-hero-ease), background 0.25s, box-shadow 0.25s, opacity 0.4s, visibility 0s linear 0.4s;
}
/* Shown only once the trailer is on screen (or finished: replay). */
.zf-title-hero.has-trailer-ui .volume-toggle.zf-title-mute { opacity: 1; visibility: visible; transition-delay: 0s; }
.volume-toggle.zf-title-mute.is-hint { animation: zfMuteHint 1.1s var(--zf-hero-ease) 2; }
@keyframes zfMuteHint {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 0 0 rgba(255, 255, 255, 0.45); }
  60% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 0 12px rgba(255, 255, 255, 0); }
}
html[dir="rtl"] .volume-toggle.zf-title-mute { left: var(--zf-t-gutter); right: auto; }
.volume-toggle.zf-title-mute:hover { transform: scale(1.06); background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); }
.volume-toggle.zf-title-mute:active { transform: scale(0.94); }
.volume-toggle.zf-title-mute:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.9); outline-offset: 3px; }

/* ---------- sections ---------- */
.zf-title-section { position: relative; z-index: 4; padding: 0 var(--zf-t-gutter); margin: 0 0 clamp(36px, 4vw, 64px); }
.zf-episodes { margin-top: -24px; }
.zf-title-section-head,
.zf-title-similar .zf-title-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.zf-title-section-heading {
  border-inline-start: 3px solid var(--zfx-red, #e50914);
  padding-inline-start: 12px;
  min-width: 0;
}
.zf-title-section-heading h2,
.zf-title-similar .zf-title-section-heading .section-title {
  margin: 0;
  font-size: clamp(20px, 1.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #f5f5f7;
}
.zf-title-section-sub { margin: 4px 0 0; font-size: 14.5px; color: rgba(255, 255, 255, 0.6); }
.zf-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* season dropdown styled as the heading */
.zf-season-picker { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.zf-season-picker select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #f5f5f7;
  font: inherit;
  font-size: clamp(20px, 1.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.025em;
  padding-inline-end: 26px;
  cursor: pointer;
  outline: none;
}
.zf-season-picker select option { background: #141416; color: #fff; font-size: 15px; font-weight: 600; }
.zf-season-picker svg { position: absolute; inset-inline-end: 0; pointer-events: none; color: rgba(255, 255, 255, 0.75); }
.zf-season-picker:focus-within { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 4px; border-radius: 6px; }

/* toolbar */
.zf-ep-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.zf-ep-view { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.zf-ep-tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.zf-ep-view .zf-ep-tool { width: 36px; height: 34px; background: transparent; box-shadow: none; border-radius: 9px; }
.zf-ep-tool:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.zf-ep-tool:active { transform: scale(0.92); }
.zf-ep-tool.is-active,
.zf-ep-tool[aria-pressed="true"] { background: rgba(255, 255, 255, 0.92); color: #0b0b0c; }
.zf-ep-tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.zf-ep-search { display: flex; align-items: center; }
.zf-ep-search input {
  width: 0;
  padding: 0;
  height: 40px;
  border: 0;
  border-radius: 11px;
  margin-inline-end: 0;
  color: #fff;
  font: inherit;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  opacity: 0;
  outline: none;
  transition: width 0.35s var(--zf-hero-ease), padding 0.35s var(--zf-hero-ease), opacity 0.25s, margin 0.35s;
}
.zf-ep-search.is-open input { width: min(240px, 40vw); padding: 0 14px; margin-inline-end: 8px; opacity: 1; }
.zf-ep-search input::-webkit-search-cancel-button { filter: invert(1); }

/* ---------- episodes ---------- */
.zf-ep-stage { position: relative; }
.zf-ep-stage:hover .zf-row-arrow:not([data-hidden]),
.zf-ep-stage .zf-row-arrow:focus-visible:not([data-hidden]) { opacity: 1; visibility: visible; transform: scale(1); transition-delay: 0s; }
.zf-ep-list { --zf-ep-gap: 14px; }
.zf-ep-list.is-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * var(--zf-ep-gap)) / 4);
  gap: var(--zf-ep-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 2px 8px;
}
.zf-ep-list.is-grid::-webkit-scrollbar { display: none; }
.zf-ep-list.is-list ~ .zf-ep-arrow,
.zf-ep-list.is-list + .zf-ep-arrow { display: none; }

.zf-ep-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  text-align: start;
  color: #fff;
  font: inherit;
  background: #121214;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  cursor: pointer;
  scroll-snap-align: start;
  transition: box-shadow 0.4s var(--zf-hero-ease), transform 0.4s var(--zf-hero-ease);
  animation: zfEpIn 0.5s var(--zf-hero-ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes zfEpIn { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
.zf-ep-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #18181b; }
.zf-ep-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s;
}
.zf-ep-thumb img.is-loaded { opacity: 1; }
.zf-ep-thumb.is-fallback img { filter: grayscale(0.4) brightness(0.55); }
.zf-ep-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0b0b0c;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s var(--zf-hero-ease), transform 0.35s var(--zf-hero-ease);
  z-index: 3;
}
.zf-ep-play svg { margin: 0 0 0 1px; }
.zf-ep-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.2); z-index: 3; }
.zf-ep-progress i { display: block; height: 100%; background: var(--zfx-red, #e50914); }

/* grid card: copy over the still */
.is-grid .zf-ep-card { aspect-ratio: 16 / 9; }
.is-grid .zf-ep-thumb { position: absolute; inset: 0; aspect-ratio: auto; }
.is-grid .zf-ep-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 5, 6, 0.96) 0%, rgba(5, 5, 6, 0.78) 30%, rgba(5, 5, 6, 0.15) 62%, rgba(5, 5, 6, 0) 80%);
}
.is-grid .zf-ep-body { position: absolute; inset-inline: 0; bottom: 0; padding: 16px 16px 14px; z-index: 2; }
.is-grid .zf-ep-play { top: 38%; }

.zf-ep-label {
  display: block;
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.zf-ep-name {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(15px, 1.1vw, 18px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zf-ep-overview {
  display: -webkit-box;
  margin-bottom: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zf-ep-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.88); }
.zf-ep-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.zf-ep-foot svg { flex: none; }
.zf-ep-vote svg { color: var(--zfx-red, #e50914); }

/* list view */
.zf-ep-list.is-list { display: flex; flex-direction: column; gap: 12px; }
.is-list .zf-ep-card { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; align-items: center; gap: 0; background: rgba(255, 255, 255, 0.035); }
.is-list .zf-ep-body { padding: 16px 22px; }
.is-list .zf-ep-overview { -webkit-line-clamp: 3; font-size: 14px; }
.is-list .zf-ep-foot { justify-content: flex-start; gap: 18px; color: rgba(255, 255, 255, 0.7); }

@media (hover: hover) and (pointer: fine) {
  .zf-ep-card:hover { box-shadow: 0 20px 44px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.85); }
  .zf-ep-card:hover .zf-ep-thumb img { transform: scale(1.06); }
  .zf-ep-card:hover .zf-ep-play { opacity: 1; transform: scale(1); }
}
.zf-ep-card:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.zf-ep-card:active { transform: scale(0.985); }

.zf-ep-skeleton {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: linear-gradient(100deg, #141416 30%, #1f1f23 50%, #141416 70%);
  background-size: 300% 100%;
  animation: zfEpShimmer 1.4s linear infinite;
}
@keyframes zfEpShimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.zf-ep-empty { margin: 8px 0 0; color: rgba(255, 255, 255, 0.6); font-size: 15px; }

/* ---------- cast ---------- */
.zf-title-section.cast-section { padding-top: 0; padding-bottom: 0; }
.cast-row.zf-cast-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.cast-row.zf-cast-row::-webkit-scrollbar { display: none; }
.cast-card.zf-cast-card {
  position: static;
  flex: 0 0 clamp(120px, 9.4vw, 160px);
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  color: #fff;
  font: inherit;
  text-align: start;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: none;
  transform: none;
}
.cast-card.zf-cast-card:hover { transform: none; box-shadow: none; }
.zf-cast-photo {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  background: linear-gradient(160deg, #26262b, #141416);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: box-shadow 0.4s var(--zf-hero-ease);
}
.zf-cast-photo .cast-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; z-index: 1; transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.zf-cast-initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; font-weight: 800; color: rgba(255, 255, 255, 0.25); }
.zf-cast-card .cast-name { display: block; margin: 0 0 2px; font-size: 14px; font-weight: 700; line-height: 1.3; color: #f5f5f7; text-shadow: none; }
.zf-cast-card .cast-char {
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (hover: hover) and (pointer: fine) {
  .zf-cast-card:hover .zf-cast-photo { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.85); }
  .zf-cast-card:hover .cast-img { transform: scale(1.06); }
}
.zf-cast-card:focus-visible { outline: none; }
.zf-cast-card:focus-visible .zf-cast-photo { box-shadow: 0 0 0 3px #fff; }
.zf-cast-stage .zf-row-arrow { top: calc(50% - 30px); }

.zf-ep-stage.is-list .zf-ep-arrow { display: none; }

/* toast for Add to List */
.zf-title-toast {
  position: fixed;
  z-index: 10050;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(18, 18, 20, 0.86);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 18px 50px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.3s cubic-bezier(0.22, 0.8, 0.24, 1), transform 0.3s cubic-bezier(0.22, 0.8, 0.24, 1);
  pointer-events: none;
}
.zf-title-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { .zf-title-toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }

/* similar shelf header spacing (rows themselves use the shared card styles) */
.zf-title-similar { margin-top: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .zf-ep-list.is-grid { grid-auto-columns: calc((100% - 2 * var(--zf-ep-gap)) / 3); } }
@media (max-width: 1100px) and (min-width: 701px) {
  .zf-title-hero .hero-content.zf-title-content { width: min(60%, 600px); }
}
@media (max-width: 900px) {
  .zf-ep-list.is-grid { grid-auto-columns: 78%; }
  .zf-ep-arrow, .zf-cast-arrow { display: none; }
}
/* Phones held upright: 16:9 trailer/backdrop on top, details flow below it on the black
   canvas. Turned sideways they use the short-screen hero below. */
@media (max-width: 700px) and (orientation: portrait), (max-width: 700px) and (min-height: 501px) {
  .zf-title-hero,
  .zf-title-section { --zf-t-gutter: 5%; }
  .movie-hero.zf-title-hero { height: auto; min-height: 0; padding: calc(56px + env(safe-area-inset-top, 0px)) 0 8px; overflow: hidden; }
  .zf-title-media { position: relative; inset: auto; aspect-ratio: 16 / 9; }
  .zf-title-hero .hero-video-wrapper { width: 100%; height: 100%; transform: translate(-50%, -50%) scale(1.22); }
  .zf-title-scrim,
  html[dir="rtl"] .zf-title-scrim {
    top: calc(56px + env(safe-area-inset-top, 0px));
    bottom: auto;
    height: 56.25vw;
    background: linear-gradient(0deg, var(--zf-hero-bg) 0%, rgba(5, 5, 6, 0) 40%);
  }
  .zf-title-hero .hero-content.zf-title-content {
    position: relative;
    inset: auto;
    width: auto;
    padding: 0 var(--zf-t-gutter);
    margin-top: -18px;
  }
  .zf-title-heading { margin-bottom: 12px; }
  .zf-title-heading .zf-hero-logo { max-height: 84px; max-width: 70%; }
  .zf-title-heading .zf-hero-title-text { font-size: clamp(26px, 8vw, 34px); }
  .zf-title-meta { font-size: 13px; }
  .zf-title-meta > span + span::before { margin: 0 8px; }
  .zf-title-genres { font-size: 13px; margin-bottom: 10px; }
  .zf-title-overview.zf-hero-synopsis { display: -webkit-box; font-size: 14px; -webkit-line-clamp: 4; margin-bottom: 18px; }
  .zf-title-buttons { width: 100%; flex-direction: column; gap: 10px; }
  .zf-title-buttons .zf-hero-btn { flex: none; width: 100%; height: 48px; padding: 0 16px !important; font-size: 15px; }
  .volume-toggle.zf-title-mute,
  html[dir="rtl"] .volume-toggle.zf-title-mute {
    top: calc(56px + env(safe-area-inset-top, 0px) + 56.25vw - 54px);
    bottom: auto;
    width: 40px;
    height: 40px;
  }
  .zf-episodes { margin-top: 18px; }
  .zf-title-section-head { flex-wrap: wrap; }
  .zf-ep-tools { width: 100%; justify-content: flex-end; }
  .is-list .zf-ep-card { grid-template-columns: 42% 1fr; }
  .is-list .zf-ep-body { padding: 10px 12px; }
  .is-list .zf-ep-overview { -webkit-line-clamp: 2; font-size: 12.5px; }
  .cast-card.zf-cast-card { flex-basis: 112px; }
}

/* Short screens (a phone turned sideways): artwork, title and the Play button fit on one
   screen. The 620px hero used to push Play below the fold. The artwork runs under the
   notch (the body keeps a safe-area padding, zapflix-nav.css); the copy stays inside. */
@media (orientation: landscape) and (max-height: 500px) {
  .movie-hero.zf-title-hero {
    --zf-t-gutter: calc(4% + env(safe-area-inset-left, 0px));
    height: 100svh;
    min-height: 330px;
    max-height: 520px;
    width: calc(100% + env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px));
    margin-left: calc(-1 * env(safe-area-inset-left, 0px));
    margin-right: calc(-1 * env(safe-area-inset-right, 0px));
  }
  /* --zf-hero-tab: the phone layer's bottom tab bar (zf-mobile.css), 0 without it */
  .zf-title-hero .hero-content.zf-title-content { bottom: calc(18px + var(--zf-hero-tab, 0px)); width: min(62%, 600px); }
  .zf-title-hero .zf-title-crumbs { margin-bottom: 6px; font-size: 12px; }
  .zf-title-heading { margin-bottom: 10px; }
  .zf-title-heading .zf-hero-logo { max-height: min(18vh, 80px); max-width: min(100%, 320px); }
  .zf-title-heading .zf-hero-title-text { font-size: clamp(24px, 7vh, 34px); }
  .zf-title-meta { margin-bottom: 8px; font-size: 13px; }
  .zf-title-genres { display: none; }
  .zf-title-overview.zf-hero-synopsis { -webkit-line-clamp: 2; margin-bottom: 12px; font-size: 13.5px; line-height: 1.45; }
  .zf-title-buttons { flex-wrap: nowrap; gap: 10px; }
  .zf-title-buttons .zf-hero-btn { min-width: 0; height: 42px; font-size: 14.5px; }
  .volume-toggle.zf-title-mute,
  html[dir="rtl"] .volume-toggle.zf-title-mute { bottom: calc(18px + var(--zf-hero-tab, 0px)); width: 40px; height: 40px; }
  /* the episodes heading no longer tucks up under the hero buttons */
  .zf-episodes { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .zf-title-content > *, .zf-ep-card { animation: none !important; }
  .zf-title-bg-img { transition: opacity 0.3s; transform: none !important; }
}

/* ---------- Actor bio window (desktop card, phone bottom sheet) ---------- */
.actor-modal-container .actor-modal.zf-actor-modal {
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);
  height: 480px;
}
.zf-actor-modal .actor-modal-left {
  position: relative;
  overflow: hidden;
  background: #0b0b0d;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zf-actor-modal .actor-modal-bg {
  position: absolute; inset: -20px;
  width: calc(100% + 40px); height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(26px) saturate(1.2) brightness(0.45);
  transform: scale(1.1);
  pointer-events: none;
}
.zf-actor-modal .actor-modal-frame {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.zf-actor-modal .actor-modal-frame .actor-modal-img {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  border-radius: 0 !important;
  object-fit: cover; object-position: center 20%;
  animation: zfActorIn 0.45s ease both;
}
.zf-actor-modal .actor-modal-initial {
  font-size: 64px; font-weight: 800; color: rgba(255, 255, 255, 0.22);
}
.zf-actor-modal .actor-modal-left.has-img .actor-modal-initial { display: none; }
.zf-actor-modal .actor-modal-left.is-loading .actor-modal-frame::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%) #19191c;
  background-size: 200% 100%;
  animation: zfActorShimmer 1.2s linear infinite;
}
.zf-actor-modal .actor-modal-right { padding: 44px 40px 36px; }
.zf-actor-modal .actor-modal-name {
  margin: 0 0 12px; padding-inline-end: 44px;
  font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; line-height: 1.1;
  color: #fff; letter-spacing: -0.01em;
}
.zf-actor-modal .actor-modal-meta {
  display: inline-flex; align-self: flex-start;
  margin: 0 0 20px; padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c9c9cf; font-size: 13.5px; font-weight: 600; line-height: 1.4;
}
.zf-actor-modal .actor-modal-bio { color: #d6d6db; font-size: 15.5px; line-height: 1.75; }
.zf-actor-modal .actor-modal-bio p { margin: 0 0 14px; }
.zf-actor-modal .actor-modal-loading { color: #e50914; font-weight: 600; }
.actor-modal-container .zf-actor-modal .actor-modal-close {
  top: 14px; right: 14px; left: auto;
  width: 40px; height: 40px;
  background: rgba(20, 20, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff;
}
html[dir="rtl"] .actor-modal-container .zf-actor-modal .actor-modal-close { right: auto; left: 14px; }
.actor-modal-container .zf-actor-modal .actor-modal-close:hover { background: #e50914; border-color: #e50914; }
@keyframes zfActorIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes zfActorShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 768px) {
  .actor-modal-container { align-items: flex-end; }
  .actor-modal-container .actor-modal.zf-actor-modal {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100% !important; max-width: none !important;
    height: auto !important; max-height: 88vh !important; max-height: 88dvh !important;
    display: block !important;
    overflow-y: auto !important; overscroll-behavior: contain;
    border-radius: 24px 24px 0 0 !important;
    border-width: 1px 0 0;
    padding: 0 0 calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .zf-actor-modal::before {
    content: ""; position: absolute; top: 8px; left: 50%; z-index: 3;
    width: 40px; height: 4px; margin-left: -20px;
    border-radius: 4px; background: rgba(255, 255, 255, 0.28);
  }
  .actor-modal-container .zf-actor-modal .actor-modal-left {
    width: 100% !important; height: auto !important;
    padding: 30px 0 4px;
    background: transparent;
  }
  .zf-actor-modal .actor-modal-bg {
    inset: 0; width: 100%; height: 100%;
    -webkit-mask-image: linear-gradient(#000 40%, transparent);
    mask-image: linear-gradient(#000 40%, transparent);
  }
  .zf-actor-modal .actor-modal-frame {
    position: relative; inset: auto;
    width: 132px; aspect-ratio: 2 / 3;
    border-radius: 18px; overflow: hidden;
    background: #1c1c20;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
  .zf-actor-modal .actor-modal-frame .actor-modal-img { object-position: center 15%; }
  .zf-actor-modal .actor-modal-initial { font-size: 48px; }
  .actor-modal-container .zf-actor-modal .actor-modal-right {
    width: 100% !important; padding: 16px 22px 6px !important;
    overflow: visible !important; display: block;
    text-align: center;
  }
  .zf-actor-modal .actor-modal-name { padding: 0; font-size: 1.55rem !important; margin-bottom: 10px; }
  .zf-actor-modal .actor-modal-meta { justify-content: center; margin-bottom: 18px; font-size: 12.5px; }
  .zf-actor-modal .actor-modal-bio { text-align: start; font-size: 15px; line-height: 1.7; }
  .actor-modal-container .zf-actor-modal .actor-modal-close { position: absolute; top: 14px; width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .zf-actor-modal .actor-modal-img, .zf-actor-modal .actor-modal-frame::before { animation: none !important; }
}

/* ---- SEO about block, breadcrumb and episode spotlight (movie_details.php) ---- */
/* breadcrumb above the title in the hero */
.zf-title-crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.62); text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.zf-title-crumbs li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.zf-title-crumbs li + li::before { content: "\203A"; opacity: .55; font-size: 15px; }
[dir="rtl"] .zf-title-crumbs li + li::before { content: "\2039"; }
.zf-title-crumbs a { color: rgba(255,255,255,.78); text-decoration: none; transition: color .15s; }
.zf-title-crumbs a:hover, .zf-title-crumbs a:focus-visible { color: #fff; }
.zf-title-crumbs [aria-current="page"] { color: #fff; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* all-episodes index under the episode rail */
.zf-ep-index { margin-top: 18px; }
.zf-ep-index-season { display: none; padding: 14px 16px 16px; border-radius: 16px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.zf-ep-index-season.is-active { display: block; }
.zf-ep-index-title { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 14px; font-weight: 800; color: #ececf1; text-decoration: none; }
.zf-ep-index-title svg { opacity: .6; transition: transform .2s, opacity .2s; }
[dir="rtl"] .zf-ep-index-title svg { transform: scaleX(-1); }
.zf-ep-index-title:hover svg { opacity: 1; transform: translateX(2px); }
[dir="rtl"] .zf-ep-index-title:hover svg { transform: scaleX(-1) translateX(2px); }
.zf-ep-index-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.zf-ep-index-season.is-collapsed .zf-ep-index-list { max-height: 136px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.zf-ep-index-list a { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 10px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: #d6d6de; text-decoration: none; background: rgba(255,255,255,.06); transition: background .15s, color .15s, transform .15s; }
.zf-ep-index-list a:hover, .zf-ep-index-list a:focus-visible { background: rgba(255,255,255,.16); color: #fff; transform: translateY(-1px); }
.zf-ep-index-list a[aria-current="page"] { background: var(--zfx-red, #e50914); color: #fff; box-shadow: 0 6px 18px rgba(229,9,20,.35); }
.zf-ep-index-more { margin-top: 12px; padding: 7px 16px; border: 0; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; }
.zf-ep-index-more:hover { background: rgba(255,255,255,.18); }

/* about card at the end of the title page */
.zf-seo-card { padding: clamp(18px, 2.2vw, 28px); border-radius: 18px; background: linear-gradient(135deg, rgba(229,9,20,.08), rgba(255,255,255,.025) 45%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.zf-seo-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.zf-seo-card .zf-seo-heading { margin: 0; font-size: clamp(18px, 1.5vw, 22px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; color: #f5f5f7; }
.zf-seo-intro { margin: 14px 0 16px; color: rgba(255,255,255,.66); line-height: 1.75; max-width: 980px; font-size: 14.5px; }
.zf-seo-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.zf-seo-tags a { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #d6d6de; text-decoration: none; background: rgba(255,255,255,.07); transition: background .15s, color .15s; }
.zf-seo-tags a:hover, .zf-seo-tags a:focus-visible { background: rgba(255,255,255,.16); color: #fff; }
.zf-ep-spot { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; align-items: center; }
.zf-ep-spot-media { border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: #17171d; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.zf-ep-spot-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zf-ep-spot-kicker { margin: 0 0 6px; color: #ff6b73; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.zf-ep-spot-title { margin: 0 0 6px; font-size: clamp(19px, 2.3vw, 26px); font-weight: 900; color: #fff; }
.zf-ep-spot-name { margin: 0 0 8px; color: #e4e4ea; font-weight: 700; }
.zf-ep-spot-overview { margin: 0 0 14px; color: #b9b9c4; line-height: 1.7; max-width: 760px; }
.zf-ep-spot-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.zf-ep-spot:not(:has(.zf-ep-spot-media)) { grid-template-columns: 1fr; }
@media (max-width: 760px) {
    .zf-ep-spot { grid-template-columns: 1fr; gap: 14px; }
    .zf-seo-intro { font-size: 14px; }
    .zf-ep-index-list { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
    .zf-ep-index-season { padding: 12px; }
    .zf-title-crumbs ol { font-size: 12px; margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .zf-title-hero #heroTrailer, .zf-title-hero .hero-bg { transition: none; }
  .volume-toggle.zf-title-mute.is-hint { animation: none; }
}
