/* ==============================================
   Vídeo de presentación en la sección Avatares (portada)
   9:16, a la derecha de la foto de grupo y de su misma altura.
   Controles en la parte inferior: altavoz · volumen · play.
   ============================================== */

.av-intro__video {
  position: relative;
  flex: 0 0 auto;
  width: clamp(200px, 15.5vw, 320px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 4px;
  background: #000;
}

.av-video__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* ── Aviso «Activar sonido» ──
   Solo aparece cuando el navegador nos ha obligado a arrancar en
   silencio. Late suavemente para que se vea, y desaparece en cuanto
   hay sonido. */
.av-video__unmute {
  position: absolute;
  left: 50%;
  bottom: 5.2rem;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--orange);
  color: #111;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  animation: av-unmute-late 2.2s ease-in-out infinite;
}

.av-video--blocked .av-video__unmute { display: inline-flex; }

.av-video__unmute svg { width: 15px; height: 15px; display: block; }

.av-video__unmute:hover {
  background: #fff;
  animation: none;
}

.av-video__unmute:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes av-unmute-late {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .av-video__unmute { animation: none; }
}

/* ── Barra inferior: altavoz + volumen + play ── */
.av-video__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 2.4rem 0.85rem 0.85rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
  /* Escondidos hasta que se quiere usarlos */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Aparecen con el ratón encima, al llegar con el teclado o, en pantallas
   táctiles, al tocar el vídeo (clase que pone video-avatar.js) */
@media (hover: hover) {
  .av-intro__video:hover .av-video__bar {
    opacity: 1;
    pointer-events: auto;
  }
}
.av-intro__video:has(:focus-visible) .av-video__bar,
.av-video--show .av-video__bar {
  opacity: 1;
  pointer-events: auto;
}

.av-video__btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.av-video__btn svg { width: 18px; height: 18px; display: block; }

.av-video__btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #111;
}

.av-video__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* El play destaca en el color de marca */
.av-video__play {
  background: var(--orange);
  border-color: var(--orange);
  color: #111;
}
.av-video__play:hover { background: #fff; border-color: #fff; }

/* Iconos que cambian según el estado */
.av-video__sound .ico-off,
.av-video__play .ico-pause,
.av-video--muted .av-video__sound .ico-on,
.av-video--playing .av-video__play .ico-play { display: none; }

.av-video--muted .av-video__sound .ico-off,
.av-video--playing .av-video__play .ico-pause { display: block; }

/* ── Línea de tiempo: ocupa el centro de la barra; lo ya reproducido
      va en el color de marca. Se puede pinchar en cualquier punto. ── */
.av-video__seek {
  --seek: 0%;
  flex: 1;
  min-width: 0;
  height: 40px;              /* 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;
}

.av-video__seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--orange) var(--seek), rgba(255, 255, 255, 0.35) var(--seek));
}

.av-video__seek::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--orange) var(--seek), rgba(255, 255, 255, 0.35) var(--seek));
}

.av-video__seek::-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);
}

.av-video__seek::-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);
}

.av-video__seek:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Volumen: en vertical, justo encima del altavoz ── */
.av-video__sound-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
}

.av-video__volume {
  --vol: 100%;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: 26px;               /* zona táctil cómoda aunque la línea sea fina */
  height: 96px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  writing-mode: vertical-lr;
  direction: rtl;            /* el mínimo abajo y el máximo arriba */
  -webkit-appearance: slider-vertical;   /* WebKit antiguo */
  appearance: none;
  touch-action: none;
}

.av-video__volume[hidden] { display: none; }

.av-video__volume::-webkit-slider-runnable-track {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--orange) var(--vol), rgba(255, 255, 255, 0.35) var(--vol));
}

.av-video__volume::-moz-range-track {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--orange) var(--vol), rgba(255, 255, 255, 0.35) var(--vol));
}

.av-video__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-left: -5px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.av-video__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);
}

.av-video__volume:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Pantallas estrechas: la presentación va en columna; el vídeo, centrado */
@media (max-width: 900px) {
  .av-intro__video {
    width: min(100%, 320px);
    align-self: center;
  }
}
