/* ==============================================
   Vídeo de presentación 9:16
   Lo usa index.html (sección Avatares).
   Aparece cada vez que se pasa por su sitio; ver intro-pop.js.
   ============================================== */

/* Por encima de la cabecera y las galerías, por debajo del lightbox. */
.intro-pop {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 10, 10, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.45s ease;
  /* En táctil, el dedo sobre el pop-up no debe desplazar la página de debajo */
  touch-action: none;
  overscroll-behavior: contain;
}

/* display:flex anularía el atributo hidden */
.intro-pop[hidden] { display: none; }

.intro-pop--out {
  opacity: 0;
  pointer-events: none;
}

/* El ancho se calcula a partir de la altura disponible para que el
   9:16 no se deforme ni en móviles estrechos ni en pantallas bajas. */
.intro-pop__frame {
  position: relative;
  width: min(88vw, calc(84vh * 9 / 16), 520px);
  aspect-ratio: 9 / 16;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.intro-pop__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* ── Botón de play central ── */
.intro-pop__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 50%;
  background: var(--orange);
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background-color 0.2s;
}

/* Triángulo de play, ligeramente desplazado para que se vea centrado */
.intro-pop__play::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 14px 0 14px 24px;
  border-color: transparent transparent transparent #fff;
}

.intro-pop__play:hover { transform: translate(-50%, -50%) scale(1.07); }

/* Mientras se reproduce, el play desaparece y aparecen los controles de sonido */
.intro-pop--playing .intro-pop__play { display: none; }

.intro-pop__audio {
  position: absolute;
  left: 0.8rem;
  right: 4.5rem;
  bottom: 0.8rem;
  display: none;
  align-items: center;
  gap: 0.9rem;
}

.intro-pop--playing .intro-pop__audio { display: flex; }

.intro-pop__sound,
.intro-pop__close {
  font-family: var(--font-body);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.intro-pop__sound {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 40px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.intro-pop__sound:hover {
  background: var(--orange);
  border-color: var(--orange);
}

/* ── Barra de volumen: una línea fina; la parte recorrida en naranja ── */
.intro-pop__volume {
  --vol: 100%;
  flex: 1;
  max-width: 160px;
  height: 44px;              /* zona táctil cómoda aunque la línea sea fina */
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}

.intro-pop__volume[hidden] { display: none; }

.intro-pop__volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--orange) var(--vol), rgba(255, 255, 255, 0.35) var(--vol));
}

.intro-pop__volume::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--orange) var(--vol), rgba(255, 255, 255, 0.35) var(--vol));
}

.intro-pop__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.intro-pop__volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.intro-pop__volume:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.intro-pop__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
}

.intro-pop__close:hover { background: rgba(255, 255, 255, 0.2); }

.intro-pop__play:focus-visible,
.intro-pop__sound:focus-visible,
.intro-pop__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .intro-pop,
  .intro-pop__play { transition: none; }
}
