/* ============================================
   FAIXA DE VÍDEOS — cards de capa + player
   Arquivo próprio de propósito: assim home.css não precisa
   ser trocado no servidor (evita problema de cache).
   Carregado por inc/faixa-videos.php
   ============================================ */

/* ── VÍDEOS (faixa de reels) ──────────────────────────────
   Cada card é só uma imagem de capa + botão de play em CSS.
   O player (iframe) só é criado quando a pessoa clica, então
   a seção não pesa no carregamento da home.
   No celular a faixa rola de lado com encaixe (scroll-snap)
   e o card que fica no centro toca o preview sozinho.
   ───────────────────────────────────────────────────────── */
.faixa-videos { background: var(--bg); }
#videos { padding-top: 0; }                    /* cola na linha do tempo do Criatório */
#videos-projetos { padding-bottom: 0; }        /* cola em "Outros projetos" */
.videos-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
/* No computador os cards se ajustam para todos aparecerem de uma vez.
   A rolagem lateral só entra quando ficariam menores que 135px — ou seja,
   de 9 vídeos em diante. */
.videos-strip { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.videos-strip::-webkit-scrollbar { display: none; }
.video-card {
  position: relative; display: block; flex: 1 1 0; min-width: 135px; scroll-snap-align: start;
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  border: 0; padding: 0; margin: 0;
  border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.video-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(31,61,46,0.18); }
.video-capa, .video-prev { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.video-prev { opacity: 0; transition: opacity .35s ease; }
.video-card.is-playing .video-prev { opacity: 1; }
.video-card::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  background: linear-gradient(to top, rgba(10,16,12,0.62), rgba(10,16,12,0));
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.video-card:has(.video-info)::after { opacity: 1; }

/* selo de reels no canto */
.video-badge {
  position: absolute; top: 9px; right: 9px; z-index: 3;
  width: 24px; height: 24px; border-radius: 7px;
  background: rgba(10,16,12,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.video-badge svg { width: 13px; height: 13px; fill: #fff; display: block; }

/* selo que é atalho para o post original (Instagram/YouTube) */
.video-badge-link { cursor: pointer; transition: transform .2s ease, background .2s ease; }
.video-badge-link:hover { background: rgba(10,16,12,0.85); transform: scale(1.15); }
.video-badge-link:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
@media (max-width: 860px) {
  /* no celular o dedo precisa de área maior */
  .video-badge { width: 30px; height: 30px; }
  .video-badge svg { width: 16px; height: 16px; }
}

/* botão de play no centro */
.video-play {
  position: absolute; inset: 0; margin: auto; z-index: 3;
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(250,247,240,0.9);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(10,16,12,0.28);
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
.video-card:hover .video-play { transform: scale(1.08); }
.video-card.is-playing .video-play { opacity: 0; transform: scale(0.8); }
.video-play svg { width: 17px; height: 17px; fill: var(--accent); margin-left: 2px; display: block; }

/* título opcional (só aparece se o vídeo tiver título na lista).
   Imita o texto que já vem gravado nas capas do Instagram: caixa alta,
   centralizado e com sombra, para a faixa ficar toda no mesmo tom. */
.video-info { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 14px 11px 15px; text-align: center; }
.video-cat { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.57rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); display: block; margin-bottom: 4px; }
.video-titulo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem; font-weight: 800; text-transform: uppercase;
  color: #fff; line-height: 1.18; display: block;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55), 0 0 3px rgba(0,0,0,0.7);
}

/* lightbox — criado pelo JS só no primeiro clique */
.video-lb {
  position: fixed; inset: 0; z-index: 200; padding: 24px;
  background: rgba(10,16,12,0.9); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.video-lb.open { opacity: 1; pointer-events: auto; }
.video-lb-box { position: relative; width: min(400px, 92vw); }
.video-lb-box.yt,
.video-lb-box.deitado { width: min(880px, 92vw); }
.video-lb-frame { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 78vh; background: #000; border-radius: 16px; overflow: hidden; }
.video-lb-box.yt .video-lb-frame { aspect-ratio: 16 / 9; }
.video-lb-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-lb-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
/* seta de play no centro do vídeo (player próprio, sem interface de fora) */
.video-lb-play {
  position: absolute; inset: 0; margin: auto; z-index: 2;
  width: 68px; height: 68px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(250,247,240,0.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px rgba(0,0,0,0.35);
  transition: transform .2s ease;
}
.video-lb-play:hover { transform: scale(1.07); }
.video-lb-play svg { width: 24px; height: 24px; fill: var(--accent); margin-left: 3px; display: block; }
.video-lb-close {
  position: absolute; top: -44px; right: 0; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(250,247,240,0.16); color: #fff; font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.video-lb-close:hover { background: rgba(250,247,240,0.28); }
body.video-lb-aberto { overflow: hidden; }


/* ── VÍDEOS no celular: faixa que rola de lado ── */
@media (max-width: 860px) {
  .videos-strip {
    gap: 12px;   /* igual ao vão do grid de variedades */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* sangra até as bordas da tela, mesmo dentro do .section-wrap */
    margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
    padding: 6px 5vw 10px;
  }
  .videos-strip::-webkit-scrollbar { display: none; }
  /* mesma largura dos cards de variedade logo abaixo: o .section-wrap ocupa
     90vw (5% de cada lado) e o grid deles é de 2 colunas com 12px de vão,
     então cada card mede 45vw - 6px. Assim as duas grades ficam alinhadas. */
  .video-card { flex: 0 0 calc(45vw - 6px); scroll-snap-align: center; }
  .video-card:hover { transform: none; }
  .video-titulo { font-size: 0.88rem; }
  .video-play { width: 56px; height: 56px; }
  .video-play svg { width: 19px; height: 19px; }
}

@media (max-width: 480px) {
  /* no celular pequeno o grid de variedades usa vão de 10px */
  .videos-strip { gap: 10px; }
  .video-card { flex: 0 0 calc(45vw - 5px); }
}
