/* ==========================================================================
   SISTEMA TIPOGRÁFICO UNIFICADO Y TOTAL · MANGAS SIN HUELLAS
   Aplica a TODAS las páginas del sitio (index, casos, blog). Sustitución completa de las tipografías anteriores (SequelSans y PPFraktionMono)
   por la triada oficial aprobada:
   - Mada (Display, Encabezados H1-H3 y Cifras)
   - PT Sans Caption (Lectura, H4, Botones, Navegación y Metadatos)
   - Roboto Slab (Testimonios y Citas)
   ========================================================================== */

/* --- 1. ALIAS DE COMPATIBILIDAD Y NEUTRALIZACIÓN TOTAL ---
   Redirige cualquier referencia residual de las fuentes anteriores */
:root {
  --font-heading: 'Mada', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'PT Sans Caption', Arial, Helvetica, sans-serif;
  --font-quote: 'Roboto Slab', Georgia, 'Times New Roman', serif;
}

/* --- 2. BASE DE CUERPO Y RESET GENERAL --- */
html,
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-heading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Neutralización de la clase de utilidad legacy .font-PPFraktionMono */
.font-PPFraktionMono,
[class*="font-PPFraktionMono"] {
  font-family: var(--font-body);
  font-display: swap;
}

/* --- 3. PÁRRAFOS Y BLOQUES DE LECTURA --- */
p,
.p,
body p,
body .p,
.lead,
.faq-head .lead {
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
}

p,
.p,
body p,
body .p,
.hero-desc,
.lead,
.home-cta-lead,
.homepage-intro__body p,
.team-copy p,
.product-desc,
.faq-list p,
details p,
.project-scroll__footer,
.case-card__body p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
}

/* --- 4. H1: TÍTULO PRINCIPAL DE IMPACTO (MADA 600 · 54px / 1.12) --- */
h1,
.h1,
h1.top-banner-home__heading,
h1.h2,
.section-topbannerhome h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 54px;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-top: 0;
  margin-bottom: 1.1rem;
  color: var(--color-heading);
}

/* --- 5. H2: TÍTULOS DE SECCIÓN MAYORES (MADA 600 · 36px / 1.18) --- */
h2,
.h2:not(h1),
.spread__heading,
.project-scroll__heading,
.block-heading:not(h1),
.credentials-modal__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: -0.010em;
  color: var(--color-heading);
}

/* Rótulos destacados de sección en mayúsculas (Casos recientes en hero) */
.section-topbannerhome .latest-work h2,
.section-topbannerhome .latest-work-links > .heading,
.section-topbannerhome .latest-work-slider > .heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 0;
  margin-top: 8px;
  margin-bottom: 10px;
  color: #FFFFFF;
}

/* --- 6. FRASE MONUMENTAL DE LA TÉCNICA (MADA 600 · 60px / 1.10) --- */
#tratamiento .animated-intro .homepage-intro__intro,
.section-intro .animated-intro .homepage-intro__intro,
p.homepage-intro__intro,
.homepage-intro__intro {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 60px;
  line-height: 1.10;
  letter-spacing: -0.02em;
  color: var(--color-heading);
  max-width: 100%;
}

/* --- 7. H3: SUBENCABEZADOS Y TARJETAS (MADA 600 · 24px / 1.25) --- */
h3,
.h3:not(.homepage-intro__intro),
article.blog-card h3,
article.blog-card h3.heading,
.project-card h3,
.project-card h3.heading,
.cta-intro h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
}

/* Tarjetas compactas del hero */
.section-topbannerhome .latest-work-slide h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* --- 8. H4: NOMBRES DE ESPECIALISTAS Y PREGUNTAS FAQ (PT SANS CAPTION 600 · 19px / 1.30) --- */
h4,
.h4,
.homepage-intro__body h4,
.team-person strong,
.faq-list summary,
.cta-post__form strong,
.credential-card__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.30;
  letter-spacing: -0.005em;
  color: var(--color-heading);
}

/* --- 9. QUOTE: TESTIMONIOS Y VIVENCIAS DE PACIENTES (ROBOTO SLAB 400 · 22px / 1.45) --- */
blockquote,
.quote,
q,
.testi-item p {
  font-family: var(--font-quote);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.45;
  font-style: normal;
  letter-spacing: 0;
  color: #1E293B;
}

/* --- 10. HIGHLIGHT, KICKERS Y METADATOS TÉCNICOS (PT SANS CAPTION 600 · 12-12.5px · +0.14em) --- */
.section-tag,
.hero-credentials,
.blog-kicker,
.blog-card__category,
.latest-work-slide .content p.heading,
.team-person > span:not(.illustrative-label),
.testi-item strong,
.testi-item span,
.column_1 > span,
.project-scroll-intro span,
.faq-head > span,
.cta-intro > span,
.homepage-intro__heading span,
.case-card__name,
.case-card__now,
.credentials-modal__kicker,
.credential-card__meta,
.credentials-modal__note,
figcaption,
.illustrative-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.20;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Highlights en fondos oscuros */
.section-topbannerhome .section-tag,
.section-topbannerhome .hero-credentials {
  color: var(--color-surface-alt);
}

.latest-work-slide .content p.heading {
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

/* --- 11. NAVEGACIÓN Y MENÚS (PT SANS CAPTION 600) --- */
.top-nav,
.top-nav ul,
.top-nav li a,
.nav-store,
.nav-store span,
.mobile-top,
.mobile-top .marque,
.mobile-top .marque ul,
.mobile-top .marque li,
.mobile-top .contact-us,
.mobile-nav,
.mobile-nav-full,
.mobile-nav-full a,
.mobile-nav-full .heading,
.brand-mark {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.top-nav li a {
  font-size: 13px;
  font-weight: 500;
}

.top-nav ul li a,
.mobile-nav a,
.mobile-nav-full .middle a {
  font-weight: 500;
}

.brand-mark {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --- 12. BOTONES Y LLAMADOS A LA ACCIÓN (PT SANS CAPTION 600) --- */
.btn,
a.btn,
button.btn,
.btn-with-arrow,
a.btn-with-arrow,
.btn-with-arrow span,
a.btn-with-arrow span,
.label-style,
a.label-style,
button.label-style,
.blog-filters button,
.product-action,
.product-action span,
.credentials-modal__close {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-with-arrow span,
a.btn-with-arrow span {
  font-size: 13.5px;
}

.label-style,
a.label-style,
button.label-style {
  font-size: 12px;
  letter-spacing: 0.10em;
}

/* --- 13. FOOTER Y NOTAS LEGALES --- */
footer,
.copyright,
.acknowledge,
footer p,
footer span {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   14. ADAPTACIÓN RESPONSIVE (MÓVIL Y TABLET)
   ========================================================================== */
@media (max-width: 991px) {
  html, body, body {
    font-size: 15.5px;
    line-height: 1.60;
  }

  h1, .h1, h1.top-banner-home__heading, h1.h2 {
    font-size: clamp(34px, 7vw, 44px);
    line-height: 1.15;
  }

  #tratamiento .animated-intro .homepage-intro__intro,
  .section-intro .animated-intro .homepage-intro__intro,
  p.homepage-intro__intro,
  .homepage-intro__intro {
    font-size: clamp(32px, 6vw, 44px);
    line-height: 1.15;
  }

  h2, .h2:not(h1), .spread__heading, .project-scroll__heading, .block-heading:not(h1) {
    font-size: clamp(26px, 5vw, 30px);
    line-height: 1.2;
  }

  h3, .h3:not(.homepage-intro__intro), article.blog-card h3, .project-card h3, .cta-intro h3 {
    font-size: clamp(20px, 3.8vw, 22px);
    line-height: 1.25;
  }

  h4, .h4, .homepage-intro__body h4, .team-person strong, .faq-list summary {
    font-size: 17px;
  }

  p, .p, .lead, .hero-desc, .home-cta-lead {
    font-size: 15.5px;
    line-height: 1.60;
  }

  blockquote, .quote, q, .testi-item p {
    font-size: clamp(18px, 3.5vw, 20px);
    line-height: 1.40;
  }

  .section-tag, .hero-credentials {
    font-size: 11px;
  }
}

/* ==========================================================================
   ALINEACIÓN Y CENTRADO ÓPTIMO DE BOTONES
   ========================================================================== */
.btn-with-arrow,
a.btn-with-arrow {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  text-decoration: none;
}

.btn-with-arrow span,
a.btn-with-arrow span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 1.25;
  padding: 0.75rem 1.1rem;
  margin: 0;
  box-sizing: border-box;
}

.btn-with-arrow i,
a.btn-with-arrow i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Alineación centrada para botones pill (.label-style) */
.label-style,
a.label-style,
button.label-style {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.35rem 0.75rem;
  line-height: 1.2;
  box-sizing: border-box;
}

/* Alineación en botones de producto (.product-action) */
.product-action,
a.product-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.2;
  padding: 0.75rem 1.1rem;
  box-sizing: border-box;
}

/* ==========================================================================
   15. FOOTER COMÚN (todas las páginas)
   ========================================================================== */
.footer-links .heading,
.main-footer .footer-links .heading,
.main-footer h2.heading,
.main-footer h3.heading,
.main-footer h4.heading,
.main-footer h5.heading {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 0;
  color: inherit;
  opacity: 0.65;
}

.footer-links a,
.main-footer .footer-links a {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.main-footer .footer-name {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: none;
}

/* ==========================================================================
   16. BLOG (blog.html)
   ========================================================================== */
body.blog .news-card .text > span,
body.blog .font-PPFraktionMono.allcaps {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.blog .news-card .heading,
body.blog .news-card h2,
body.blog .news-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

body.blog .news-card .content p,
body.blog .news-card .text p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
}

body.blog .vertical-nav button,
body.blog .change-post-category button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* ==========================================================================
   17. CASOS (casos.html)
   ========================================================================== */
body.page .case-card__meta,
body.page .case-detail__kicker,
body.page .case-detail__meta,
body.page .case-detail__facts dt,
body.page .case-mobile__kicker,
body.page .case-mobile__meta,
body.page .case-card__action {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.page .case-card__meta strong {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

body.page .case-detail__body p,
body.page .case-mobile__body p,
body.page .case-card p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
}

body.page .case-detail h2,
body.page .case-detail h3,
body.page .case-mobile h2,
body.page .case-mobile h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* H1 sobre el hero oscuro de la home */
body .section-topbannerhome h1,
body .background-color-black h1 {
  color: #FFFFFF;
}

/* H1 tipo block-heading: el texto va dentro de cajas blancas, debe ser oscuro */
.block-heading > span,
h1.block-heading > span {
  color: var(--color-heading);
  background: #fff;
}

/* Copyright y aviso legal del footer: escala de metadato */
.main-footer .copyright,
.main-footer .acknowledge,
.copyright,
.acknowledge {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Los .heading dentro de tarjetas del blog no deben heredar H2 grande */
body.blog .news-card .heading {
  font-size: 24px;
}
/* Ajuste de tipografía para el footer en pantallas amplias */
@media (min-width: 1600px) {
  .main-footer .footer-name {
    font-size: 6rem;
    line-height: 1;
  }
}
