/* ============================================================
   SEÇÃO (mobile)
   ============================================================ */
.video {
  padding: 72px 24px 88px;
  background-color: #D5F3F0;
}

.video__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
}


/* ---------- Texto ---------- */
.video__rotulo {
  margin: 0 0 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #A1772B;
}

.video__titulo {
  margin: 0 0 28px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  color: #1E3A38;
  text-wrap: balance;
}

.video__divisor {
  display: block;
  width: 64px;
  height: 1px;
  margin: 0 0 28px;
  background-color: #C9A45C;
}

.video__texto {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.9;
  color: #5A6664;
}


/* ============================================================
   MÍDIA (moldura dourada deslocada + player)
   ============================================================ */
.video__midia {
  position: relative;
  margin: 0 12px 12px 0; /* espaço para a moldura deslocada */
}

.video__midia::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  z-index: 0;
  border: 1px solid #C9A45C;
}

.video__player {
  position: relative;
  z-index: 1;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: #1E3A38;
  box-shadow: 0 24px 48px #1E3A3833;
}


/* ============================================================
   CAPA (botão que cobre o player até o clique)
   ============================================================ */
.video__capa {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background-color: #1E3A38;
  color: #FFFDF8;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.7s ease, visibility 0s linear 0s;
}

.video__capa:focus-visible {
  outline: 2px solid #C9A45C;
  outline-offset: -6px;
}

.video__poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 1.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.8s ease;
}

/* Classe adicionada pelo JavaScript quando a miniatura termina de carregar */
.video__poster.is-carregada {
  opacity: 1;
}

/* Película escura: dá leitura ao texto e destaque ao play */
.video__capa::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(180deg, #1A2E2C40 0%, #1A2E2C1A 40%, #1A2E2CE0 100%);
}


/* ---------- Botão de play ---------- */
.video__botao-play {
  position: absolute;
  top: 45%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border: 1px solid #FFFDF8;
  border-radius: 50%;
  background-color: #1E3A3859;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

.video__botao-play svg {
  margin-left: 3px; /* ajuste óptico do triângulo */
  fill: #FFFDF8;
  transition: fill 0.4s ease, opacity 0.3s ease;
}

/* Anel que pulsa suavemente, chamando o clique */
.video__botao-play::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 100%;
  height: 100%;
  border: 1px solid #FFFDF8;
  border-radius: 50%;
  opacity: 0;
  animation: videoPulso 2.8s ease-out infinite;
}

/* Anel de carregamento (aparece só depois do clique) */
.video__botao-play::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 100%;
  height: 100%;
  border: 2px solid #FFFDF800;
  border-top-color: #C9A45C;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}


/* ---------- Legenda ---------- */
.video__legenda {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px 14px;
}

.video__legenda-textos {
  display: block;
}

.video__legenda-titulo {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
  color: #FFFDF8;
}

/* No celular a legenda fica só com o título, para não poluir */
.video__legenda-texto {
  display: none;
  margin-top: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: #F3ECDD;
}

.video__selo {
  display: none;
  padding: 10px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FFFDF8;
  border: 1px solid #FFFDF8B3;
  white-space: nowrap;
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}


/* ============================================================
   IFRAME (criado pelo JavaScript só depois do clique)
   ============================================================ */
.video__iframe {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
}


/* ============================================================
   ESTADOS
   ============================================================ */

/* Carregando: o play vira um anel girando, a capa continua visível */
.video__player.is-carregando .video__capa {
  cursor: progress;
}

.video__player.is-carregando .video__botao-play::before {
  animation: none;
}

.video__player.is-carregando .video__botao-play svg {
  opacity: 0;
}

.video__player.is-carregando .video__botao-play::after {
  opacity: 1;
  animation: videoGiro 0.9s linear infinite;
}

/* Reproduzindo: a capa some e o vídeo aparece */
.video__player.is-reproduzindo .video__capa {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}


/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes videoPulso {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0;    transform: scale(1.55); }
}

@keyframes videoGiro {
  to { transform: rotate(360deg); }
}


/* ============================================================
   TABLET (576px+)
   ============================================================ */
@media (min-width: 576px) {
  .video {
    padding: 88px 32px 104px;
  }

  .video__titulo {
    font-size: 42px;
  }

  .video__texto {
    font-size: 16px;
  }

  .video__midia {
    margin: 0 14px 14px 0;
  }

  .video__midia::before {
    top: 14px;
    left: 14px;
    right: -14px;
    bottom: -14px;
  }

  .video__botao-play {
    top: 46%;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
  }

  .video__botao-play svg {
    width: 26px;
    height: 26px;
  }

  .video__legenda {
    padding: 0 24px 22px;
  }

  .video__legenda-titulo {
    font-size: 28px;
  }

  .video__legenda-texto {
    display: block;
  }

  .video__selo {
    display: inline-block;
  }
}


/* ============================================================
   DESKTOP (992px+): texto à esquerda, vídeo à direita
   ============================================================ */
@media (min-width: 992px) {
  .video {
    padding: 128px 32px 144px;
  }

  .video__container {
    grid-template-columns: 5fr 7fr;
    align-items: center;
    gap: 80px;
  }

  .video__titulo {
    font-size: 48px;
  }

  .video__midia {
    margin: 0 16px 16px 0;
  }

  .video__midia::before {
    top: 16px;
    left: 16px;
    right: -16px;
    bottom: -16px;
  }

  .video__legenda {
    padding: 0 32px 28px;
  }

  .video__legenda-titulo {
    font-size: 32px;
  }
}


/* ============================================================
   HOVER (só em telas com mouse)
   ============================================================ */
@media (hover: hover) {
  .video__capa:hover .video__poster {
    transform: scale(1.05);
  }

  .video__capa:hover .video__botao-play {
    background-color: #1FB4B0;
    border-color: #1FB4B0;
    transform: scale(1.08);
  }

  .video__capa:hover .video__botao-play svg {
    fill: #1E3A38;
  }

  .video__capa:hover .video__selo {
    color: #1E3A38;
    background-color: #FFFDF8;
    border-color: #FFFDF8;
  }
}


/* ============================================================
   MOVIMENTO REDUZIDO
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .video__botao-play::before {
    animation: none;
  }

  .video__poster,
  .video__capa:hover .video__poster {
    transition: none;
    transform: none;
  }

  .video__capa,
  .video__player.is-reproduzindo .video__capa {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}