/**
 * Depoimentos em Vídeo — carrossel + modal player.
 *
 * Carrossel: track flex com translateX, slides com largura calculada via
 * --per-page (custom prop setada pelo JS por breakpoint). Loop por modulo.
 *
 * Modal: fixed overlay com vídeo em frame vertical 9:16 + nav lateral.
 *   - Body recebe .pucpr-depo-video-locked pra travar scroll.
 *   - Mobile mantém o frame com backdrop visível (não vai full-screen) por
 *     decisão de produto.
 */

/* ============ Carrossel ============ */

.pucpr-depo-video {
  --card-radius: 20px;
  --card-height: 490px;
  --card-padding: 30px;

  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* O carrossel é o Swiper (classes .swiper/.swiper-wrapper/.swiper-slide), que
   cuida de layout flex, largura dos slides, gap (spaceBetween) e transform.
   Aqui só ajustamos o que é nosso. O .pucpr-depo-video__viewport carrega a
   classe .swiper; o Swiper já aplica position:relative + overflow:hidden. */

/* O .swiper do Swiper traz margin-inline:auto. Como o pai é flex-column, auto
   margin no eixo cruzado encolhe o elemento pro conteúdo (0 no init) em vez de
   esticar — colapsando a largura. width:100% trava em full-width. */
.pucpr-depo-video__swiper {
  width: 100%;
}

.pucpr-depo-video__track {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Slide com a altura do card (o Swiper define só a largura). */
.pucpr-depo-video__slide {
  height: var(--card-height);
}

/* Escopo extra em .pucpr-depo-video pra vencer o Elementor global kit,
   que estiliza `button` com `.elementor-kit-NNN button` (0,1,1) — sem isso
   o border-radius do kit (geralmente bem maior que 20px) vence o nosso e
   o `background` dark padrão do kit aparece como uma "barra preta". */
.pucpr-depo-video .pucpr-depo-video__card {
  position: relative;
  display: block;
  width: 100%;
  height: var(--card-height);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--card-radius);
  background: transparent;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  /* Drag do carrossel não deve gerar seleção de texto nem ghost-image
	   nativa do <img> — o user-select: none cobre o texto; a img tem
	   user-drag: none + draggable="false" no HTML. */
  user-select: none;
  -webkit-user-select: none;
}

.pucpr-depo-video .pucpr-depo-video__foto {
  -webkit-user-drag: none;
  user-drag: none;
}

.pucpr-depo-video .pucpr-depo-video__card:hover,
.pucpr-depo-video .pucpr-depo-video__card:focus-visible {
  outline: none;
}

/* Overlay sobre a foto: gradiente que vai de transparente a 50% pra preto
   sólido em 100%, dando contraste pro nome/cargo na parte inferior. */
.pucpr-depo-video__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, #000 100%);
  pointer-events: none;
  z-index: 1;
}

/* No hover do card só a foto escala — a área do card mantém o tamanho
   (overflow:hidden cuida do clipping). Escopo extra em .pucpr-depo-video
   pra vencer o kit do Elementor, que aplica `.elementor-kit-NNN img
   { height: auto }` (0,1,1) e fazia a foto colapsar pra altura
   proporcional. */
.pucpr-depo-video .pucpr-depo-video__foto {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.4s ease;
}

.pucpr-depo-video .pucpr-depo-video__card:hover .pucpr-depo-video__foto,
.pucpr-depo-video
  .pucpr-depo-video__card:focus-visible
  .pucpr-depo-video__foto {
  transform: scale(1.2);
}

/* Resize/expand colado no canto top-right (gradiente próprio do SVG já
   escurece o cantinho). Some no estado normal e aparece no hover. */
.pucpr-depo-video__resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  z-index: 2;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.pucpr-depo-video__card:hover .pucpr-depo-video__resize,
.pucpr-depo-video__card:focus-visible .pucpr-depo-video__resize {
  opacity: 1;
}

svg.pucpr-depo-video__resize-ico {
  display: block;
  width: 100%;
  height: 100%;
}

/* Play centralizado horizontalmente, abaixo do meio do card — fica na
   "zona escura" do gradiente, em cima do nome. O SVG já vem com o círculo
   vermelho e o triângulo branco; só posicionamos. */
/* Stack inferior (play + legenda) — coluna flex com gap 10px, ancorada na
   base do card. O .bottom limita a largura do texto (left/right:
   var(--card-padding)) pra nome/cargo terem onde quebrar. */
.pucpr-depo-video__bottom {
  position: absolute;
  left: var(--card-padding);
  right: var(--card-padding);
  bottom: var(--card-padding);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pucpr-depo-video__play {
  position: static;
  width: 80px;
  height: 80px;
  flex: 0 0 auto;
  align-self: flex-start;
  pointer-events: none;
}

svg.pucpr-depo-video__play-ico {
  display: block;
  width: 100%;
  height: 100%;
}

.pucpr-depo-video__legend {
  position: static;
}

.pucpr-depo-video__nome {
  margin: 0 0 10px;
  font-family: "Poppins", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  color: #fff;
  /* Balanceia as linhas (sem palavra-viúva isolada). Browsers sem
	   suporte caem no wrap natural. */
  text-wrap: balance;
}

.pucpr-depo-video__sub {
  margin: 0;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #fff;
}

/* Nav (setas + dots) */
.pucpr-depo-video__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* Scope sob .pucpr-depo-video: o Elementor global kit estiliza `button` com
   `.elementor-kit-NNN button` (specificity 0,1,1) e pintaria seta/dots de roxo.
   O escopo extra garante que nossos tokens (mesmo padrão do widget Cursos em
   Alta) vençam o kit. */
.pucpr-depo-video .pucpr-depo-video__arrow {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f5f0f2;
  border: 0;
  color: #000000;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
}

.pucpr-depo-video .pucpr-depo-video__arrow:hover,
.pucpr-depo-video .pucpr-depo-video__arrow:focus-visible {
  background: #ece2e6;
  outline: none;
}

.pucpr-depo-video__arrow-ico {
  display: block;
  width: 8px;
  height: 16px;
}

/* O SVG é left-chevron; espelha pra direita no botão "next". */
.pucpr-depo-video__arrow--next .pucpr-depo-video__arrow-ico {
  transform: scaleX(-1);
}

/* Escopo .pucpr-depo-video (0,2,0) pra vencer o CSS do Swiper, que aplica
   width:100% em .swiper-pagination-bullets.swiper-pagination-horizontal e
   esticaria os dots, empurrando prev/next pras pontas. width/flex auto mantêm
   os dots como grupo central. */
.pucpr-depo-video .pucpr-depo-video__dots {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
}

.pucpr-depo-video .pucpr-depo-video__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f0e8eb;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.4s ease;
}

.pucpr-depo-video .pucpr-depo-video__dot:hover {
  background: #e3d6db;
}

.pucpr-depo-video .pucpr-depo-video__dot.is-active {
  background: #ff0040;
}

.pucpr-depo-video--empty {
  padding: 14px 18px;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 8px;
  color: #856404;
  font-size: 14px;
}

/* ============ Modal ============ */

.pucpr-depo-video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pucpr-depo-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

/* X de fechar — escopo extra pra vencer o kit do Elementor que pintaria
   o <button> de roxo. Linha fina (xmark Light), sem círculo de fundo. */
.pucpr-depo-video-modal .pucpr-depo-video-modal__close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 0;
  cursor: pointer;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pucpr-depo-video-modal .pucpr-depo-video-modal__close:hover,
.pucpr-depo-video-modal .pucpr-depo-video-modal__close:focus-visible {
  background: transparent;
  color: #fff;
  outline: none;
  opacity: 0.85;
}

svg.pucpr-depo-video-modal__close-ico {
  width: 28px;
  height: 28px;
  display: block;
}

/* Setas prev/next do modal — círculo 40×40 #F5F0F2 com chevron preto.
   Escopo extra em .pucpr-depo-video-modal pra vencer o kit do Elementor. */
.pucpr-depo-video-modal .pucpr-depo-video-modal__nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f5f0f2;
  border: 0;
  color: #000;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: none;
}

.pucpr-depo-video-modal__nav-arrow--prev {
  left: 24px;
}
.pucpr-depo-video-modal__nav-arrow--next {
  right: 24px;
}

.pucpr-depo-video-modal .pucpr-depo-video-modal__nav-arrow:hover,
.pucpr-depo-video-modal .pucpr-depo-video-modal__nav-arrow:focus-visible {
  background: #f5f0f2;
  color: #000;
  outline: none;
  opacity: 0.9;
}

svg.pucpr-depo-video-modal__nav-ico {
  width: 24px;
  height: 24px;
  display: block;
}

.pucpr-depo-video-modal__frame {
  position: relative;
  width: min(90vw, 440px);
  aspect-ratio: 9 / 16;
  max-height: 75vh;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  z-index: 2;
  /* Deixa o swipe horizontal pra navegação (JS); scroll vertical segue livre. */
  touch-action: pan-y;
  /* Glow suave em volta do frame — é isto que dá a sensação de
	   "vignette" no Figma, não o backdrop. */
  box-shadow: 10px 10px 60px 0 rgba(0, 0, 0, 0.8);
}

.pucpr-depo-video-modal__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Player do YouTube ocupando o frame em modo "cover": o iframe é forçado a
   16:9 (min-width/min-height 100% + aspect-ratio) — o browser escolhe o menor
   16:9 que cobre a caixa 9:16 em ambas as dimensões. Centralizado e com as
   laterais cortadas pelo overflow:hidden do frame. Como o iframe é exatamente
   16:9, o YouTube preenche sem tarjas internas. Trade-off: vídeo landscape
   mostra só a faixa central (~31% da largura) — ok pra talking-head.

   Esconde o título do YouTube: o player sempre desenha a faixa de título no
   topo (o param `showinfo` foi removido em 2018, não há mais como desligar via
   API). Como não dá pra remover, o iframe é levemente ampliado (scale) e
   deslocado pra cima, jogando a faixa do topo pra fora do frame, que tem
   overflow:hidden. O título já fica no topo-esquerda e o "cover" corta as
   laterais; o overscan vertical garante o resto. --yt-overscan controla quanto
   ampliar (1.22 ≈ 14% recortado no topo, 8% embaixo — ainda cobre o frame). */
.pucpr-depo-video-modal__yt {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 1;
  overflow: hidden;
}

.pucpr-depo-video-modal__yt[hidden] {
  display: none;
}

.pucpr-depo-video-modal__yt-mount {
  width: 100%;
  height: 100%;
}

.pucpr-depo-video-modal__yt iframe {
  --yt-overscan: 1.22;
  position: absolute;
  top: 50%;
  left: 50%;
  /* -53% (em vez de -50%) puxa 3% extra pra cima, recortando mais o topo
     (título) e menos a base, mantendo o frame coberto. */
  transform: translate(-50%, -53%) scale(var(--yt-overscan));
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

/* Camada transparente sobre o iframe: o player cross-origin do YouTube engole
   os pointer events, então sem isto o swipe de navegação (e o gesto pro frame)
   não funcionaria sobre o vídeo — quebraria a navegação mobile (sem setas). */
.pucpr-depo-video-modal__yt-guard {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  /* Igual ao frame: swipe horizontal vira navegação (JS), scroll vertical livre. */
  touch-action: pan-y;
}

.pucpr-depo-video-modal__progress {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  overflow: hidden;
  /* Acima do player do YouTube (z-index:1) e da guarda (z-index:2) pra
     barra continuar visível sobre o iframe. */
  z-index: 3;
}

.pucpr-depo-video-modal__progress-bar {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 999px;
  transition: width 0.12s linear;
}

.pucpr-depo-video-modal__caption {
  margin-top: 20px;
  color: #fff;
  font-size: 15px;
  text-align: center;
  z-index: 2;
  max-width: min(90vw, 500px);
}

.pucpr-depo-video-modal__caption strong {
  font-weight: 700;
}

.pucpr-depo-video-modal__dots {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  z-index: 2;
}

/* Escopo extra em .pucpr-depo-video-modal pra vencer o kit do Elementor,
   que pintava esses <button>s de roxo. */
.pucpr-depo-video-modal .pucpr-depo-video-modal__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f5f0f2;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.4s ease;
}

.pucpr-depo-video-modal .pucpr-depo-video-modal__dot.is-active {
  background: #ff0040;
}

.pucpr-depo-video-modal .pucpr-depo-video-modal__dot:hover,
.pucpr-depo-video-modal .pucpr-depo-video-modal__dot:focus-visible {
  background: #f5f0f2;
  outline: none;
}

.pucpr-depo-video-modal .pucpr-depo-video-modal__dot.is-active:hover,
.pucpr-depo-video-modal .pucpr-depo-video-modal__dot.is-active:focus-visible {
  background: #ff0040;
}

/* Body scroll lock */
body.pucpr-depo-video-locked {
  overflow: hidden;
}

/* ============ Responsivo ============ */

@media (max-width: 1024px) {
  .pucpr-depo-video__nome {
    font-size: 18px;
  }
  .pucpr-depo-video__play {
    left: 16px;
    bottom: 96px;
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 600px) {
  /* No mobile a navegação do carrossel fica só nos dots — as setas somem
     (o swipe/drag e as bolinhas dão conta). Escopo extra (.pucpr-depo-video)
     pra igualar a especificidade da regra base (0,2,0) que seta inline-flex —
     sem isso o display:none perde mesmo dentro do media query. */
  .pucpr-depo-video .pucpr-depo-video__arrow {
    display: none;
  }

  /* Espaço cards → dots = 40px no mobile. */
  .pucpr-depo-video {
    gap: 40px;
  }

  /* Mobile com 1 card por vez: o Swiper usa slidesPerView:'auto', então NÃO
     aplica width inline e a largura do card vem daqui. Largura fixa de 287.5px
     (spec do Figma) → com slidesOffsetBefore:20 (JS) sobra o peek do próximo
     card à direita. (Com ppMobile>1 o Swiper volta a usar slidesPerView
     numérico + width inline, que naturalmente prevalece.) */
  .pucpr-depo-video .pucpr-depo-video__slide {
    width: 287.5px;
  }

  /* Modal no mobile: navegação só por swipe + dots — as setas somem. */
  .pucpr-depo-video-modal .pucpr-depo-video-modal__nav-arrow {
    display: none;
  }

  /* Reserva uma faixa no topo pro X não cair em cima do vídeo: empurra o
     conteúdo pra baixo (padding-top) e limita a altura do frame pra tudo
     caber sem o vídeo subir até o X. */
  .pucpr-depo-video-modal {
    justify-content: center;
    padding-top: 64px;
  }

  .pucpr-depo-video-modal__frame {
    max-height: 62vh;
  }

  .pucpr-depo-video-modal__close {
    top: 14px;
    right: 14px;
  }

  /* Mobile (touch): desativa o zoom da foto no hover/focus. Em telas de
     toque o :hover "gruda" depois do tap e deixa a foto ampliada — escopo
     extra (.pucpr-depo-video) pra igualar a especificidade (0,3,0) da regra
     base que aplica o scale(1.2). */
  .pucpr-depo-video .pucpr-depo-video__card:hover .pucpr-depo-video__foto,
  .pucpr-depo-video
    .pucpr-depo-video__card:focus-visible
    .pucpr-depo-video__foto {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pucpr-depo-video__track,
  .pucpr-depo-video__card,
  .pucpr-depo-video__play,
  .pucpr-depo-video-modal__progress-bar {
    transition: none;
  }
}
