/* Parche 019. Encuadre completo, zona libre para el logo y características abiertas. */
.hero-film-stage {
  --hero-header-clearance: calc(var(--nav-height) + 12px);
  --hero-social-clearance: 68px;
  --hero-frame-height: 56.25vw;
  --hero-media-ratio: 1.777777778;
  --hero-stage-height: min(100vh, calc(var(--hero-frame-height) + var(--hero-header-clearance) + var(--hero-social-clearance)));
  height: var(--hero-stage-height);
}

@supports (height: 100svh) {
  .hero-film-stage {
    --hero-stage-height: min(100svh, calc(var(--hero-frame-height) + var(--hero-header-clearance) + var(--hero-social-clearance)));
  }
}

/* El video queda anclado; el contenido conserva el desplazamiento normal de la página. */
.hero-film-backdrop {
  position: fixed;
  inset: 0 0 auto;
  z-index: 0;
  width: 100%;
  height: var(--hero-stage-height);
  background: #f6e5e1;
}

/* La zona central coincide con el fotograma; solo se prolongan sus colores de borde. */
.hero-film-backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-style: solid;
  border-color: transparent;
  border-width: var(--hero-frame-top, var(--hero-header-clearance)) var(--hero-side-clearance, 0px) var(--hero-frame-bottom, var(--hero-social-clearance));
  border-image-source: url('../assets/video/fondo-portada-019.png');
  border-image-slice: 1 fill;
  border-image-width: 1;
  border-image-repeat: stretch;
}

.hero-film-backdrop[hidden] { display: none; }

.hero.hero-film { padding-bottom: 0; }

.hero-film > .container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  padding: 1px 5% 64px;
  background: var(--crema);
}

.event-ribbon, body > main, body > .footer {
  position: relative;
  z-index: 1;
}

/* El apartado permanece al inicio. Se adapta su área útil, sin estirar ni recortar el video. */
.hero-film-player {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-block: var(--hero-header-clearance) var(--hero-social-clearance);
  aspect-ratio: auto;
}

.hero-film-player video {
  width: min(100%, calc((var(--hero-stage-height) - var(--hero-header-clearance) - var(--hero-social-clearance)) * var(--hero-media-ratio)));
  max-width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: var(--hero-media-ratio);
  object-fit: contain;
  object-position: center;
  clip-path: inset(var(--hero-mask-top, 0px) 0 0);
}

.hero-film-player .hero-film-poster {
  inset: var(--hero-header-clearance) 0 var(--hero-social-clearance);
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: inset(var(--hero-mask-top, 0px) 0 0);
}

.hero-film-poster img {
  width: min(100%, calc((var(--hero-stage-height) - var(--hero-header-clearance) - var(--hero-social-clearance)) * var(--hero-media-ratio)));
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Funde únicamente el borde del fotograma con el fondo original del mismo video. */
.hero-film-player video, .hero-film-poster img {
  -webkit-mask-image: linear-gradient(transparent, #000 3%, #000 97%, transparent), linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(transparent, #000 3%, #000 97%, transparent), linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-composite: intersect;
}

/* Transparencia sobre el video; fondo crema al llegar al contenido. */
.site-header {
  background: #fcf6eef5;
  border-bottom: 1px solid #c9757b26;
  box-shadow: 0 4px 18px #49393708;
  backdrop-filter: blur(12px);
  transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.site-header.is-over-video {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

/* La misma crema clara de la marca, sin recuadros ni sombras por característica. */
.section[aria-labelledby='features-title'] {
  background: #fffdf9;
}

.features-grid {
  gap: 34px 42px;
  text-align: center;
}

.features-grid article,
.features-grid article:hover,
.features-grid article:first-child {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.features-grid article {
  padding: 22px 18px;
}

.features-grid article:hover {
  translate: none;
}

.features-grid .icon {
  width: 43px;
  height: 43px;
  padding: 0;
  margin: 0 auto 18px;
  border: 0;
  border-radius: 0;
  background: none;
}

@media (max-aspect-ratio: 1/1) {
  .hero-film-stage {
    --hero-frame-height: 177.777778vw;
    --hero-media-ratio: .5625;
  }

  .hero-film-backdrop::before {
    border-image-source: url('../assets/video/fondo-portada-movil-019.png');
  }
}

@media (max-width: 700px) {
  .hero-film > .container { padding-bottom: 42px; }

  .features-grid {
    gap: 24px;
    text-align: left;
  }

  .features-grid article {
    padding: 9px 0;
  }

  .features-grid .icon {
    width: 43px;
    height: 43px;
    margin: 0;
  }
}

@media (max-height: 440px) and (orientation: landscape) {
  .hero-film-stage {
    --hero-header-clearance: calc(var(--nav-height) + 4px);
    --hero-social-clearance: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-film-backdrop { position: relative; }

  .site-header {
    transition: none;
  }
}

@media print {
  .hero-film-backdrop::before { display: none; }
  .hero-film-stage { height: auto; }
  .hero-film-backdrop { position: static; height: auto; }

  .site-header {
    background: var(--crema);
    backdrop-filter: none;
    box-shadow: none;
  }

  .hero-film-player {
    height: auto;
    padding: 0;
  }

  .hero-film-player .hero-film-poster {
    position: static;
    clip-path: none;
  }
}
