/* ============================================================
   STYLE.CSS — Matheus Willers | Instrutor de Trânsito
   Complemento ao Tailwind CSS
============================================================ */

/* --- SMOOTH SCROLL --- */
html {
  scroll-behavior: smooth;
}

/* --- SCROLL OFFSET para header sticky --- */
section[id] {
  scroll-margin-top: 80px;
}

/* --- SELEÇÃO DE TEXTO --- */
::selection {
  background-color: #1F1F1F;
  color: #fff;
}

/* --- TRANSIÇÕES GLOBAIS --- */
a, button {
  transition: all 0.2s ease;
}

/* --- SEÇÕES ESCTURAS BG FALLBACK --- */
#inicio {
  background-color: #F3F3F1;
}

#habilitados,
#contato {
  background-color: #1F1F1F;
}

/* --- CARD HOVER LIFT --- */
article.bg-brand-white {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

article.bg-brand-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* --- BOTÃO WHATSAPP FLUTUANTE (ÚNICO COM VERDE) --- */
#whatsapp-float {
  animation: pulse-green 2.5s infinite;
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
  }
}

/* --- ACCORDION TRANSITION --- */
[x-show][x-transition] {
  transition: all 0.2s ease;
}

/* --- IMAGENS --- */
img {
  display: block;
  max-width: 100%;
}

.hero-top-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
}

.sobre-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: 50% 25%; /* Alinhamento focado no rosto e tronco superior */
}

/* --- FOCUS RING ACESSIBILIDADE --- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #1F1F1F;
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- PRINT --- */
@media print {
  #whatsapp-float,
  #header { display: none; }
}

/* ============================================================
   RESPONSIVIDADE MOBILE — max-width: 768px
============================================================ */
@media (max-width: 768px) {

  /* Scroll offset menor no mobile */
  section[id] {
    scroll-margin-top: 64px;
  }

  /* CABEÇALHO */
  #header .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* HERO */
  #inicio {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  #inicio h1 {
    font-size: 1.625rem;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  #inicio .mb-5 a {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  #inicio p.flex {
    justify-content: flex-start;
  }

  /* SEÇÃO SOBRE */
  #sobre .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  #sobre h2 {
    font-size: 1.5rem;
  }

  #sobre a#sobre-cta {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* SERVIÇOS / CARDS DE AULAS */
  #servicos .grid {
    grid-template-columns: 1fr !important;
  }

  #servicos h2 {
    font-size: 1.5rem;
  }

  #servicos .mt-12 a {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* COMO FUNCIONA */
  #como-funciona .grid {
    grid-template-columns: 1fr !important;
  }

  #como-funciona h2 {
    font-size: 1.5rem;
  }

  #como-funciona .mt-14 a {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* GALERIA NA PRÁTICA */
  #aulas-na-pratica .grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  #aulas-na-pratica h2 {
    font-size: 1.5rem;
  }

  #aulas-na-pratica .h-64 {
    height: 240px;
  }

  /* DIFERENCIAIS */
  #diferenciais .grid {
    grid-template-columns: 1fr !important;
  }

  #diferenciais h2 {
    font-size: 1.5rem;
  }

  /* AVALIAÇÕES / DEPOIMENTOS */
  #avaliacoes .grid {
    grid-template-columns: 1fr !important;
  }

  #avaliacoes h2 {
    font-size: 1.5rem;
  }

  #avaliacoes .text-center a {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* CIDADES / REGIÃO */
  #regiao .grid {
    grid-template-columns: 1fr !important;
  }

  #regiao h2 {
    font-size: 1.5rem;
  }

  /* FAQ */
  #faq h2 {
    font-size: 1.5rem;
  }

  #faq .mt-12 a {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* CTA FINAL */
  #contato h2 {
    font-size: 1.5rem;
  }

  #contato a {
    width: 100%;
    display: flex;
    justify-content: center;
    max-width: 320px;
    margin: 0 auto;
  }

  /* RODAPÉ */
  #rodape .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  #rodape {
    padding-top: 2.5rem;
  }

  /* Ajuste do copyright bar no mobile */
  #rodape + div .flex {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  /* WHATSAPP FLUTUANTE */
  #whatsapp-float {
    bottom: 18px !important;
    right: 18px !important;
    width: 52px;
    height: 52px;
  }

  /* PADDING GERAL DOS CONTAINERS */
  .max-w-7xl,
  .max-w-5xl,
  .max-w-3xl,
  .max-w-6xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Evitar scroll horizontal */
  body {
    overflow-x: hidden;
  }
}

/* ============================================================
   RESPONSIVIDADE MOBILE — max-width: 480px
============================================================ */
@media (max-width: 480px) {

  /* Títulos ainda menores em telas muito pequenas */
  h1 {
    font-size: 1.5rem !important;
    line-height: 1.25 !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  /* Hero */
  #inicio {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  #inicio .h-\[320px\] {
    height: 180px !important;
  }

  /* Cards com padding menor */
  article {
    padding: 1rem !important;
  }

  /* Botões mobile pequenos — largura total */
  a.inline-flex,
  a.flex {
    font-size: 0.9rem;
  }

  /* WhatsApp flutuante */
  #whatsapp-float {
    width: 48px;
    height: 48px;
    bottom: 16px !important;
    right: 16px !important;
  }

  #whatsapp-float svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* FAQ itens */
  #faq button {
    font-size: 0.875rem;
    padding: 1rem;
  }

  /* Destaques hero (DETRAN e Desde 2017) */
  #inicio .grid-cols-1 {
    grid-template-columns: 1fr !important;
  }
}
