/* ==========================================================================
   Fisioterapia Hermosillo — hoja de estilos única
   Sistema visual: geometría de agave (corte angular de ~12°, reutilizado
   como firma en tarjetas, imágenes y botones) sobre luz de desierto.
   ========================================================================== */

/* ---- Tipografías autohospedadas (2 archivos, según presupuesto de rendimiento) ---- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-bold.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-regular.woff2") format("woff2");
}

/* ---- Variables de diseño ---- */
:root {
  --color-stone: #F4F1EB;
  --color-ink: #1B2B3A;
  --color-agave: #5C7A80;      /* uso decorativo: bordes, fondos, UI grande */
  --color-agave-text: #4A6469; /* texto: AA en stone (5.61) y blanco (6.33) */
  --color-sky: #2F7DA8;      /* uso decorativo / UI grande, no texto pequeño */
  --color-sky-text: #1F5A78; /* enlaces y texto: AA en stone y blanco */
  --color-orange: #E8622C;
  --color-shadow: #0F1B24;
  --color-white: #FFFFFF;

  --font-display: "Space Grotesk", "Arial Narrow", Arial, sans-serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --cut-sm: 18px;
  --cut-md: 28px;
  --cut-lg: 44px;

  --container: 1180px;
  --header-h: 72px;

  --ease-weighted: cubic-bezier(.16,.84,.44,1);
}

/* ---- Reset básico ---- */
*, *::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: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--color-stone);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.125rem; /* 18px base — legibilidad para audiencia adulto mayor */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding: 0; margin: 0; list-style: none; }
a { color: var(--color-sky-text); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.6em;
  color: var(--color-ink);
}
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-agave-text); }
p { margin: 0 0 1em; }
address { font-style: normal; }
dt { font-weight: 700; color: var(--color-ink); }
dd { margin: 0 0 1em; }

.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;
}

.skip-link {
  position: absolute; left: 0; top: -100px;
  background: var(--color-ink); color: var(--color-white);
  padding: 0.9em 1.2em; z-index: 1000; transition: top 0.2s var(--ease-weighted);
}
.skip-link:focus { top: 0; }

/* Foco visible consistente en todo el sitio */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid var(--color-sky);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin: 0 0 0.6em;
}
section { padding: 3.5rem 0; }
@media (min-width: 900px) { section { padding: 6rem 0; } }

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem; /* >= 18.66px en negritas: cumple "texto grande" AA */
  text-decoration: none;
  white-space: nowrap;
  padding: 0.85em 1.5em;
  min-height: 44px;
  border: none;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%);
}
.btn--cta {
  background: var(--color-orange);
  color: var(--color-ink); /* ink sobre naranja = 4.28:1, válido en texto grande */
}
.btn--cta:hover, .btn--cta:focus-visible { background: #d1551f; }
.btn--lg { padding: 1em 1.75em; font-size: 1.2rem; }
.btn--block { width: 100%; }
.site-nav .btn--nav { display: none; }
@media (min-width: 900px) {
  .site-nav .btn--nav {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.6em 1.3em;
    font-size: 0.95rem;
    min-height: 44px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  }
}

.icon-wa { width: 1.1em; height: 1.1em; fill: currentColor; flex-shrink: 0; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--color-ink);
  min-height: var(--header-h);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-white);
  min-width: 0;
}
.brand__mark { width: 40px; height: 40px; border-radius: 6px; background: var(--color-white); padding: 3px; flex-shrink: 0; }
.brand__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.15;
  color: var(--color-white);
}
.brand__name strong { display: block; font-size: 1.05rem; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-white);
  transition: transform 0.25s var(--ease-weighted), opacity 0.25s var(--ease-weighted);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
@media (min-width: 900px) { .nav-toggle { display: none; } }

.site-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--color-ink);
  padding: 1.5rem 1.25rem 2rem;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s var(--ease-weighted), opacity 0.25s var(--ease-weighted);
  overflow-y: auto;
}
.site-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.site-nav ul { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1.5rem; }
.site-nav a {
  display: block;
  padding: 0.9em 0.2em;
  color: var(--color-white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  min-height: 44px;
}
.site-nav .btn--cta { color: var(--color-ink); }

@media (min-width: 900px) {
  .site-nav {
    position: static;
    inset: auto;
    background: none;
    padding: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  .site-nav ul { flex-direction: row; gap: 1.25rem; margin-bottom: 0; flex-shrink: 0; }
  .site-nav a { border-bottom: none; padding: 0.4em 0; font-size: 0.95rem; min-height: auto; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background: var(--color-stone);
  padding-top: 3rem;
  padding-bottom: 0;
  overflow: hidden;
}
.hero__inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
@media (min-width: 900px) {
  .hero__inner {
    flex-direction: row;
    align-items: center;
    padding-bottom: 4rem;
  }
  .hero__copy { flex: 1.15; }
  .hero__figure { flex: 1; }
}

/* Sin <br> forzados: text-wrap balance reparte las líneas solo en cada ancho.
   (Navegadores sin soporte simplemente hacen el salto de línea normal.) */
.hero__headline {
  position: relative;
  overflow: hidden;
  margin-bottom: 0.5em;
  max-width: 15ch;
  text-wrap: balance;
}
.hero__headline .reveal-angle { display: inline-block; }
.hero__headline::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-stone);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
  animation: heroReveal 0.85s var(--ease-weighted) 0.2s both;
}
@keyframes heroReveal {
  from { transform: translateX(0); }
  to   { transform: translateX(130%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__headline::after { animation: none; transform: translateX(130%); }
}

.hero__sub { font-size: 1.15rem; max-width: 42ch; }

.hero__figure {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-lg)), calc(100% - var(--cut-lg)) 100%, 0 100%);
  background: var(--color-ink);
}
.hero__figure img { width: 100%; }

.agave-lines {
  height: 34px;
  background-image: repeating-linear-gradient(
    115deg,
    var(--color-shadow) 0 2px,
    transparent 2px 34px
  );
  opacity: 0.55;
}

/* ==========================================================================
   Especialidades
   ========================================================================== */
.specialty-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}
@media (min-width: 900px) {
  .specialty-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.specialty-card {
  background: var(--color-white);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-md)), calc(100% - var(--cut-md)) 100%, 0 100%);
}

.specialty-card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.specialty-card__media img { width: 100%; height: 100%; object-fit: cover; }

.specialty-card__body { padding: 1.75rem; }
.specialty-card__tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin-bottom: 0.5em;
}
.specialty-card__detail h4 { margin-top: 1.2em; margin-bottom: 0.35em; }
.specialty-card__detail p { font-size: 1rem; }
/* Nota personal de Dante en primera persona: se distingue del texto clínico
   con el mismo tratamiento de borde que usan .about__facts y .practical-info. */
.specialty-card__note {
  margin-top: 1.5rem;
  margin-bottom: 0;
  padding: 1rem 1.25rem;
  background: var(--color-stone);
  border-left: 4px solid var(--color-agave);
  font-size: 1rem;
}
.specialty-card .btn { margin-top: 1.25rem; }

/* ==========================================================================
   Sobre Dante
   ========================================================================== */
.about__inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
@media (min-width: 900px) {
  .about__inner { flex-direction: row; align-items: flex-start; }
  .about__figure { flex: 0 0 38%; }
  .about__body { flex: 1; }
}
.about__figure img {
  clip-path: polygon(var(--cut-lg) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut-lg));
}
.about__facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2rem;
  margin: 1.75rem 0;
  padding: 1.5rem;
  background: var(--color-white);
  border-left: 4px solid var(--color-agave);
}

/* ==========================================================================
   Testimonios
   ========================================================================== */
.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 900px) { .testimonial-grid { grid-template-columns: repeat(3, 1fr); } }
.testimonial-card {
  margin: 0;
  padding: 1.75rem;
  background: var(--color-white);
  border-top: 3px solid var(--color-agave);
}
.testimonial-card p { font-size: 1.05rem; font-style: italic; }
.testimonial-card footer { color: var(--color-agave-text); font-size: 0.9rem; margin-top: 0.75em; }

/* ==========================================================================
   Primera visita
   ========================================================================== */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin: 2.5rem 0;
}
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step {
  background: var(--color-white);
  padding: 1.75rem 1.5rem;
  position: relative;
  border-bottom: 4px solid var(--color-agave);
}
.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  background: var(--color-ink);
  color: var(--color-white);
  margin-bottom: 0.75rem;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 75% 100%, 0 100%);
}
.step h3 { font-size: 1.1rem; }
.step p { font-size: 1rem; margin-bottom: 0; }

.practical-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 700px) { .practical-info { grid-template-columns: 1fr 1fr; } }
.practical-info > div { background: var(--color-white); padding: 1.5rem; border-left: 4px solid var(--color-sky); }

/* ==========================================================================
   Ubicación
   ========================================================================== */
.location__inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 900px) {
  .location__inner { flex-direction: row; }
  .location__info { flex: 1; }
  .location__map { flex: 1; }
}
.location__map {
  min-height: 320px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut-lg) 100%, 0 calc(100% - var(--cut-lg)));
  background: var(--color-agave);
}
.location__map iframe { width: 100%; height: 100%; min-height: 320px; }
.location address { font-size: 1.05rem; margin-bottom: 1.25rem; }
.hours { margin-bottom: 1.5rem; max-width: 22rem; }
.hours li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5em 0;
  border-bottom: 1px solid rgba(27,43,58,0.12);
}
.hours li span:last-child { color: var(--color-agave-text); white-space: nowrap; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--color-ink);
  color: var(--color-white);
  padding: 3rem 0 6rem;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 900px) {
  .site-footer__inner {
    grid-template-columns: 1.2fr 1.2fr 1.4fr auto;
    align-items: start;
  }
  .site-footer { padding-bottom: 3rem; }
}
.site-footer__brand { display: flex; align-items: center; gap: 0.75rem; }
.site-footer__social { display: flex; gap: 0.25rem; margin-top: 0.75rem; }
.site-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #C9D4D8;
}
.site-footer__social a:hover,
.site-footer__social a:focus-visible { color: var(--color-white); }
.icon-social { width: 24px; height: 24px; fill: currentColor; }
.site-footer__brand img { background: var(--color-white); padding: 4px; border-radius: 6px; }
.site-footer__name { font-family: var(--font-display); font-size: 1.1rem; margin: 0; }
.site-footer__address { color: #C9D4D8; line-height: 1.7; }
.site-footer__nav { display: flex; flex-direction: column; gap: 0.6rem; }
.site-footer__nav a { color: #C9D4D8; text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.site-footer__nav a:hover, .site-footer__nav a:focus-visible { color: var(--color-white); }
.site-footer__legal { grid-column: 1 / -1; color: #8CA0A8; font-size: 0.85rem; margin: 1rem 0 0; }

/* ==========================================================================
   Barra fija de WhatsApp (móvil)
   ========================================================================== */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 600;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
  background: var(--color-stone);
  border-top: 1px solid rgba(27,43,58,0.12);
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.3s var(--ease-weighted), opacity 0.3s var(--ease-weighted);
  pointer-events: none;
}
.sticky-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 900px) {
  .sticky-cta { display: none; }
}
