/* ==========================================================================
   VIDEOBLAST.AI — cinema mode (markup is created by assets/js/cinema.js)
   ========================================================================== */

.cinema {
  --cinema-ratio: 1.7778;   /* width / height of the current film, set by cinema.js */
  --cinema-chrome: 176px;   /* vertical room for paddings and the caption bar */
  position: fixed; inset: 0; z-index: 120;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.cinema[hidden] { display: none; }
.cinema.is-open { opacity: 1; }
.cinema:focus { outline: none; }
.cinema.has-desc { --cinema-chrome: 216px; }

.cinema__backdrop {
  position: fixed; inset: 0;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(16, 43, 94, 0.5), rgba(16, 43, 94, 0) 70%),
    rgba(4, 11, 28, 0.9);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.cinema__guard { position: fixed; width: 1px; height: 1px; overflow: hidden; outline: none; }

.cinema__stage {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 76px var(--gutter) 28px;
}

/* The frame is as wide as the picture fits the viewport, but never narrower
   than a comfortable caption line (portrait films). */
.cinema__frame {
  --screen-w: min(100%, 1480px, calc((100vh - var(--cinema-chrome)) * var(--cinema-ratio)));
  width: max(var(--screen-w), min(100%, 620px));
}
@supports (height: 100dvh) {
  .cinema__frame { --screen-w: min(100%, 1480px, calc((100dvh - var(--cinema-chrome)) * var(--cinema-ratio))); }
}

.cinema__screen {
  position: relative;
  width: var(--screen-w);
  max-width: 100%;
  aspect-ratio: var(--cinema-ratio);
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity .55s var(--ease-out), transform .7s var(--ease-out);
}
.cinema.is-open .cinema__screen { opacity: 1; transform: none; }

.cinema__video {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain; /* portrait or odd ratios are shown whole, never cropped */
  background: #000;
}

.cinema__error {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(7, 21, 48, 0.55), rgba(7, 21, 48, 0.88));
}
.cinema__error[hidden] { display: none; }
.cinema__error-text {
  margin: 0;
  max-width: 16em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--white);
}

.cinema__close {
  position: fixed; top: clamp(14px, 2.4vh, 24px); right: clamp(14px, 2vw, 28px); z-index: 2;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(7, 21, 48, 0.4);
  transition: background-color .3s, border-color .3s, color .3s, transform .5s var(--ease-out);
}
.cinema__close svg { width: 20px; height: 20px; }

.cinema__bar {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 16px 28px;
  margin-top: 20px;
}
.cinema__caption { flex: 1 1 260px; min-width: 0; }
.cinema__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  overflow-wrap: anywhere;
}
.cinema__desc {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cinema__desc[hidden] { display: none; }
.cinema__desc--long { font-size: 14px; line-height: 1.6; letter-spacing: 0.02em; text-transform: none; max-width: 62ch; }

.cinema__nav { flex: none; display: flex; align-items: center; gap: 14px; }
.cinema__nav[hidden] { display: none; }
.cinema__arrow {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: border-color .3s, color .3s, opacity .3s;
}
.cinema__arrow svg { width: 16px; height: 16px; }
.cinema__arrow[aria-disabled="true"] { opacity: 0.3; cursor: default; }
.cinema__count {
  margin: 0;
  min-width: 5.2em;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.24em;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.cinema__now { color: var(--gold-400); }

.cinema__sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (hover: hover) {
  .cinema__close:hover { background: var(--gold-400); border-color: transparent; color: var(--navy-900); transform: rotate(90deg); }
  .cinema__arrow:not([aria-disabled="true"]):hover { border-color: var(--gold-400); color: var(--gold-300); }
}

@media (max-width: 640px) {
  .cinema { --cinema-chrome: 210px; }
  .cinema.has-desc { --cinema-chrome: 260px; }
  .cinema__stage { padding: 72px 16px 20px; }
  .cinema__frame { width: var(--screen-w); min-width: min(100%, 300px); }
  .cinema__bar { margin-top: 16px; }
  .cinema__close { top: 12px; right: 12px; width: 44px; height: 44px; }
  .cinema__arrow { width: 44px; height: 44px; }
}

/* Phones turned sideways: keep the picture as large as possible */
@media (max-height: 540px) {
  .cinema { --cinema-chrome: 96px; }
  .cinema.has-desc { --cinema-chrome: 120px; }
  .cinema__stage { padding: 12px 72px 12px var(--gutter); }
  .cinema__bar { margin-top: 10px; gap: 8px 20px; }
  .cinema__title { font-size: 18px; }
  .cinema__desc { margin-top: 2px; }
  .cinema__arrow { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .cinema, .cinema__screen, .cinema__close, .cinema__arrow { transition: none; }
  .cinema__screen { transform: none; }
}
