/* ==========================================================================
   Santa Casa de Sabará: fundação: tokens, reset, tipografia, utilitários
   ========================================================================== */

:root {
  /* Vinho institucional: extraído do logotipo (#752636) */
  --wine-950: #350F18;
  --wine-900: #4A1522;
  --wine-800: #5E1E2C;
  --wine-700: #752636;
  --wine-600: #8B3247;
  --wine-500: #A2455B;
  --wine-300: #C98A9B;
  --wine-350: #BC7787;  /* 3,4:1 no branco: o menor tom que passa em texto grande */
  --wine-100: #F0DCE1;
  --wine-50:  #FAF1F3;

  /* Rosa do coração da marca */
  --rose-500: #E2708C;
  --rose-400: #EE92A8;
  --rose-300: #F5B3C2;
  --rose-200: #FAD3DC;
  --rose-100: #FDE8ED;
  --rose-50:  #FEF5F7;

  /* Dourado discreto: memória dos dois séculos */
  --gold-700: #8A6A34;
  --gold-600: #A9833F;
  --gold-500: #C4A054;
  --gold-200: #EEDFBE;
  --gold-50:  #FBF6EA;

  /* Neutros quentes */
  --ink-900: #1C1416;
  --ink-800: #2E2327;
  --ink-700: #4A3B40;
  --ink-600: #635257;
  --ink-500: #6E5C62;
  --ink-400: #7B686E;  /* 5.2:1 no branco; o #8F7F84 anterior ficava em 3.8 */
  --ink-300: #B4A7AB;
  --ink-200: #DCD2D5;
  --ink-100: #EDE6E8;
  --paper:   #FFFFFF;
  --cream:   #FBF8F7;
  --cream-2: #F6F0EF;
  --line:    #E8DEE1;
  --line-soft: #F1EAEC;

  /* Sinalização */
  --ok-700:   #1F6B4A;
  --wa:       #158043;  /* verde do WhatsApp escurecido: branco sobre ele dá 5.0:1 */
  --wa-dark:  #106836;
  --ok-100:   #DFF3E8;
  --warn-700: #8A5A12;
  --warn-100: #FBEDD5;
  --info-700: #1C5A76;
  --info-100: #DDEFF7;

  /* Tipografia */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.97rem + 0.16vw, 1.08rem);
  --step-1:  clamp(1.16rem, 1.10rem + 0.30vw, 1.35rem);
  --step-2:  clamp(1.38rem, 1.27rem + 0.54vw, 1.75rem);
  --step-3:  clamp(1.64rem, 1.45rem + 0.92vw, 2.30rem);
  --step-4:  clamp(1.95rem, 1.64rem + 1.53vw, 3.05rem);
  --step-5:  clamp(2.30rem, 1.82rem + 2.40vw, 4.05rem);
  --step-6:  clamp(2.70rem, 1.94rem + 3.75vw, 5.20rem);

  /* Espaçamento: escala de 4px */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 2.5rem;   --sp-8: 3rem;
  --sp-9: 4rem;     --sp-10: 5rem;    --sp-11: 6.5rem;  --sp-12: 8rem;

  /* Traços */
  --r-xs: 4px;  --r-sm: 8px;  --r-md: 12px;  --r-lg: 18px;  --r-xl: 26px;  --r-full: 999px;

  --shadow-xs: 0 1px 2px rgba(53, 15, 24, .06);
  --shadow-sm: 0 2px 6px rgba(53, 15, 24, .06), 0 1px 2px rgba(53, 15, 24, .04);
  --shadow-md: 0 8px 24px rgba(53, 15, 24, .08), 0 2px 6px rgba(53, 15, 24, .04);
  --shadow-lg: 0 20px 48px rgba(53, 15, 24, .12), 0 4px 12px rgba(53, 15, 24, .06);
  --shadow-xl: 0 32px 72px rgba(53, 15, 24, .16), 0 8px 20px rgba(53, 15, 24, .06);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --wrap: 1240px;
  --wrap-narrow: 680px;  /* ~74 caracteres por linha no corpo de texto; 820px dava 90 */
  --wrap-wide: 1440px;
  --gutter: clamp(1.15rem, 4vw, 3rem);

  --header-h: 84px;
}

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink-800);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--sp-4); font-weight: 600; line-height: 1.15; color: var(--ink-900); text-wrap: balance; }
h1 { font-family: var(--font-display); font-size: var(--step-5); font-weight: 600; letter-spacing: -0.015em; }
h2 { font-family: var(--font-display); font-size: var(--step-4); font-weight: 600; letter-spacing: -0.012em; }
h3 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; letter-spacing: -0.008em; }
h4 { font-size: var(--step-1); font-weight: 650; letter-spacing: -0.005em; }
h5, h6 { font-size: var(--step-0); font-weight: 650; }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--wine-700); text-decoration-color: color-mix(in srgb, var(--wine-700) 32%, transparent); text-underline-offset: 3px; transition: color .2s var(--ease), text-decoration-color .2s var(--ease); }
a:hover { color: var(--wine-600); text-decoration-color: currentColor; }

/* O `display` dos componentes (flex/grid) vence o `[hidden]` da folha do
   navegador: sem esta linha, o filtro de especialidades e o de convênios
   marcavam os itens como ocultos e eles continuavam visíveis. */
[hidden] { display: none !important; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.35em; }
li { margin-bottom: .4em; }
li::marker { color: var(--wine-500); }

strong, b { font-weight: 650; color: var(--ink-900); }

blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-5) var(--sp-6);
  border-left: 3px solid var(--wine-700);
  background: var(--wine-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  color: var(--wine-900);
}
blockquote p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-8) 0; }

table { border-collapse: collapse; width: 100%; }

code, pre, kbd { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .9em; }

:target { scroll-margin-top: calc(var(--header-h) + 2rem); }

::selection { background: var(--rose-200); color: var(--wine-950); }

:focus-visible {
  outline: 3px solid var(--wine-600);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Layout ---------- */

.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--gutter) * 2, var(--wrap-narrow)); margin-inline: auto; }
.wrap--wide { width: min(100% - var(--gutter) * 2, var(--wrap-wide)); margin-inline: auto; }

.section { padding-block: clamp(3.25rem, 7vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--cream { background: var(--cream); }
.section--rose { background-color: var(--rose-50); background-image: linear-gradient(180deg, var(--rose-50), var(--paper)); }
.section--wine { background: var(--wine-900); color: var(--rose-100); }
.section--wine h1, .section--wine h2, .section--wine h3, .section--wine h4 { color: #fff; }

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

.stack > * + * { margin-top: var(--sp-4); }

/* ---------- Utilitários ---------- */

.u-center { text-align: center; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mt-6 { margin-top: var(--sp-6); }
.u-measure { max-width: 68ch; }
.u-measure-tight { max-width: 54ch; }

.screen-reader-text, .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: var(--sp-4);
  z-index: 9999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--wine-800); color: #fff;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 600; text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* Olho-título de seção */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  margin: 0 0 var(--sp-3);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wine-600);
}
.eyebrow::before {
  content: ""; width: 1.85rem; height: 2px;
  background: currentColor; border-radius: 2px;
  opacity: .55;
}
.eyebrow--center { justify-content: center; }
.section--wine .eyebrow { color: var(--rose-300); }

.section-head { margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head--center { text-align: center; max-width: 46rem; margin-inline: auto; }
.section-head__lead { font-size: var(--step-1); color: var(--ink-500); margin-bottom: 0; }
.section--wine .section-head__lead { color: var(--rose-200); }

.lead { font-size: var(--step-1); line-height: 1.6; color: var(--ink-600); }

/* Revelação ao rolar */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
