/* ==========================================================================
   Dr. Arthur Costa — Oftalmologia
   Componentes customizados (complementam o Tailwind via CDN)
   Paleta oficial (manual de marca):
     navy-950 #0A153A | navy-900 #0E225E | navy-700 #303F77
     navy-500 #304BA0 | navy-300 #6679B4
   ========================================================================== */

:root {
  --navy-950: #0A153A;
  --navy-900: #0E225E;
  --navy-700: #303F77;
  --navy-500: #304BA0;
  --navy-300: #6679B4;
  --sand-50: #F9FAFC;
  --sand-100: #F1F4F9;
  /* Fonte de marca: "Fraunces" (serif editorial premium). Pode ser trocada
     pela "Aorell" licenciada — ver branding/apresentacao-logotipo.pdf */
  --font-brand: "Fraunces", serif;
  --font-sans: "Poppins", sans-serif;
}

/* Refinamento tipográfico premium dos títulos (eixo óptico de display,
   ligaduras e espaçamento levemente comprimido) */
.font-brand,
.section-title,
.journey-number,
.stat-number {
  font-family: var(--font-brand);
  font-variation-settings: "opsz" 72;
  font-feature-settings: "liga" 1;
  letter-spacing: -0.015em;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* compensa o header fixo nos links âncora */
}

/* ==========================================================================
   MOBILE / ANTI-OVERFLOW
   Nada pode gerar rolagem horizontal: a tela não "desliza" para o lado.
   ========================================================================== */

html, body {
  max-width: 100%;
  overflow-x: hidden; /* fallback */
  overflow-x: clip;   /* não cria contêiner de scroll (melhor com Lenis) */
}

img, svg, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Textos longos nunca estouram a largura */
h1, h2, h3, p, li, a {
  overflow-wrap: break-word;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

/* Estado inicial: transparente sobre o hero navy */
#site-header {
  background: transparent;
}

#site-header #desktop-nav a,
#site-header #btn-open-mobile-nav {
  color: #ffffff;
}

/* Logo oficial — troca entre versão negativa e escura conforme o estado */
.logo-img {
  height: 44px;
  width: auto;
  display: block;
}

/* Telas pequenas: logo menor para nunca disputar espaço com o botão do menu */
@media (max-width: 480px) {
  .logo-img { height: 32px; }
}

.site-logo .logo-dark { display: none; }

#site-header.header-scrolled .site-logo .logo-light { display: none; }
#site-header.header-scrolled .site-logo .logo-dark { display: block; }

/* Estado "scrolled" (adicionado via js/main.js) */
#site-header.header-scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px -8px rgba(10, 21, 58, 0.12);
}

#site-header.header-scrolled #desktop-nav a,
#site-header.header-scrolled #btn-open-mobile-nav {
  color: var(--navy-950);
}

/* Links de navegação */
.nav-link {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--navy-300);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.mobile-nav-link {
  display: block;
  padding: 12px 8px;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-link:hover {
  background: var(--sand-100);
  color: var(--navy-500);
}

/* ==========================================================================
   TIPOGRAFIA DE SEÇÃO
   ========================================================================== */

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy-500);
  margin-bottom: 16px;
}

.section-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--navy-500);
  border-radius: 2px;
}

.section-eyebrow.justify-center {
  justify-content: center;
}

.section-title {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy-950);
}

/* ==========================================================================
   LISTAS DE CREDENCIAIS
   ========================================================================== */

.credential-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--navy-700);
}

/* Conteúdo com elementos inline (<em>, <strong>) fica agrupado num único
   bloco de texto — evita que o flex distribua as palavras em colunas */
.credential-item span {
  flex: 1;
  min-width: 0;
}

.credential-item i {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(48, 75, 160, 0.1);
  color: var(--navy-500);
  font-size: 0.85rem;
  margin-top: 1px;
}

/* ==========================================================================
   CARDS DE SERVIÇOS / ESPECIALIDADES
   ========================================================================== */

.service-card {
  background: #ffffff;
  border: 1px solid rgba(10, 21, 58, 0.06);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 8px 24px -8px rgba(10, 21, 58, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px -15px rgba(10, 21, 58, 0.25);
}

.service-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--navy-500), var(--navy-900));
  color: #ffffff;
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.service-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--navy-950);
  margin-bottom: 14px;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--navy-700);
}

.service-list li {
  position: relative;
  padding-left: 20px;
}

.service-list li::before {
  content: "\f00c"; /* check (Font Awesome) */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.65rem;
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--navy-300);
}

/* Cards de destaque (fundo navy) */
.highlight-card {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-950));
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 20px 45px -15px rgba(10, 21, 58, 0.25);
}

/* ==========================================================================
   JORNADA DA CIRURGIA REFRATIVA
   ========================================================================== */

.journey-list {
  display: grid;
  gap: 16px;
  counter-reset: journey;
}

@media (min-width: 1024px) {
  .journey-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.journey-step {
  background: var(--sand-50);
  border: 1px solid rgba(10, 21, 58, 0.06);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.journey-step:hover {
  transform: translateY(-4px);
  border-color: rgba(48, 75, 160, 0.35);
  box-shadow: 0 8px 24px -8px rgba(10, 21, 58, 0.12);
}

.journey-number {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-300);
  line-height: 1;
}

.journey-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy-950);
  margin-bottom: 6px;
}

.journey-desc {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--navy-700);
}

/* Caixas de estatística */
.stat-box {
  background: #ffffff;
  border: 1px solid rgba(10, 21, 58, 0.08);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 8px 24px -8px rgba(10, 21, 58, 0.12);
}

.stat-number {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-500);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--navy-700);
  line-height: 1.5;
}

/* ==========================================================================
   DIFERENCIAIS (fundo navy)
   ========================================================================== */

.diff-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 24px;
  transition: background 0.25s ease, transform 0.25s ease;
}

.diff-card:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-4px);
}

.diff-card i {
  font-size: 1.4rem;
  color: var(--navy-300);
  margin-bottom: 16px;
  display: block;
}

.diff-card h3 {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.diff-card p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
}

/* ==========================================================================
   NA MÍDIA
   ========================================================================== */

.media-card {
  display: flex;
  background: #ffffff;
  border: 1px solid rgba(10, 21, 58, 0.06);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(10, 21, 58, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px -15px rgba(10, 21, 58, 0.25);
}

.media-photo {
  width: 150px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center top; /* mantém o rosto visível no recorte */
}

.media-body {
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(48, 75, 160, 0.1);
  color: var(--navy-500);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-body h3 {
  margin: 0;
  font-family: var(--font-brand);
  font-variation-settings: "opsz" 40;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy-950);
}

.media-body p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--navy-700);
}

.media-link {
  margin-top: auto;
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-500);
  text-decoration: none;
  transition: color 0.2s ease, gap 0.2s ease;
}

.media-link:hover {
  color: var(--navy-900);
  gap: 12px;
}

.media-link i { font-size: 0.7rem; }

@media (max-width: 640px) {
  .media-card {
    flex-direction: column;
    border: 1px solid rgba(10, 21, 58, 0.1);
    border-radius: 18px;
  }

  .media-photo {
    width: 100%;
    height: 300px;
    object-position: center 12%;
  }

  .media-body {
    padding: 22px 20px 26px;
    gap: 12px;
  }

  .media-body h3 {
    font-size: 1.05rem;
    line-height: 1.4;
  }

  .media-body p {
    font-size: 0.85rem;
  }

  .media-link {
    margin-top: 4px;
    padding: 10px 18px;
    border: 1px solid rgba(48, 75, 160, 0.35);
    border-radius: 999px;
  }
}

/* ==========================================================================
   DEPOIMENTOS
   ========================================================================== */

.testimonial-card {
  background: var(--sand-50);
  border: 1px solid rgba(10, 21, 58, 0.06);
  border-radius: 20px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

.testimonial-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--navy-900);
  font-style: italic;
}

.testimonial-card footer {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--navy-300);
}

/* ==========================================================================
   FAQ / ACCORDION
   ========================================================================== */

.faq-item {
  background: #ffffff;
  border: 1px solid rgba(10, 21, 58, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.faq-item.open {
  box-shadow: 0 8px 24px -8px rgba(10, 21, 58, 0.12);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--navy-950);
  padding: 18px 22px;
  cursor: pointer;
  background: transparent;
  border: 0;
  font-family: inherit;
}

.faq-question i {
  flex-shrink: 0;
  color: var(--navy-500);
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-answer p {
  padding: 0 22px 20px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--navy-700);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer-link {
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--navy-300);
}

.social-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
  background: var(--navy-500);
  transform: translateY(-2px);
}

/* ==========================================================================
   BOTÃO FLUTUANTE DO WHATSAPP
   ========================================================================== */

#whatsapp-float {
  animation: whatsapp-pulse 2.5s ease-in-out infinite;
}

@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48, 75, 160, 0.45); }
  50% { box-shadow: 0 0 0 14px rgba(48, 75, 160, 0); }
}

/* ==========================================================================
   AJUSTES MOBILE POR SEÇÃO
   ========================================================================== */

@media (max-width: 640px) {
  /* Barra de credibilidade: no mobile vira uma lista alinhada à esquerda,
     com ícone fixo na primeira linha e texto que quebra alinhado */
  section.bg-sand-50.border-b > div {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 14px;
    text-align: left;
  }

  section.bg-sand-50.border-b > div > span {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
  }

  section.bg-sand-50.border-b > div > span i {
    justify-self: center;
    margin-top: 3px;
  }

  /* Hero: números de credibilidade sem quebrar o grid */
  #hero dl { gap: 12px; }
  #hero dl dd.font-brand { font-size: 1.1rem; }

  /* Botão flutuante do WhatsApp um pouco menor */
  #whatsapp-float {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    bottom: 16px;
    right: 16px;
  }

  /* Contato: card interno com respiro correto */
  #contato .rounded-\[2\.5rem\] { border-radius: 1.5rem; }
}

/* ==========================================================================
   ESTADOS DE REVEAL (aplicados via GSAP — apenas transform/opacity)
   will-change promove os elementos animados para camada de GPU
   ========================================================================== */

html.js [data-reveal],
html.js .service-card,
html.js .journey-step,
html.js .diff-card,
html.js .stat-box,
html.js .testimonial-card {
  will-change: transform, opacity;
}

/* Respeita usuários com preferência por menos movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #whatsapp-float { animation: none; }
  .service-card,
  .journey-step,
  .diff-card,
  .social-icon { transition: none; }
}
