/* ============================================================
   Centro Cardiovascular Dr. Norberto Casso
   Sistema de diseño — institucional-médico refinado
   Firma: línea de ECG. Tipografía: Spectral / Source Sans 3 / IBM Plex Mono
   ============================================================ */

:root {
  /* Color */
  --ink: #0E2A45;
  --ink-soft: #24486B;
  --sky: #4A90C2;
  --sky-deep: #2F6EA0;
  --sky-tint: #EAF2F8;
  --paper: #FBFCFD;
  --paper-2: #F1F6F9;
  --line: #DCE6EE;
  --muted: #5B7186;
  --white: #FFFFFF;
  --wa: #25D366;
  --wa-deep: #1EA556;

  /* Type */
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm */
  --maxw: 1160px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(14, 42, 69, .05), 0 12px 32px -18px rgba(14, 42, 69, .28);
  --shadow-lg: 0 24px 60px -28px rgba(14, 42, 69, .45);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky-deep); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.15rem; }
strong { font-weight: 600; }

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.25rem, 8vw, 6rem); }
.section--tint { background: var(--paper-2); }
.section--ink { background: var(--ink); color: #DCE8F2; }
.section--ink h1, .section--ink h2, .section--ink h3 { color: #fff; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 200; }
.skip-link:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 2px; }

/* Eyebrow / labels — clinical mono */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sky-deep);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--sky); display: inline-block; }
.section--ink .eyebrow { color: #7FB4DC; }

/* Section heading block */
.h-lead { font-size: clamp(1.9rem, 4.4vw, 3rem); margin-bottom: .35em; }
.h-sub { color: var(--muted); font-size: 1.12rem; max-width: 56ch; }
.section--ink .h-sub { color: #9FBAD1; }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem; line-height: 1;
  padding: .95rem 1.5rem; border-radius: var(--radius);
  border: 1.5px solid var(--b); background: var(--b); color: #fff;
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, color .18s;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn svg { width: 1.15em; height: 1.15em; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }
.section--ink .btn--ghost,
.hero .btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.section--ink .btn--ghost:hover,
.hero .btn--ghost:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.06); }
.btn--wa { --b: var(--wa); background: var(--wa); border-color: var(--wa); color: #06331b; }
.btn--wa:hover { background: var(--wa-deep); border-color: var(--wa-deep); color: #fff; }
.btn--lg { padding: 1.1rem 1.8rem; font-size: 1.06rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 252, 253, .88); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; }
.brand__role { font-family: var(--mono); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

.nav__links { display: block; }
.nav__cta { display: none; }
.nav__toggle {
  display: inline-flex; flex-direction: column; gap: 5px; justify-content: center;
  width: 46px; height: 42px; padding: 0 10px; background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer;
}
.nav__toggle span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav[data-open="true"] .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav[data-open="true"] .nav__toggle span:nth-child(2) { opacity: 0; }
.nav[data-open="true"] .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__panel {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: .5rem var(--gutter) 1.4rem; box-shadow: var(--shadow);
}
.nav[data-open="true"] .nav__panel { display: block; }
.nav__panel a { display: block; padding: .8rem .25rem; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.nav__panel a[aria-current="page"] { color: var(--sky-deep); }
.nav__panel .btn { margin-top: 1rem; width: 100%; }

@media (min-width: 940px) {
  .nav__toggle { display: none; }
  .nav__panel { display: contents; }
  .nav__links { display: flex; align-items: center; gap: 1.4rem; }
  .nav__links a { padding: 0; border: 0; font-weight: 600; font-size: .98rem; color: var(--ink-soft); position: relative; }
  .nav__links a:hover { color: var(--ink); }
  .nav__links a[aria-current="page"] { color: var(--sky-deep); }
  .nav__links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -26px; height: 2px; background: var(--sky); }
  .nav__cta { display: inline-flex; }
  .nav__panel .btn { display: none; }
}

/* ---------- ECG signature line ---------- */
.ecg { display: block; width: 100%; height: auto; color: var(--sky); }
.ecg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ecg--divider { color: var(--line); height: 34px; }
.ecg--divider .lead { stroke: var(--sky); }
.ecg-draw path {
  stroke-dasharray: var(--len, 1400);
  stroke-dashoffset: var(--len, 1400);
  animation: ecg-draw 2.6s var(--ease) forwards;
}
@keyframes ecg-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .ecg-draw path { animation: none; stroke-dashoffset: 0; } }

.divider-wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: clip; background: var(--ink); color: #E7F0F8; isolation: isolate; }
.hero__bg { position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(74,144,194,.35), transparent 55%),
    radial-gradient(90% 80% at -5% 110%, rgba(47,110,160,.30), transparent 50%),
    var(--ink);
}
.hero__grid { position: absolute; inset: 0; z-index: -1; opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
  mask-image: linear-gradient(to bottom, #000, transparent 78%); }
.hero__inner { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.hero__eyebrow { color: #86BEE6; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 6.2vw, 4.2rem); line-height: 1.04; max-width: 15ch; }
.hero h1 em { font-style: italic; color: #9DCBEC; }
.hero__lead { font-size: clamp(1.08rem, 2.4vw, 1.35rem); color: #B9D0E4; max-width: 46ch; margin-block: 1.2rem 1.8rem; }
.hero .btn-row { margin-bottom: 2.2rem; }
.hero__ecg { max-width: 560px; margin-top: .5rem; }
.hero__ecg .ecg { height: 62px; }

.hero__sedes { display: grid; gap: .8rem; margin-top: 2.4rem; }
.sede-chip {
  display: flex; align-items: center; gap: .9rem; padding: .95rem 1.1rem;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); color: #E7F0F8;
}
.sede-chip:hover { background: rgba(255,255,255,.1); color: #fff; }
.sede-chip__pin { width: 30px; height: 30px; flex: none; color: #9DCBEC; }
.sede-chip__name { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; color: #fff; }
.sede-chip__hrs { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: #9FBAD1; }
@media (min-width: 720px) { .hero__sedes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) {
  .hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
  .hero__sedes { margin-top: 0; align-content: center; }
}

/* ---------- Stat / trust strip ---------- */
.trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
@media (min-width: 720px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust__item { }
.trust__n { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.7rem); color: var(--ink); line-height: 1; }
.trust__l { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: .5rem; }

/* ---------- Generic grid ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid--2 { grid-template-columns: 1fr 1fr; } .grid--3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #C7D8E6; }
.card__icon { width: 42px; height: 42px; color: var(--sky-deep); margin-bottom: 1rem; }
.card h3 { font-size: 1.25rem; }
.card p { color: var(--muted); margin-bottom: 0; }

/* Service list (compact) */
.svc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.svc-list li { display: flex; gap: .85rem; align-items: baseline; padding: .95rem .2rem; border-bottom: 1px solid var(--line); }
.svc-list li:last-child { border-bottom: 0; }
.svc-list .n { font-family: var(--mono); font-size: .78rem; color: var(--sky-deep); min-width: 2.2ch; }
.svc-list .t { font-family: var(--serif); font-size: 1.16rem; color: var(--ink); }
.svc-list .d { color: var(--muted); font-size: .96rem; display: block; margin-top: .15rem; }

/* ---------- Sede cards (locations) ---------- */
.sedes { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .sedes { grid-template-columns: 1fr 1fr; } }
.sede {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.sede__map { aspect-ratio: 16 / 10; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.sede__map iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(.15) contrast(1.02); }
.sede__body { padding: 1.7rem; display: flex; flex-direction: column; gap: .9rem; flex: 1; }
.sede__name { font-size: 1.5rem; margin: 0; }
.sede__loc { font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sky-deep); margin: 0; }
.sede dl { display: grid; grid-template-columns: auto 1fr; gap: .55rem .9rem; margin: 0; font-size: .98rem; }
.sede dt { color: var(--sky-deep); }
.sede dt svg { width: 18px; height: 18px; display: block; }
.sede dd { margin: 0; color: var(--ink-soft); }
.sede dd .hrs { font-family: var(--mono); font-size: .86rem; }
.sede__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: .7rem; padding-top: .4rem; }
.sede__actions .btn { flex: 1 1 auto; }

/* ---------- Credentials / affiliations ---------- */
.creds { display: flex; flex-wrap: wrap; gap: .7rem; }
.cred {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .06em;
  padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 100px;
  color: var(--ink-soft); background: var(--white);
}
.section--ink .cred { color: #CFE0EE; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }

/* ---------- Split feature ---------- */
.split { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 3.5rem; } .split--rev .split__media { order: 2; } }
.split__media { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); aspect-ratio: 4 / 3; }

/* Portrait placeholder */
.portrait { width: 100%; height: 100%; display: grid; place-items: center; color: var(--sky); background:
  radial-gradient(80% 80% at 50% 20%, var(--sky-tint), var(--paper-2)); }
.portrait svg { width: 40%; opacity: .5; }
.ph-note { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; padding: .6rem; }

/* ---------- Coverage strip ---------- */
.coverage { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; justify-content: space-between; }
.coverage__tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.tag { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; padding: .5rem 1rem; border-radius: var(--radius); background: var(--sky-tint); color: var(--ink); border: 1px solid #D3E4F1; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); max-width: 20ch; margin-inline: auto; }
.cta-band p { color: #9FBAD1; max-width: 48ch; margin: 0 auto 1.8rem; }
.cta-band .btn-row { justify-content: center; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .8rem; max-width: 780px; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .3rem 1.2rem; }
.faq summary { font-family: var(--serif); font-size: 1.16rem; color: var(--ink); cursor: pointer; padding: 1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); color: var(--sky-deep); font-size: 1.5rem; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); padding-bottom: 1rem; margin: 0; }

/* ---------- Page header (interior) ---------- */
.pagehead { background: var(--ink); color: #E7F0F8; position: relative; overflow: clip; }
.pagehead__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.pagehead__bg { position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(14,42,69,.74), rgba(14,42,69,.92)), radial-gradient(90% 120% at 90% -20%, rgba(74,144,194,.4), transparent 55%); }
.pagehead__inner { position: relative; z-index: 1; padding-block: clamp(2.6rem, 6vw, 4.2rem); }
.pagehead h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); max-width: 20ch; }
.pagehead p { color: #B9D0E4; max-width: 54ch; margin: 0; }
.crumbs { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #7FB4DC; margin-bottom: 1.1rem; }
.crumbs a { color: #7FB4DC; } .crumbs a:hover { color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #A9C2D6; padding-block: 3.2rem 2rem; }
.site-footer a { color: #CFE0EE; }
.site-footer a:hover { color: #fff; }
.footer__grid { display: grid; gap: 2.2rem; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer__brand .brand__name { color: #fff; }
.footer__brand .brand__role { color: #7FB4DC; }
.footer__brand p { color: #94AEC4; max-width: 34ch; margin-top: 1rem; font-size: .96rem; }
.footer h4 { color: #fff; font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; margin-bottom: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: .98rem; }
.footer__meta { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: space-between; align-items: center; margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .84rem; color: #8AA6BD; }
.footer__meta .mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; }

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--wa); color: #06331b; font-weight: 700; font-family: var(--sans);
  padding: .85rem 1.15rem; border-radius: 100px; box-shadow: var(--shadow-lg);
  transition: transform .18s var(--ease), background .2s;
}
.wa-float:hover { transform: translateY(-2px) scale(1.02); background: var(--wa-deep); color: #fff; }
.wa-float svg { width: 1.4em; height: 1.4em; }
.wa-float__txt { display: none; }
@media (min-width: 600px) { .wa-float__txt { display: inline; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Imágenes ---------- */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.split__media img.img-cover { border-radius: 0; }
figure { margin: 0; }

/* Hero con retrato */
.hero__figure { position: relative; align-self: center; }
.hero__figure img { position: relative; z-index: 1; width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: block; }
.hero__figure::before { content: ""; position: absolute; right: -16px; bottom: -16px; width: 62%; height: 68%; border: 2px solid rgba(74,144,194,.45); border-radius: var(--radius-lg); z-index: 0; }
.hero__badge { position: absolute; left: -10px; bottom: 20px; z-index: 2; background: #fff; border-radius: var(--radius); padding: .7rem 1rem; box-shadow: var(--shadow-lg); }
.hero__badge strong { display: block; font-family: var(--serif); font-size: 1rem; color: var(--ink); line-height: 1.1; }
.hero__badge span { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 939px) {
  .hero__figure { max-width: 440px; margin-inline: auto; margin-top: 2.4rem; }
  .hero__figure::before { display: none; }
}

/* Banda con imagen de fondo */
.imgband { position: relative; overflow: clip; background: var(--ink); color: #E7F0F8; }
.imgband img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; z-index: 0; }
.imgband__inner { position: relative; z-index: 1; }

/* Caption bajo imágenes de referencia */
.figcap { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: .6rem; }

/* Marco sutil para imágenes de sección */
.framed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 4 / 3; }
.framed img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Lead paragraph */
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.prose h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin-top: 2.2rem; }
.prose h3 { font-size: 1.3rem; margin-top: 1.6rem; }
.prose ul li { margin-bottom: .4rem; }
