/* Clínica Quirúrgica del Tórax — estilos base */

:root {
  --color-primary: #114b5f;
  --color-primary-dark: #0b3542;
  --color-accent: #1c7c84;
  --color-bg: #ffffff;
  --color-bg-alt: #f3f6f7;
  --color-text: #1a2327;
  --color-text-muted: #51606a;
  --color-border: #dce4e6;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 6px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 17px;
}

h1, h2, h3 {
  color: var(--color-primary-dark);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 1.4em 0 0.6em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 0.5em; }
p { margin: 0 0 1em; }
ul { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

a { color: var(--color-accent); text-decoration: underline; text-decoration-thickness: from-font; }
a:hover { color: var(--color-primary-dark); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 0.6em 1em;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9em 1.2em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.brand img { height: 30px; width: auto; }

.main-nav { flex: 0 1 auto; }
.nav-toggle {
  display: none;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5em 0.9em;
  font-size: 0.95rem;
  cursor: pointer;
}
#nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3em;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  position: relative;
}
#nav-list > li > a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}
#nav-list > li > a:hover, #nav-list > li > a[aria-current="page"] { color: var(--color-accent); }

.has-sub { position: relative; }
.sub-toggle {
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
}
.sub-nav {
  display: none;
  position: absolute;
  top: 1.8em;
  left: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  list-style: none;
  margin: 0;
  padding: 0.5em;
  min-width: 260px;
  z-index: 50;
}
.has-sub.open .sub-nav { display: block; }
.sub-nav li { margin: 0; }
.sub-nav a {
  display: block;
  padding: 0.5em 0.6em;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.92rem;
}
.sub-nav a:hover { background: var(--color-bg-alt); color: var(--color-accent); }

.header-cta { display: flex; gap: 0.6em; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.6em 1.1em;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-primary-dark); border-color: var(--color-border); }
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-primary-invert { background: #fff; color: var(--color-primary-dark); }
.btn-primary-invert:hover { background: var(--color-bg-alt); }
.btn-ghost-invert { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-ghost-invert:hover { border-color: #fff; }

/* ---------- Main content ---------- */
main { max-width: var(--max-width); margin: 0 auto; padding: 2em 1.2em 1em; }
.page { max-width: 760px; }

.hero {
  display: flex;
  align-items: center;
  gap: 2.5em;
  max-width: none;
}
.hero-text { flex: 1 1 480px; max-width: 640px; }
.hero .lead { font-size: 1.1rem; color: var(--color-text-muted); }
.hero-cta { display: flex; gap: 0.8em; flex-wrap: wrap; margin-top: 1.2em; }
.hero-photo {
  flex: 1 1 320px;
  max-width: 380px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
}
@media (max-width: 760px) {
  .hero { flex-direction: column-reverse; }
  .hero-photo { max-width: 100%; }
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 2em;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1em 1.4em;
  margin: 2em 0;
}
.trust-strip p { margin: 0; font-weight: 600; color: var(--color-primary-dark); font-size: 0.95rem; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 2.5em;
  margin: 2em 0;
}
.home-col h2 { margin-top: 0; }
.home-col h2 a { text-decoration: none; }

.contact-actions, .cta-band-actions { display: flex; gap: 0.8em; flex-wrap: wrap; margin-top: 1em; }

.cta-band {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  max-width: var(--max-width);
  margin: 2em auto;
  padding: 1.6em 1.6em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: wrap;
}
.cta-band p { margin: 0; font-weight: 600; font-size: 1.1rem; }
.cta-band a { text-decoration: none; }

.post-list { list-style: none; padding: 0; }
.post-list > li { border-top: 1px solid var(--color-border); padding: 1.2em 0; }
.post-list > li:first-child { border-top: none; }
.post-date { color: var(--color-text-muted); font-size: 0.85rem; margin: 0; }
.post h1 { margin-top: 0.2em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-bg-alt); border-top: 1px solid var(--color-border); margin-top: 2em; }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2em 1.2em 1em;
  display: flex;
  justify-content: space-between;
  gap: 2em;
  flex-wrap: wrap;
}
.footer-about p { color: var(--color-text-muted); font-size: 0.92rem; }
.footer-legal ul { list-style: none; padding: 0; display: flex; gap: 1.2em; flex-wrap: wrap; }
.footer-legal a { color: var(--color-text-muted); text-decoration: none; font-size: 0.9rem; }
.footer-legal a:hover { color: var(--color-accent); }
.copy {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.2em 1.4em;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Sticky mobile call button */
.mobile-call {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: none;
  text-align: center;
  background: var(--color-primary);
  color: #fff;
  padding: 0.85em;
  font-weight: 700;
  text-decoration: none;
  z-index: 200;
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  #nav-list {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 0.5em;
  }
  .main-nav.open #nav-list { display: flex; }
  #nav-list > li { border-bottom: 1px solid var(--color-border); }
  #nav-list > li > a, .sub-toggle { display: block; padding: 0.7em 0.4em; }
  .sub-nav { position: static; border: none; box-shadow: none; padding-left: 1em; }
  .header-cta { display: none; }
  .home-grid { grid-template-columns: 1fr; }
  main { padding-bottom: 5em; }
  .mobile-call { display: block; }
}
