/* ==========================================================================
   ABRAC EM MOVIMENTO - FRONTEND STYLES
   Design System Fiel 100% ao Original:
   - Fundo Branco Puro (#ffffff)
   - Título "ABRAC EM MOVIMENTO" em UMA LINHA, no espaço superior
   - Imagens com ALTURAS VARIADAS e DESLOCAMENTO IRREGULAR para cima e para baixo
   - Espaço elegante entre a base das imagens e a régua interativa (timeline)
   - Hover Labels Elegantes (Número no topo, nome na base)
   - Régua em Canvas Interativa com traços e onda no hover
   - Compatibilidade Total com WordPress 6.x e Divi 4.x / 5.x
   ========================================================================== */

@font-face {
  font-family: 'PP Neue Montreal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/PPNeueMontreal-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'PP Neue Montreal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/PPNeueMontreal-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'PP Neue Montreal Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/PPNeueMontrealMono-Medium.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   Garante que o overflow do documento NÃO quebre o position: sticky
   -------------------------------------------------------------------------- */
html, body {
  overflow-x: clip !important;
}

/* Resets específicos para o tema Divi (Divi 4.x e Divi 5.x) */
.et_pb_section:has(.abrac-scroll-wrapper),
.et_pb_row:has(.abrac-scroll-wrapper),
.et_pb_column:has(.abrac-scroll-wrapper),
.et_pb_code:has(.abrac-scroll-wrapper),
.et_pb_code_inner:has(.abrac-scroll-wrapper),
.et_pb_module:has(.abrac-scroll-wrapper) {
  overflow: visible !important;
  overflow-x: clip !important;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Scroll Wrapper & Sticky Viewport (Fundo Branco #ffffff)
   -------------------------------------------------------------------------- */
.abrac-scroll-wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #000000;
  font-family: 'PP Neue Montreal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: visible !important;
  /* min-height removido: a altura real será injetada apenas via Javascript no frontend */
  display: block;
}

.abrac-sticky-viewport {
  position: -webkit-sticky;
  position: sticky;
  top: 110px; /* Offset para o menu fixo do site (Desktop) */
  left: 0;
  width: 100%;
  height: calc(100vh - 110px); /* Ajusta a altura considerando o offset do menu */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Alinha no topo (logo abaixo do menu) */
  align-items: center;
  background-color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  z-index: 100;
}

/* Regras de Proteção ABSOLUTA para o Divi Visual Builder via CSS */
body.et-fb .abrac-scroll-wrapper,
body.et_pb_is_pagebuilder .abrac-scroll-wrapper,
.et-fb-root-ancestor .abrac-scroll-wrapper {
  height: auto !important;
  min-height: auto !important;
}

body.et-fb .abrac-sticky-viewport,
body.et_pb_is_pagebuilder .abrac-sticky-viewport,
.et-fb-root-ancestor .abrac-sticky-viewport {
  position: relative !important;
  height: auto !important;
  top: 0 !important;
  padding-bottom: 50px !important;
}

/* --------------------------------------------------------------------------
   Tipografia do Topo: "ABRAC EM MOVIMENTO"
   -------------------------------------------------------------------------- */
.abrac-headline-container {
  display: none; /* Removido conforme solicitado */
}

.abrac-carousel-container {
  position: relative;
  width: 100%;
  height: auto; /* Muda de 100% para auto para não empurrar a timeline */
  display: flex;
  align-items: flex-start;
  cursor: grab;
  z-index: 5;
  touch-action: pan-y;
  padding-top: 20px; /* Respiro entre o menu do site e os cards */
}

.abrac-carousel-container.is-dragging {
  cursor: grabbing;
}

.abrac-slides-track {
  position: relative;
  display: flex;
  align-items: flex-start;
  height: auto;
  padding-top: 0;
  padding-bottom: 0; /* Remove padding bottom gigante para colar a timeline */
  will-change: transform;
  padding-left: 0;
  box-sizing: border-box;
  touch-action: pan-y;
}

/* --------------------------------------------------------------------------
   Cards Individuais: DESLOCAMENTOS IRREGULARES (Para Cima e Para Baixo)
   Rhythm editorial original com alturas variadas e ondulação suave
   -------------------------------------------------------------------------- */
.abrac-slide {
  position: relative;
  flex-shrink: 0;
  margin-right: clamp(1.4rem, 2.2vw, 2.8rem);
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Variação rítmica sutil que complementa as diferentes proporções de aspecto */
.abrac-slide:nth-child(odd) {
  transform: translateY(8px);
}

.abrac-slide:nth-child(even) {
  transform: translateY(-12px);
}

.abrac-slide:nth-child(3n) {
  transform: translateY(-18px);
}

.abrac-slide:nth-child(4n) {
  transform: translateY(14px);
}

.abrac-slide:nth-child(5n) {
  transform: translateY(-6px);
}

/* Formato 1: Pôster Alto & Estreito (Estilo Better Off Florida / BO®S Launch) */
.abrac-slide--tall {
  width: clamp(230px, 19vw, 310px);
}
.abrac-slide--tall .abrac-media-box {
  aspect-ratio: 1 / 1.76;
  max-height: min(62vh, 580px);
}

/* Formato 2: Retrato Padrão Editorial (Estilo Colete Azul / Surfista no Tubo) */
.abrac-slide--portrait {
  width: clamp(240px, 20vw, 320px);
}
.abrac-slide--portrait .abrac-media-box {
  aspect-ratio: 1 / 1.333;
  max-height: min(53vh, 480px);
}

/* Formato 3: Clássico Médio Editorial */
.abrac-slide--standard {
  width: clamp(240px, 20vw, 320px);
}
.abrac-slide--standard .abrac-media-box {
  aspect-ratio: 1 / 1.25;
  max-height: min(49vh, 440px);
}

/* Formato 4: Quadrado (Estilo Slick Rick com Coroa) */
.abrac-slide--square {
  width: clamp(240px, 20vw, 320px);
}
.abrac-slide--square .abrac-media-box {
  aspect-ratio: 1 / 1.0;
  max-height: min(42vh, 360px);
}

/* Formato 5: Paisagem / Retângulo Amplo Horizontal */
.abrac-slide--wide {
  width: clamp(270px, 23vw, 370px);
}
.abrac-slide--wide .abrac-media-box {
  aspect-ratio: 1 / 0.84;
  max-height: min(36vh, 310px);
}

.abrac-card-inner {
  position: relative;
  width: 100%;
  transition: transform 0.25s ease-out;
  transform-style: preserve-3d;
}

/* Caixa de Imagem */
.abrac-media-box {
  position: relative;
  width: 100%;
  background-color: #f2f2f2;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.abrac-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
  transform-origin: center center;
}

.abrac-slide:hover .abrac-media-img {
  transform: scale(1.04);
}

/* Badge Decorativo (Canto Inferior Direito da Imagem) */
.abrac-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #000000;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.abrac-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Hover Labels (Rótulo na Base alinhado à esquerda com espaçamento natural)
   - Títulos completos em até 2 linhas sem cortar
   - Alinhamento à esquerda sem espaços estranhos entre palavras
   -------------------------------------------------------------------------- */
.abrac-label-bottom {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  font-family: 'PP Neue Montreal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: normal;
  word-spacing: normal;
  color: #000000;
  line-height: 1.25;
  text-align: left !important;
}

.abrac-label-bottom span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  text-overflow: ellipsis;
  max-width: 100%;
  text-transform: uppercase;
  text-align: left !important;
  letter-spacing: normal;
  word-spacing: normal;
  transform: translateY(-115%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  word-break: normal;
  overflow-wrap: break-word;
}

.abrac-slide:hover .abrac-label-bottom span {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Linha do Tempo em Canvas (Régua Interativa na Base)
   Agora no fluxo normal para ficar colada logo abaixo dos cards
   -------------------------------------------------------------------------- */
.abrac-timeline-wrapper {
  position: relative; /* Remove o absolute para colar aos cards */
  width: 100%;
  height: 44px;
  margin-top: clamp(65px, 8vh, 85px); /* Espaço entre a base das fotos/títulos e a timeline */
  z-index: 15;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}

.abrac-timeline-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* --------------------------------------------------------------------------
   Mobile Adaptations
   - Título em uma linha preservado
   - Deslocamento ondulante proporcional no mobile
   - Espaço limpo e respiro acima da timeline
   - Títulos alinhados à esquerda sempre visíveis
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .abrac-sticky-viewport {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 70px !important;
    height: auto !important; /* Em vez de 100vh, pega apenas a altura real dos cards para revelar a próxima seção mais rápido no fim do scroll */
    justify-content: flex-start !important;
    padding-bottom: 30px; /* Respiro abaixo da régua */
  }

  .abrac-headline-container {
    display: none;
  }

  .abrac-carousel-container {
    align-items: flex-start !important; 
    padding-top: 20px; /* Folga da borda */
    box-sizing: border-box;
  }

  .abrac-slides-track {
    align-items: flex-start !important;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* ... outros estilos ... */
  .abrac-slide {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
  }

  .abrac-slide:nth-child(odd) {
    transform: translateY(6px);
  }
  .abrac-slide:nth-child(even) {
    transform: translateY(-8px);
  }
  .abrac-slide:nth-child(3n) {
    transform: translateY(-12px);
  }
  .abrac-slide:nth-child(4n) {
    transform: translateY(8px);
  }

  .abrac-slide {
    width: clamp(230px, 70vw, 290px);
    margin-right: 1.25rem;
  }

  .abrac-slide--tall .abrac-media-box {
    aspect-ratio: 1 / 1.6;
    max-height: 48vh;
  }

  .abrac-slide--portrait .abrac-media-box {
    aspect-ratio: 1 / 1.3;
    max-height: 44vh;
  }

  .abrac-slide--standard .abrac-media-box {
    aspect-ratio: 1 / 1.2;
    max-height: 40vh;
  }

  .abrac-slide--square .abrac-media-box {
    aspect-ratio: 1 / 1.0;
    max-height: 35vh;
  }

  .abrac-slide--wide {
    width: clamp(240px, 76vw, 320px);
  }
  .abrac-slide--wide .abrac-media-box {
    aspect-ratio: 1 / 0.84;
    max-height: 30vh;
  }

  .abrac-badge {
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
  }

  .abrac-badge svg {
    width: 14px;
    height: 14px;
  }

  .abrac-label-bottom {
    text-align: left !important;
  }

  .abrac-label-bottom span {
    transform: translateY(0) !important;
    font-size: 0.76rem;
    line-height: 1.25;
    text-align: left !important;
    letter-spacing: normal;
    word-spacing: normal;
  }
  
  .abrac-timeline-wrapper {
    margin-top: 45px; /* Timeline colada logo abaixo dos cards */
    height: 36px;
    bottom: auto; /* Remove qualquer conflito anterior */
  }
}
