/* ============================================================
   CASA DAS PALMEIRAS · VARIANTE "vídeo no hero"
   ------------------------------------------------------------
   Carregue DEPOIS de styles.css. Esta folha não altera nenhuma
   outra seção: tudo aqui está preso a `.hero--split` ou a
   `.hero-video*`, classes que só existem nesta variante.

   Desktop (>= 1024px): hero em duas colunas, texto na 1 e vídeo na 2.
   Abaixo disso: hero volta a ser a tela cheia de sempre e o vídeo
   vira a segunda faixa da página, com fundo próprio.

   Trocar o formato do card é uma linha só: --hero-video-ratio.
   9 / 16 = o vídeo inteiro, sem corte (padrão).
   4 / 5  = retrato mais curto; o object-fit: cover corta topo e base.
   ============================================================ */

:root {
  --hero-video-ratio: 9 / 16;
}

/* ---------- BASE = MOBILE: empilhado, vídeo em segundo ---------- */

.hero--split {
  display: block;
  height: auto;
  min-height: 0;
  align-items: initial;
}

/* A foto ocupa exatamente a primeira tela; a faixa do vídeo vem depois. */
.hero--split .hero__img-wrap {
  height: 100vh;
  bottom: auto;
}

.hero--split .hero__grid {
  position: relative;
  z-index: 1;
}

.hero--split .hero__content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Segunda faixa: fundo areia opaco, por cima da foto do hero. */
.hero--split .hero__media {
  position: relative;
  z-index: 1;
  background: var(--bg-alt);
  padding: 3.5rem 1.25rem 4rem;
}

/* ---------- O CARD DE VÍDEO ---------- */

.hero-video {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.125rem;
}

.hero-video__frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: var(--hero-video-ratio);
  overflow: hidden;
  border-radius: 12px;
  background: var(--primary-deep);
}

.hero-video__el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}

/* Botão de play/pause: o autoplay é mudo e em loop, então o visitante
   precisa de um jeito óbvio de parar. Serve também para quem chega com
   o autoplay bloqueado pelo navegador. */
/* Os dois controles vivem numa linha no canto inferior esquerdo. O canto
   direito é do teaser fixo do WhatsApp (.wa-teaser, bottom 5.75rem /
   right 1.5rem), que cobria o botão de pausa. */
.hero-video__ctls {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.hero-video__toggle,
.hero-video__sound {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(250, 248, 243, 0.4);
  border-radius: 999px;
  background: rgba(26, 47, 38, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #FAF8F3;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 200ms ease, background 200ms ease;
}
.hero-video__toggle:hover,
.hero-video__sound:hover { border-color: var(--accent-soft); }
.hero-video__toggle:focus-visible,
.hero-video__sound:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* Alto-falante: as ondas aparecem quando o som está ligado, o risco quando não. */
.hero-video__spk { display: inline-flex; }
.hero-video__sound[data-muted="true"]  .hero-video__spk-on,
.hero-video__sound[data-muted="false"] .hero-video__spk-off { display: none; }
.hero-video__sound[data-muted="true"]  .hero-video__word--mute,
.hero-video__sound[data-muted="false"] .hero-video__word--unmute { display: none; }

/* Só ícone. O card tem ~228px de largura no desktop e dois botões com
   texto estouravam para cima do teaser do WhatsApp. O rótulo continua
   no HTML, visível só para leitor de tela. */
.hero-video__word {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hero-video__toggle,
.hero-video__sound { padding: 0.5rem 0.625rem; gap: 0; }

.hero-video__glyph { display: inline-block; }
.hero-video__toggle[data-playing="false"] .hero-video__glyph {
  width: 0;
  height: 0;
  border-left: 9px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.hero-video__toggle[data-playing="true"] .hero-video__glyph {
  width: 9px;
  height: 10px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.hero-video__toggle[data-playing="false"] .hero-video__word--pause,
.hero-video__toggle[data-playing="true"] .hero-video__word--play { display: none; }

/* Legenda fora da imagem, nunca por cima dela. */
.hero-video__caption {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.65;
  font-weight: 300;
  color: var(--fg-soft);
  text-align: center;
  max-width: 21rem;
}

.hero-video__link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent-text);
  border-bottom: 1px solid rgba(184, 132, 31, 0.4);
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}
.hero-video__link:hover { color: var(--accent); border-color: var(--accent); }
.hero-video__link .arrow { display: inline-block; transition: transform 200ms ease; }
.hero-video__link:hover .arrow { transform: translateY(2px); }

/* Tablet e celular grande: a faixa respira mais e o card cresce um pouco. */
@media (min-width: 640px) and (max-width: 1023px) {
  .hero--split .hero__media { padding: 4.5rem 2rem 5rem; }
  .hero-video__frame { max-width: 340px; }
}

/* ---------- DESKTOP: duas colunas ---------- */

@media (min-width: 1024px) {
  .hero--split {
    display: flex;
    align-items: flex-end;
    height: 100vh;
    min-height: 680px;
  }

  .hero--split .hero__img-wrap {
    height: auto;
    bottom: 0;
  }

  .hero--split .hero__grid {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem 5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4rem;
    align-items: end;
  }

  .hero--split .hero__content {
    min-height: 0;
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .hero--split .hero__media {
    background: transparent;
    padding: 0;
  }

  /* Legenda ACIMA do card: embaixo ela ficava debaixo do teaser fixo
     do WhatsApp e era cortada no meio. */
  .hero-video { align-items: flex-start; gap: 1rem; flex-direction: column-reverse; }

  /* Altura mandando na largura: assim o card nunca vira uma parede.
     52vh cabe folgado num notebook de 800px de altura. */
  .hero-video__frame {
    width: auto;
    max-width: none;
    height: clamp(340px, 52vh, 560px);
    box-shadow: 0 24px 60px rgba(26, 47, 38, 0.45);
  }

  .hero-video__caption {
    color: rgba(250, 248, 243, 0.85);
    text-align: left;
    max-width: 19rem;
  }

  .hero-video__link {
    color: var(--accent-soft);
    border-bottom-color: rgba(217, 178, 106, 0.45);
  }
  .hero-video__link:hover { color: #FAF8F3; border-color: #FAF8F3; }
}

/* Telas largas e baixas (notebook 1440x800): não deixa o card comer o texto. */
@media (min-width: 1024px) and (max-height: 760px) {
  .hero-video__frame { height: clamp(300px, 46vh, 420px); }
  .hero--split .hero__grid { padding-bottom: 3.5rem; gap: 3rem; }
}

/* Quem pede menos movimento não recebe autoplay (o JS respeita isso);
   aqui só garantimos que o botão de play fique visível de cara. */
@media (prefers-reduced-motion: reduce) {
  .hero-video__toggle,
  .hero-video__sound { background: rgba(26, 47, 38, 0.75); }
}
