/* ── Video Accordion — expand gallery ── */
/* Desktop: horizontal flex | Mobile: vertical stack */
/* Inactive: slim pill strip | Active: portrait card (≈4:5) */

[data-video-accordion] {
  --va-gap: 12px;
  --va-strip: 54px;          /* inactive width (desktop) / height (mobile) */
  --va-active-flex: 5;       /* flex ratio for active card */
  --va-inactive-flex: 1;
  --va-radius-strip: 28px;
  --va-radius-active: 28px;
  --va-duration: 0.7s;
  --va-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --va-font-label: 0.72rem;
  --va-font-title: 0.875rem;

  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--va-gap);
  min-height: clamp(380px, min(56vw, 75vh), 800px);
  width: 100%;
}

/* ── Item base ── */
.va-item {
  position: relative;
  flex: var(--va-inactive-flex) 1 0;
  min-width: var(--va-strip);
  border-radius: var(--va-radius-strip);
  overflow: hidden;
  cursor: pointer;
  background: #141414;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition:
    flex var(--va-duration) var(--va-ease),
    box-shadow 0.45s ease;
  will-change: flex;
}

.va-item.is-active {
  flex: var(--va-active-flex) 1 0;
  border-radius: var(--va-radius-active);
  cursor: default;
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.24);
}

.va-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

/* ── Media ── */
.va-item__media {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.va-item__media video,
.va-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.07);
  transition: transform 1.1s var(--va-ease);
}

.va-item.is-active .va-item__media video,
.va-item.is-active .va-item__media img {
  transform: scale(1);
}

/* ── Overlay escuro nos inativos ── */
.va-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  pointer-events: none;
  z-index: 2;
  transition: opacity var(--va-duration) var(--va-ease);
}

.va-item.is-active::after {
  opacity: 0;
}

/* ── Label vertical nos strips ── */
.va-item__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
  transition: opacity 0.35s ease, visibility 0s;
}

.va-item__label span {
  font-size: var(--va-font-label);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  user-select: none;
  max-height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Some na hora ao expandir — evita título duplicado no centro durante a animação */
.va-item.is-active .va-item__label {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

/* ── Título no card ativo ── */
.va-item__active-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  box-sizing: border-box;
  padding: 48px 18px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.60) 0%, transparent 100%);
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--va-font-title);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: opacity 0.2s ease;
}

.va-item.is-active .va-item__active-title {
  opacity: 1;
  transition: opacity 0.35s ease 0.28s;
}

/* ── Controles no card ativo (som + expandir) ── */
.va-item__mute,
.va-item__fullscreen {
  position: absolute;
  top: 12px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
}

.va-item__mute {
  left: 12px;
}

.va-item__fullscreen {
  right: 12px;
}

.va-item__mute svg,
.va-item__fullscreen svg {
  width: 15px;
  height: 15px;
  display: block;
}

.va-item.is-active .va-item__mute,
.va-item.is-active .va-item__fullscreen {
  opacity: 1;
  pointer-events: auto;
}

.va-item__mute:hover,
.va-item__fullscreen:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.55);
}

/* ── Lightbox (expandir vídeo) ── */
.va-lightbox {
  --va-lb-duration: 0.42s;
  --va-lb-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  inset: 0;
  /* Acima do site-header (10005) e do morphed-menu (10002) — senão o
     cabeçalho do site fica por cima do player e tapa os botões dele. */
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  visibility: hidden;
  pointer-events: none;
}

.va-lightbox:not([hidden]) {
  visibility: visible;
}

.va-lightbox:not([hidden]):not(.is-open) {
  pointer-events: none;
}

.va-lightbox.is-open {
  pointer-events: auto;
}

.va-lightbox[hidden] {
  display: none;
}

.va-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: none;
  opacity: 0;
  transition: opacity var(--va-lb-duration) var(--va-lb-ease);
}

.va-lightbox.is-open .va-lightbox__backdrop {
  opacity: 1;
}

.va-lightbox__panel {
  position: relative;
  z-index: 1;
  /* Largura casada ao vídeo 9:16 na altura disponível — sem barras laterais. */
  width: min(100%, calc((100vh - 2rem) * 9 / 16));
  max-height: 100%;
  opacity: 0;
  transform: scale(0.96) translateY(10px);
  transition:
    opacity var(--va-lb-duration) var(--va-lb-ease),
    transform var(--va-lb-duration) var(--va-lb-ease);
  will-change: opacity, transform;
}

.va-lightbox.is-open .va-lightbox__panel {
  opacity: 1;
  transform: none;
}

/* Símbolos (som + fechar) sobre o canto superior direito do vídeo. */
.va-lightbox__toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.va-lightbox__mute,
.va-lightbox__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease;
}

.va-lightbox__mute:hover,
.va-lightbox__close:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* Centra o ícone de som no círculo: remove o vão do svg inline e compensa o
   peso visual do alto-falante (que "puxa" pra esquerda). Vale p/ card e player. */
.va-item__mute span[data-icon]:not([hidden]),
.va-lightbox__mute span[data-icon]:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.va-item__mute svg,
.va-lightbox__mute svg {
  display: block;
  transform: translateX(1.5px);
}

.va-lightbox__media {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 2rem);
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: none;
}

.va-lightbox__media video {
  display: block;
  width: 100%;
  max-height: calc(100vh - 2rem);
  object-fit: contain;
}

/* Play central do player — aparece quando pausado */
.va-lightbox__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease;
}

.va-lightbox__play svg {
  margin-left: 4px; /* centra opticamente o triângulo */
  display: block;
}

.va-lightbox__play:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(0, 0, 0, 0.6);
}

.va-lightbox.is-paused .va-lightbox__play {
  opacity: 1;
  pointer-events: auto;
}

/* Barra de progresso (seek) */
.va-lightbox__seek {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 3;
  width: calc(100% - 32px);
  height: 4px;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.va-lightbox__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.va-lightbox__seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

@media (max-width: 767px) {
  .va-lightbox__seek {
    bottom: 8px;
    height: 28px;
    background: transparent;
  }

  .va-lightbox__seek::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
  }

  .va-lightbox__seek::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
  }

  .va-lightbox__seek::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    margin-top: -9px;
  }

  .va-lightbox__seek::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }
}

html.va-lightbox-open {
  overflow: hidden;
}

/* ── Mobile: coluna vertical ── */
@media (max-width: 767px) {
  /* Dimensões ajustadas para caber em 100svh sem inner-scroll.
     Matemática (svh ≥ 717px, iPhone 14 Pro c/ barra de endereço visível):
       padding-top 68 + card 4:5 ≈ 419 + 5×strip 40 + 5×gap 6 = 717px exato.
     Sem inner-scroll → sem scroll-lock no iOS. */
  [data-video-accordion] {
    --va-gap: 6px;
    --va-strip: 56px;
    --va-bottom-pad: 0px;
    --va-font-label: 0.66rem;
    --va-font-title: 0.8rem;
    flex-direction: column;
    min-height: 0;
    height: auto;
    align-items: stretch;
    padding-top: 68px;   /* limpa o header fixo (≈68px) */
    padding-bottom: var(--va-bottom-pad);
  }

  /* Reseta o flex para ambos os estados — o desktop .is-active tem mais especificidade */
  .va-item,
  .va-item.is-active {
    flex: none;
    min-width: 0;
  }

  .va-item {
    width: 100%;
    height: var(--va-strip);
    transition:
      height var(--va-duration) var(--va-ease),
      box-shadow 0.45s ease;
    will-change: height;
  }

  /* Ratio exato 4:5 — sem max-height, sem inner-scroll para compensar. */
  .va-item.is-active {
    flex-shrink: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    border-radius: var(--va-radius-active);
    box-shadow: 0 10px 38px rgba(0, 0, 0, 0.24);
    transition:
      height var(--va-duration) var(--va-ease),
      box-shadow 0.45s ease;
    will-change: height;
  }

  /* Label horizontal no strip mobile */
  .va-item__label {
    padding: 0 14px;
    box-sizing: border-box;
  }

  .va-item__label span {
    writing-mode: horizontal-tb;
    transform: none;
    max-height: none;
    max-width: 100%;
    min-width: 0;
  }

  .va-item__active-title {
    padding: 40px 14px 14px;
    letter-spacing: 0.14em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
}

/* ──────────────────────────────────────────────────────────────
   LANÇAMENTO — modo 1 vídeo (.va--single)
   Preview em 3:4 centralizado (desktop e mobile). O "expandir" (lightbox)
   continua mostrando o vídeo inteiro em 9:16 via object-fit: contain.
   Para reverter: remova a classe "va--single" do HTML e descomente os
   itens video2–video6. Nada aqui afeta o modo galeria padrão.
   ────────────────────────────────────────────────────────────── */
[data-video-accordion].va--single {
  justify-content: center;
  align-items: center;
  min-height: 0;
  height: clamp(380px, 72vh, 760px);
}

[data-video-accordion].va--single .va-item,
[data-video-accordion].va--single .va-item.is-active {
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  aspect-ratio: 3 / 4;
  min-width: 0;
}

/* Título do card no modo 1 vídeo — Unbounded, sem caixa-alta, música/artista em
   duas linhas, espaçamento no mesmo padrão dos outros títulos do site. */
[data-video-accordion].va--single .va-item__active-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--title-letter-spacing-extra);
  text-transform: none;
  line-height: 1.2;
  display: block;
}

[data-video-accordion].va--single .va-item__song {
  display: block;
}

[data-video-accordion].va--single .va-item__artist {
  display: block;
  margin-top: 0.15em;
  font-weight: var(--weight-regular);
  font-size: 0.82em;
  opacity: 0.85;
}

/* Ao tocar, o título recolhe — o vídeo já mostra o nome embutido. */
[data-video-accordion].va--single .va-item.is-playing .va-item__active-title {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Botão play central — só existe no modo 1 vídeo (sem autoplay) */
.va-item__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
}

.va-item__play svg {
  margin-left: 3px; /* centra opticamente o triângulo */
  display: block;
}

.va-item__play:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(0, 0, 0, 0.55);
}

.va-item.is-playing .va-item__play {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  [data-video-accordion].va--single {
    flex-direction: column;
    height: auto;
    /* Folga generosa: a pílula do MENU desce até ~90px; afasta o topo do card
       (e seus botões de som/expandir) dessa zona pra não ficarem cobertos. */
    padding-top: 104px;
  }

  [data-video-accordion].va--single .va-item,
  [data-video-accordion].va--single .va-item.is-active {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .va-item,
  .va-item::after,
  .va-item__label,
  .va-item__active-title,
  .va-item__media video,
  .va-item__media img {
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }

  .va-item.is-active .va-item__label {
    transition: none;
  }

  .va-lightbox__backdrop,
  .va-lightbox__panel {
    transition-duration: 0.01s !important;
  }
}
