/* Dr. Héctor García — Cirugía General */

:root {
  --ink: #132826;
  --ink-soft: #3E514C;
  --muted: #5E6E69;
  --paper: #F3EEE4;
  --paper-2: #E8E1D3;
  --surface: #FFFCF6;
  --line: #D4CBBA;
  --line-strong: #B9AFA0;
  --brand: #153E39;
  --brand-2: #1C534C;
  --brand-3: #247067;
  --accent: #8A4E36;
  --accent-soft: #F0E3D8;
  --wa: #126E51;
  --wa-hover: #0E5942;
  --emergency: #5C2A2A;
  --emergency-bg: #F7EEEE;
  --header-bg: #153E39;
  --shadow: 0 10px 30px rgba(19, 40, 38, 0.08);
  --max: 1120px;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --focus: 0 0 0 3px rgba(36, 112, 103, 0.45);
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-2); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: none; box-shadow: var(--focus); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.skip:focus { top: 0.75rem; }

/* —— Header —— */
.site-header {
  background: var(--header-bg);
  color: #F4EFE6;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.topbar {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.35rem 1rem;
  background: #0F2F2B;
  color: #D9E4E1;
}

.bar {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
}

.logo {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex: 0 0 auto;
}
.logo:hover { color: inherit; }
.logo-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.logo-spec {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #C9D9D5;
  margin-top: 0.12rem;
}

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.nav-burger {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: #F4EFE6;
  border-radius: 1px;
}

.site-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #0F2F2B;
  padding: 0.5rem 0 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-toggle:checked ~ .site-nav { display: flex; }

.site-nav a,
.site-nav .nav-label {
  color: #F4EFE6;
  text-decoration: none;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  font-size: 0.98rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #F0E3D8;
  background: rgba(255,255,255,0.06);
}

.nav-sub { position: relative; }
.nav-sub > .nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}
.nav-sub ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0.25rem 0.75rem;
}
.nav-sub ul a {
  font-weight: 400;
  font-size: 0.95rem;
  color: #D5E0DD;
  padding: 0.45rem 1.25rem;
  display: block;
}

.btn-header {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.7rem 1.15rem;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { color: inherit; transform: translateY(-1px); }
.btn-wa {
  background: var(--wa);
  color: #fff;
}
.btn-wa:hover { background: var(--wa-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface); color: var(--brand); }
.btn-light {
  background: var(--surface);
  color: var(--brand);
  border-color: transparent;
}
.btn-light:hover { background: #fff; color: var(--brand); }
.btn-on-dark {
  background: transparent;
  color: #F4EFE6;
  border-color: rgba(244,239,230,0.45);
}
.btn-on-dark:hover { background: rgba(255,255,255,0.08); color: #fff; }

.icon-wa,
.icon-phone,
.icon-mail {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

@media (min-width: 960px) {
  .nav-burger { display: none; }
  .bar { padding: 0.85rem 1.5rem; }
  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: static;
    background: transparent;
    padding: 0;
    margin-left: auto;
    gap: 0.15rem;
    border: 0;
  }
  .site-nav a,
  .site-nav .nav-label {
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    background: transparent;
  }
  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    background: rgba(255,255,255,0.08);
  }
  .nav-sub ul {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 16.5rem;
    background: #0F2F2B;
    padding: 0.5rem 0;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.28);
    z-index: 20;
  }
  .nav-sub ul a { padding: 0.45rem 1rem; }
  .nav-sub:hover ul,
  .nav-sub:focus-within ul { display: block; }
  .btn-header { display: inline-flex; margin-left: 0.75rem; }
}

/* —— Layout —— */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { display: block; }

.hero {
  padding: 2.4rem 0 2.6rem;
}
.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-3);
  font-weight: 600;
  margin: 0 0 0.7rem;
}
h1, h2, h3, .serif {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
h1 {
  font-size: clamp(1.85rem, 4.4vw, 2.85rem);
  margin: 0 0 1rem;
}
h2 { font-size: clamp(1.45rem, 3vw, 1.95rem); margin: 0 0 0.8rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.5rem; }

.lead, .prose p, .prose li {
  color: var(--ink-soft);
}
.lead {
  font-size: 1.08rem;
  margin: 0 0 1.25rem;
  max-width: 42rem;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.25rem 0 1rem;
}
.hero-meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.portrait {
  position: relative;
  max-width: 22rem;
  margin: 0 auto;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 1.1rem -0.9rem -0.9rem 1.1rem;
  background: var(--brand);
  border-radius: 18px 18px 6px 18px;
  z-index: 0;
}
.portrait picture,
.portrait img {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  width: 100%;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.portrait figcaption {
  position: relative;
  z-index: 1;
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 800px) {
  .hero { padding: 3.2rem 0 3.5rem; }
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
  }
  .portrait { margin: 0 0 0 auto; }
}

/* —— Sections —— */
.section { padding: 2.4rem 0; }
.section-alt { background: var(--surface); }
.section-brand {
  background: var(--brand);
  color: #E7EFED;
}
.section-brand h2,
.section-brand h3 { color: #F7F3EB; }
.section-brand p { color: #C9D6D3; }
.section-head {
  max-width: 40rem;
  margin-bottom: 1.6rem;
}
.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.proc-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .proc-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .proc-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.proc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem 1.15rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.proc-card:hover {
  color: inherit;
  border-color: var(--brand-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.proc-num {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.proc-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}
.proc-card p {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  flex: 1;
}
.proc-card .more {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-2);
}

.facts {
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .facts { grid-template-columns: 1fr 1fr; }
}
.fact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}
.fact h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.fact p, .fact li { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.fact a { font-weight: 600; }

.note {
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  margin: 1.25rem 0;
}
.note-urgent {
  border-left-color: var(--emergency);
  background: var(--emergency-bg);
}
.note p { margin: 0; color: var(--ink); }

/* —— Prose pages —— */
.page-hero {
  padding: 2rem 0 0.5rem;
}
.crumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }

.prose {
  max-width: 42rem;
}
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.15rem; }
.prose li { margin: 0.3rem 0; }
.prose h2 { margin-top: 2rem; }

.page-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: 3rem;
}
@media (min-width: 880px) {
  .page-layout {
    grid-template-columns: minmax(0, 1fr) 18.5rem;
    align-items: start;
    gap: 3rem;
  }
  .aside { position: sticky; top: 7.5rem; }
}

.aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.3rem;
}
.aside-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 0.9rem; }
.aside-card .btn { width: 100%; margin-top: 0.35rem; }
.aside-list { list-style: none; margin: 0; padding: 0; }
.aside-list a {
  display: block;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--brand-2);
  font-weight: 600;
  font-size: 0.95rem;
}
.aside-list a:first-child { border-top: 0; }
.aside-list a:hover { color: var(--accent); }

.faq { margin: 1.2rem 0 1.6rem; }
.faq details {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--brand-3);
  font-size: 1.3rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.6rem 0 0.2rem; color: var(--ink-soft); }

.split {
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 800px) {
  .split { grid-template-columns: 15.5rem 1fr; gap: 3rem; }
}
.portrait-simple img {
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
  background: var(--paper-2);
}

.cred-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.3rem;
}
.cred-list li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.cred-list li:first-child { border-top: 0; }
.cred-list strong { color: var(--ink); font-weight: 600; display: block; }

.contact-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.contact-card h2 { font-size: 1.2rem; }
.contact-card p { margin: 0 0 0.8rem; color: var(--ink-soft); }
.contact-card a.big {
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--brand);
  word-break: break-word;
}
.contact-card a.big:hover { color: var(--accent); }

/* —— Footer —— */
.site-footer {
  background: #0F2A27;
  color: #C9D4D1;
  padding: 2.5rem 0 2rem;
  margin-top: 0;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  gap: 1.6rem;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 2.5rem; }
}
.site-footer h2 {
  color: #F4EFE6;
  font-size: 1.05rem;
  margin: 0 0 0.55rem;
}
.site-footer a { color: #E8F0EE; }
.site-footer a:hover { color: #fff; }
.site-footer p, .site-footer li { margin: 0 0 0.4rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.disclaimer {
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: #A8B6B3;
  max-width: 52rem;
}
.legal {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: #8FA09C;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

/* —— Floating WhatsApp —— */
.wa-float {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(18, 110, 81, 0.4);
  text-decoration: none;
}
.wa-float:hover { background: var(--wa-hover); color: #fff; }
.wa-float svg { width: 28px; height: 28px; }
.wa-float span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

body { padding-bottom: 4.5rem; }
@media (min-width: 960px) {
  body { padding-bottom: 0; }
}

@media print {
  .site-header, .wa-float, .btn, .nav-burger { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  a { color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .proc-card { transition: none; }
}

/* Fixes */
.nav-toggle {
  position: absolute;
  left: -999px;
  width: 1px;
  height: 1px;
}
.nav-burger span { width: 100%; }
.logo:focus-visible,
.btn:focus-visible,
.wa-float:focus-visible,
.site-nav a:focus-visible,
.nav-burger:focus-within {
  box-shadow: 0 0 0 3px rgba(244, 239, 230, 0.55);
}
.proc-card:focus-visible,
a.big:focus-visible {
  box-shadow: var(--focus);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile header CTA is intentional (kept visible). Higher specificity than .btn. */
.btn.btn-header {
  display: inline-flex;
  margin-left: 0.2rem;
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  flex: 0 0 auto;
}

@media (min-width: 960px) {
  .btn.btn-header {
    padding: 0.7rem 1.15rem;
    font-size: 0.98rem;
    margin-left: 0.75rem;
  }
}

/* Leave a gutter so the floating WhatsApp button does not cover the portrait. */
@media (max-width: 959px) {
  .portrait {
    max-width: min(20rem, calc(100% - 4.25rem));
    margin-left: 0;
    margin-right: 4.25rem;
  }
}

.nav-sub > .nav-label::after {
  content: "";
  display: none;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-0.15em);
  opacity: 0.8;
}

@media (min-width: 960px) {
  .nav-sub > .nav-label {
    display: inline-flex;
    align-items: center;
  }
  .nav-sub > .nav-label::after {
    display: inline-block;
  }
}

html { overflow-x: hidden; }
