/* ================================================================
   SISTEMA VISUAL DE SUBPÁGINAS DE SERVICIO
   Se carga SOLO en /rehabilitacion-fisica-cuautla/ y
   /gimnasio-entrenamiento-cuautla/. No afecta a la home.

   Reutiliza los tokens de styles.css (--red, --black-card, fuentes).
   Prefijo pg- para no colisionar con ninguna clase existente.
   Todo el texto funcional se mantiene en 12px o más y con
   contraste mínimo 4.5:1, porque el público objetivo es 60+.
================================================================ */

.pg-wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.pg-section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.pg-section--tinted { background: var(--black-soft); }

.pg-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.9rem;
}

.pg-h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--white);
  margin-bottom: 1.1rem;
}

.pg-intro {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.7;
  color: rgba(255,255,255,0.76);
  max-width: 62ch;
}

/* ── HERO DE PÁGINA ─────────────────────────────────────────── */
.pg-hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  padding: 8rem 0 clamp(2.5rem, 6vw, 4.5rem);
  isolation: isolate;
  overflow: hidden;
}

.pg-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.pg-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(0,0,0,0.97) 6%, rgba(0,0,0,0.82) 42%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to right, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 70%);
}

.pg-breadcrumb {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1.5rem;
}
.pg-breadcrumb a { color: rgba(255,255,255,0.82); border-bottom: 1px solid rgba(255,30,30,0.6); }
.pg-breadcrumb a:hover { color: var(--red); }
.pg-breadcrumb span { margin: 0 0.5rem; color: rgba(255,255,255,0.35); }

.pg-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.94;
  letter-spacing: 0.005em;
  color: var(--white);
  max-width: 18ch;
  margin-bottom: 1.25rem;
}
.pg-h1 em { font-style: normal; color: var(--red); }

.pg-lead {
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  max-width: 54ch;
  margin-bottom: 2rem;
}

.pg-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

/* ── SUBNAVEGACIÓN PEGAJOSA ─────────────────────────────────── */
.pg-subnav {
  position: sticky;
  top: 72px;
  z-index: 900;
  background: rgba(0,0,0,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--black-border);
  border-bottom: 1px solid var(--black-border);
}
.pg-subnav-inner {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  max-width: 1160px;
  margin: 0 auto;
}
.pg-subnav-inner::-webkit-scrollbar { display: none; }
.pg-subnav a {
  flex: none;
  padding: 1.05rem 0;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.62);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.pg-subnav a:hover { color: var(--white); border-bottom-color: var(--red); }

/* ── ¿ESTO ES PARA TI? ──────────────────────────────────────── */
.pg-casos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 0.85rem 2.5rem;
  margin-top: 2.5rem;
}
.pg-caso {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-top: 1px solid var(--black-border);
}
.pg-caso-marca {
  flex: none;
  width: 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red);
  padding-top: 0.15rem;
}
.pg-caso p { font-size: 1rem; line-height: 1.6; color: rgba(255,255,255,0.82); }

/* ── PROCESO EN PASOS ───────────────────────────────────────── */
.pg-proceso {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  counter-reset: paso;
}
.pg-paso { position: relative; padding-top: 2.25rem; border-top: 2px solid var(--black-border); }
.pg-paso::before {
  counter-increment: paso;
  content: "0" counter(paso);
  position: absolute;
  top: -0.95rem;
  left: 0;
  background: var(--black);
  padding-right: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--red);
  letter-spacing: 0.05em;
}
.pg-section--tinted .pg-paso::before { background: var(--black-soft); }
.pg-paso h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.6rem;
}
.pg-paso p { font-size: 0.98rem; line-height: 1.65; color: rgba(255,255,255,0.72); }

/* ── FICHAS ALTERNADAS (técnicas / programas) ───────────────── */
.pg-fichas { margin-top: 3.5rem; display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 5.5rem); }

.pg-ficha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}
.pg-ficha:nth-child(even) .pg-ficha-media { order: 2; }

.pg-ficha-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--black-border);
}
.pg-ficha-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.pg-ficha:hover .pg-ficha-media img { transform: scale(1.05); }

.pg-ficha-num {
  font-family: var(--font-display);
  font-size: 1.15rem;
  /* 0.35 daba 3:1 y esto es una etiqueta, no un adorno: sube a 5.3:1 */
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  margin-bottom: 0.55rem;
}
.pg-ficha h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 1.15rem;
}
.pg-ficha dl { display: flex; flex-direction: column; gap: 1rem; }
.pg-ficha dt {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 0.3rem;
}
.pg-ficha dd { font-size: 1rem; line-height: 1.68; color: rgba(255,255,255,0.78); max-width: 54ch; }

/* ── PRUEBA (testimonio + credencial) ───────────────────────── */
.pg-prueba {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
  margin-top: 2.5rem;
}
.pg-testimonio {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.pg-testimonio blockquote {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
  margin-bottom: 1.35rem;
}
.pg-testimonio figcaption { font-size: 0.95rem; color: rgba(255,255,255,0.6); }
.pg-testimonio figcaption strong { display: block; color: var(--white); font-weight: 600; margin-bottom: 0.15rem; }

.pg-credencial {
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.pg-credencial h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.3rem;
}
.pg-credencial-rol {
  font-size: 0.9rem;
  color: var(--red);
  margin-bottom: 1rem;
}
.pg-credencial p { font-size: 0.97rem; line-height: 1.65; color: rgba(255,255,255,0.72); }
.pg-credencial dl { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--black-border); font-size: 0.93rem; }
.pg-credencial dt { color: rgba(255,255,255,0.5); }
.pg-credencial dd { color: var(--white); margin-bottom: 0.6rem; }

/* ── CIERRE ─────────────────────────────────────────────────── */
.pg-cierre {
  background: var(--red-cta);
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
  text-align: center;
}
.pg-cierre h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  color: var(--white);
  margin-bottom: 1rem;
}
.pg-cierre p {
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
  max-width: 52ch;
  margin: 0 auto 2rem;
}
.pg-cierre .btn-cta-big { background: var(--black); }
.pg-cierre .btn-cta-big:hover { background: #141414; }

/* ── PUENTE A LA OTRA PÁGINA ────────────────────────────────── */
.pg-puente {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.75rem;
  align-items: center;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  background: var(--black-card);
}
.pg-puente-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.5rem;
}
.pg-puente p { font-size: clamp(1.02rem, 1.8vw, 1.18rem); line-height: 1.55; color: var(--white); max-width: 48ch; }

/* ── RESPONSIVO ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pg-ficha { grid-template-columns: 1fr; gap: 1.5rem; }
  .pg-ficha:nth-child(even) .pg-ficha-media { order: 0; }
  .pg-prueba { grid-template-columns: 1fr; }
  .pg-puente { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .pg-hero { min-height: auto; padding: 7rem 0 3rem; }
  .pg-subnav { top: 64px; }
  .pg-actions { flex-direction: column; align-items: stretch; }
  .pg-actions > * { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .pg-ficha-media img { transition: none; }
  .pg-ficha:hover .pg-ficha-media img { transform: none; }
}

/* ================================================================
   ANTI-SCROLL-INFINITO
   El problema no era la longitud sino la falta de jerarquía: seis
   fichas idénticas se leen como una sola unidad repetida y la página
   no da señal de avance. Tres respuestas: jerarquía en el contenido,
   orientación permanente, y una ruptura de ritmo a mitad de página.
================================================================ */

/* ── Barra de progreso de lectura ───────────────────────────── */
.pg-progreso {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--red);
  z-index: 1200;
  transition: width 0.1s linear;
}

/* ── Sección activa en la subnavegación (scrollspy) ─────────── */
.pg-subnav a.activo {
  color: var(--white);
  border-bottom-color: var(--red);
}

/* ── Fichas destacadas: las dos de mayor peso ───────────────── */
.pg-destacadas { margin-top: 3rem; display: flex; flex-direction: column; gap: clamp(2.5rem, 6vw, 4.5rem); }

/* ── Bloque compacto: el resto, en rejilla densa ────────────── */
.pg-compactas {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--black-border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.pg-compactas-titulo {
  grid-column: 1 / -1;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255,255,255,0.62);
  margin-bottom: 0.25rem;
}

.pg-compacta-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--black-border);
}
.pg-compacta-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.pg-compacta:hover .pg-compacta-media img { transform: scale(1.05); }

.pg-compacta h3 {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.pg-compacta p { font-size: 0.98rem; line-height: 1.6; color: rgba(255,255,255,0.72); }

/* ── Banda de declaración: la ruptura de ritmo ──────────────── */
.pg-declaracion {
  padding: clamp(4rem, 10vw, 8rem) 0;
  border-top: 1px solid var(--black-border);
  border-bottom: 1px solid var(--black-border);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,30,30,0.10) 0%, rgba(255,30,30,0) 62%),
    var(--black);
}
.pg-declaracion p {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.2vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: 0.01em;
  color: var(--white);
  max-width: 20ch;
}
.pg-declaracion p em { font-style: normal; color: var(--red); }
.pg-declaracion cite {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.5);
}

@media (prefers-reduced-motion: reduce) {
  .pg-progreso { transition: none; }
  .pg-compacta-media img { transition: none; }
  .pg-compacta:hover .pg-compacta-media img { transform: none; }
}
