/* ==========================================================================
   Fórum do Agronegócio 2027 - estilos base compartilhados
   Tokens do Figma estão no tailwind.config inline de cada página.
   Aqui ficam: fontes, animações (com prefers-reduced-motion),
   sistema de placeholders cinza e ajustes que o Tailwind CDN não cobre.
   ========================================================================== */

:root {
  --accent: #04223A;
  --secondary: #3A6F98;
  --primary: #8D4A2A;
  --mint: #EEF4FB;
  --background: #EEF3F8;
  --lime: #E08B4F;
}

html {
  scroll-behavior: smooth;
  /* compensa o header fixo ao pular para âncoras */
  scroll-padding-top: 120px;
  /* iOS/Safari: não inflar o texto ao girar para paisagem */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* iOS: remove o flash cinza ao tocar em links/botões */
  -webkit-tap-highlight-color: transparent;
  /* evita rolagem horizontal acidental em telas pequenas */
  overflow-x: hidden;
}

/* iOS/Safari: `vh` inclui a barra de endereço e faz o hero "pular".
   dvh acompanha a barra dinâmica; vh fica de fallback p/ browsers antigos.
   O seletor de ID vence a utility min-h-[88vh] por especificidade. */
#hero {
  min-height: 88vh;
  min-height: 88dvh;
}

.font-display {
  font-family: "Special Gothic Expanded One", system-ui, sans-serif;
}

/* --------------------------------------------------------------------------
   Sistema de placeholders cinza (sinaliza assets que o Caio troca depois).
   Uso: <div class="ph" data-ph="Foto edição 2024"></div>
   ou em <img class="ph-img" onerror="..."> com fallback.
   -------------------------------------------------------------------------- */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #3A6F98, #04223A);
  overflow: hidden;
  isolation: isolate;
}
.ph::after {
  content: attr(data-ph);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(243, 250, 249, .72);
  text-transform: uppercase;
}
/* variante clara para fundos claros */
.ph--light {
  background:
    repeating-linear-gradient(45deg, rgba(4, 34, 58, .03) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.ph--light::after { color: rgba(58, 111, 152, .65); }

/* logo placeholder (caixa branca com texto "logo ipsum") */
.ph-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: .01em;
}

/* --------------------------------------------------------------------------
   Hero - vídeo de fundo + ken burns no poster enquanto carrega
   -------------------------------------------------------------------------- */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
/* fundo de segurança caso o vídeo dummy não carregue */
.hero-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 70% 10%, rgba(224, 139, 79, .30), transparent 60%),
    linear-gradient(135deg, #3A6F98, #04223A 70%);
}
.ken-burns { animation: kenBurns 20s ease-in-out infinite alternate; }
@keyframes kenBurns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* --------------------------------------------------------------------------
   Reveal on scroll (fade-in / slide-up) via IntersectionObserver (main.js)
   -------------------------------------------------------------------------- */
/* reveal via animation (não transition) para não interferir nas transições
   de hover/cor dos próprios elementos revelados */
.reveal {
  opacity: 0;
  will-change: opacity, transform;
}
.reveal.is-visible {
  animation: revealUp .7s cubic-bezier(.16, 1, .3, 1) both;
}
.reveal[data-delay="1"].is-visible { animation-delay: .08s; }
.reveal[data-delay="2"].is-visible { animation-delay: .16s; }
.reveal[data-delay="3"].is-visible { animation-delay: .24s; }
.reveal[data-delay="4"].is-visible { animation-delay: .32s; }
@keyframes revealUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Contador regressivo - barra fina sticky sob o header
   -------------------------------------------------------------------------- */
.countdown-bar {
  transform: translateY(-130%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), opacity .3s ease, visibility .3s ease;
}
.countdown-bar.is-active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Carrossel horizontal (palestrantes) - scroll-snap sem barra visível
   -------------------------------------------------------------------------- */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.no-scrollbar::-webkit-scrollbar { display: none; }

.carousel-btn {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(58, 111, 152, .35);
  color: #3A6F98;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.carousel-btn:hover { border-color: #E08B4F; color: #E08B4F; }
/* variante para fundos escuros */
.carousel-btn--dark { border-color: rgba(58, 111, 152, .35); color: #3A6F98; }

/* --------------------------------------------------------------------------
   Cards - hover
   -------------------------------------------------------------------------- */
.card-hover {
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(4, 34, 58, .16);
}

/* --------------------------------------------------------------------------
   Modal (palestrantes / programação)
   -------------------------------------------------------------------------- */
.modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
}
.modal__panel {
  transform: translateY(16px) scale(.98);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.modal.is-open .modal__panel {
  transform: none;
}

/* --------------------------------------------------------------------------
   Toggle de patrocinadores A/B
   -------------------------------------------------------------------------- */
.sponsors-view { display: none; }
.sponsors-view.is-active { display: block; }
.numbers-view { display: none; }
.numbers-view.is-active { display: block; }
.toggle-btn { transition: background-color .25s ease, color .25s ease; }

/* acordeão da programação */
.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
}
.acc-item.is-open .acc-body { max-height: 600px; }
.acc-item.is-open .acc-chevron { transform: rotate(180deg); }
.acc-chevron { transition: transform .3s ease; }

/* --------------------------------------------------------------------------
   Botão INGRESSOS - formato de ticket (notches nas laterais), do Figma.
   Mantém o token verde (bg-primary); os notches recortam revelando o fundo.
   -------------------------------------------------------------------------- */
.btn-ticket {
  --notch: 9px;
  border-radius: 9px;
  -webkit-mask:
    radial-gradient(circle var(--notch) at left center, #0000 var(--notch), #000 calc(var(--notch) + 0.5px)),
    radial-gradient(circle var(--notch) at right center, #0000 var(--notch), #000 calc(var(--notch) + 0.5px));
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

/* mobile nav */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.mobile-menu.is-open { max-height: 380px; }

/* --------------------------------------------------------------------------
   Respeitar prefers-reduced-motion: desliga todas as animações
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .ken-burns { animation: none; }
}
