/* ============================================================
   Dr. Joel Gambín — Traumatología y artroscopia deportiva
   Sistema de diseño v3 — estilo de referencia aprobado por Joel
   Azul cielo suave · petróleo oscuro · píldoras negras · Lato
   ============================================================ */

:root {
  --bg: #FFFFFF;
  --bg-soft: #EAF4F9;
  --head: #17404E;
  --ink: #2C3A41;
  --muted: #5F6E75;
  --line: #DCE9EF;
  --sky: #5FB3D4;
  --teal: #2E9CBE;
  --panel: #1C4552;
  --on-panel: #D6E7ED;
  --btn: #101314;
  --wa: #1FAF5F;
  --r-card: 20px;
  --shadow: 0 10px 30px rgba(23, 64, 78, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Lato", "Segoe UI", system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.16; text-wrap: balance; margin: 0; font-weight: 700; color: var(--head); }
h1 { font-size: clamp(34px, 5.2vw, 52px); }
h2 { font-size: clamp(27px, 3.6vw, 38px); }
h3 { font-size: 19px; }
p { margin: 0 0 16px; max-width: 64ch; }
a { color: var(--head); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 700; }
ul { padding-left: 20px; }
li { margin: 6px 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 740px; }

.eyebrow {
  font-size: 17px;
  font-weight: 700;
  color: var(--sky);
  margin: 0 0 14px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.brand .name { font-weight: 800; font-size: 19px; color: var(--head); }
.brand .tag { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--teal); }
.nav .lang { font-size: 12.5px; font-weight: 800; color: var(--head); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.nav .lang:hover { color: var(--teal); border-color: var(--sky); }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; color: var(--head); font-family: inherit; }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 18px;
    gap: 2px;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: none; }
  .nav .lang { text-align: center; margin-top: 10px; }
}

/* ---------- Botones (píldoras negras, como la referencia) ---------- */
.btn {
  display: inline-block;
  background: var(--btn);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 30px;
  border-radius: 999px;
  border: 1.5px solid var(--btn);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { opacity: 0.88; color: #fff; transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--head); border-color: var(--head); }
.btn.ghost:hover { color: var(--teal); border-color: var(--teal); opacity: 1; }
.btn.on-dark { border-color: var(--btn); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, #F6FBFD 70%, #FFFFFF 100%);
  padding: 76px 0 56px;
}
.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 56px; align-items: center; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }
.hero .lead { font-size: 18.5px; color: var(--ink); max-width: 50ch; margin: 18px 0 28px; }
.hero .lead .places { color: var(--muted); }
.cred-line { margin: 30px 0 0; padding-top: 18px; border-top: 1px solid rgba(23, 64, 78, 0.14); font-size: 12.5px; letter-spacing: 0.04em; color: var(--muted); max-width: none; }

.portrait {
  background: linear-gradient(170deg, #D8ECF5 0%, #BCDEED 100%);
  border-radius: 24px;
  aspect-ratio: 3 / 3.3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4E7A8C;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ---------- Tarjetas dúo (blanca + panel oscuro) ---------- */
.duo { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; margin-top: 44px; }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }
.duo-white, .duo-dark { border-radius: var(--r-card); padding: 32px 34px; box-shadow: var(--shadow); }
.duo-white { background: #fff; }
.duo-dark { background: var(--panel); color: var(--on-panel); }
.duo-dark h3, .duo-white h3 { font-size: 22px; margin-bottom: 12px; }
.duo-dark h3 { color: #fff; }
.duo-dark p { color: var(--on-panel); font-size: 15.5px; }
.duo-white .go { font-weight: 700; text-decoration: none; }
.duo-white .go:hover { color: var(--teal); }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 8px 0 8px 34px; position: relative; font-weight: 600; color: var(--ink); }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--teal);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Secciones ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-soft); }
.section-head { margin-bottom: 38px; }
.section-head p { color: var(--muted); font-size: 17px; }

/* ---------- Fila editorial (eyebrow+título | párrafo | botón) ---------- */
.split-row { display: grid; grid-template-columns: 1.1fr 1.2fr auto; gap: 40px; align-items: center; margin-bottom: 46px; }
@media (max-width: 900px) { .split-row { grid-template-columns: 1fr; gap: 18px; } }
.split-row p { margin: 0; color: var(--ink); }

/* ---------- Tarjetas de servicio con "foto" ---------- */
.service-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.service-card {
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.service-card:hover { transform: translateY(-4px); }
.service-card .thumb {
  height: 150px;
  background: linear-gradient(160deg, #D5EBF5 0%, #A9D5E8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #47768A;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.service-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.service-card h3 { font-size: 19px; }
.service-card p { font-size: 14.5px; color: var(--muted); margin: 0; }
.service-card .btn { align-self: flex-start; margin-top: auto; padding: 11px 22px; font-size: 13.5px; }

/* ---------- ¿Por qué elegir? ---------- */
.why-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .why-grid { grid-template-columns: 1fr; gap: 34px; } }
.check-card {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 22px 26px;
  margin: 24px 0 28px;
}
.check-card .check-list li { border-bottom: 1px solid rgba(23, 64, 78, 0.08); }
.check-card .check-list li:last-child { border-bottom: none; }
.check-card .check-list li::before { background: #fff; }

/* ---------- Opiniones ---------- */
.review-band { text-align: center; }
.review-card {
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 0 auto;
  padding: 38px 34px;
}
.review-band .stars, .review-card .stars { color: var(--head); font-size: 24px; letter-spacing: 7px; }
.review-band .score, .review-card .score { font-size: 44px; font-weight: 800; color: var(--head); margin: 8px 0 2px; }
.review-band .src, .review-card .src { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.review-line { text-align: center; font-size: 15.5px; }
.review-line .stars { letter-spacing: 5px; margin-right: 10px; color: var(--head); }

/* ---------- Banda de sedes (panel oscuro con pines) ---------- */
.sede-band {
  background: var(--panel);
  border-radius: 26px;
  padding: 46px 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 34px;
  text-align: center;
  color: var(--on-panel);
  box-shadow: var(--shadow);
}
.sede-band .pin { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--sky); }
.sede-band h3 { color: #fff; font-size: 19px; margin-bottom: 6px; }
.sede-band p { color: var(--on-panel); font-size: 14.5px; margin: 0 auto; }
.sede-band a { color: #fff; font-weight: 700; text-decoration: none; font-size: 16px; }
.sede-band a:hover { color: var(--sky); }

/* ---------- Tarjetas genéricas (interiores, sedes de contacto) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.card {
  background: #fff;
  border: none;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease;
}
a.card:hover { transform: translateY(-4px); }
.card h3 { font-size: 18px; }
.card p { font-size: 14.5px; color: var(--muted); margin: 0; }
.card .more { margin-top: 8px; font-weight: 700; font-size: 14px; color: var(--head); }
a.card:hover h3, a.card:hover .more { color: var(--teal); }

.sede .city { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.sede address { font-style: normal; font-size: 14.5px; color: var(--muted); }
.sede .tel { font-weight: 800; color: var(--head); text-decoration: none; font-size: 16px; }
.sede .tel:hover { color: var(--teal); }

/* ---------- Sobre mí ---------- */
.split { display: grid; grid-template-columns: 300px 1fr; gap: 52px; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.creds { list-style: none; padding: 0; margin: 18px 0 0; }
.creds li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.creds li:last-child { border-bottom: none; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 18px 0; border-bottom: 1px solid var(--line); max-width: 66ch; }
.timeline li:last-child { border-bottom: none; }
.timeline .when { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sky); font-weight: 700; }
.timeline h3 { font-size: 17px; margin: 5px 0 4px; }
.timeline p { font-size: 15px; color: var(--muted); margin: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 740px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 16px; color: var(--head); padding: 17px 30px 17px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 15px; font-size: 20px; color: var(--sky); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p, .faq details ul { padding: 0 0 18px; margin: 0; color: var(--muted); font-size: 15.5px; }
.faq details ul { padding-left: 22px; }

/* ---------- Páginas interiores ---------- */
.page-hero { background: linear-gradient(180deg, var(--bg-soft) 0%, #F6FBFD 100%); padding: 64px 0 44px; }
.page-hero h1 { max-width: 26ch; font-size: clamp(30px, 4.4vw, 44px); }
.page-hero .lead { color: var(--muted); font-size: 17.5px; max-width: 58ch; margin: 16px 0 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.article { padding: 56px 0 30px; }
.article h2 { font-size: 25px; margin: 44px 0 14px; }
.article h2:first-child { margin-top: 0; }
.article h3 { margin: 26px 0 8px; }
.article ul { max-width: 66ch; }
.phase { display: grid; grid-template-columns: 140px 1fr; gap: 14px; border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 700px; }
.phase .t { font-weight: 800; font-size: 12.5px; color: var(--teal); letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.phase p { margin: 0; font-size: 15px; color: var(--muted); }
@media (max-width: 560px) { .phase { grid-template-columns: 1fr; gap: 3px; } }
.notice {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 680px;
  margin: 34px 0;
}
.notice a { color: var(--muted); }

/* ---------- Vídeo ---------- */
.video-link { display: block; max-width: 480px; text-decoration: none; margin: 10px 0 0; }
.video-link .thumb { position: relative; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.video-link .thumb::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  background: rgba(23, 64, 78, 0.25);
  transition: background 0.15s ease;
}
.video-link:hover .thumb::after { background: rgba(23, 64, 78, 0.45); }
.video-link .cap { font-size: 13px; color: var(--muted); margin-top: 9px; }

/* ---------- CTA ---------- */
.cta-band { background: var(--bg-soft); text-align: center; padding: 76px 0; }
.cta-band h2 { color: var(--head); }
.cta-band p { color: var(--muted); margin: 14px auto 28px; max-width: 52ch; }
.cta-band .btn-row { justify-content: center; }
.cta-band .tel-line { margin-top: 20px; font-size: 14.5px; color: var(--muted); }
.cta-band .tel-line a { color: var(--head); font-weight: 800; text-decoration: none; }
.cta-band .tel-line a:hover { color: var(--teal); }

/* ---------- Footer (panel oscuro) ---------- */
.site-footer { background: var(--panel); color: var(--on-panel); padding: 52px 0 116px; font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 12px; }
.site-footer a { color: var(--on-panel); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 7px 0; }
.site-footer p { color: var(--on-panel); }
.site-footer .legal-line { border-top: 1px solid rgba(255, 255, 255, 0.16); margin-top: 32px; padding-top: 20px; font-size: 12.5px; }

/* ---------- Barra móvil ---------- */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  gap: 8px;
  box-shadow: 0 -8px 24px rgba(23, 64, 78, 0.10);
}
.mobile-cta a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 13.5px;
  padding: 12px 6px;
  border-radius: 999px;
}
.mobile-cta .call { border: 1.5px solid var(--head); color: var(--head); }
.mobile-cta .wa { background: var(--wa); color: #fff; }
.mobile-cta .book { background: var(--btn); color: #fff; }
@media (max-width: 760px) {
  .mobile-cta { display: flex; }
  body { padding-bottom: 68px; }
}

/* ---------- Fotos ---------- */
.portrait.has-photo { padding: 0; overflow: hidden; aspect-ratio: auto; }
.portrait.has-photo img { width: 100%; height: auto; display: block; }

.photo-fader {
  position: relative;
  aspect-ratio: 3 / 2;
  max-width: 640px;
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 10px 0 0;
}
.photo-fader img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: photofade 10s infinite;
}
.photo-fader img:nth-child(2) { animation-delay: 5s; }
@keyframes photofade {
  0% { opacity: 0; }
  8% { opacity: 1; }
  50% { opacity: 1; }
  58% { opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-fader img { animation: none; }
  .photo-fader img:first-child { opacity: 1; }
}
.photo-cap { font-size: 13px; color: var(--muted); margin-top: 9px; }

/* ---------- Artículos clínicos: comparativas y esquemas ---------- */
.tablewrap { overflow-x: auto; background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); margin: 18px 0 8px; }
table.compare { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 660px; }
.compare th { text-align: left; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 2px solid var(--line); }
.compare td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.compare tr:last-child td { border-bottom: none; }
.compare td:first-child { font-weight: 700; color: var(--head); white-space: nowrap; }
.compare .best { color: var(--teal); font-weight: 700; }

.graft-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 20px; margin: 20px 0 6px; }
.graft-card { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px 22px 20px; }
.graft-card.hl { outline: 2.5px solid var(--teal); }
.graft-card .g-tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--teal); border-radius: 999px; padding: 3px 11px; margin-bottom: 10px; }
.graft-card h3 { font-size: 17px; margin-bottom: 3px; }
.graft-card .g-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.g-pros, .g-cons { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.g-pros li { padding: 3px 0 3px 21px; position: relative; color: var(--ink); margin: 0; }
.g-pros li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.g-cons { margin-top: 7px; }
.g-cons li { padding: 3px 0 3px 21px; position: relative; color: var(--muted); margin: 0; }
.g-cons li::before { content: "–"; position: absolute; left: 2px; font-weight: 700; }

.evidence { background: var(--panel); color: var(--on-panel); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 28px 30px; margin: 28px 0; max-width: 720px; }
.evidence h3 { color: #fff; margin-bottom: 10px; font-size: 20px; }
.evidence p { color: var(--on-panel); font-size: 15px; max-width: none; }
.evidence p:last-child { margin-bottom: 0; }
.stat-row { display: flex; gap: 40px; flex-wrap: wrap; margin: 18px 0 14px; }
.stat .num { display: block; font-size: 36px; font-weight: 800; color: #fff; line-height: 1.1; }
.stat .lbl { font-size: 13px; color: var(--on-panel); }

.diagram { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px; margin: 20px 0; max-width: 540px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram .cap { font-size: 13px; color: var(--muted); margin: 12px 0 0; text-align: center; }

.refs { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 38px; max-width: 700px; }
.refs ol { padding-left: 18px; margin: 6px 0 0; }
.refs li { margin: 4px 0; }
.refs a { color: var(--muted); }

/* ---------- Relacionados / lista antigua ---------- */
.related { background: var(--bg-soft); padding: 56px 0 76px; }
.t-list { border-top: 1px solid var(--line); }
.t-row { display: grid; grid-template-columns: minmax(220px, 0.9fr) 1.4fr auto; gap: 10px 28px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.t-row h3 { font-size: 18px; }
.t-row p { margin: 0; font-size: 14.5px; color: var(--muted); }
.t-row .arrow { font-size: 18px; color: var(--sky); transition: transform 0.15s ease; }
.t-row:hover .arrow { transform: translateX(4px); }
.t-row:hover h3 { color: var(--teal); }
@media (max-width: 680px) { .t-row { grid-template-columns: 1fr auto; } .t-row p { grid-column: 1 / -1; } }
