/* ─────────────────────────────────────────────────────────────
   Estilos del sitio — Dr. David Dabed
   Paleta y tipografía: dr.dabed.cadera/00_Brand_Guidelines.md
   Tipografía sin serifa: Plus Jakarta Sans (títulos) + Inter (texto)
   ───────────────────────────────────────────────────────────── */
:root {
  --navy: #0B2545;          /* Azul Quirúrgico */
  --blue: #134074;          /* Azul Titanio */
  --teal: #00A896;          /* Cyan Médico (detalles) */
  --teal-strong: #027A73;   /* botones con texto blanco (contraste AA) */
  --teal-soft: #E3F5F2;
  --ice: #F4F6F9;           /* Gris Quirófano Claro */
  --line: #E2E8F0;
  --ink: #1E293B;           /* Gris Grafito */
  --muted: #5B6778;
  --white: #FFFFFF;
  --gold: #F2B01E;
  --warn-bg: #FFF6E0;
  --warn-line: #F1D28A;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 37, 69, .05), 0 8px 24px rgba(11, 37, 69, .07);
  --shadow-hover: 0 2px 4px rgba(11, 37, 69, .06), 0 16px 36px rgba(11, 37, 69, .12);
  --maxw: 1160px;

  --font-head: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--teal-strong); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, .h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.18; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); font-weight: 800; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; margin: 1.6em 0 .5em; }
h3, .h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 .45em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.small { font-size: .92rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center.lead, .section-head.center .lead { margin-inline: auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4em;
  font: 700 .78rem/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal-strong); margin: 0 0 .8em;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--white); padding: 8px 12px; z-index: 100; }
.icon { flex: none; }

/* Contenedores */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 780px; }
.section { padding-block: clamp(56px, 8vw, 96px); }
.section--tight { padding-block: clamp(32px, 5vw, 56px); }
.section--flush { padding-top: 8px; }
.section--ice { background: var(--ice); }
.section--navy { background: var(--navy); color: #D5DEEA; }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy .eyebrow { color: var(--teal); }
.section--navy .lead { color: #B9C6D8; }
.section-head { margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { margin-top: 0; }
.section-head.center { text-align: center; }

/* Grillas */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.split { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: 1fr; align-items: center; }
.split--top { align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.1fr; } }
.stack { display: grid; gap: 16px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.35em; border-radius: 999px; border: 2px solid transparent;
  font: 700 1rem/1.2 var(--font-head); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--sm { padding: .55em 1.05em; font-size: .92rem; }
.btn--lg { padding: .95em 1.6em; font-size: 1.05rem; }
.btn--primary { background: var(--teal-strong); color: var(--white); box-shadow: 0 6px 16px rgba(2, 122, 115, .25); }
.btn--primary:hover { background: #02665F; color: var(--white); }
.btn--ghost { border-color: var(--line); color: var(--navy); background: var(--white); }
.btn--ghost:hover { border-color: var(--teal-strong); color: var(--teal-strong); }
.btn--white { background: var(--white); color: var(--navy); }
.btn--white:hover { color: var(--teal-strong); }
.btn--wa { background: #1FAF5A; color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4em 0; }

/* Barra superior y encabezado */
.topbar { background: var(--navy); color: #C9D5E4; font-size: .85rem; }
.topbar-in { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; }
.topbar a { color: var(--white); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
@media (max-width: 700px) { .topbar span { display: none; } .topbar-in { justify-content: center; } }

.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 20px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); margin-right: auto; }
.brand-mark {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--navy); color: var(--white); font: 800 1rem/1 var(--font-head); letter-spacing: -.02em;
  box-shadow: inset 0 -3px 0 var(--teal);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font: 800 1.05rem/1.2 var(--font-head); }
.brand-text span { font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-links a { display: block; padding: .5em .8em; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .97rem; }
.nav-links a:hover { background: var(--ice); color: var(--navy); }
.nav-links a[aria-current="page"] { color: var(--teal-strong); background: var(--teal-soft); }
.header-cta { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; background: none; border: 0; color: var(--navy); padding: 6px; cursor: pointer; border-radius: 10px; }
.mobile-menu { border-top: 1px solid var(--line); background: var(--white); }
.mobile-menu ul { list-style: none; margin: 0; padding-block: 8px 16px; }
.mobile-menu a { display: block; padding: .75em 0; text-decoration: none; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); }
@media (max-width: 960px) { .nav { display: none; } .menu-btn { display: inline-flex; } .hide-sm { display: none; } }
@media (max-width: 420px) { .brand-text span { display: none; } }

/* Hero */
.hero { background: linear-gradient(180deg, var(--ice) 0%, var(--white) 100%); padding-block: clamp(40px, 7vw, 88px); overflow: hidden; }
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero h1 .accent { color: var(--teal-strong); }
.rating-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .95rem; color: var(--ink); text-decoration: none; }
.rating-line span { color: var(--muted); }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; font-size: .92rem; color: var(--muted); }
.badges li { display: inline-flex; align-items: center; gap: 6px; }
.badges .icon { color: var(--teal-strong); }
.hero-photo { position: relative; margin: 0; max-width: 460px; justify-self: center; width: 100%; }
.hero-photo::before { content: ""; position: absolute; inset: 24px -18px -18px 24px; border-radius: 28px; background: var(--teal-soft); z-index: 0; }
.hero-photo img { position: relative; z-index: 1; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 28px; box-shadow: var(--shadow-hover); background: #E4E9EF; }
.hero-photo figcaption {
  position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 16px;
  background: rgba(11, 37, 69, .88); color: var(--white); border-radius: 16px; padding: 12px 16px;
  display: flex; flex-direction: column; font-size: .85rem; backdrop-filter: blur(6px);
}
.hero-photo figcaption strong { font: 700 1rem/1.3 var(--font-head); }

/* Estrellas */
.stars { display: inline-flex; gap: 1px; }
.stars .on { color: var(--gold); }
.stars .off { color: #CBD5E1; }
.gold { color: var(--gold); vertical-align: -2px; }

/* Franja de confianza */
.trust { border-block: 1px solid var(--line); background: var(--white); }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; padding-block: 22px; }
.trust-item { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px; }
.trust-item strong { font: 800 1.05rem/1.3 var(--font-head); color: var(--navy); }
.trust-item span { font-size: .85rem; color: var(--muted); }

/* Tarjetas */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card p { color: var(--muted); }
.card--link { text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #CFE9E4; color: inherit; }
.card--feature { background: var(--teal-soft); border-color: #C7E8E2; }
.card--feature .btn { align-self: flex-start; }
.card-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--teal-soft); color: var(--teal-strong); margin-bottom: 16px; }
.more { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font: 700 .95rem/1.2 var(--font-head); color: var(--teal-strong); text-decoration: none; }
.checks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 6px; font-size: .93rem; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks .icon { color: var(--teal-strong); margin-top: 3px; }
.checks--lg { font-size: 1rem; gap: 10px; }
.chip { display: inline-block; font: 600 .75rem/1 var(--font-body); letter-spacing: .02em; padding: 6px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-strong); }
.meta { font-size: .88rem; color: var(--muted); margin-bottom: .6em; }

/* Cómo trabajo (fondo azul) */
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pillars li { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 22px; }
.pillars p { margin: 0; color: #B9C6D8; font-size: .97rem; }
.pillar-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--teal); color: var(--navy); font: 800 .95rem/1 var(--font-head); margin-bottom: 12px; }

/* Opiniones */
.review { margin: 0; }
.review-top { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.review blockquote { margin: 0 0 18px; color: var(--ink); font-size: .98rem; }
.review figcaption { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; font-size: .88rem; }
.review figcaption span { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-strong); font-size: .8rem; font-weight: 600; }

/* Sedes */
.sede h3 { margin-top: 12px; }
.sede p { display: flex; gap: 6px; align-items: flex-start; }
.sede .btn-row { margin: auto 0 0; padding-top: 8px; }

/* Radar */
.papers { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.paper { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.paper a { font-weight: 600; color: var(--navy); text-decoration: none; line-height: 1.4; }
.paper a:hover { color: var(--teal-strong); text-decoration: underline; }
.paper a .icon { display: inline; vertical-align: -2px; color: var(--muted); }
.paper-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.paper-note { margin: 10px 0 0; font-size: .92rem; background: var(--ice); border-radius: 10px; padding: 10px 12px; }
.paper[hidden] { display: none; }
.radar-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .radar-grid { grid-template-columns: 1.6fr 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip-btn { font: 600 .85rem/1 var(--font-body); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.events li { display: flex; flex-direction: column; border-left: 3px solid var(--teal); padding: 6px 0 6px 14px; font-size: .9rem; color: var(--muted); }
.events a { font-weight: 600; color: var(--navy); text-decoration: none; font-size: 1rem; }

/* FAQ */
.faq { margin-top: 2em; }
.faq h2 { margin-top: 0; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font: 700 1rem/1.4 var(--font-head); color: var(--navy); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--teal-strong); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 18px 16px; margin: 0; color: var(--muted); }

/* CTA */
.cta-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 100%); color: #D5DEEA;
  border-radius: 24px; padding: clamp(28px, 5vw, 48px);
}
.cta-band h2 { color: var(--white); margin: 0 0 .3em; }
.cta-band p { margin: 0; }

/* Instagram */
.ig-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.ig-head h2 { margin: 0 0 .2em; }
.ig-head p { margin: 0; }
.ig-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 800px) { .ig-grid { grid-template-columns: repeat(6, 1fr); } }
.ig-tile { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--ice); }
.ig-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.ig-tile:hover img { transform: scale(1.04); }
.ig-empty { display: grid; place-items: center; color: #9AA8BA; background: linear-gradient(135deg, var(--ice), var(--teal-soft)); }

/* Páginas internas */
.page-head { background: linear-gradient(180deg, var(--ice), var(--white)); padding-block: clamp(40px, 6vw, 72px) 24px; }
.page-head h1 { margin-bottom: .3em; }
.article { padding-top: 40px; }
.breadcrumbs { font-size: .88rem; color: var(--muted); margin-bottom: 1.2em; }
.breadcrumbs a { color: var(--muted); }
.prose { font-size: 1.06rem; }
.prose h2 { font-size: 1.5rem; margin: 1.8em 0 .5em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.5em 0; padding: 16px 20px; border-left: 4px solid var(--teal); background: var(--ice); border-radius: 0 12px 12px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-head); color: var(--navy); background: var(--ice); }
.callout { background: var(--ice); border-radius: var(--radius-sm); padding: 16px 18px; font-size: .95rem; color: var(--muted); margin-top: 32px; }
.callout--warn { background: var(--warn-bg); color: #6B4E00; }
.draft-flag { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #6B4E00; padding: 10px 14px; border-radius: 12px; font-size: .92rem; }
.about-photo { margin: 0; }
.about-photo img { border-radius: 28px; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; width: 100%; box-shadow: var(--shadow-hover); background: #E4E9EF; }
@media (min-width: 900px) { .about-photo { position: sticky; top: 110px; } }

/* Pie de página */
.site-footer { background: var(--navy); color: #B9C6D8; padding-block: 56px 32px; font-size: .95rem; }
.site-footer a { color: var(--white); }
.site-footer h2 { font: 700 .8rem/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin: 0 0 1em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-cols { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.footer-brand { display: flex; align-items: center; gap: 10px; font: 800 1.1rem/1.2 var(--font-head); color: var(--white); }
.muted-inv { color: #8FA0B8; font-size: .88rem; }
.legal { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 20px; font-size: .85rem; color: #8FA0B8; }

/* Barra fija de agenda en celulares */
.mobile-bar { display: none; }
@media (max-width: 760px) {
  .mobile-bar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  }
  .mobile-bar .btn--primary { flex: 1; }
  body { padding-bottom: 76px; }
}

/* Ajustes finos */
.eyebrow + h1, .eyebrow + h2 { margin-top: 0; }
.card .chip { align-self: flex-start; }
.grid + .center, .grid + p { margin-top: 28px; }

/* Sello "Traumatólogo en RedSalud" */
.verified { color: #1D9BF0; vertical-align: -3px; }
.badges .badge-featured {
  background: var(--white); border: 1px solid #CFE3F7; color: var(--navy); font-weight: 600;
  padding: 6px 12px 6px 8px; border-radius: 999px; box-shadow: 0 2px 8px rgba(11, 37, 69, .06);
}
.badges .badge-featured .icon { color: #1D9BF0; }
.photo-seal {
  position: absolute; z-index: 2; top: 16px; left: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .96); color: var(--navy); border-radius: 14px;
  padding: 8px 12px 8px 10px; box-shadow: var(--shadow); font-size: .78rem; line-height: 1.25;
}
.photo-seal .icon { color: #1D9BF0; }
.photo-seal span { display: flex; flex-direction: column; color: var(--muted); }
.photo-seal strong { font: 700 .88rem/1.25 var(--font-head); color: var(--navy); }
.about-photo figcaption { margin-top: 12px; font-size: .92rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.byline { display: flex; align-items: center; gap: 6px; font-size: .92rem; color: var(--muted); margin-top: -.4em; }

/* Botón flotante de WhatsApp (pantallas medianas y grandes) */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  display: inline-flex; align-items: center; gap: 10px;
  background: #1FAF5A; color: var(--white); text-decoration: none;
  padding: 12px 18px 12px 14px; border-radius: 999px;
  font: 700 .95rem/1 var(--font-head);
  box-shadow: 0 10px 28px rgba(31, 175, 90, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.wa-float:hover { color: var(--white); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(31, 175, 90, .45); }
@media (max-width: 760px) { .wa-float { display: none; } }
@media (min-width: 761px) and (max-width: 1100px) { .wa-float span { display: none; } .wa-float { padding: 14px; } }
.pillars { grid-template-columns: 1fr; }
