html {
  scroll-behavior: smooth;
}

::selection {
  background-color: #003f87;
  /* primary */
  color: #ffffff;
}

::-moz-selection {
  background-color: #003f87;
  color: #ffffff;
}

/* ==========================================================================
   NAV LINKS
   ========================================================================== */

.nav-link {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: #424752;
  /* on-surface-variant */
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.nav-link:hover {
  color: #003f87;
  /* primary */
}

.nav-link--active {
  color: #003f87;
  /* primary */
  border-bottom-color: #003f87;
  font-weight: 700;
}

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

.footer-link {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #dbe4ed;
  /* surface-variant */
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

.footer-link:hover {
  color: #ffffff;
}

/* ==========================================================================
   BACK TO TOP BUTTON
   ========================================================================== */

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   EDITORIAL FLOAT IMAGE — illustration style
   Image floats LEFT; "Traditional surgical" is full-width above it;
   "Recent studies" and every paragraph after flows right + below.
   ========================================================================== */

/* Section establishes a block-formatting context */
.article-text-section {
  display: block;
  overflow: hidden;
  /* contains the float */
}

/* Paragraphs inside the section get consistent spacing */
.article-text-section p {
  margin-bottom: 1em;
}

/* The float itself */
.article-float-left-img {
  float: left;
  width: 185px;
  /* compact, editorial feel */
  height: auto;
  margin: 2px 24px 12px 0;
  border-radius: 6px;
  display: block;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.20),
    0 8px 24px rgba(0, 0, 0, 0.24),
    0 20px 48px rgba(0, 0, 0, 0.12);
}

/* Clears the float at the end of the section */
.clear-float {
  clear: both;
}

/* Mobile: image goes full width, no float */
@media (max-width: 640px) {
  .article-float-left-img {
    float: none;
    /* Compacta: ocupa metade da largura, alinhada à esquerda com texto fluindo */
    width: 120px;
    max-width: 120px;
    margin: 4px 16px 8px 0;
    float: left; /* mantém float à esquerda mas menor */
  }
}

/* ==========================================================================
   MOBILE TYPOGRAPHY & RESPONSIVENESS SCALE — ≤ 640px
   ========================================================================== */
@media (max-width: 640px) {

  /* ── 1. Padding do main reduzido ── */
  main {
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }

  /* ── 2. H1 — headline principal da hero ── */
  article h1 {
    font-size: 22px !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
  }

  /* ── 3. H2 — títulos de seção ── */
  article h2 {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  /* ── 4. H3 — Social Proof ── */
  article h3 {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  /* ── 5. H4 — depoimentos ── */
  article h4,
  aside h4 {
    font-size: 17px !important;
    line-height: 1.3 !important;
  }

  /* ── 6. Subheadline bold da hero: APENAS o primeiro p da primeira section ──
     FIX: selector restrito à primeira section (hero), evita atingir
     "For decades..." que é o primeiro p de .article-text-section */
  article > section:first-child > p:first-of-type {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  /* ── 7. Parágrafos do artigo (section 2 em diante) ── */
  .article-text-section p,
  article section p.text-article-body {
    font-size: 15px !important;
    line-height: 1.55 !important;
  }

  /* ── 8. Gap entre seções do artigo ── */
  article {
    gap: 32px !important;
  }

  /* ── 9. Social proof: cards em coluna única ── */
  .grid.grid-cols-1.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* ── 10. Depoimentos: layout vertical ── */
  article section .flex.flex-col.md\:flex-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* ── 11. Avatar de depoimento: menor ── */
  article section .w-32.h-32 {
    width: 64px !important;
    height: 64px !important;
  }
}

/* ==========================================================================
   SIDEBAR MOBILE — mostra a sidebar em mobile (abaixo do artigo)
   ========================================================================== */

/* Sidebar visível em mobile, empilhada abaixo do artigo */
aside {
  display: flex !important; /* sobrescreve hidden (display:none) */
  flex-direction: column;
  width: 100% !important;       /* largura total em mobile */
  position: static !important;  /* remove sticky em mobile */
  gap: 24px;
}

/* Em desktop volta ao layout normal (lg: breakpoint) */
@media (min-width: 1024px) {
  aside {
    width: 33.333% !important;
    position: sticky !important;
    top: 96px;
  }
}

/* Card de imagem da sidebar: aspect ratio fixo no mobile */
@media (max-width: 640px) {
  aside .relative.rounded-xl.overflow-hidden.aspect-\[4\/5\] {
    aspect-ratio: 16 / 9 !important;
  }

  /* Sidebar H4 no card de imagem */
  aside h4.text-headline-md {
    font-size: 16px !important;
    line-height: 1.3 !important;
  }

  /* MaroBrain ad: centralizado */
  aside .w-fit.mx-auto {
    width: 100% !important;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
  aside .w-56 {
    width: 100% !important;
    max-width: 280px;
  }
}