/* ===== Tokens ===== */
:root {
  --cream-header: #F5EFE6;
  --ink: #2B2D33;
  --navy: #1F2A44;
  --gold: #C9894B;
  --gold-dark: #B07438;
  --sage: #8FA58A;
  --bone: #FBF8F3;
  --white: #FFFFFF;
  --border: #E6DFD2;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;

  --max-width: 1100px;
  --header-h: 104px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bone);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; }
h3 { font-size: 1.4rem; font-weight: 600; }

p { margin: 0 0 1em; }

a { color: var(--navy); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ===== Layout helpers ===== */
.section { padding: 64px 20px; }
.section-alt { background: var(--cream-header); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.narrow { max-width: 760px; }
.section-title-center { text-align: center; margin-bottom: 1em; }
.lead { font-size: 1.15rem; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream-header);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-link { flex-shrink: 0; }

.logo-img {
  height: 92px;
  width: auto;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.menu-toggle span {
  display: block;
  height: 3px;
  background: var(--navy);
  border-radius: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.site-nav a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.98rem;
}
.site-nav a:not(.btn):hover,
.site-nav a:not(.btn):focus {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 14px 28px;
  min-height: 48px;
  line-height: 20px;
  text-align: center;
  transition: transform 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
}
.btn:hover, .btn:focus { transform: translateY(-1px); }

.btn-primary {
  background: var(--gold);
  color: var(--white);
}
.btn-primary:hover, .btn-primary:focus { background: var(--gold-dark); }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover, .btn-secondary:focus { background: var(--navy); color: var(--white); }

.btn-nav {
  padding: 10px 20px;
  min-height: auto;
  font-size: 0.92rem;
}

.btn-large { font-size: 1.1rem; padding: 16px 32px; }

/* ===== Hero ===== */
/* Dimensionado para que imagen (completa, sin recortar) + botón entren en una pantalla, sin scroll */
.hero {
  padding: 14px 0 16px;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-figure {
  position: relative;
  margin: 0;
}

.hero-img {
  width: 100%;
  max-height: 74svh;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}

/* Texto sobreimpreso en 3 líneas, con peso gráfico propio, sobre la parte baja de la foto */
.hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 36px 24px 22px;
  background: linear-gradient(to top, rgba(31,42,68,0.82) 0%, rgba(31,42,68,0.5) 60%, rgba(31,42,68,0) 100%);
  text-align: center;
}

.hero-overlay .hero-lead {
  color: var(--bone);
  font-size: clamp(1.15rem, 2.8vw, 1.9rem);
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  margin-bottom: 0;
}

.hero-lead {
  font-family: var(--font-serif);
  color: var(--navy);
}

.hero-name {
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.3;
}
.hero-name-main {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  margin: 0;
}
.hero-name-sub {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--navy);
  margin: 0;
}

.hero-text {
  max-width: 680px;
  margin: 18px auto 0;
  padding: 0 20px;
  text-align: center;
}

/* ===== Sobre mí + Qué es un psicogerontólogo (bloque compacto, una sola pantalla) ===== */
.compact-section {
  padding: 32px 20px;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-grid {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.compact-grid { margin-bottom: 16px; }

.about-badge {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.about-badge-initial {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  color: var(--cream-header);
}

.about-text { flex: 1; min-width: 260px; }

.about-text h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 0.3em; }

.about-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.3em;
}

.about-text p { margin-bottom: 0.5em; }

.about-list {
  margin: 0 0 0.6em;
  padding-left: 1.3em;
}
.about-list li { margin-bottom: 0.15em; }

.psico-block { border-top: 1px solid var(--border); padding-top: 16px; margin-left: auto; margin-right: auto; }
.psico-block h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 0.3em; }
.psico-block .lead { font-size: 1rem; line-height: 1.55; margin-bottom: 0; }

.section-cta { text-align: center; margin-top: 18px; }

/* ===== Stat highlight ===== */
.stat-highlight {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--navy);
  border-left: 4px solid var(--gold);
  padding-left: 20px;
  margin-top: 1.5em;
}
.stat-number {
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 1.7rem;
}

/* ===== Feature blocks ===== */
.feature-block {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.feature-block:last-child { margin-bottom: 0; }

.feature-reverse { flex-direction: row-reverse; }

.feature-img {
  flex: 1 1 420px;
  border-radius: 12px;
  object-fit: cover;
  max-height: 340px;
  width: 100%;
}

.feature-text { flex: 1 1 320px; }

/* ===== Check list ===== */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6em;
}
.check-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 0.7em;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--sage);
  font-weight: 700;
  font-size: 1.2rem;
}

.closing-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 1.3em;
}

/* ===== Cards ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.card h3 { margin-bottom: 0.5em; }
.card p { margin-bottom: 0; }

.hours-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--sage);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.hours-box p:last-child { margin-bottom: 0; }

.fees-box { border-left-color: var(--gold); }

.free-consult {
  font-weight: 700;
  color: var(--gold-dark);
  font-size: 1.1rem;
}

/* ===== Map ===== */
.map-wrap {
  position: relative;
  padding-top: 56%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== CTA final ===== */
.cta-final {
  background: var(--navy);
  color: var(--bone);
  text-align: center;
}
.cta-final h2 { color: var(--bone); }
.cta-final .free-consult { color: var(--gold); }

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 1.5em 0;
}
.cta-final .btn-secondary {
  background: transparent;
  color: var(--bone);
  border-color: var(--bone);
}
.cta-final .btn-secondary:hover, .cta-final .btn-secondary:focus {
  background: var(--bone);
  color: var(--navy);
}

.crisis-note {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 1.2em;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--ink);
  color: var(--bone);
  padding: 44px 20px;
}
.footer-inner { text-align: center; }
.footer-inner a { color: var(--bone); }
.footer-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.5em;
}
.footer-credentials {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.8em;
}
.footer-inner .crisis-note { opacity: 0.75; }
.copyright { font-size: 0.85rem; opacity: 0.7; margin-top: 1em; margin-bottom: 0; }

/* ===== Botón flotante de WhatsApp ===== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 200;
  color: var(--white);
}
.whatsapp-icon { width: 32px; height: 32px; }

/* ===== Modal formulario de consulta ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31,42,68,0.6);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  padding: 32px 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin-bottom: 0.8em;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--navy);
  cursor: pointer;
  padding: 4px 8px;
}

#consultaForm label {
  display: block;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 14px;
  font-size: 0.98rem;
}
#consultaForm input,
#consultaForm textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  background: var(--bone);
}
#consultaForm input:focus,
#consultaForm textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
#consultaForm input:invalid:not(:placeholder-shown),
#consultaForm textarea:invalid:not(:placeholder-shown) {
  border-color: #B3453D;
}
#consultaForm textarea { resize: vertical; }

.modal-error {
  color: #B3453D;
  font-weight: 600;
  margin-bottom: 14px;
}

#consultaForm .btn {
  width: 100%;
}

/* ===== Mobile ===== */
@media (max-width: 820px) {
  .menu-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream-header);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
  }
  .site-nav .btn-nav {
    margin: 16px 24px;
    border-radius: 999px;
  }

  .feature-block, .feature-reverse {
    flex-direction: column;
  }

  .about-grid { flex-direction: column; text-align: center; }

  .compact-section { min-height: auto; }
  .hero { min-height: auto; }

  .whatsapp-float { bottom: 16px; right: 16px; width: 52px; height: 52px; }
  .whatsapp-icon { width: 28px; height: 28px; }

  body { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .btn:focus { transform: none; }
}
