/* Inter local: evita pedidos ao Google Fonts e mantém a tipografia disponível offline. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2");
}

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg-color: #ffffff;
  --section-alt-bg: #f0f4f8;
  --card-bg: #ffffff;
  --footer-bg: #ffffff;

  --text-main: #1a202c;
  --text-light: #4a5568;

  --primary-blue: #2c5282;
  --accent-teal: #319795;

  --brand-teal: #016d78;

  /* D10 — cor de texto de links/CTAs (contraste ≥4.5:1 nos dois temas).
     `--accent-teal` fica reservado para decoração. */
  --link-color: var(--brand-teal);

  --border-color: #e2e8f0;
  --hero-gradient: linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);

  --section-space: 48px;
  --section-space-mobile: 40px;

  --radius-sm: 8px;
  --radius-md: 12px;

  --shadow-soft: 0 3px 12px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-photo: 0 10px 25px rgba(0, 0, 0, 0.1);

  /* Larguras (F2) — 1:1 com os literais migrados. */
  --measure-article: 720px;
  --width-shell: 900px;
  --width-narrow: 620px;

  /* Movimento e camadas (F2) — offsets acoplados a article-reading.js. */
  --duration-fast: .2s;
  --duration-base: .25s;
  --ease-standard: ease;
  --z-nav: 20;
  --z-top: 25;
  --z-progress: 30;
  --scroll-offset-nav: 90px;
  --scroll-offset-nav-mobile: 72px;
  --scroll-offset-article: 110px;

  /* Tipografia (F2) — escala mínima com usos repetidos ou papel documentado. */
  --text-xs: .8rem;
  --text-sm: .9rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-h3: 1.18rem;
  --text-h2: 1.6rem;

  /* Espaço (F2) — apenas valores com ≥2 usos em padding/margin/gap. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  /* Superfícies e marcações (F2) — 1:1 com os literais migrados. */
  --surface-glass: rgba(255, 255, 255, 0.76);
  --surface-top: rgba(255, 255, 255, 0.78);
  --shadow-menu: 0 12px 28px rgba(20, 45, 70, 0.14);
  --whatsapp: #128c7e;
  --booking-note: #475569;
  --booking-muted: #64748b;
  --booking-link: #334155;
  --booking-portal: #2b7a78;

  --container-width: var(--width-shell);
}

@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #0f172a;
    --bg-color: #0f172a;
    --section-alt-bg: #1e293b;
    --footer-bg: #0f172a;

    --text-main: #f8fafc;
    --text-light: #cbd5e1;

    --primary-blue: #93c5e8;
    --accent-teal: #5fc4bb;
    --link-color: var(--accent-teal);

    --border-color: #334155;
    --hero-gradient: linear-gradient(135deg, #1a365d 0%, #0f172a 100%);

    /* Superfícies e marcações (F2) — variantes escuras 1:1. */
    --surface-glass-dark: rgba(15, 23, 42, 0.76);
    --surface-top-dark: rgba(15, 23, 42, 0.78);
    --whatsapp-dark: #5ee39b;
    --booking-portal-dark: #7dd3c7;
    --booking-muted-dark: #94a3b8;
    --booking-link-dark: #dbeafe;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-light);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--primary-blue);
  font-family: "Inter", sans-serif;
  line-height: 1.3;
}

p {
  margin-top: 0;
}

a {
  color: var(--link-color);
  font-weight: 600;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

/* D2 — anel único de foco para todos os interativos. `:where()` mantém a
   especificidade baixa (0,1,0) para que os overrides por componente possam
   ajustar o offset sem `!important`. */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--section-space) 0;
}

/* As secções são brancas por defeito; apenas as alternadas recebem fundo. */
main > section.section {
  background-color: var(--card-bg);
}

main > section.section:nth-of-type(even) {
  background-color: var(--section-alt-bg);
}

/* Em páginas com hero dentro do main, a secção imediatamente seguinte é branca. */
main:has(> .section-subpage-hero) > section.section:nth-of-type(even) {
  background-color: var(--card-bg);
}

main:has(> .section-subpage-hero)
  > section.section:nth-of-type(odd):not(.section-subpage-hero) {
  background-color: var(--section-alt-bg);
}

.section-title {
  width: 100%;
  display: inline-block;
  margin: 0 0 30px;
  position: relative;
  text-align: center;
  font-size: 1.8rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 2px;
  background-color: var(--accent-teal);
}

.section > .container > *:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Homepage header
   ========================================================================== */
header {
  background: var(--hero-gradient);
  border-bottom: 4px solid var(--accent-teal);
  padding: 60px 0 var(--space-8);
  position: relative;
  text-align: center;
}

.doctor-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--card-bg);
  background-color: var(--border-color);
  box-shadow: var(--shadow-photo);
}

/* ==========================================================================
   Homepage content
   ========================================================================== */
.about-layout {
  display: grid;
  max-width: none;
  margin: 0 auto;
  gap: 34px;
}

.home-page #sobre-mim > .container {
  max-width: var(--width-shell);
}

.about-supporting {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  gap: var(--space-6);
}

.about-volunteering,
.about-engineering,
.about-journey {
  min-width: 0;
}

.about-volunteering > p,
.about-engineering > p {
  margin-bottom: 0;
  color: var(--text-light);
}

.about-journey {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.about-highlight {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: #f3f8f6;
  color: var(--text-light);
}

.about-highlight p {
  margin: 0;
}

.about-engineering {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-color);
}

.about-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
  margin: var(--space-4) 0 0;
  padding: 26px 0 0;
  list-style: none;
}

.about-timeline::before {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  height: 2px;
  background: var(--border-color);
  content: "";
}

.about-timeline li {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  color: var(--text-main);
  line-height: 1.5;
}

.about-timeline li + li {
  padding-left: 18px;
  border-left: 1px solid var(--border-color);
}

.about-timeline li::before {
  position: absolute;
  top: -25px;
  left: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--card-bg);
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 0 1px var(--accent-teal);
  content: "";
}

.about-timeline li + li::before {
  left: 18px;
}

.about-timeline h4 {
  margin: 0;
  color: var(--text-main);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
}

.about-timeline p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.94rem;
}

.timeline-year {
  color: var(--primary-blue);
  font-size: 0.88rem;
  font-weight: 700;
}

.timeline-term {
  white-space: nowrap;
}

/* ==========================================================================
   Cards and grids — componentes partilhados (contrato F3)
   --------------------------------------------------------------------------
   `.grid`, `.card`, `.read-more` e `.grid-footer` pertencem a `style.css` e
   são consumidos pela homepage, índice, áreas clínicas e artigos sugeridos.
   Os overrides de artigo (`.article-content .artigos-sugeridos …`) vivem em
   `article.css` e não são segundas definições. A grelha de 6 colunas
   (`min-width: 900px`) e o reposicionamento do último cartão são intencionais;
   não fundir com a variante de artigo.
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

/* `.grid-footer` é o rodapé partilhado das grelhas (homepage, índice, áreas e
   artigos sugeridos); pertence a `style.css`. */
.grid-footer {
  margin-top: 15px;
  text-align: center;
  font-size: var(--text-sm);
}

.card {
  padding: 30px 25px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  text-align: center;
  transition:
    transform var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-card);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-bottom: 15px;
  color: var(--accent-teal);
}

.card-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.8;
}

.card h3 {
  margin: 0 0 10px;
  color: var(--primary-blue);
  font-size: var(--text-lg);
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--text-light);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
}

/* `.read-more` é o CTA partilhado dos cartões; os overrides de artigo vivem em
   `article.css` (`.article-content .artigos-sugeridos .card .read-more`). */
.read-more {
  display: inline-block;
  margin-top: 14px;
  color: var(--link-color);
  font-weight: 600;
  text-decoration: none;
}

.read-more > span[aria-hidden="true"] {
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-standard);
}

a.card:hover .read-more > span[aria-hidden="true"],
a.card:focus-visible .read-more > span[aria-hidden="true"] {
  transform: translateX(4px);
}

.read-more:hover,
.read-more:focus-visible {
  text-decoration: underline;
}

a.card {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .grid > .card {
    grid-column: span 2;
  }

  .grid > .card:last-child:nth-child(3n + 1) {
    grid-column: 3 / span 2;
  }

  .grid > .card:nth-last-child(2):nth-child(3n + 1) {
    grid-column: 2 / span 2;
  }

  .grid > .card:last-child:nth-child(3n + 2) {
    grid-column: 4 / span 2;
  }
}

/* ==========================================================================
   Marcações
   ========================================================================== */

#agendamento {
  background-color: #f8fafc;
}

.booking-intro {
  text-align: center;
}

#agendamento .booking-directory {
  max-width: var(--measure-article);
  margin: 28px auto 0;
  padding: 0 var(--space-6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
}

#agendamento .booking-row {
  display: block;
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--border-color);
}

#agendamento .booking-row:last-child {
  border-bottom: 0;
}

#agendamento .booking-place h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

#agendamento .booking-place-note {
  margin: 0;
  color: var(--booking-note);
  font-size: 0.95rem;
  line-height: 1.45;
}

#agendamento .booking-availability {
  margin-top: 2px;
  color: var(--booking-muted);
  font-size: 0.8125rem;
  font-style: italic;
}

#agendamento .booking-details {
  display: grid;
  margin-top: 14px;
  gap: var(--space-1);
}

#agendamento .booking-details p {
  margin: 0;
  line-height: 1.5;
}

#agendamento .booking-contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  color: var(--text-light);
  font-size: 0.9375rem;
  font-weight: 400;
}

#agendamento .booking-contact-line strong {
  color: var(--booking-muted);
  font-weight: 600;
}

#agendamento .booking-contact-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

#agendamento .booking-contact-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--brand-teal);
}

#agendamento .booking-contact-line-whatsapp .booking-contact-icon {
  color: var(--whatsapp);
}

#agendamento .booking-details a[href^="tel:"],
#agendamento .booking-details a[href^="mailto:"] {
  color: var(--booking-link);
  font-weight: 600;
  text-decoration: none;
}

#agendamento .booking-inline-action {
  display: inline;
  color: var(--booking-portal);
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  text-decoration: none;
}

#agendamento .booking-inline-action-whatsapp {
  color: var(--whatsapp);
}

#agendamento .booking-inline-action:hover,
#agendamento .booking-inline-action:focus-visible {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  #agendamento .booking-directory {
    padding: 0 18px;
  }

  #agendamento .booking-row {
    padding: var(--space-6) 0 26px;
  }

  #agendamento .booking-support {
    max-width: 680px;
    margin-right: auto;
    margin-left: auto;
  }
}

@media (prefers-color-scheme: dark) {
  #agendamento {
    background-color: var(--section-alt-bg);
  }

  #agendamento .booking-contact-line strong {
    color: var(--booking-muted-dark);
  }

  #agendamento .booking-details a[href^="tel:"],
  #agendamento .booking-details a[href^="mailto:"] {
    color: var(--booking-link-dark);
  }

  #agendamento .booking-place-note {
    color: var(--text-light);
  }

  #agendamento .booking-inline-action-whatsapp {
    color: var(--whatsapp-dark);
  }

  #agendamento .booking-inline-action-portal {
    color: var(--booking-portal-dark);
  }

  #agendamento .booking-availability {
    color: var(--text-light);
  }

  #agendamento .booking-contact-line-whatsapp .booking-contact-icon {
    color: var(--whatsapp-dark);
  }

  #agendamento .booking-inline-action:hover,
  #agendamento .booking-inline-action:focus-visible {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

#agendamento .booking-support {
  margin-top: 2rem;
  text-align: center;
  font-size: var(--text-sm);
}

/* ==========================================================================
   Subpages
   ========================================================================== */
.section-subpage-hero {
  padding: 56px 0 52px;
}

.subpage-hero-brand {
  background: var(--hero-gradient);
}

.section-subpage-hero .page-title {
  margin-bottom: var(--space-4);
  font-size: 2.1rem;
  text-align: center;
}

.section-subpage-hero .articles-note {
  max-width: var(--width-narrow);
  margin: 0 auto;
  font-size: 1.02rem;
}

.lead {
  margin-bottom: 34px;
}

.symptom-item {
  margin-bottom: 28px;
}

.symptom-item p {
  margin-bottom: var(--space-2);
}

.symptom-item .read-more {
  display: inline-block;
  margin-top: var(--space-1);
}

/* ==========================================================================
   Página de artigos
   ========================================================================== */

.articles-note {
  max-width: var(--measure-article);
  margin: 0 auto;
  color: var(--text-light);
  text-align: center;
  font-size: 0.95rem;
}

.articles-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: var(--width-shell);
  margin: var(--space-6) auto 0;
  text-align: center;
}

.articles-nav a {
  color: color-mix(in srgb, var(--primary-blue) 90%, var(--card-bg));
  padding: var(--space-2) 14px;
  border: 1px solid color-mix(in srgb, var(--primary-blue) 35%, transparent);
  border-radius: 999px;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.articles-nav a:hover,
.articles-nav a:focus-visible {
  border-color: var(--accent-teal);
  background: var(--accent-teal);
  color: var(--card-bg);
}

.articles-category-section {
  scroll-margin-top: var(--scroll-offset-nav);
}

.articles-category {
  margin: 0 0 26px;
  color: var(--primary-blue);
  font-size: 1.45rem;
  text-align: center;
}

.articles-category::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin: 9px auto 0;
  border-radius: 2px;
  background: var(--accent-teal);
}

.back-to-top-link {
  margin: -28px auto var(--space-8);
  text-align: center;
}

.back-to-top-link a {
  color: var(--link-color);
  font-size: var(--text-sm);
  text-decoration: none;
}

.back-to-top-link a:hover,
.back-to-top-link a:focus-visible {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  padding: var(--space-8) var(--space-5);
  border-top: 1px solid var(--border-color);
  background: var(--footer-bg);
  color: var(--text-light);
  text-align: center;
  font-size: var(--text-sm);
}

.footer-symbol {
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto var(--space-3);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem 1.1rem;
  flex-wrap: wrap;
  margin: 1.25rem auto 1rem;
}

.footer-nav a {
  color: var(--primary-blue);
  font-weight: 600;
  text-decoration-color: var(--accent-teal);
  text-underline-offset: 0.18em;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--link-color);
}

.footer-nav a:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
  border-radius: 2px;
}

footer p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 600px) {
  :root {
    --section-space: var(--section-space-mobile);
  }

  .doctor-photo {
    width: 112px;
    height: 112px;
  }

  .articles-nav {
    gap: var(--space-2);
    margin-top: 18px;
  }

  .articles-nav a {
    min-height: 0;
    padding: 7px 11px;
    font-size: var(--text-xs);
    text-align: center;
  }
}

/* ==========================================================================
   Homepage — navegação sticky, hero e cartões responsivos
   (estilos migrados de index3.html; classes test-* renomeadas)
   ========================================================================== */

.home-header > .container {
  max-width: var(--width-shell);
}

.hero {
  display: grid;
  align-items: center;
}

.hero-title-main {
  display: block;
}

.home-page a:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* Subtítulos editoriais da secção "Sobre mim". */
.about-layout .about-kicker {
  margin: 0 0 var(--space-2);
  color: var(--accent-teal);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .about-journey {
    padding-bottom: var(--space-6);
  }

  .about-timeline {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 0 0 0 22px;
  }

  .about-timeline::before {
    top: 8px;
    bottom: 8px;
    left: 5px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .about-timeline li::before {
    top: 5px;
    left: -21px;
  }

  .about-timeline li + li::before {
    left: -21px;
  }

  .about-timeline li + li {
    padding-left: 0;
    border-left: 0;
  }

  .about-highlight {
    padding: 11px 14px;
  }
}

@media (prefers-color-scheme: dark) {
  .about-highlight {
    background: #192e30;
  }
}

.secondary-areas-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: 0 auto 18px;
  color: var(--text-light);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: normal;
  text-align: center;
  text-transform: none;
}

.secondary-areas-title::before,
.secondary-areas-title::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border-color);
}

.priority-grid {
  margin-bottom: 26px;
}

.secondary-area-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  max-width: var(--width-narrow);
  margin: 0 auto;
}

.secondary-area-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--primary-blue);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.secondary-area-card:hover,
.secondary-area-card:focus-visible {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.secondary-area-card .card-icon {
  min-width: 32px;
  margin: 0;
}

.secondary-area-card .card-icon svg {
  width: 32px;
  height: 32px;
}

.secondary-area-card h3 {
  flex: 1;
  margin: 0;
  color: var(--primary-blue);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
}

.secondary-area-arrow {
  margin-left: auto;
  color: var(--accent-teal);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform var(--duration-fast) var(--ease-standard);
}

.secondary-area-card:hover .secondary-area-arrow,
.secondary-area-card:focus-visible .secondary-area-arrow {
  transform: translateX(4px);
}

@media (max-width: 840px) {
  .hero-copy > p {
    max-width: 34rem;
  }

  .secondary-area-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 360px;
  }

  .secondary-area-card {
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3) 18px;
  }

  .secondary-area-card h3 {
    flex: initial;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .hero-title-main {
    font-size: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  body * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* Navegação sticky */
.site-nav {
  position: sticky;
  z-index: var(--z-nav);
  top: 0;
  min-height: 76px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-soft);
}

@keyframes nav-shrink {
  to {
    min-height: 58px;
  }
}

@media (prefers-color-scheme: dark) {
  .site-nav {
    background: var(--surface-glass-dark);
  }
}

/* O atributo `aria-current` continua presente no link "Artigos" ("page" no
   índice de artigos, "true" nas páginas de artigo) por razões de
   acessibilidade, mas não recebe destaque visual: o menu deve manter todos os
   links com a mesma aparência. */

.site-nav-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  width: min(100% - 40px, var(--width-shell));
  min-height: 76px;
  margin: 0 auto;
}

.back-to-top-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-top);
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--surface-top);
  color: var(--primary-blue);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}

.back-to-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-button:hover,
.back-to-top-button:focus-visible {
  background: var(--card-bg);
  color: var(--link-color);
}

/* Visível em todos os tamanhos: os artigos são longos e o regresso ao topo
   continua a ser útil em desktop. */
@media (min-width: 1024px) {
  .back-to-top-button {
    right: 28px;
    bottom: 28px;
  }
}

@media (prefers-color-scheme: dark) {
  .back-to-top-button {
    background: var(--surface-top-dark);
  }
}

.site-brand {
  display: flex;
  align-items: center;
  justify-self: start;
  line-height: 1.25;
  text-decoration: none;
}

.site-brand picture {
  display: block;
  width: min(100%, 220px);
  line-height: 0;
}

.site-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.desktop-nav-links {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: clamp(16px, 2.3vw, 32px);
}

.desktop-nav-links a {
  color: var(--text-main);
  font-size: 0.91rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-nav-links a:hover,
.desktop-nav-links a:focus-visible {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.desktop-nav-links .desktop-nav-cta {
  margin-left: 2px;
  padding-left: clamp(12px, 1.4vw, 18px);
  border-left: 1px solid var(--border-color);
  color: var(--primary-blue);
  font-weight: 600;
}

.mobile-menu {
  display: none;
}

.home-page header.home-header {
  padding: 56px 0;
  border: 0;
  background: var(--hero-gradient);
}

.hero {
  grid-template-columns: minmax(0, 560px) 170px;
  justify-content: center;
  gap: 28px;
  max-width: var(--width-shell);
  text-align: left;
}

.hero-copy {
  display: block;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.hero-copy h1 {
  margin: 0 0 var(--space-3);
  letter-spacing: -0.035em;
}

.hero-copy > .hero-kicker {
  margin: 0 0 var(--space-2);
  color: var(--accent-teal);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-specialty {
  white-space: nowrap;
}

.hero-title-main {
  font-size: clamp(2.25rem, 3.1vw, 2.625rem);
  font-weight: 600;
}

.hero-copy > p {
  max-width: 560px;
  margin: 0;
  color: var(--text-light);
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.6;
}

.hero-photo {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  box-sizing: border-box;
  width: 170px;
  height: 170px;
  border: 5px solid #fff;
  box-shadow: var(--shadow-photo);
}

#agendamento .booking-contact {
  color: var(--text-light);
  font-size: var(--text-sm);
  font-weight: 400;
  text-decoration: none;
}

#agendamento .booking-contact:hover,
#agendamento .booking-contact:focus-visible {
  color: var(--link-color);
  text-decoration: none;
}

.home-page section[id] {
  scroll-margin-top: var(--scroll-offset-nav);
}

@media (max-width: 1023px) {
  .site-nav,
  .site-nav-inner {
    animation: nav-shrink linear both;
    animation-timeline: scroll(root);
    animation-range: 0 180px;
  }

  .site-nav-inner {
    grid-template-columns: 1fr auto;
    width: min(100% - 32px, 760px);
    min-height: 60px;
  }

  .site-nav {
    min-height: 60px;
  }

  .desktop-nav-links {
    display: none;
  }

  .site-brand img {
    width: min(100%, 190px);
  }

  .mobile-menu {
    position: relative;
    display: block;
    justify-self: end;
  }

  .mobile-menu summary {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    color: var(--primary-blue);
    cursor: pointer;
    line-height: 1;
    list-style: none;
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  /* Ícones Lucide (`menu` / `x`). A troca é resolvida pelo estado nativo de
     <details>, sem JavaScript: os dois spans ocupam a mesma célula da grelha
     do `summary`, pelo que a substituição não desloca o alinhamento. O
     `currentColor` do Lucide herda a cor do `summary` em ambos os temas. */
  .mobile-menu-icon {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    place-items: center;
    line-height: 0;
  }

  .mobile-menu-icon svg {
    width: 22px;
    height: 22px;
  }

  .mobile-menu-icon--close {
    display: none;
  }

  .mobile-menu[open] .mobile-menu-icon--open {
    display: none;
  }

  .mobile-menu[open] .mobile-menu-icon--close {
    display: grid;
  }

  .mobile-menu[open] summary {
    background: var(--bg-color);
  }

  .mobile-menu-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    display: grid;
    min-width: 210px;
    gap: 2px;
    padding: var(--space-2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: var(--shadow-menu);
  }

  .mobile-menu-panel a {
    padding: 10px var(--space-3);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
  }

  .mobile-menu-panel a:hover,
  .mobile-menu-panel a:focus-visible {
    background: var(--bg-color);
  }

  .mobile-menu-panel a.mobile-menu-cta {
    margin-top: var(--space-1);
    padding: 14px var(--space-3) 10px;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    color: var(--primary-blue);
    font-weight: 600;
    text-align: left;
  }

  .mobile-menu-panel a.mobile-menu-cta:hover,
  .mobile-menu-panel a.mobile-menu-cta:focus-visible {
    background: var(--bg-color);
    color: var(--link-color);
    text-decoration: underline;
  }

  .home-page header.home-header {
    padding: 36px 0 42px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
    gap: 28px;
    text-align: left;
  }

  .hero-copy {
    display: block;
    grid-column: 1;
    align-self: center;
  }

  .hero-copy h1 {
    margin: 0 0 var(--space-3);
  }

  .hero-title-main {
    font-size: clamp(2rem, 4.5vw, 2.625rem);
  }

  .hero-copy > p {
    margin: 0;
    font-size: var(--text-base);
  }

  .hero-photo {
    grid-column: 2;
    width: clamp(120px, 23vw, 180px);
    height: clamp(120px, 23vw, 180px);
  }
}

@media (max-width: 768px) {
  .home-page {
    --section-space-mobile: 34px;
  }

  .home-page header.home-header {
    padding: var(--space-5) 0 36px;
  }

  .hero {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  .hero-photo {
    order: -1;
    width: 112px;
    height: 112px;
    margin: 0;
    border-width: 3px;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-copy h1 {
    margin: 0 0 var(--space-2);
  }

  .hero-title-main {
    font-size: clamp(1.8rem, 6vw, 2rem);
    font-weight: 700;
  }

  .hero-copy > .hero-kicker {
    margin-bottom: 6px;
    font-size: 0.92rem;
    letter-spacing: 0.1em;
  }

  .hero-copy > p {
    max-width: 34rem;
    margin: 0 auto;
    font-size: 0.96rem;
  }

  .home-page section[id] {
    scroll-margin-top: var(--scroll-offset-nav-mobile);
  }

  .articles-category-section {
    scroll-margin-top: var(--scroll-offset-nav-mobile);
  }
}
