/* ═══════════════════════════════════════════════════════
   film.css — страница отдельного фильма
   ═══════════════════════════════════════════════════════ */

/* ── HEADER TRANSPARENT MODE ─────────────────── */
.film-page .site-header {
  background: linear-gradient(to bottom, rgba(0,0,0,.72) 0%, transparent 100%);
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background .35s ease, border-bottom-color .35s ease, backdrop-filter .35s ease;
}
.film-page .site-header.scrolled {
  background: rgba(0,0,0,.88);
  border-bottom-color: rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── HERO ────────────────────────────────────── */
.film-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

/* Фоновый кадр сдвинут правее */
.hero-bg-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 68% center;   /* кадр правее */
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero-slide.active { opacity: 1 }

/*
  Размытая рамка: backdrop-filter + mask-image.
  mask-image создаёт «окошко» (прозрачное в центре-справа),
  за пределами окошка — размытие 28px.
*/
.hero-blur-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  /* Большое окошко — чёткий кадр, лёгкое размытие только по краям */
  -webkit-mask-image: radial-gradient(
    ellipse 68% 80% at 64% 46%,
    transparent 45%,
    rgba(0,0,0,.4) 72%,
    black 92%
  );
  mask-image: radial-gradient(
    ellipse 68% 80% at 64% 46%,
    transparent 45%,
    rgba(0,0,0,.4) 72%,
    black 92%
  );
}

/* Тёмный градиент снизу — для читаемости текста */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.92) 0%,
    rgba(0,0,0,.55) 22%,
    rgba(0,0,0,.08) 50%,
    transparent 70%
  );
}

/* Текстовый блок — снизу слева */
.hero-content-wrap {
  position: relative;
  z-index: 3;
  padding: 0 56px 60px;
  max-width: 620px;
}

.hero-back {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color var(--tr);
}
.hero-back:hover { color: rgba(255,255,255,.8) }

.hero-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}
.hero-badge-item {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: rgba(255,255,255,.52);
}
.hero-badge-sep { color: rgba(255,255,255,.2); font-size: 10px }

.hero-title {
  font-size: clamp(30px, 4.2vw, 58px);
  font-weight: 700;
  color: #fff;
  line-height: 1.07;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.hero-title-en {
  font-size: clamp(14px, 1.6vw, 19px);
  color: rgba(255,255,255,.35);
  font-style: italic;
  margin-bottom: 20px;
  letter-spacing: .01em;
}
.hero-synopsis {
  font-size: 14px;
  color: rgba(255,255,255,.62);
  line-height: 1.78;
  max-width: 520px;
}

.hero-slide-dots {
  position: absolute;
  bottom: 28px;
  right: 52px;
  z-index: 4;
  display: flex;
  gap: 8px;
}
.slide-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  border: none;
  cursor: pointer;
  transition: background .2s, transform .2s;
  padding: 0;
}
.slide-dot.active {
  background: rgba(255,255,255,.9);
  transform: scale(1.4);
}

/* ── TAB BAR ─────────────────────────────────── */
.film-tabs-bar {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  position: sticky;
  top: 72px;
  z-index: 90;
}
.film-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0 22px;
  height: 52px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--tr), border-bottom-color var(--tr);
  margin-bottom: -1px;
  white-space: nowrap;
}
.film-tab:hover { color: var(--text) }
.film-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── PANELS ──────────────────────────────────── */
.film-panels { min-height: 60vh; background: var(--bg) }
.film-panel { display: none }
.film-panel.active { display: block }
.panel-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 52px 40px 72px;
}

/* ── VIDEO TAB ───────────────────────────────── */
.video-wrap { display: flex; justify-content: center }
.video-player {
  width: 100%;
  max-width: 920px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.video-player iframe { width: 100%; height: 100%; border: none }

.video-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 16px;
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  color: var(--text-dim);
  text-align: center;
  gap: 14px;
}
.panel-empty-icon {
  font-size: 36px;
  opacity: .25;
}
.panel-empty p { font-size: 14px }

/* ── DETAILS TAB ─────────────────────────────── */
.details-layout {
  display: flex;
  gap: 52px;
  align-items: flex-start;
}
.details-poster-col { flex-shrink: 0; width: 240px }
.details-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.details-poster-ph {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
}
.details-info-col { flex: 1; min-width: 0 }

.detail-release {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 18px;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
}
.detail-tag {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: .05em;
}

.detail-grid {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.detail-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--text);
  padding-right: 20px;
}
.detail-row.full { grid-column: 1 / -1; padding-right: 0 }
.detail-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-dim);
  font-weight: 600;
}
.detail-link { color: var(--accent); text-decoration: none }
.detail-link:hover { text-decoration: underline }

.detail-section-hd {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent);
  font-weight: 600;
  margin: 28px 0 12px;
}
.detail-festivals { list-style: none }
.detail-festivals li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0 8px 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
  line-height: 1.5;
}
.detail-festivals li::before {
  content: '★';
  color: var(--accent);
  font-size: 9px;
  position: absolute;
  left: 0;
  top: 10px;
}

/* ── STILLS GALLERY ──────────────────────────── */
.stills-section { margin-top: 36px }
.stills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.still-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  transition: opacity var(--tr), transform var(--tr);
}
.still-img:hover { opacity: .85; transform: scale(1.01) }

/* Lightbox */
.still-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.94);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
}
.still-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 6px;
  object-fit: contain;
}

/* ── MATERIALS TAB ───────────────────────────── */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.material-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: border-color var(--tr);
}
.material-card:hover { border-color: rgba(200,169,110,.3) }
.material-card-icon {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 4px;
  opacity: .7;
}
.material-card-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
}
.material-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: .06em;
  text-decoration: none;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity var(--tr);
}
.material-btn:hover { opacity: .82 }
.material-btn--soon {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 400;
  cursor: default;
}
.material-btn--soon:hover { opacity: 1 }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1024px) {
  .hero-content-wrap { padding: 0 40px 52px }
  .hero-slide-dots { right: 40px }
  .film-tabs-bar { padding: 0 24px }
  .panel-inner { padding: 40px 24px 56px }
}

@media (max-width: 768px) {
  /*
    На мобильном: кадр по центру и сверху,
    blur-рамка отключена, вместо неё сильный
    градиент снизу — текст читается на тёмном фоне.
  */
  .film-hero { align-items: flex-end; min-height: 100svh }

  .hero-slide {
    background-position: center 15%;   /* субъект по центру */
  }

  /* Убираем боковое blur-окошко, оно не работает в портрете */
  .hero-blur-frame {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* Сильный градиент от низа — закрывает ~55% снизу */
  .hero-overlay {
    background: linear-gradient(
      to top,
      rgba(0,0,0,.96) 0%,
      rgba(0,0,0,.80) 30%,
      rgba(0,0,0,.30) 55%,
      transparent 75%
    );
  }

  .hero-content-wrap {
    padding: 0 20px 36px;
    max-width: 100%;
  }
  .hero-back    { margin-bottom: 16px }
  .hero-title   { font-size: clamp(26px, 7vw, 36px) }
  .hero-synopsis { font-size: 13px; -webkit-line-clamp: 3;
                   display: -webkit-box; -webkit-box-orient: vertical;
                   overflow: hidden }

  .hero-slide-dots { right: 16px; bottom: 16px }

  /* Табы */
  .film-tabs-bar { padding: 0 16px; top: 60px; overflow-x: auto }
  .film-tab { padding: 0 14px; font-size: 10px; white-space: nowrap }

  /* Панели */
  .panel-inner { padding: 24px 16px 48px }
  .details-layout { flex-direction: column; gap: 24px }
  .details-poster-col { width: 140px }
  .detail-grid { grid-template-columns: 1fr }
  .detail-row { padding-right: 0 }
  .detail-row.full { grid-column: 1 }
  .stills-grid { grid-template-columns: repeat(2, 1fr); gap: 6px }
  .video-player { border-radius: 4px }
}

@media (max-width: 480px) {
  .film-tabs-bar { top: 54px }
  .hero-content-wrap { padding: 0 16px 28px }
  .hero-title { font-size: 24px }
  .hero-badge-item, .hero-badge-sep { font-size: 9px }
  .details-poster-col { width: 110px }
  .materials-grid { grid-template-columns: repeat(2, 1fr) }
  .stills-grid { grid-template-columns: 1fr 1fr; gap: 5px }
  .still-img { border-radius: 4px }
}
