/* =====================================================================
   DRA. PATRICIA MATSUNAGA — FOLHA DE ESTILOS
   Paleta extraída da própria logomarca (terracota = artérias,
   azul-ardósia = veias), pareada com serifado editorial (Fraunces)
   e sans-serif humanista (Manrope).
===================================================================== */

/* ---------- 1. TOKENS DE DESIGN (variáveis CSS) ---------- */
:root {
  /* Cores base */
  --paper:        #F6F3EE;
  --paper-alt:    #EFE9E0;
  --white:        #FFFFFF;
  --ink:          #2B2622;
  --ink-soft:     #6B6259;

  /* Terracota (artérias) */
  --terracotta:      #9D6355;
  --terracotta-deep: #7A4A3F;
  --terracotta-tint: #E9D9D1;

  /* Ardósia (veias) */
  --slate:      #7C93A0;
  --slate-deep: #55707D;
  --slate-tint: #DCE5E8;

  --line: rgba(43, 38, 34, 0.12);
  --shadow: 0 20px 40px -24px rgba(43, 38, 34, 0.35);

  /* Tipografia */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, "Segoe UI", sans-serif;

  /* Espaçamento */
  --space-section: clamp(4.5rem, 8vw, 8rem);
  --container-w: 1180px;

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;

  --transition: 0.35s cubic-bezier(.4,0,.2,1);
}

/* ---------- 2. RESET BÁSICO ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0 0 0.5em; color: var(--ink); }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

/* Foco visível para acessibilidade via teclado */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--slate-deep);
  outline-offset: 3px;
}

/* Respeita preferência de redução de movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}
.section { padding: var(--space-section) 0; position: relative; }
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  margin-bottom: 0.9em;
}
.center { text-align: center; }
.section-lead {
  max-width: 640px;
  margin: 0 auto 3rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }

/* ---------- 3. BOTÕES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.9em 1.8em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  box-shadow: 0 12px 24px -12px rgba(157, 99, 85, 0.6);
}
.btn-primary:hover { background: var(--terracotta-deep); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 0.65em 1.4em; font-size: 0.85rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero-actions.center { justify-content: center; margin-bottom: 3rem; }

/* =====================================================================
   CABEÇALHO (STICKY HEADER)
===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--transition);
}
/* O efeito de vidro fosco (blur) vive num pseudo-elemento, e não no
   .site-header em si. Isso é proposital: "backdrop-filter" num
   ancestral transforma qualquer elemento fixed dentro dele (como o
   menu mobile) em algo posicionado relativo a ESSE ancestral, e não
   à tela toda — era essa a causa do menu mobile aparecer "preso"
   atrás do conteúdo. Isolando o blur aqui, o menu volta a se
   posicionar corretamente em relação à janela do navegador. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(246, 243, 238, 0.88);
  backdrop-filter: blur(10px);
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -16px rgba(43,38,34,0.3); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 1.05rem; }
.brand-text em { font-style: normal; font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.02em; }

.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.main-nav ul { display: flex; gap: 1.15rem; flex-wrap: nowrap; }
.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
  padding: 0.3em 0;
  white-space: nowrap;
  transition: color var(--transition);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--terracotta);
  transition: width var(--transition);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }
.nav-cta { flex-shrink: 0; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================================
   HERO
===================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(5rem, 12vw, 8rem);
  padding-bottom: clamp(6rem, 14vw, 10rem);
  background: linear-gradient(135deg, var(--terracotta-tint) 0%, var(--paper) 45%, var(--slate-tint) 100%);
}
.hero-roots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}
.roots-artery path { stroke: var(--terracotta); }
.roots-vein path { stroke: var(--slate); }
.draw-line {
  fill: none;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw 2.4s ease-out forwards;
}
.roots-artery .draw-line:nth-child(2) { animation-delay: 0.15s; }
.roots-artery .draw-line:nth-child(3) { animation-delay: 0.3s; }
.roots-artery .draw-line:nth-child(4) { animation-delay: 0.45s; }
.roots-artery .draw-line:nth-child(5) { animation-delay: 0.6s; }
.roots-vein .draw-line:nth-child(2) { animation-delay: 0.15s; }
.roots-vein .draw-line:nth-child(3) { animation-delay: 0.3s; }
.roots-vein .draw-line:nth-child(4) { animation-delay: 0.45s; }
.roots-vein .draw-line:nth-child(5) { animation-delay: 0.6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-inner { position: relative; max-width: 680px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); margin-bottom: 0.4em; }
.hero-lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 560px; }

/* =====================================================================
   PERFIL
===================================================================== */
.perfil-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.portrait-frame {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.portrait-mark {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.perfil-role { color: var(--terracotta-deep); font-weight: 700; letter-spacing: 0.02em; }
.formation-title { margin-top: 1.6em; font-size: 1.05rem; }
.formation-list { display: flex; flex-direction: column; gap: 0.7em; }
.formation-list li {
  padding-left: 1.4em;
  position: relative;
  color: var(--ink-soft);
}
.formation-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--slate);
}

/* =====================================================================
   CARTÕES (Especialidade / Serviços)
===================================================================== */
.cards-grid {
  display: grid;
  gap: 1.75rem;
}
.cards-grid.three { grid-template-columns: repeat(3, 1fr); }
.cards-grid.four { grid-template-columns: repeat(4, 1fr); }
.services-grid { grid-template-columns: repeat(3, 1fr); }

.spec-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2.2rem 1.8rem;
  border: 1px solid var(--line);
  transition: transform var(--transition), box-shadow var(--transition);
}
.spec-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.spec-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--terracotta-tint);
  margin-bottom: 1.2rem;
}
.spec-card:nth-child(2) .spec-icon { background: var(--slate-tint); }
.spec-card:nth-child(3) .spec-icon { background: var(--terracotta-tint); }
.spec-icon svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: var(--terracotta-deep);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spec-card:nth-child(2) .spec-icon svg { stroke: var(--slate-deep); }

.service-item {
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
}
.service-item h3 { font-size: 1.05rem; margin-bottom: 0.35em; }
.service-item p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* =====================================================================
   CUIDADO INTEGRADO (seção nova — entre Especialidade e Varizes)
   Formato numerado, sem ícones, para se diferenciar do grid de cards
   de Especialidade/Serviços. Fundo em degradê suave (identidade da
   marca) para criar separação visual entre os blocos da página.
===================================================================== */
.integrated-care {
  background: linear-gradient(135deg, var(--terracotta-tint) 0%, var(--paper) 50%, var(--slate-tint) 100%);
}
.integrated-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.integrated-item {
  padding: 2.4rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.integrated-index {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--terracotta);
  opacity: 0.55;
  margin-bottom: 0.6rem;
}
.integrated-item:nth-child(2) .integrated-index,
.integrated-item:nth-child(3) .integrated-index { color: var(--slate); }
.integrated-item h3 { font-size: 1.15rem; margin-bottom: 0.5em; }
.integrated-item p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.integrated-footer { text-align: center; margin-top: 2.8rem; }

@media (max-width: 720px) {
  .integrated-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   TRATAMENTO DE VARIZES (Abas)
===================================================================== */
.varizes { background: var(--paper); }
.especialidade,
.services,
.contact { background: var(--paper-alt); }
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.tab-btn {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0.7em 1.3em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-soft);
  transition: all var(--transition);
}
.tab-btn.is-active,
.tab-btn:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--white);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

.tab-panel-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--line);
}

.tab-visual {
  aspect-ratio: 5 / 4;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.tab-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.advantages-list { display: flex; flex-direction: column; gap: 0.6em; margin: 1em 0; }
.advantages-list li {
  padding-left: 1.5em;
  position: relative;
  color: var(--ink-soft);
}
.advantages-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--terracotta-deep);
  font-weight: 700;
}
.tab-actions { margin-top: 1.4rem; }

/* =====================================================================
   BLOG / CARROSSEL "SUA SAÚDE"
===================================================================== */
.carousel { position: relative; display: flex; align-items: center; gap: 1rem; }
.carousel-track-wrap { overflow: hidden; flex: 1; }
.carousel-track {
  display: flex;
  transition: transform var(--transition);
}
.carousel-slide {
  flex: 0 0 100%;
  padding: 0 0.5rem;
}
@media (min-width: 720px) {
  .carousel-slide { flex-basis: 50%; }
}
@media (min-width: 1080px) {
  .carousel-slide { flex-basis: 33.3333%; }
}
.blog-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 2rem;
  height: 100%;
}
.blog-card h3 { font-size: 1.1rem; }
.blog-card p { color: var(--ink-soft); font-size: 0.95rem; }
.blog-cta {
  color: var(--terracotta-deep);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0;
}
.carousel-arrow {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.carousel-arrow:hover { background: var(--terracotta); color: var(--white); }

/* =====================================================================
   CONTATO
===================================================================== */
.offices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.office-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 2.2rem;
}
.office-address { color: var(--ink-soft); }
.office-link {
  display: inline-block;
  color: var(--slate-deep);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.office-phone { font-weight: 600; margin-bottom: 1.2rem; }
.office-phone a:hover { color: var(--terracotta-deep); }
.office-map {
  width: 100%;
  height: 200px;
  border: 0;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  display: block;
}

/* =====================================================================
   RODAPÉ
===================================================================== */
.site-footer { background: var(--ink); color: var(--paper); padding: 3rem 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.8rem; }
.footer-mark { width: 40px; height: 40px; border-radius: 50%; }
.footer-brand p { margin: 0; font-size: 0.85rem; opacity: 0.75; }
.footer-social { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.88rem; }
.footer-social a { opacity: 0.85; transition: opacity var(--transition); }
.footer-social a:hover { opacity: 1; text-decoration: underline; }
.footer-copy { width: 100%; text-align: center; font-size: 0.8rem; opacity: 0.55; margin: 1.5rem 0 0; }

/* =====================================================================
   BOTÃO FLUTUANTE DE WHATSAPP
===================================================================== */
.whatsapp-float {
  position: fixed;
  right: clamp(1rem, 4vw, 2rem);
  bottom: clamp(1rem, 4vw, 2rem);
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px -10px rgba(0,0,0,0.35);
  z-index: 90;
  animation: pulse-wa 2.6s ease-in-out infinite;
}
.whatsapp-float svg { width: 34px; height: 34px; fill: var(--white); display: block; flex-shrink: 0; }
@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 14px 28px -10px rgba(0,0,0,0.35), 0 0 0 0 rgba(37,211,102,0.5); }
  50% { box-shadow: 0 14px 28px -10px rgba(0,0,0,0.35), 0 0 0 12px rgba(37,211,102,0); }
}

/* =====================================================================
   RESPONSIVIDADE
===================================================================== */
/* Nível 1 (≤1040px): o menu vira hambúrguer. O limiar foi definido
   acima da largura mínima necessária para os itens do menu caberem
   em uma única linha, evitando a quebra em telas intermediárias.
   As grades também passam a 2 colunas nesta faixa. */
@media (max-width: 1040px) {
  .main-nav {
    position: fixed;
    inset: 68px 0 0 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem clamp(1.25rem, 6vw, 2rem);
    gap: 2rem;
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 1.4rem; width: 100%; }
  .nav-link { font-size: 1.1rem; }
  .nav-cta { width: 100%; justify-content: center; }
  .hamburger { display: flex; }

  .cards-grid.three,
  .cards-grid.four,
  .services-grid,
  .offices-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Nível 2 (≤960px): ajustes de layout do perfil e das abas de tratamento. */
@media (max-width: 960px) {
  .perfil-grid { grid-template-columns: 1fr; }
  .portrait-frame { max-width: 320px; margin: 0 auto; }
  .tab-panel-grid { grid-template-columns: 1fr; }
  .tab-visual { max-width: 280px; margin: 0 auto; }
}

/* Nível 3 (≤760px): telas de celular — tudo em coluna única. */
@media (max-width: 760px) {
  .cards-grid.three,
  .cards-grid.four,
  .services-grid,
  .offices-grid { grid-template-columns: 1fr; }

  /* Carrossel "Sua Saúde": no celular as setas ficam abaixo do
     cartão em vez de espremê-lo nas laterais, dando mais largura
     de leitura para o texto. */
  .carousel { flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
  .carousel-track-wrap { flex-basis: 100%; width: 100%; order: 1; }
  .carousel-arrow { order: 2; width: 42px; height: 42px; font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.1rem; }
}
