/* ============================================================
   Buen Jale — Sistema tipográfico único (Clash Display)  v1
   Se carga AL FINAL de todas las hojas. Sustituye los espaciados
   contradictorios (-0.07em … 0, interlineado .82 … 1.4) que cada
   hoja de estilos aplicaba por su cuenta.

   Reglas del sistema
   · 3 niveles: DISPLAY (h1), TÍTULO (h2), TARJETA (h3/h4)
   · Tracking casi neutro: Clash Display ya trae kerning propio (GPOS);
     un tracking muy negativo en mayúsculas anchas hace que se toquen
     las letras y desaparezca el espacio entre palabras.
   · Interlineado suficiente para acentos en MAYÚSCULAS (Á É Í Ó Ú).
   · Nunca se parte una palabra a la mitad.
   ============================================================ */

:root {
  --bj-gutter: 20px;

  --bj-track-display: -.012em;
  --bj-track-title:   -.006em;
  --bj-track-card:     0em;

  --bj-word-display: .12em;
  --bj-word-title:   .09em;
  --bj-word-card:    .05em;

  --bj-lh-display: 1.08;
  --bj-lh-title:   1.14;
  --bj-lh-card:    1.24;
}

/* ---------- Base común a todos los encabezados ---------- */
html body :is(h1, h2, h3, h4, h5,
  .banner-one_heading, .page-title_heading, .sec-title_heading,
  .service-block_one-heading, .gallery-block_one-heading, .journal-block_one-heading,
  .team-block_one-heading, .contact-one_heading, .awards-block_one-title,
  .case-section-title, .footer-text) {
  font-kerning: normal;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  text-wrap: balance;
}

/* ---------- DISPLAY: h1 de hero ---------- */
html body :is(
  .banner-one.banner-one-enhanced .banner-one_heading,
  .banner-one.banner-one-enhanced .banner-one_heading.hero-responsive-title,
  .portfolio-hero h1, .case-hero h1, .sx-hero h1,
  .page-title_heading, .article-hero h1
) {
  letter-spacing: var(--bj-track-display) !important;
  word-spacing: var(--bj-word-display) !important;
  line-height: var(--bj-lh-display) !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
/* El hero de inicio apila dos palabras: interlineado algo más compacto, sin cortar acentos */
html body .banner-one.banner-one-enhanced .banner-one_heading.hero-responsive-title {
  line-height: 1.02 !important;
  row-gap: .02em !important;
}
html body .banner-one.banner-one-enhanced .banner-one_heading.hero-responsive-title span {
  padding-top: .06em;   /* aire para el acento de las mayúsculas */
}

/* Tamaños de los h1 que antes se desbordaban o quedaban gigantes */
html body .portfolio-hero h1 { font-size: clamp(44px, 10.6vw, 160px) !important; }
html body .case-hero h1      { font-size: clamp(42px, 9vw, 128px)  !important; max-width: 100%; }
html body .sx-hero h1        { font-size: clamp(36px, 7.4vw, 104px) !important; max-width: 100%; }

/* Palabras muy largas (p. ej. AUTOMATIZACIONES = 11.2 × el tamaño de fuente):
   el tamaño se calcula a partir del ANCHO REAL de la columna/tarjeta que lo contiene,
   así la palabra siempre cabe completa, a cualquier ancho de pantalla. */
html body .bj-longword.bj-longword {            /* respaldo para navegadores sin container queries */
  font-size: min(clamp(28px, 7vw, 62px), calc((100vw - 2 * var(--bj-gutter)) / 11.6)) !important;
}
html body h2.bj-longword.bj-longword {
  font-size: min(clamp(24px, 4.4vw, 44px), calc((100vw - 2 * var(--bj-gutter) - 72px) / 11.6)) !important;
}
.sx-hero-content, .service-overview-card { container-type: inline-size; }
@supports (width: 1cqw) {
  html body h1.bj-longword.bj-longword { font-size: min(104px, calc(100cqw / 11.6)) !important; }
  html body h2.bj-longword.bj-longword { font-size: min(48px,  calc((100cqw - 72px) / 11.6)) !important; }
}

/* ---------- TÍTULO: h2 de sección ---------- */
html body :is(
  .sec-title_heading, .case-section-title, .case-section-head h2,
  .case-preview-copy h2, .case-cta-inner h2, .portfolio-card h2,
  .sx-section-head h2, .sx-content-card h2, .sx-process-intro h2, .sx-cta-inner h2,
  .service-overview-card h2, .team-one .about-intro-main h2,
  .article-section h2, .main-footer h2,
  .service-experience-page .sx-section-head h2,
  .service-experience-page .sx-content-card h2,
  .service-experience-page .sx-process-intro h2,
  .service-experience-page .sx-cta-inner h2
) {
  letter-spacing: var(--bj-track-title) !important;
  word-spacing: var(--bj-word-title) !important;
  line-height: var(--bj-lh-title) !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* ---------- TARJETA: h3 / h4 ---------- */
html body :is(
  .service-block_one-heading, .gallery-block_one-heading, .journal-block_one-heading,
  .team-block_one-heading, .contact-one_heading, .awards-block_one-title,
  .about-ecosystem-panel h3, .team-one .about-intro-main h3,
  .service-experience-page .sx-process-detail h3,
  .service-experience-page .sx-deliverable-card h3,
  .service-experience-page .sx-benefit-card h3,
  .case-section h3, .service-overview-card h3
) {
  letter-spacing: var(--bj-track-card) !important;
  word-spacing: var(--bj-word-card) !important;
  line-height: var(--bj-lh-card) !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* ---------- Textos grandes del footer (antes: overflow-wrap:anywhere) ---------- */
html body .main-footer :is(h2, .footer-text) {
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* ---------- Móvil: gutter real y tamaños que garantizan que cada palabra quepa ---------- */
@media (max-width: 767px) {
  html body .case-cta-inner h2,
  html body .case-section-title,
  html body .case-section-head h2,
  html body .case-preview-copy h2,
  html .project-page :is(.case-section-title, .case-section-head h2, .case-preview-copy h2, .case-cta-inner h2, .case-next strong) {
    font-size: clamp(26px, 7.4vw, 34px) !important;
  }
  html body .portfolio-card h2 { font-size: clamp(26px, 8vw, 34px) !important; }
}
@media (max-width: 420px) {
  html body { --bj-gutter: 18px; }
}

/* Pantallas muy angostas (≤ 360px): tarjetas con palabras largas (RECONOCIMIENTO, SEGMENTACIÓN…) */
@media (max-width: 380px) {
  html body :is(.service-experience-page .sx-process-detail h3,
                .service-experience-page .sx-deliverable-card h3,
                .service-experience-page .sx-benefit-card h3) {
    font-size: clamp(19px, 6.4vw, 23px) !important;
  }
  html body :is(.case-section-title, .case-section-head h2, .case-preview-copy h2, .case-cta-inner h2),
  html .project-page :is(.case-section-title, .case-section-head h2, .case-preview-copy h2, .case-cta-inner h2, .case-next strong) {
    font-size: clamp(22px, 7vw, 28px) !important;
  }
}

/* Hero del portafolio: 3 líneas apiladas, interlineado más compacto (el acento cabe con 1.0) */
html body .portfolio-hero h1 { line-height: 1.0 !important; font-size: clamp(44px, 10.2vw, 150px) !important; }


/* ---------- Tarjetas de servicios (home): mismo estilo que el resto de títulos ----------
   Antes: peso 400 y minúsculas (único título del sitio así). Ahora: peso y mayúsculas del sistema,
   con tamaño calculado según el ancho de la columna para que "AUTOMATIZACIONES" siempre quepa. */
.service-card-copy { container-type: inline-size; }
html body .services-one-home .service-card .service-block_one-heading,
html body .services-one-home .service-card .service-block_one-heading a {
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: var(--bj-track-title) !important;
  word-spacing: var(--bj-word-title) !important;
  line-height: 1.12 !important;
  max-width: 100% !important;
  overflow-wrap: normal !important;
}
html body .services-one-home .service-card .service-block_one-heading {
  font-size: clamp(22px, 2.5vw, 38px) !important;           /* respaldo */
}
@supports (width: 1cqw) {
  html body .services-one-home .service-card .service-block_one-heading {
    font-size: min(40px, calc(100cqw / 11.3)) !important;
  }
}
