/* Cardiólogos en Línea · «Cuidar empieza por escucharte»
   Hoja de estilos compartida por todas las páginas. */

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-latin-opsz.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color */
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --ink: #15324D;
  --ink-deep: #0F2740;
  --ink-2: #52616C;
  --red: #B8323C;
  --red-soft: #E07A80;
  --divider: #D9E1E5;
  --wa: #146A43;
  --wa-hover: #0E5634;
  --focus: #1D5FA8;

  /* Tipografía */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-body: 1.125rem;
  --fs-small: 1rem;
  --fs-label: 0.8125rem;
  --fs-display: clamp(2.5rem, 1.2rem + 4.6vw, 5.25rem);
  --fs-display-md: clamp(2.25rem, 1.1rem + 3.6vw, 4.5rem);
  --fs-h2: clamp(2rem, 1.25rem + 2.2vw, 3.25rem);
  --fs-h3: clamp(1.5rem, 1.15rem + 1vw, 2.125rem);

  /* Espacio y retícula */
  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1296px;
  --wrap-left: calc((100% - min(100% - 2 * var(--gutter), var(--maxw))) / 2);
  --rail-indent: clamp(22px, 5.5vw, 96px);
  --section-y: clamp(64px, 4vw + 40px, 120px);
  --header-h: 64px;
  --dock-h: 0px;
  --radius: 6px;
  --thread: 2px;

  /* Movimiento */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-draw: cubic-bezier(.65, 0, .35, 1);
}

@media (min-width: 1024px) {
  :root { --header-h: 80px; --fs-body: 1.1875rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  padding-bottom: var(--dock-h);
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
address { font-style: normal; }
button { font: inherit; color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.sr-only, .hero__caption {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* ---------- Tipografía ---------- */
.eyebrow {
  font-size: var(--fs-label);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}
.display, .h2, .doctor__name, .index__title, .paths__title, .place__street, .closing__title, .page-title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 420;
  text-wrap: balance;
}
.display {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.022em;
}
.display--md { font-size: var(--fs-display-md); line-height: 1.04; letter-spacing: -0.02em; }
.h2 { font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.015em; max-width: 20ch; }
.lead { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); line-height: 1.5; color: var(--ink-2); max-width: 34em; text-wrap: pretty; }
p { text-wrap: pretty; }

/* ---------- Botones y enlaces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border: 2px solid transparent; border-radius: var(--radius);
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 650; line-height: 1.2;
  text-decoration: none; text-align: center;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--lg { min-height: 60px; padding: 0 28px; font-size: 1.125rem; }
.btn--sm { min-height: 46px; padding: 0 18px; font-size: 1rem; }
.btn--wa { background: var(--wa); color: #fff; box-shadow: 0 1px 0 rgba(15, 39, 64, .08), 0 8px 24px -14px rgba(20, 106, 67, .7); }
.btn--wa:hover { background: var(--wa-hover); box-shadow: 0 1px 0 rgba(15, 39, 64, .08), 0 14px 28px -14px rgba(20, 106, 67, .8); }
.btn--wa-line { background: var(--surface); color: var(--wa); border-color: rgba(20, 106, 67, .45); }
.btn--wa-line:hover { border-color: var(--wa); background: #F1F7F3; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--ink-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: rgba(21, 50, 77, .35); }
.btn--ghost:hover { border-color: var(--ink); background: var(--surface); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  font-weight: 650; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(21, 50, 77, .35);
}
.link-arrow .icon { transition: transform .25s var(--ease); color: var(--red); }
.link-arrow:hover .icon { transform: translateX(4px); }
.link-arrow--sm { font-size: 1rem; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--divider); }
/* En reposo la cabecera es transparente: la línea del logo puede bajar hacia la página. */
.trace-on .site-header:not(.is-scrolled) { background: transparent; }
.site-header__inner {
  display: flex; align-items: center; gap: 24px; min-height: var(--header-h); flex-wrap: wrap;
}
.brand { display: block; flex: none; margin-right: auto; padding: 6px 0; }
.brand img { width: auto; height: 38px; }
.nav__list { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 1rem; font-weight: 550; text-decoration: none; color: var(--ink);
  background: linear-gradient(var(--red), var(--red)) left calc(100% - 8px) / 0 2px no-repeat;
  transition: background-size .3s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { background-size: 100% 2px; }
.site-header__actions { display: flex; align-items: center; gap: 16px; }
.link-phone {
  display: none; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 650; text-decoration: none; white-space: nowrap;
}
.link-phone .icon { color: var(--red); }
.site-header .btn--wa { display: none; }
.menu-toggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  background: transparent; border: 1.5px solid rgba(21, 50, 77, .3); border-radius: var(--radius);
  font-weight: 650; cursor: pointer;
}
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s;
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Sin JS: la navegación se muestra en una fila bajo el logo. */
html:not(.js) .menu-toggle { display: none; }
html:not(.js) .nav { order: 3; width: 100%; padding-bottom: 10px; }

/* Con JS en pantallas pequeñas: panel desplegable. */
@media (max-width: 1179px) {
  .js .nav {
    position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 49;
    background: var(--bg); border-top: 1px solid var(--divider);
    padding: 8px var(--gutter) calc(96px + env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
  }
  .js .nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .25s var(--ease), transform .25s var(--ease); }
  .js .nav__list { flex-direction: column; gap: 0; }
  .js .nav__list li + li { border-top: 1px solid var(--divider); }
  .js .nav a { min-height: 60px; width: 100%; font-family: var(--serif); font-size: 1.5rem; font-weight: 420; background: none; }
  .js .nav .nav__contact { display: grid; gap: 12px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--divider); }
  .js .nav .nav__contact .btn { display: inline-flex; font-family: var(--sans); font-size: 1.125rem; font-weight: 650; }
  .js .nav .nav__contact .btn--wa { background: var(--wa); color: #fff; }
  .js .nav .nav__contact .btn--ghost { color: var(--ink); }
  .nav__address { margin-top: 6px; color: var(--ink-2); font-size: var(--fs-small); }
}
.nav__contact { display: none; }
@media (min-width: 640px) {
  .site-header .btn--wa { display: inline-flex; }
}
@media (min-width: 1024px) {
  .brand img { height: 54px; }
}
@media (min-width: 1180px) {
  .menu-toggle { display: none; }
  .site-header__inner { flex-wrap: nowrap; }
  .nav { margin-right: 8px; }
}
@media (min-width: 1360px) {
  .link-phone { display: inline-flex; }
}

/* ---------- La línea (hilo gráfico) ---------- */
/* Respaldo sin JavaScript: trazos CSS estáticos, siempre completos.
   Con JavaScript, scripts/line.js dibuja un único trazo SVG continuo (html.trace-on). */
.thread { position: absolute; display: block; background: var(--red); pointer-events: none; }
.rail { position: relative; }
:root { --rail-shift: 0px; }
@media (max-width: 767px) { :root { --rail-shift: 8px; } }
.rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--wrap-left) + var(--rail-shift));
  width: var(--thread); background: var(--red);
}
.rail--end::before { bottom: auto; height: 100%; }
.rail__inner { padding-left: var(--rail-indent); }

.trace-on .rail::before,
.trace-on .thread,
.trace-on .paths__item::before,
.trace-on .index__row::before,
.trace-on .doctor__photo::after { visibility: hidden; }
.trace-on .doctor__photo { border-bottom-color: transparent; }

body { position: relative; }
.trace {
  position: absolute; left: 0; top: 0; z-index: 2; overflow: visible;
  pointer-events: none;
}
.trace path { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: butt; stroke-linejoin: round; }
.trace .trace__intro { transition: stroke-dashoffset 1.8s var(--ease-draw) .3s; }
.trace .trace__main.is-catching { transition: stroke-dashoffset .28s var(--ease-draw); }
.trace .trace__node { fill: var(--bg); stroke: var(--red); stroke-width: 2; transition: fill .35s var(--ease); }
.trace .trace__node.is-on { fill: var(--red); }
.trace .trace__head { fill: var(--red); transition: opacity .2s var(--ease); }
.trace .trace__closing { stroke: #D9545E; }
/* Llegada: el trazo rodea el botón donde termina. */
.trace-on .steps__cta .btn, .trace-on .closing__cta .btn { transition: box-shadow .5s var(--ease), background-color .2s var(--ease), transform .2s var(--ease); }
.trace-on .steps__cta .btn.is-reached { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--red); }
.trace-on .closing__cta .btn.is-reached { box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px #D9545E; }
.steps__node { transition: background-color .35s var(--ease), color .35s var(--ease); }
.steps__node.is-on { background: var(--red); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .trace .trace__intro, .trace .trace__node, .steps__node { transition: none; }
  .btn, .link-arrow .icon, .nav a { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- Escena 1 · Bienvenida «Hazle un espacio a tu corazón» ----------
   Granate profundo con texto marfil; el equipo médico sobre un plano rosa empolvado
   que llega al borde derecho y tiene una sola esquina curva (arriba a la izquierda). */
.hero {
  --hero-bg: #542331;
  --ivory: #F6EEE6;
  --ivory-2: rgba(246, 238, 230, .82);
  --rose: #E6CBC8;
  --rose-line: #E7A9B2;
  --plane-radius: clamp(56px, 7vw, 120px);
  position: relative;
  background: var(--hero-bg);
  color: var(--ivory);
  overflow: clip;
}
.hero__grid { display: grid; }
.hero__copy { padding-left: var(--rail-indent); }
.hero .eyebrow { color: #EDB9BF; }
.hero .display {
  font-size: clamp(2.375rem, 0.9rem + 4.3vw, 4.75rem);
  line-height: 1.02; letter-spacing: -0.024em; color: var(--ivory);
}
.hero .display span { display: block; }
.hero .lead { color: var(--ivory-2); max-width: 31em; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 32px; }
.hero__cta { display: flex; flex-direction: column; gap: 10px; }
.hero__note { font-size: var(--fs-small); color: var(--ivory-2); }
.btn--ivory {
  background: var(--ivory); color: #3E1823;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12), 0 14px 30px -18px rgba(0, 0, 0, .7);
}
.btn--ivory .icon { color: #8E2F3F; }
.btn--ivory:hover { background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .12), 0 18px 34px -18px rgba(0, 0, 0, .8); }
.hero :focus-visible { outline-color: var(--ivory); }
.hero__more { color: var(--ivory); min-height: 60px; text-decoration-color: rgba(246, 238, 230, .45); }
.hero__more .icon { color: #EDB9BF; }

.hero__photo { position: relative; margin: 0; background: var(--rose); border-top-left-radius: var(--plane-radius); overflow: hidden; }
.hero__photo picture { position: absolute; inset: 0; display: block; }
/* Retrato original con su fondo blanco pasado al rosa del plano (assets/production/equipo-rosa-v1):
   rostros y batas conservan sus píxeles. Una sombra muy baja asienta al equipo sobre el piso. */
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.hero__photo::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none;
  background: linear-gradient(to top, rgba(62, 24, 35, .16), rgba(62, 24, 35, 0));
}

.hero__base { position: relative; }
.hero__services {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0;
  padding-left: var(--rail-indent); min-height: 64px;
  font-size: 0.9375rem; font-weight: 450; letter-spacing: .04em; color: var(--ivory);
}
.hero__services li { display: flex; align-items: center; }
.hero__services li + li::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%; margin-inline: 20px; background: var(--rose-line);
}
.hero .thread--floor { left: var(--wrap-left); right: 0; top: 0; bottom: auto; height: var(--thread); background: var(--rose-line); }
/* Una sola acción dominante por encuadre: mientras se ve la llamada marfil, la de cabecera pasa a contorno. */
.site-header.is-quiet .site-header__actions .btn--wa {
  background: transparent; color: var(--hero-bg, #542331); border-color: rgba(84, 35, 49, .4); box-shadow: none;
}
.site-header.is-quiet .site-header__actions .btn--wa .icon { color: var(--wa); }
.trace .trace__start { fill: var(--bg); }
/* En el primer encuadre sólo asoma el capítulo siguiente (nodo + antetítulo), nunca un título cortado. */
@media (min-width: 860px) {
  .hero + .section { padding-top: clamp(80px, 6.8vw, 104px); }
  .hero__photo img { transform: scale(1.06); transform-origin: 46% 100%; }
}
/* Respuesta de la línea a la llamada: una luz recorre una vez el piso hacia el equipo. */
.trace .trace__pulse { stroke: #FFF8F1; stroke-width: 2.5; stroke-linecap: butt; stroke-dasharray: 0 100000; visibility: hidden; }
.trace .trace__pulse.is-running { visibility: visible; }
/* Destino del trazo: un nodo abierto al pie del equipo; se enciende cuando llega la luz. */
.trace .trace__foot { fill: #542331; stroke: #E7A9B2; stroke-width: 2; transition: fill .5s var(--ease), stroke .5s var(--ease); }
.trace .trace__foot { animation: foot-in .45s var(--ease) 1.95s both; }
@keyframes foot-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .trace .trace__foot { animation: none; } }
.trace .trace__foot.is-lit { fill: #FFF8F1; stroke: #FFF8F1; transition-duration: .15s; }
.trace .trace__pulse.is-running { transition: stroke-dashoffset 1.15s cubic-bezier(.45, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) { .trace .trace__pulse { display: none; } }

/* Entrada suave del mensaje (una sola vez). */
@keyframes hero-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero__copy > * { animation: hero-in .8s var(--ease) both; }
.hero__copy > :nth-child(2) { animation-delay: .08s; }
.hero__copy > :nth-child(3) { animation-delay: .18s; }
.hero__copy > :nth-child(4) { animation-delay: .26s; }

@media (max-width: 859px) {
  .hero__grid { padding-top: 28px; }
  .hero .eyebrow { margin-bottom: 12px; }
  .hero .display { font-size: clamp(2.125rem, 10.2vw, 3.25rem); }
  .hero .lead { margin-top: 14px; font-size: 1.0625rem; }
  .hero__actions { margin-top: 22px; flex-direction: column; align-items: stretch; gap: 6px; }
  .hero__cta .btn { width: 100%; }
  .hero__note { text-align: left; }
  .hero__copy, .hero__services { padding-left: calc(var(--rail-indent) + var(--rail-shift) + 6px); }
  .hero__more { min-height: 48px; align-self: flex-start; }
  /* El plano llega al borde derecho; a la izquierda deja pasar la línea. */
  .hero__photo {
    margin-top: 22px; margin-left: calc(var(--rail-indent) + var(--rail-shift) + 6px); margin-right: calc(-1 * var(--gutter));
    height: clamp(300px, 86vw, 480px); --plane-radius: clamp(48px, 14vw, 88px);
  }
  .hero__photo img { object-position: 50% 24%; }
  .hero__services { flex-direction: column; align-items: flex-start; padding-block: 16px 20px; gap: 8px; }
  .hero__services li::before,
  .hero__services li + li::before {
    content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; margin: 0 12px 0 0; background: var(--rose-line);
  }
}
@media (min-width: 860px) {
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
    /* ~650px de bienvenida en escritorio, siempre dentro del primer pantallazo. */
    grid-template-rows: minmax(clamp(500px, calc(100svh - var(--header-h) - 64px - 28px), 620px), auto);
  }
  .hero__copy { grid-column: 1 / span 7; align-self: center; padding-block: clamp(28px, 3vw, 44px); }
  .hero .eyebrow { margin-bottom: 20px; }
  .hero .lead { margin-top: 22px; }
  .hero__actions { margin-top: 32px; }
  .hero__photo {
    grid-column: 8 / -1; margin-top: clamp(24px, 3vw, 40px);
    margin-right: calc(-1 * max(var(--gutter), (100vw - var(--maxw)) / 2));
  }
}
@media (min-width: 860px) and (max-width: 1099px) {
  .hero .lead { font-size: 1.125rem; }
  .hero__actions { margin-top: 26px; gap: 4px 24px; }
  .hero__services li + li::before { margin-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__copy > * { animation: none; }
}

/* ---------- Secciones ---------- */
.section { padding-block: var(--section-y); }
.section__head { margin-bottom: clamp(36px, 4vw, 64px); }
.section__head--split { display: grid; gap: 20px; }
.section__intro { color: var(--ink-2); max-width: 34em; }
@media (min-width: 1024px) {
  .section__head--split { grid-template-columns: 7fr 5fr; gap: 0 48px; align-items: start; }
  .section__head--split > div { display: contents; }
  .section__head--split .eyebrow { grid-column: 1 / -1; }
  .section__head--split .h2 { grid-column: 1; }
  .section__head--split .section__intro { grid-column: 2; padding-top: .7em; }
}

/* Escena 2 · Orientación */
.paths { border-top: 1px solid var(--divider); }
.paths__item {
  position: relative; display: grid; gap: 6px 24px;
  grid-template-columns: 1fr auto;
  padding: 26px 0 28px; border-bottom: 1px solid var(--divider);
}
.paths__item::before {
  content: ""; position: absolute; top: -5px; left: calc(-1 * var(--rail-indent) + var(--rail-shift) - 4px);
  width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--red);
}
.paths__num { grid-column: 1 / -1; font-size: var(--fs-label); font-weight: 650; letter-spacing: .14em; color: var(--red); }
.paths__title { font-size: var(--fs-h3); line-height: 1.12; letter-spacing: -0.01em; }
.paths__title a { text-decoration: none; }
.paths__title a::after { content: ""; position: absolute; inset: 0; }
.paths__text { grid-column: 1 / 2; color: var(--ink-2); max-width: 32em; }
.paths__go {
  grid-column: 2; grid-row: 2 / span 2; align-self: center;
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px solid rgba(21, 50, 77, .25); color: var(--red);
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), border-color .3s var(--ease);
}
.paths__item:hover .paths__go { background: var(--red); border-color: var(--red); color: #fff; transform: translateX(4px); }
.paths__item:hover .paths__title a { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.paths__item:focus-within { outline: 3px solid var(--focus); outline-offset: 4px; }
.paths__item a:focus-visible { outline: none; }
@media (min-width: 900px) {
  .paths__item { grid-template-columns: 72px minmax(0, 5fr) minmax(0, 5fr) auto; align-items: center; padding: 34px 0; }
  .paths__num { grid-column: 1; }
  .paths__text { grid-column: 3; }
  .paths__go { grid-column: 4; grid-row: 1; }
}

/* Escena 3 · Nuestra forma de atender */
.manner { background: var(--surface); }
.manner__head { max-width: 980px; }
.manner__intro { margin-top: 28px; font-size: clamp(1.125rem, 1rem + .45vw, 1.375rem); color: var(--ink-2); max-width: 36em; }
.principles { display: grid; gap: 32px; margin-top: clamp(48px, 5vw, 80px); }
.principles li { padding-top: 22px; border-top: 1px solid var(--divider); position: relative; }
.principles li::before { content: ""; position: absolute; top: -1px; left: 0; width: 40px; height: 2px; background: var(--red); }
.principles h3 { font-family: var(--serif); font-weight: 450; font-size: 1.625rem; line-height: 1.2; margin-bottom: 8px; }
.principles p { color: var(--ink-2); }
@media (min-width: 860px) { .principles { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* Escena 4 · Equipo */
.team__grid { display: grid; gap: 48px; max-width: 1080px; }
.team .section__head { margin-bottom: clamp(8px, 1.5vw, 24px); }
.doctor__photo { position: relative; border-bottom: var(--thread) solid var(--red); }
.doctor__photo img { width: 100%; aspect-ratio: 1086 / 1340; object-fit: cover; object-position: 50% 100%; mix-blend-mode: multiply; }
.doctor:first-child .doctor__photo::after {
  content: ""; position: absolute; bottom: calc(-1 * var(--thread)); left: calc(-1 * var(--rail-indent));
  width: var(--rail-indent); height: var(--thread); background: var(--red);
}
.doctor__body { padding-top: 22px; }
.doctor__role { font-size: var(--fs-label); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }
.doctor__name { font-size: var(--fs-h3); line-height: 1.12; margin-bottom: 10px; }
.doctor__body p:last-child { color: var(--ink-2); max-width: 28em; }
.team__actions { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: clamp(40px, 4vw, 64px); }
@media (min-width: 720px) {
  .team__grid { grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 4vw, 64px); }
  .doctor + .doctor .doctor__photo::after {
    content: ""; position: absolute; bottom: calc(-1 * var(--thread)); right: 100%;
    width: clamp(24px, 4vw, 64px); height: var(--thread); background: var(--red);
  }
}
@media (max-width: 719px) {
  .doctor .doctor__photo::after {
    content: ""; position: absolute; bottom: calc(-1 * var(--thread)); left: calc(-1 * var(--rail-indent));
    width: var(--rail-indent); height: var(--thread); background: var(--red);
  }
  .team__grid { gap: 84px; }
  .doctor__body { padding-top: 14px; }
  .team__actions .btn { flex: 1 1 100%; }
}

/* Escena 5 · Estudios */
.index { border-top: 1px solid var(--divider); }
.index__row { position: relative; display: grid; gap: 14px; padding: 28px 0 30px; border-bottom: 1px solid var(--divider); }
.index__row::before {
  content: ""; position: absolute; top: -5px; left: calc(-1 * var(--rail-indent) + var(--rail-shift) - 4px);
  width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--red);
}
.index__num { font-size: var(--fs-label); font-weight: 650; letter-spacing: .14em; color: var(--red); }
.index__title { font-size: var(--fs-h3); line-height: 1.12; letter-spacing: -0.01em; margin-bottom: 6px; }
.index__title a { text-decoration: none; }
.index__title a:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.index__main p { color: var(--ink-2); max-width: 32em; }
.index__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
@media (max-width: 699px) {
  .index__actions .btn { flex: 1 1 100%; }
}
@media (min-width: 1024px) {
  .index__row { grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 32px 0; }
  .index__num { align-self: start; padding-top: 12px; }
  .index__actions { justify-content: flex-end; flex-wrap: nowrap; }
}

.also { margin-top: clamp(40px, 4vw, 64px); display: grid; gap: 16px; }
.also__title { font-size: var(--fs-label); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.also__list { display: grid; gap: 0; }
.also__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; border-bottom: 1px dashed var(--divider);
}
.also__name { font-family: var(--serif); font-size: 1.3125rem; }
.also__list a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 650; color: var(--wa); }
@media (min-width: 1024px) {
  .also { grid-template-columns: 200px 1fr; align-items: start; }
  .also__title { padding-top: 20px; }
  .also__list { grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
}

/* Escena 6 · Coordina */
.steps .section__head { position: relative; }
.steps__track { --node: 56px; --cta-w: 300px; --track-gap: clamp(36px, 4vw, 64px); position: relative; }
.thread--steps {
  background: none; left: calc(-1 * var(--rail-indent)); top: calc(-1 * var(--track-gap) - 2px);
  border-left: var(--thread) solid var(--red); border-bottom: var(--thread) solid var(--red);
}
.steps__list li { position: relative; }
.steps__node {
  display: inline-grid; place-items: center; width: var(--node); height: var(--node); border-radius: 50%;
  background: var(--bg); border: var(--thread) solid var(--red); color: var(--ink);
  font-family: var(--serif); font-size: 1.5rem; font-weight: 500; position: relative; z-index: 3;
  line-height: 1; font-variant-numeric: lining-nums tabular-nums;
}
.steps__list p { margin-top: 16px; font-size: 1.1875rem; max-width: 22em; }
.steps__note { color: var(--ink-2); font-size: var(--fs-small); }

@media (max-width: 899px) {
  .steps__track { display: flex; flex-direction: column; gap: 36px; }
  .thread--steps { width: var(--rail-indent); bottom: 30px; }
  .steps__list { display: grid; gap: 28px; }
  .steps__list li { padding-left: 16px; }
  .steps__node { --node: 34px; position: absolute; left: calc(-1 * var(--rail-indent) + var(--rail-shift) - 16px); top: 3px; font-size: 1.125rem; }
  .steps__list p { margin-top: 0; padding-top: 8px; }
  .steps__cta { display: flex; flex-direction: column-reverse; gap: 14px; padding-left: 16px; }
  .steps__cta .btn { width: 100%; }
}
@media (min-width: 900px) {
  .steps__track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) var(--cta-w); gap: 0 32px; align-items: start; }
  .thread--steps { height: calc(var(--track-gap) + 2px + var(--node) / 2 + 1px); right: var(--cta-w); }
  .steps__list { display: contents; }
  .steps__cta { grid-column: 4; display: grid; gap: 14px; margin-top: calc(var(--node) / 2 - 30px); }
  .steps__cta .btn { width: 100%; white-space: nowrap; }
  .steps__track { --cta-w: 340px; }
}

/* Escena 7 · Ubicación */
.place { background: var(--surface); }
.place__grid { display: grid; gap: 56px; }
.place__address { margin-top: 28px; display: grid; gap: 4px; font-size: 1.1875rem; color: var(--ink-2); }
.place__street { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.5rem); line-height: 1.05; color: var(--ink); letter-spacing: -0.015em; }
.place__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.place__label { font-size: var(--fs-label); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }
.place__label:not(:first-child) { margin-top: 40px; }
.hours div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.hours div:first-child { border-top: 1px solid var(--divider); }
.hours dt { font-weight: 600; }
.hours dd { color: var(--ink-2); text-align: right; }
.contact-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.contact-list li:first-child { border-top: 1px solid var(--divider); }
.contact-list .icon { grid-row: span 2; color: var(--red); margin-top: 4px; }
.contact-list span { font-size: var(--fs-small); color: var(--ink-2); }
.contact-list a { font-weight: 650; overflow-wrap: anywhere; min-height: 32px; display: inline-flex; align-items: center; }
.fine { margin-top: 24px; font-size: var(--fs-small); color: var(--ink-2); }
@media (max-width: 599px) { .place__actions .btn { flex: 1 1 100%; } }
@media (min-width: 960px) {
  .place__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; }
  .place__lead { grid-column: 1 / span 6; }
  .place__info { grid-column: 8 / -1; padding-top: 6px; }
}

/* Escena 8 · Preguntas */
.faq__grid { display: grid; gap: 32px; }
.faq__list { border-top: 1px solid var(--divider); }
.faq details { border-bottom: 1px solid var(--divider); }
.faq summary {
  position: relative; display: flex; align-items: center; min-height: 72px; padding: 16px 52px 16px 0;
  font-family: var(--serif); font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem); line-height: 1.25; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 18px; height: 2px; background: var(--red);
  transition: transform .3s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq details p { padding: 0 52px 24px 0; color: var(--ink-2); max-width: 40em; }
@media (min-width: 960px) {
  .faq__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; }
  .faq__head { grid-column: 1 / span 4; }
  .faq__list { grid-column: 6 / -1; }
}

/* Escena 9 · Cierre */
.closing { background: var(--ink); color: #fff; padding-block: clamp(80px, 8vw, 144px); position: relative; overflow: hidden; }
.closing__grid { display: grid; gap: 24px; padding-left: var(--rail-indent); }
.closing__title { color: #fff; max-width: 14ch; }
.closing__text { color: rgba(255, 255, 255, .82); font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); max-width: 30em; }
.closing__cta { position: relative; display: grid; gap: 16px; margin-top: 16px; }
.thread--closing { background: var(--red-soft); height: var(--thread); }
.closing .btn--wa { box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .6); }
.closing__phone { display: inline-flex; align-items: center; min-height: 48px; color: #fff; font-weight: 600; }
.closing :focus-visible { outline-color: #fff; }
@media (max-width: 767px) {
  .thread--closing { position: relative; display: block; width: calc(100% + var(--gutter)); margin-left: calc(-1 * var(--gutter)); }
  .closing__cta .btn { width: 100%; }
  .trace-on .closing__cta { padding-left: 16px; }
  .trace .trace__intro { transition-duration: 1.1s; }
}
@media (min-width: 768px) {
  .closing__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: end; }
  .closing__title { grid-column: 1 / span 7; }
  .closing__text { grid-column: 8 / -1; padding-bottom: 10px; }
  .closing__cta { grid-column: 1 / -1; display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin-top: clamp(24px, 3vw, 48px); }
  .thread--closing { position: relative; flex: 1 1 120px; margin-left: calc((100% - 100vw) / 2); }
  .closing__phone { flex-basis: 100%; justify-content: flex-end; }
}

/* ---------- Pie ---------- */
.site-footer { padding-block: 64px 40px; font-size: var(--fs-small); }
.site-footer__grid { display: grid; gap: 40px; }
.site-footer__brand img { width: 180px; height: auto; margin-bottom: 16px; }
.site-footer__brand p, .site-footer__contact p { color: var(--ink-2); }
.site-footer__contact p + p { margin-top: 12px; }
.site-footer__label { font-family: var(--sans); font-size: var(--fs-label); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }
.site-footer__nav ul + .site-footer__label { margin-top: 28px; }
.site-footer__nav li a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; }
.site-footer__nav li a:hover { text-decoration: underline; }
.site-footer__social { display: flex; flex-wrap: wrap; gap: 0 18px; }
.site-footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--divider); color: var(--ink-2);
}
.site-footer__legal ul { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer__legal a { display: inline-flex; align-items: center; min-height: 40px; }
@media (min-width: 900px) {
  .site-footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; }
}

/* ---------- Barra móvil ---------- */
.dock { display: none; }
@media (max-width: 767px) {
  :root { --dock-h: calc(76px + env(safe-area-inset-bottom)); }
  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(250, 248, 245, .97); border-top: 1px solid var(--divider);
    box-shadow: 0 -10px 30px -20px rgba(15, 39, 64, .35);
  }
  .dock__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px;
    border-radius: var(--radius); font-weight: 650; font-size: 1.0625rem; text-decoration: none;
  }
  .dock { transition: transform .24s var(--ease), visibility 0s linear 0s; }
  .dock.is-hidden { transform: translateY(100%); visibility: hidden; transition: transform .24s var(--ease), visibility 0s linear .24s; }
  .dock__btn--wa { background: var(--wa); color: #fff; }
  .dock__btn--call { border: 2px solid rgba(21, 50, 77, .35); color: var(--ink); background: var(--surface); }
}

/* ---------- Páginas internas ---------- */
.crumbs { padding-top: 28px; margin-bottom: clamp(20px, 3.5vw, 48px); font-size: var(--fs-small); color: var(--ink-2); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.crumbs li + li::before { content: "/"; margin-right: 10px; color: var(--divider); }
.crumbs a { display: inline-flex; align-items: center; min-height: 40px; }
.crumbs li { display: inline-flex; align-items: center; min-height: 40px; }
.crumbs, .page-hero__copy { padding-left: var(--rail-indent); }
.page-hero { position: relative; padding-block: clamp(24px, 4vw, 56px) clamp(48px, 6vw, 96px); }
.page-hero__grid { display: grid; gap: 32px; }
.page-title { font-size: var(--fs-display-md); line-height: 1.04; letter-spacing: -0.02em; max-width: 16ch; }
.page-hero .lead { margin-top: 24px; }
.page-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin-top: 32px; }
.page-hero__aside { align-self: end; }
.page-hero__photo img { width: 100%; max-height: 420px; object-fit: contain; object-position: 50% 100%; mix-blend-mode: multiply; }
.page-hero .thread--floor { bottom: 0; }

/* Nosotros: cada médico de pie sobre el mismo piso. */
.page-hero__duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(12px, 2vw, 28px); align-items: start; }
.page-hero__duo .page-hero__photo img { max-height: 460px; }
.page-hero__duo figcaption { margin-top: 20px; }
.page-hero__duo .doctor__role { margin-bottom: 6px; }
.page-hero__duo .doctor__name { font-size: clamp(1.25rem, 1.6vw, 1.625rem); margin-bottom: 8px; }
.page-hero__duo figcaption p:last-child { color: var(--ink-2); font-size: var(--fs-small); max-width: 26ch; }

/* Contacto: la dirección, en grande, es lo que la línea subraya. */
.page-hero__place { padding-bottom: clamp(18px, 2vw, 28px); }
.page-hero__street { font-family: var(--serif); font-weight: 400; font-size: clamp(2.5rem, 5.4vw, 5rem); line-height: 1; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.page-hero__place .eyebrow { margin-bottom: 14px; }
.page-hero__district { margin-top: 14px; color: var(--ink-2); }

@media (max-width: 959px) {
  .page-hero__grid { gap: 16px; }
  .page-hero__photo img { max-height: 300px; }
  .page-hero__duo .page-hero__photo img { max-height: 280px; }
  .page-hero__aside { margin-top: 24px; }
  .page-hero--duo .page-hero__aside,
  .page-hero--place .page-hero__aside { padding-left: var(--rail-indent); }
  .page-hero__street { overflow-wrap: anywhere; }
}
/* Teléfono: retrato de busto, para que los rostros se lean (no miniaturas de cuerpo entero). */
@media (max-width: 599px) {
  .page-hero__duo .page-hero__photo picture { display: block; aspect-ratio: 4 / 5; overflow: hidden; }
  .page-hero__duo .page-hero__photo img {
    width: 150%; max-width: none; max-height: none; height: auto;
    margin-left: -25%; object-fit: cover;
  }
  .page-hero__duo .doctor__role { letter-spacing: .06em; }
}
@media (max-width: 699px) { .page-hero__actions .btn { flex: 1 1 100%; } }
@media (min-width: 960px) {
  .page-hero__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; align-items: end; }
  .page-hero__copy { grid-column: 1 / span 7; padding-bottom: clamp(48px, 5vw, 72px); }
  .page-hero__aside { grid-column: 9 / -1; }
  .page-hero--duo { padding-bottom: clamp(190px, 15vw, 230px); }
  .page-hero--duo .page-hero__copy { grid-column: 1 / span 6; }
  .page-hero--duo .page-hero__aside { grid-column: 7 / -1; }
  /* Los nombres cuelgan bajo el piso: el trazo pasa por debajo de las acciones y sobre los nombres. */
  .page-hero--duo .page-hero__photo { position: relative; }
  .page-hero--duo figcaption { position: absolute; top: 100%; left: 0; right: 0; }
  .page-hero--place .page-hero__aside { grid-column: 8 / -1; }
}

.prose { display: grid; gap: clamp(48px, 5vw, 80px); }
.prose__block { display: grid; gap: 16px; }
.prose__block h2 { font-family: var(--serif); font-weight: 420; font-size: var(--fs-h3); line-height: 1.15; max-width: 24ch; }
.prose__block p, .prose__block li { max-width: 38em; }
.prose__block p + p { margin-top: 4px; }
.prose__block ul.bullets { display: grid; gap: 10px; }
.prose__block ul.bullets li { position: relative; padding-left: 26px; }
.prose__block ul.bullets li::before { content: ""; position: absolute; left: 0; top: .78em; width: 14px; height: 2px; background: var(--red); }
@media (min-width: 960px) {
  .prose__block { grid-template-columns: 5fr 7fr; gap: 24px 48px; }
  .prose__block > h2 { grid-column: 1; }
  .prose__block > :not(h2) { grid-column: 2; }
}

.related { display: grid; gap: 0; border-top: 1px solid var(--divider); }
.related a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px;
  border-bottom: 1px solid var(--divider); text-decoration: none; font-family: var(--serif); font-size: 1.375rem;
}
.related a .icon { color: var(--red); transition: transform .25s var(--ease); }
.related a:hover .icon { transform: translateX(4px); }
@media (min-width: 900px) { .related { grid-template-columns: 1fr 1fr; column-gap: 40px; } }

/* ---------- Impresión ---------- */
@media print {
  .site-header, .dock, .closing, .thread, .rail::before, .rail::after { display: none !important; }
  body { padding: 0; }
}
