/* Instituto Areté — style.v6.css
   Mobile-first · sem !important · sem classes órfãs · sem redefinições duplicadas
   Organização: variáveis → reset → containers → topbar → brand → nav → hamburger
               → hero → seções → tipografia → médico → formulário → footer
               → menu mobile → animações de estado */


/* ─── 1. Variáveis ──────────────────────────────────────── */

:root {
  --topbar-h: 64px;
  --ink:    #101417;
  --paper:  #f5f1ea;
  --petrol: #0E2433;
  --gold:   #b59a55;
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --muted:  #5f6b73;
  --line:   rgba(16,20,23,.12);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --max:    1100px;
}

@media (min-width: 900px) {
  :root { --topbar-h: 72px; }
}


/* ─── 2. Reset & base ───────────────────────────────────── */

/* Atributo [hidden] esconde o menu; especificidade (0,2,0) vence qualquer
   regra de display sem classe extra — sem precisar de !important            */
.mobileMenu[hidden] { display: none; }

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: auto;
  scroll-padding-top: var(--topbar-h);
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-serif);
  line-height: 1.55;
  overflow-x: hidden;
}

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

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

/* Seções com âncora não somem sob o header fixo */
section[id],
#hero { scroll-margin-top: var(--topbar-h); }


/* ─── 3. Containers ─────────────────────────────────────── */

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

/* Desktop: coluna de leitura estreita */
@media (min-width: 900px) {
  .container--narrow { max-width: 68ch; }
}


/* ─── 4. Topbar ─────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0);
  overflow: visible;
  transition:
    background     .25s ease,
    border-color   .25s ease,
    backdrop-filter .25s ease;
}

.topbar.is-solid {
  background: var(--petrol);
  border-bottom: 1px solid rgba(181,154,85,.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* No topo transparente, oculta marca textual e logo */
.topbar:not(.is-solid) .brand__text { display: none; }
.topbar:not(.is-solid) .brand__logo { display: none; }

/* Ao rolar (is-solid), exibe marca com estilo certo */
.topbar.is-solid .brand__text {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 13px;
  opacity: .95;
}

.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}


/* ─── 5. Brand ──────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
}

.brand__logo {
  width: 44px;
  height: auto;
  margin-right: 12px;
  filter: none;
}

.brand__text {
  color: #f4f6f6;
  font-weight: 600;
  letter-spacing: .5px;
  font-size: 16px;
  line-height: 1;
  position: relative;
}

/* Sublinhado discreto no hover — desktop only */
.brand__text::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -7px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transition: opacity .18s ease;
}

.brand:hover .brand__text::after,
.brand:focus-visible .brand__text::after { opacity: .9; }

@media (max-width: 899px) {
  .brand__text::after { display: none; }
}


/* ─── 6. Nav desktop ────────────────────────────────────── */

/* Mobile-first: nav oculta */
.nav { display: none; }

@media (min-width: 900px) {
  .nav {
    display: flex;
    gap: 16px;
    align-items: center;
  }

  .nav a {
    color: rgba(244,246,246,.86);
    font-size: 14px;
    padding: 8px 10px;
    text-decoration: none;
    position: relative;
    transition: color .18s ease;
  }

  .nav a:hover { color: rgba(244,246,246,.98); }

  /* Underline instantâneo — sem animação de crescimento */
  .nav a::after {
    content: "";
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 1px;
    background: rgba(244,246,246,.75);
    opacity: 0;
  }

  .nav a:hover::after,
  .nav a:focus-visible::after { opacity: 1; }
}


/* ─── 7. Hamburger ──────────────────────────────────────── */

/* Mobile-first: visível */
.menuBtn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin-right: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
}

.menuBtn span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(244,246,246,.92);
  border-radius: 2px;
  opacity: .9;
  transition: transform 180ms ease, opacity 180ms ease;
  transform-origin: center;
}

/* Estado aberto: forma um X */
.menuBtn.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menuBtn.is-open span:nth-child(2) { opacity: 0; }
.menuBtn.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Desktop: hamburger oculto */
@media (min-width: 900px) {
  .menuBtn { display: none; }
}


/* ─── 8. Hero ───────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--topbar-h) + 8px) 24px 24px;
  color: #f4f1ec;
  background: url('../assets/bg-arete-v2.webp') center/cover no-repeat;
  position: relative;
  overflow: hidden;
}

/* Pseudoelementos desativados (border frame rejeitado) */
.hero::before,
.hero::after { display: none; }

.hero__inner {
  position: relative;
  z-index: 3;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transform: translateY(-32px);
}

/* Scroll sentinel do iOS */
#scrollSentinel {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px; width: 1px;
  pointer-events: none;
}

/* Logo wrapper: reserva espaço fixo para a animação não mover o texto */
.logoWrap {
  width: 150px;
  height: 150px;
  margin: 0 auto -10px;
  overflow: visible;
  display: block;
}

/* Seletor amplo garante hit independente do <picture> */
.hero .logoWrap img {
  width: 132px;
  height: auto;
  display: block;
  margin: 0 auto;
  transform: translateY(42px);
  will-change: transform;
}

@media (min-width: 900px) {
  .hero .logoWrap img {
    width: 144px;
    transform: translateY(34px);
  }
}

/* Bloco de texto do hero */
.textblock { margin-top: 0; }

.brandTitle {
  margin: 6px 0 0;
  text-transform: uppercase;
  letter-spacing: .30em;
  line-height: 1.0;
  text-shadow: 0 10px 28px rgba(0,0,0,.55);
  hyphens: none;
  -webkit-hyphens: none;
}

.brandTitle .inst {
  display: block;
  font-size: 14px;
  font-weight: 600;
  opacity: .90;
}

.brandTitle .arete {
  display: block;
  margin-top: 6px;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: .18em;
}

.tagline {
  margin: 60px 0 18px;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,.96);
  letter-spacing: .03em;
  font-weight: 300;
  line-height: 1.6;
  text-align: center;
}

/* Hero: subtítulos e parágrafos sempre centralizados */
.hero p,
.hero .subtitle { text-align: center; }


/* ─── 9. Seções de conteúdo ─────────────────────────────── */

.section {
  padding: 60px 0;
  background: var(--paper);
}

/* Mobile pequeno: interesse cabe melhor com menos padding top */
@media (max-width: 520px) {
  #interesse { padding-top: 56px; }
  #interesse h2 { margin-bottom: 10px; }
}

/* Desktop: mais respiro vertical */
@media (min-width: 769px) {
  .section { padding: 70px 0; }
  #medico { padding-bottom: 64px; }
}

/* Interesse: safe area no fundo (botão não some sob UI do iOS) */
#interesse {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}


/* ─── 10. Tipografia ────────────────────────────────────── */

h1, h2, h3, h4 {
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: break-word;
  margin-bottom: 28px;
}

h2 {
  margin: 0 0 28px;
  font-size: 28px;
  letter-spacing: -.4px;
}

p, li {
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.6;
  margin-bottom: 1.4em;
}

.prose {
  max-width: 68ch;
  text-align: left;
}

/* Respiro extra entre parágrafos do prose */
.prose p + p { margin-top: 2.1rem; }

.prose strong { color: var(--petrol); }

/* Pull quote editorial — left-aligned (comportamento do v88) */
.section-quote {
  margin: 2.5rem 0;
  max-width: 28ch;
  text-align: left;
  font-size: clamp(1.45rem, 4.1vw, 1.75rem);
  line-height: 1.3;
  font-style: italic;
  color: var(--ink);
}

/* Respiro antes do formulário */
#interesse .prose { margin-bottom: 28px; }


/* ─── 11. Seção Médico ──────────────────────────────────── */

/* Mobile: empilhado */
.medico-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.medico-title { margin: 0 0 6px; }
.medico-text  { margin-top: 36px; }

/* Foto + faixa: colados sem gap */
.medico-photo {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
}

.medico-photo img {
  display: block;
  margin-bottom: 0;
  width: 100%;
}

@media (max-width: 768px) {
  .medico-photo img { border-radius: 0; }
}

/* Desktop médio: grid editorial */
@media (min-width: 900px) {
  #medico { scroll-margin-top: 110px; }

  .medico-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    column-gap: 40px;
    align-items: stretch;
  }

  .medico-title {
    grid-column: 2;
    margin: 0 0 10px;
  }

  .medico-photo {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: stretch;
    border-radius: 4px;
    overflow: hidden;
  }

  .medico-photo img {
    height: 100%;
    object-fit: cover;
  }

  .medico-text {
    margin-top: 0;
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  #medico .container {
    max-width: 1040px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .medico-layout {
    grid-template-columns: 400px minmax(0, 1fr);
    column-gap: 48px;
    justify-content: center;
  }

  .medico-text .prose { max-width: 60ch; }
}

@media (min-width: 1200px) {
  #medico .container { max-width: 1240px; }

  .medico-layout {
    grid-template-columns: 440px 62ch;
    column-gap: 56px;
    justify-content: center;
  }
}

/* Faixa de créditos sob a foto */
.medico-faixa {
  background: #0f1f2e;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.medico-faixa__left  { flex: 1; min-width: 0; }
.medico-faixa__right { flex-shrink: 0; text-align: right; }

.medico-faixa__name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  color: #f5f0e8;
  white-space: nowrap;
  margin-bottom: 5px;
}

.medico-faixa__spec {
  font-size: 11px;
  color: rgba(245,240,232,.5);
  letter-spacing: .06em;
}

.medico-faixa__divider {
  width: 1px;
  height: 36px;
  background: rgba(184,146,42,.35);
  flex-shrink: 0;
}

.medico-faixa__crm {
  font-size: 11px;
  color: #d4aa50;
  letter-spacing: .1em;
  line-height: 1.9;
  white-space: nowrap;
}


/* ─── 12. Formulário de interesse ───────────────────────── */

.interest-form {
  margin: 14px auto 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.interest-form .fields-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.interest-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.interest-form label {
  display: block;
  font-size: .92rem;
  margin: 0 0 6px;
  color: rgba(15,56,74,.78);
}

.interest-form label.label-row {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  color: rgba(15,56,74,.82);
  font-weight: 500;
}

.interest-form .label-text { min-width: 0; color: inherit; }

/* "(opcional)" */
.interest-form .label-hint {
  font-size: .86em;
  color: rgba(15,56,74,.60);
  white-space: nowrap;
}


/* Inputs: apenas linha inferior, fundo transparente */
.interest-form input {
  width: 100%;
  padding: 14px 0 10px;
  border: none;
  border-bottom: 1px solid rgba(181,154,85,.28);
  border-radius: 0;
  background: transparent;
  outline: none;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  transition: border-color .12s ease;
}

.interest-form input::placeholder { color: rgba(15,56,74,.42); }

.interest-form input:focus {
  border-bottom-color: rgba(15,56,74,.38);
}

/* Impede quadrado cinza do autopreenchimento do browser */
.interest-form input:-webkit-autofill,
.interest-form input:-webkit-autofill:hover,
.interest-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--paper) inset;
  -webkit-text-fill-color: var(--ink);
  transition: background-color 5000s ease-in-out 0s;
}

/* Honeypot: absolutamente oculto */
.interest-form .hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

/* Botão */
.interest-form .btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 20px;
  border-radius: 4px;
  border: 1px solid rgba(181,154,85,.42);
  background: var(--petrol);
  color: var(--gold);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: filter .12s ease;
}

.interest-form .btn-primary:hover { filter: brightness(1.03); }

/* Mensagem de status (sucesso / erro) */
.form-status {
  margin-top: 14px;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(15,56,74,.85);
}

.form-status.err { color: rgba(140,35,35,.92); }

/* Desktop: formulário alinha com coluna de leitura */
@media (min-width: 821px) {
  .interest-form {
    margin-top: 18px;
    margin-left: 0;
    margin-right: 0;
  }

  .interest-form .fields-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: end;
  }

  .interest-form .field input {
    padding: 16px 2px 12px;
    border-bottom-color: rgba(10,31,45,.12);
  }

  .interest-form .btn-primary {
    width: 100%;
    margin: 18px 0 0;
    display: block;
    height: 52px;
  }

  .form-status { text-align: left; margin-top: 16px; }
}


/* ─── 13. Footer ────────────────────────────────────────── */

.footer {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0) 60%),
    var(--petrol);
  border-top: 1px solid rgba(181,154,85,.22);
  color: rgba(244,246,246,.88);
  padding: 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  min-height: var(--topbar-h);
  padding: 0 20px;
  max-width: var(--max);
  margin: 0 auto;
}

.footer__meta {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.25;
  color: rgba(244,246,246,.70);
  letter-spacing: .02em;
}


/* ─── 14. Menu mobile (fullscreen overlay) ──────────────── */

/* Trava scroll do body quando menu aberto */
html.menu-open,
body.menu-open {
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Painel fullscreen */
.mobileMenu.is-open {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  min-height: -webkit-fill-available;
  background: var(--petrol);
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  animation: mobileMenuFadeIn 180ms ease-out both;
}

/* Topo interno: logo + botão fechar */
.mobileMenu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.mobileMenu__brand {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.mobileMenu__logo,
.mobileMenu__brand .brand__logo {
  width: 44px;
  height: auto;
  margin-right: 12px;
  display: block;
  filter: none;
}

.mobileMenu__text,
.mobileMenu__brand .brand__text {
  color: #f4f6f6;
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: .22em;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
  display: inline-block;
  opacity: .95;
}

/* Remove underline do brand dentro do menu */
.mobileMenu__brand .brand__text::after { display: none; }

/* Botão X de fechar */
.mobileMenu__close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.mobileMenu__close span {
  position: absolute;
  width: 22px;
  height: 2px;
  background: rgba(244,246,246,.92);
  border-radius: 2px;
}

.mobileMenu__close span:nth-child(1) { transform: rotate(45deg); }
.mobileMenu__close span:nth-child(2) { transform: rotate(-45deg); }

/* Lista de links */
.mobileMenu__links {
  padding: 10px 22px 0;
}

.mobileMenu__links a {
  display: block;
  padding: 18px 0;
  color: rgba(244,246,246,.92);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .2px;
  text-decoration: none;
  background: transparent;
}

/* CTA "Acompanhar o projeto" com borda dourada */
.mobileMenu__links a.nav__cta {
  margin-top: 26px;
  border: 1px solid rgba(181,154,85,.95);
  color: rgba(181,154,85,.98);
  border-radius: 4px;
  padding: 14px 18px;
  text-align: center;
  font-weight: 600;
}

/* Rodapé filosófico */
.mobileMenu__footer {
  margin-top: auto;
  padding: 28px 22px 4px;
  color: rgba(244,246,246,.70);
  font-size: 13px;
  letter-spacing: .06em;
  text-align: center;
  font-style: italic;
  opacity: .72;
}

/* Animação de entrada do painel */
@keyframes mobileMenuFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mobileMenu.is-open { animation: none; }
}


/* ─── Overrides (após animations.v1.css) ───────────────── */

/* Section-quote: mais largo no desktop para preencher a coluna */
@media (min-width: 900px) {
  .section-quote { max-width: 48ch; }
}

/* Nav underline: cancela animação de crescimento do animations.v1.css.
   Especificidade .topbar .nav a (0,2,1) > .nav a:not(.nav__cta) (0,1,1) */
@media (min-width: 900px) {
  .topbar .nav a::after {
    content: "";
    position: absolute;
    bottom: -5px; left: 0; right: 0;
    width: auto;
    height: 1px;
    background: rgba(244,246,246,.75);
    opacity: 0;
    transition: opacity .18s ease;
  }

  .topbar .nav a:hover::after,
  .topbar .nav a:focus-visible::after {
    opacity: 1;
    width: auto;
  }
}

/* ─── Classes para inline styles migrados ──────────────── */

/* mobileMenu__links: grid com gap mínimo */
.mobileMenu__links {
  display: grid;
  gap: 2px;
}

/* mobileMenu__footer: estilos tipográficos fixos */
/* (já definido na seção menu mobile — valores consolidados lá) */

/* Nav link ativo (página atual destacada) */
.nav a.is-current {
  color: #f4f1ec;
  opacity: 1;
}

/* Seção cadernos: padding específico */
.section--cadernos-hero {
  padding-top: 64px;
  padding-bottom: 80px;
}

/* Seção atendimento: padding específico */
.section--atendimento-hero {
  padding-top: 56px;
}

/* Seção artigo caderno: padding específico */
.section--artigo {
  padding-top: 52px;
  padding-bottom: 72px;
}
