/* ==========================================================================
   Dr. Mario Vega — hoja de estilos del sitio
   Se copia tal cual a deploy/assets/estilos.css al ejecutar `node build.mjs`.
   ========================================================================== */

/* --------------------------------------------------------------- tokens */
/* Cada color se declara dos veces: primero el hexadecimal y después el mismo
   color en oklch. Los navegadores viejos que no entienden oklch descartan la
   segunda línea y se quedan con el hex, así el sitio nunca queda sin color. */

:root {
  --bg: #fbfcfc;              --bg: oklch(99% 0.002 200);
  --surface: #ffffff;         --surface: oklch(100% 0 0);
  --surface-soft: #eef4f5;    --surface-soft: oklch(96% 0.012 190);
  --text: #14202a;            --text: oklch(20% 0.02 220);
  --text-soft: #566670;       --text-soft: oklch(47% 0.02 210);
  --border: #dbe4e7;          --border: oklch(90% 0.012 200);
  --primary: #16375f;         --primary: oklch(30% 0.08 250);
  --primary-dark: #0d2340;    --primary-dark: oklch(20% 0.07 250);
  --secondary: #1789c4;       --secondary: oklch(62% 0.16 230);
  --secondary-dark: #00699c;  --secondary-dark: oklch(50% 0.16 230);

  --gradient: linear-gradient(120deg, var(--primary), var(--secondary));
  --button-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --button-gradient-dark: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
  --button-shadow: 0 10px 26px rgba(20, 45, 90, 0.34);

  --font-head: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --shadow-card: 0 10px 30px rgba(60, 90, 120, 0.07);
  --shadow-card-hover: 0 14px 36px rgba(60, 90, 120, 0.14);
  --radius: 20px;

  /* alto de la barra superior, para el scroll con anclas */
  --header-h: 104px;
}

/* ----------------------------------------------------------- cimientos */

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

html { scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

a, button { transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; }

/* Salta al contenido, para lectores de pantalla y teclado */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: #fff;
  padding: 12px 20px; border-radius: 0 0 10px 0;
  text-decoration: none; font-weight: 600;
}
.skip:focus { left: 0; color: #fff; }

/* ------------------------------------------------------------ contenedores */

.wrap    { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap-md { max-width: 1000px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap-sm { max-width: 860px;  margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.section      { padding: 80px 0; }
.section-tight{ padding: 48px 0; }
.section-soft { background: var(--surface-soft); }

/* El bloque que "monta" sobre la cabecera curva de las páginas internas */
.section-overlap { margin-top: -40px; position: relative; }

.center { text-align: center; }

.section-title { font-size: 32px; line-height: 1.2; margin: 0 0 32px; }
.section-title.is-left { margin-bottom: 16px; }

.lead { font-size: 16px; line-height: 1.7; color: var(--text-soft); margin: 0; }

.nota {
  font-size: 13px; color: var(--text-soft); font-style: italic; margin: 24px 0 0;
}

/* ------------------------------------------------------------- cabecera */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  box-shadow: 0 2px 16px rgba(45, 75, 105, 0.08);
}

.site-header > .wrap {
  padding-top: 14px; padding-bottom: 12px;
  display: flex; flex-direction: column; gap: 10px;
}

.header-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text); flex-shrink: 0;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name { font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.1; }
.brand-sub  { font-size: 9.5px; color: var(--text-soft); letter-spacing: 0.6px; text-transform: uppercase; }

.nav {
  display: flex; gap: 18px; flex-wrap: wrap;
  align-items: center; justify-content: center;
  border-top: 1px solid var(--border); padding-top: 10px;
}
.nav a {
  color: var(--text-soft); font-weight: 600; text-decoration: none;
  white-space: nowrap; text-transform: uppercase;
  letter-spacing: 0.5px; font-size: 12.5px;
}
.nav a:hover { color: var(--primary); }
.nav a.is-active { color: var(--primary); font-weight: 700; }

/* --------------------------------------------------------------- botones */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 15px; line-height: 1.2;
  padding: 15px 30px;
  cursor: pointer; border: 0;
}

.btn-wa { background: var(--button-gradient); color: #fff; box-shadow: var(--button-shadow); }
.btn-wa:hover { background: var(--button-gradient-dark); color: #fff; }

.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: var(--surface-soft); color: var(--primary-dark); }

.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.6); color: #fff; font-weight: 600; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.btn-sm { padding: 10px 18px; font-size: 13px; font-weight: 600; }

/* enlace "seguir leyendo →" */
.link-more { font-weight: 700; text-decoration: none; font-size: 15px; display: inline-block; }

/* ------------------------------------------------------------------ hero */

/* Hero con foto de fondo (home y bariátrica) */
.hero {
  position: relative; overflow: hidden;
  background: var(--primary);
}
.hero-inner {
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%);
  background: var(--gradient);
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
/* Velo sobre la foto. Tiene dos trabajos a la vez: garantizar que el texto
   blanco se lea sobre cualquier foto, y no apagar del todo la imagen. Por eso
   el tramo oscuro cubre la mitad izquierda —donde va el texto— y recién ahí
   se abre. */
.hero-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(100deg,
      rgba(12, 27, 43, 0.82) 0%,
      rgba(12, 27, 43, 0.58) 45%,
      rgba(12, 27, 43, 0.26) 78%,
      rgba(12, 27, 43, 0.18) 100%);
}

/* La legibilidad del titular no puede depender solo del velo: si el velo es
   lo bastante oscuro como para garantizarla, apaga la foto. La sombra hace
   ese trabajo y deja que la imagen se vea. */
.hero-content { text-shadow: 0 2px 14px rgba(8, 20, 33, 0.55); }
.hero-content {
  position: relative;
  padding-top: 110px; padding-bottom: 110px;
  display: flex; flex-direction: column; gap: 22px;
  color: #fff;
}
.hero-eyebrow {
  font-weight: 600; font-size: 14px; letter-spacing: 0.6px;
  text-transform: uppercase; opacity: 0.9;
}
/* El ancho del titular no es estético: es lo que evita que la última línea se
   monte sobre la persona de la foto. La imagen escala con el ancho de la
   ventana (el sujeto cae siempre cerca del 56%), mientras el texto vive en un
   contenedor topado en 1200px; con líneas más largas, en cualquier pantalla
   grande el titular termina encima de la cara. A 580px la línea corta antes. */
.hero h1 {
  font-size: clamp(30px, 5.2vw, 50px);
  line-height: 1.15; margin: 0; max-width: 580px;
}
.hero p { font-size: 17px; line-height: 1.6; margin: 0; max-width: 540px; opacity: 0.93; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.hero-narrow .hero-content { max-width: 660px; }

/* Hero plano, en degradado (páginas internas) */
.hero-plain {
  background: var(--gradient);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
  padding: 90px 24px 104px;
  color: #fff; text-align: center;
}
.hero-plain h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 0; }
.hero-plain .hero-eyebrow + h1 { margin-top: 14px; }
.hero-plain p { font-size: 16px; margin: 14px auto 0; opacity: 0.92; max-width: 560px; }

/* ---------------------------------------------------------------- rejillas */

.grid { display: grid; gap: 24px; }
.grid-cards  { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.grid-3      { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4      { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }

/* Dos columnas: foto + texto */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.split-top { align-items: start; }
.split-even { grid-template-columns: 1fr 1fr; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { gap: 20px; }

/* ---------------------------------------------------------------- tarjetas */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

a.card {
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 8px;
}
a.card:hover { box-shadow: var(--shadow-card-hover); color: var(--text); }

.card-title { font-family: var(--font-head); font-size: 19px; font-weight: 600; }
.card-text  { font-size: 14px; color: var(--text-soft); line-height: 1.5; }

/* La tarjeta destacada (bariátrica) */
a.card-featured { border-color: var(--primary); }
a.card-featured .card-title { color: var(--primary); }

/* Tarjeta grande de especialidad */
.card-lg { padding: 36px; }
.card-lg h2 { font-size: 26px; margin: 8px 0 12px; }
.card-num {
  color: var(--primary); font-weight: 600; font-size: 13px;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.card-lg p { font-size: 15px; line-height: 1.7; color: var(--text-soft); margin: 0 0 12px; }
.card-lg ul { margin: 0; padding-left: 20px; color: var(--text-soft); font-size: 15px; line-height: 1.8; }

/* Tarjeta grande sobre el degradado */
.card-gradient {
  background: var(--gradient); color: #fff; border: 0;
  border-radius: var(--radius); padding: 36px;
  box-shadow: 0 16px 40px rgba(30, 90, 140, 0.22);
}
.card-gradient .card-num { color: #fff; opacity: 0.85; }
.card-gradient p { color: #fff; opacity: 0.92; }
.card-gradient a { color: #fff; }

/* ------------------------------------------------------------------ listas */

.lista-motivos { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.9; }

.lista-check { display: flex; flex-direction: column; gap: 14px; }
.lista-check li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.6; }
.lista-check { list-style: none; padding: 0; margin: 0; }
.lista-check .punto {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gradient); margin-top: 8px; flex-shrink: 0;
}

/* Credenciales pendientes de completar */
.credencial {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
  font-size: 15px; color: var(--text-soft);
  box-shadow: 0 8px 24px rgba(60, 90, 120, 0.05);
}
.credencial.is-pendiente { font-style: italic; }

/* --------------------------------------------------------------- pasos */

.paso { display: flex; flex-direction: column; gap: 8px; }
.paso-num { font-family: var(--font-head); font-size: 28px; font-weight: 600; color: var(--primary); }
.paso-titulo { font-weight: 600; font-size: 16px; }
.paso-texto { font-size: 14px; color: var(--text-soft); line-height: 1.6; }

/* valores / filosofía */
.valor-titulo { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--primary); }

/* ---------------------------------------------------------- testimonios */

.testimonio {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 16px;
  margin: 0;
}
.testimonio p { font-size: 15px; line-height: 1.6; margin: 0; }
.testimonio figcaption { font-size: 13px; color: var(--text-soft); font-weight: 600; }

/* Aviso de contenido de ejemplo */
.aviso-ejemplo {
  background: #fff7e6;
  border: 1px solid #e8c477;
  border-left: 4px solid #d99a1d;
  border-radius: 12px;
  padding: 16px 20px;
  color: #6b4a08;
  font-size: 14px; line-height: 1.6;
  margin: 0 0 32px;
}
.aviso-ejemplo strong { display: block; margin-bottom: 4px; }

/* ------------------------------------------------------------------ FAQ */

.faq {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 32px;
  box-shadow: var(--shadow-card);
}
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }

.faq summary {
  cursor: pointer; list-style: none;
  padding: 22px 32px 22px 0; position: relative;
  font-weight: 600; font-size: 17px; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 4px; top: 50%;
  width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--secondary);
  border-bottom: 2px solid var(--secondary);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq summary:hover { color: var(--primary); }
.faq .respuesta { font-size: 15px; color: var(--text-soft); line-height: 1.6; padding: 0 0 22px; margin: -4px 0 0; }

/* FAQ resumida de la home */
.faq-resumen { display: flex; flex-direction: column; gap: 20px; }
.faq-resumen > div { border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.faq-resumen > div:last-child { border-bottom: 0; padding-bottom: 0; }
.faq-resumen dt { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.faq-resumen dd { font-size: 14px; color: var(--text-soft); line-height: 1.6; margin: 0; }

/* ------------------------------------------------------------- imágenes */

.media { display: block; width: 100%; border-radius: 24px; overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-4x5 { aspect-ratio: 4 / 5; }
.media-1x1 { aspect-ratio: 1 / 1; }
.media-4x3 { aspect-ratio: 4 / 3; }
.media-sombra { box-shadow: 0 16px 40px rgba(25, 55, 95, 0.14); }

/* Hueco de foto todavía sin imagen */
.media-hueco {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  padding: 16px; text-align: center;
  background: var(--surface-soft);
  border: 1px dashed rgba(60, 90, 120, 0.35);
  color: var(--text-soft);
  font-size: 13px; font-weight: 600;
}

/* ------------------------------------------------------------ datos contacto */

.datos { display: flex; flex-direction: column; gap: 20px; }
.dato-rotulo {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-soft); margin-bottom: 6px;
}
.dato-valor { font-size: 17px; font-weight: 600; }
.dato-valor a { text-decoration: none; }
.dato-valor a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- franja CTA */

.cta-band { background: var(--gradient); padding: 64px 24px; text-align: center; color: #fff; }
.cta-band h2 { color: #fff; font-size: clamp(24px, 4vw, 30px); margin: 0; }
.cta-band > div {
  max-width: 640px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 20px; align-items: center;
}

/* ------------------------------------------------------------------ pie */

.site-footer { background: var(--surface-soft); border-top: 1px solid var(--border); }
.footer-cols {
  padding-top: 56px; padding-bottom: 32px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px;
}
.footer-marca { font-family: var(--font-head); font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.footer-rotulo {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-soft); margin-bottom: 14px;
}
.footer-lista { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-lista a { color: var(--text); text-decoration: none; }
.footer-lista a:hover { color: var(--primary); text-decoration: underline; }
.footer-legal {
  border-top: 1px solid var(--border); padding: 20px 24px;
  text-align: center; font-size: 13px; color: var(--text-soft);
}

/* --------------------------------------------------------- botón WhatsApp */

.wa-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  background: var(--button-gradient); color: #fff;
  padding: 14px 22px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 15px;
  box-shadow: 0 14px 34px rgba(15, 45, 95, 0.42);
  display: flex; align-items: center; gap: 9px;
}
.wa-fab:hover { background: var(--button-gradient-dark); color: #fff; }
.wa-fab svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* --- tablet ------------------------------------------------------------ */
@media (max-width: 960px) {
  .split, .split-even { grid-template-columns: 1fr; gap: 32px; }

  /* con una sola columna, la foto vertical se come la pantalla */
  .split .media-4x5 { aspect-ratio: 3 / 2; }
  .split .media-1x1 { aspect-ratio: 3 / 2; }

  .section { padding: 64px 0; }
  .hero-content { padding-top: 84px; padding-bottom: 96px; }

  /* El velo diagonal supone texto a la izquierda y foto a la derecha. Por
     debajo de este ancho eso deja de valer: la foto empieza a recortarse a lo
     ancho, el sujeto se corre hacia el centro y el titular le queda encima con
     el velo en su parte más clara. A partir de acá el degradado va de arriba
     abajo y cubre parejo, que es como funciona en el móvil. */
  .hero-veil {
    background:
      linear-gradient(180deg,
        rgba(12, 27, 43, 0.74) 0%,
        rgba(12, 27, 43, 0.62) 35%,
        rgba(12, 27, 43, 0.70) 75%,
        rgba(12, 27, 43, 0.82) 100%);
  }
}

/* --- móvil ------------------------------------------------------------- */
@media (max-width: 720px) {
  /* la barra pegajosa roba demasiado alto en pantallas cortas */
  .site-header { position: static; }
  html { scroll-padding-top: 12px; }

  .wrap, .wrap-md, .wrap-sm { padding-left: 18px; padding-right: 18px; }

  /* El botón del encabezado sobra en el móvil: el flotante de WhatsApp ya
     está siempre a la vista, y así el menú no se come media pantalla. */
  .btn-header { display: none; }
  .nav { gap: 12px 14px; }
  .nav a { font-size: 11.5px; letter-spacing: 0.4px; }

  .section { padding: 52px 0; }
  .section-title { font-size: 26px; margin-bottom: 24px; }

  /* curvas más suaves: en vertical el corte diagonal se vuelve muy agresivo */
  .hero-inner { clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%); }
  .hero-plain { clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%); padding: 64px 18px 76px; }

  .hero-content { padding-top: 64px; padding-bottom: 80px; gap: 16px; }
  .hero p { font-size: 16px; }
  .hero-actions { gap: 12px; }
  .hero-actions .btn { width: 100%; }

  .card-lg { padding: 26px; }
  .card-gradient { padding: 26px; }
  .faq { padding: 4px 20px; }
  .faq summary { font-size: 16px; }

  .cta-band { padding: 48px 18px; }
  .cta-band .btn { width: 100%; }

  /* el botón flotante, más compacto y sin tapar el pie */
  .wa-fab { bottom: 16px; right: 16px; padding: 13px 18px; font-size: 14px; }

  /* espacio para que el botón flotante no tape el final de la página */
  .site-footer { padding-bottom: 64px; }
}

@media (max-width: 400px) {
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 9px; }
  .wa-fab { padding: 13px; }
  .wa-fab span { display: none; }
}

/* --- impresión --------------------------------------------------------- */
@media print {
  .wa-fab, .nav, .cta-band, .hero-actions { display: none !important; }
  .site-header { position: static; box-shadow: none; }
  .hero, .hero-inner, .hero-plain { background: none !important; color: #000; clip-path: none; }
  .hero-veil, .hero-bg { display: none; }
  .hero h1, .hero p, .hero-plain h1, .hero-plain p { color: #000 !important; }
  body { background: #fff; }
}

/* --- menos movimiento -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
