/* =========================================================
   OSTEOPATÍA CONSCIENTE — Sistema de diseño
   Paleta: pino oscuro / arena cálida / ocre
   Tipos: Fraunces (display) + Work Sans (texto) + IBM Plex Mono (utilidad)
   Firma visual: línea de columna vertebral que atraviesa la página
   ========================================================= */

:root {
  --pine:      #1E2A24;
  --pine-70:   #1E2A24B3;
  --sand:      #F2EEE3;
  --sand-dim:  #E9E2D2;
  --sage:      #6B7F6E;
  --sage-dim:  #DDE3D8;
  --ochre:     #B8863E;
  --rule:      #C9C2AE;
  --white:     #FFFDF9;

  --font-display: "Fraunces", serif;
  --font-body: "Work Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --max-w: 1120px;
  --gap: clamp(1.5rem, 3vw, 3rem);

  --radius: 18px;
  --radius-sm: 10px;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--pine);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 500; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 600; }

p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
  display: block;
  margin-bottom: 0.9em;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* Foco visible accesible */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
}

/* ---------- NAV ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--sand);
  border-bottom: 1px solid var(--rule);
}

.site-nav .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--pine);
}

.brand span { color: var(--ochre); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--pine-70);
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--pine);
  border-color: var(--ochre);
}

/* El botón "Pedir cita" dentro del menú necesita más especificidad
   para no heredar el color de texto de .nav-links a */
.nav-links a.btn-primary {
  color: var(--white);
  border-bottom: none;
  padding: 0.6rem 1.5rem;
}

.nav-links a.btn-primary:hover {
  color: var(--white);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  /* CORRECCIÓN: Se aumenta el padding horizontal de 1.4rem a 2rem para dar más aire */
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--pine);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-primary { background: var(--pine); color: var(--white); }
.btn-primary:hover { background: var(--ochre); border-color: var(--ochre); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--pine); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--pine); }

/* CORRECCIÓN: Se equilibra el padding de .nav-cta en escritorio (1.5rem laterales) */
.nav-cta { font-size: 0.85rem; padding: 0.6rem 1.5rem; }

/* ---------- Hamburguesa (móvil) ---------- */
.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--pine);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- SIGNATURE: línea de columna ---------- */
.spine-divider {
  width: 100%;
  height: 48px;
  display: block;
  margin: 0 auto;
}

.spine-divider path {
  fill: none;
  stroke: var(--ochre);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
  animation: draw-spine 1.6s ease forwards;
}

.spine-divider circle {
  fill: var(--sand);
  stroke: var(--sage);
  stroke-width: 1.4;
  opacity: 0;
  animation: fade-dot 0.4s ease forwards;
}

@keyframes draw-spine { to { stroke-dashoffset: 0; } }
@keyframes fade-dot { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .spine-divider path { stroke-dashoffset: 0; animation: none; }
  .spine-divider circle { opacity: 1; animation: none; }
}

/* ---------- HERO ---------- */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--gap);
  align-items: center;
}

.hero h1 { margin-bottom: 0.4em; }

.hero-sub {
  font-size: 1.1rem;
  color: var(--pine-70);
  max-width: 34em;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}

.hero-photo {
  aspect-ratio: 4 / 5;
  background: linear-gradient(155deg, var(--sage-dim), var(--sand-dim));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---------- SECTIONS ---------- */
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }

.section-head {
  max-width: 40em;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- CARDS servicios ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 1.8rem;
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover { border-color: var(--ochre); transform: translateY(-3px); }

.card .eyebrow { margin-bottom: 0.6em; }

.card p { color: var(--pine-70); font-size: 0.95rem; margin-bottom: 0; }

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.88rem;
  font-family: var(--font-mono);
  text-decoration: none;
  color: var(--ochre);
  border-bottom: 1px solid transparent;
}
.card-link:hover { border-color: var(--ochre); }

/* ---------- Sobre mí / bio ---------- */
.bio-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--gap);
  align-items: start;
}

.bio-photo {
  aspect-ratio: 3 / 4;
  background: linear-gradient(155deg, var(--sand-dim), var(--sage-dim));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.list-plain {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--pine-70);
}

.list-plain li { padding-left: 1.2em; position: relative; }
.list-plain li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ochre);
}

/* ---------- Testimonios ---------- */
.testimonial {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ochre);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--pine);
  background: var(--white);
  margin: 0;
}

.testimonial cite {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.75rem;
  color: var(--pine-70);
  letter-spacing: 0.04em;
}

/* ---------- CTA banda ---------- */
.cta-band {
  background: var(--pine);
  color: var(--sand);
  text-align: center;
  padding: clamp(3rem, 7vw, 4.5rem) 0;
}

.cta-band h2 { color: var(--white); }
.cta-band .hero-sub { color: #C9CFC9; margin: 0 auto 1.6rem; }
.cta-band .btn-primary { background: var(--ochre); border-color: var(--ochre); color: var(--pine); }
.cta-band .btn-primary:hover { background: var(--white); border-color: var(--white); }
.cta-band .btn-ghost { border-color: #4A5A50; color: var(--sand); }
.cta-band .btn-ghost:hover { border-color: var(--sand); }

/* ---------- Contacto ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}

.info-block { margin-bottom: 1.6rem; }
.info-block h3 { margin-bottom: 0.3em; }
.info-block p { color: var(--pine-70); margin-bottom: 0; }

.map-block {
  aspect-ratio: 4/2;
  min-height: 320px;
  background: var(--sand-dim);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.map-block iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--pine-70);
  text-align: center;
  padding: 1rem;
}

/* ---------- Detalle de servicios ---------- */
.service-detail {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: baseline;
  padding: 1.8rem 0;
  border-top: 1px solid var(--rule);
}

.service-detail:last-child { border-bottom: 1px solid var(--rule); }

.service-detail h3 { margin-bottom: 0.35em; }
.service-detail p { color: var(--pine-70); margin-bottom: 0; max-width: 42em; }

.service-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--pine);
  text-align: right;
  white-space: nowrap;
}

.service-meta small { display: block; color: var(--pine-70); font-size: 0.72rem; margin-top: 0.2em; }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--pine-70);
}

.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--pine); }

/* ---------- Responsive / menú móvil ---------- */
@media (max-width: 860px) {
  .hamburger { display: flex; }

  .nav-links {
    position: absolute;
    top: calc(100% + 1px);
    right: clamp(1.25rem, 4vw, 2.5rem);
    left: clamp(1.25rem, 4vw, 2.5rem);
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.4rem 1.6rem;
    box-shadow: 0 12px 28px -12px rgba(30, 42, 36, 0.25);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .nav-links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* CORRECCIÓN EXCLUSIVA PARA EL MENÚ RESPONSIVE DESPLEGABLE */
  .nav-links .nav-cta { 
    width: 100%;             /* Se estira a lo ancho del contenedor */
    justify-content: center; /* Centra el texto en el eje x */
    padding: 0.85rem 2rem;   /* Aumenta el alto y da mucho espacio a los lados */
    font-size: 0.95rem;      /* Escala la tipografía para que rime con los otros links */
    margin-top: 0.5rem;      /* Espacio de separación con el link de arriba */
  }
  
  .map-block {
    width: 100%;
    min-height: auto;
    aspect-ratio: 1/1;
  }

  .hero-grid, .bio-grid, .contact-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .service-detail { grid-template-columns: 1fr; }
  .service-meta { text-align: left; }
}

/* ---------- Animación fade-in (controlada por GSAP, JS añade estos estilos en línea) ---------- */
.reveal { will-change: transform, opacity; }