/*
 * Ajuste tipográfico transversal.
 * Mantiene el texto de lectura (artículos, noticias, fichas y formularios)
 * alineado a la izquierda, y centra la jerarquía comercial y sus entradillas.
 */

:root {
  --gh-title-measure: 16ch;
  --gh-section-title-measure: 23ch;
  --gh-lead-measure: 60ch;
  --gh-copy-measure: 68ch;
}

.editorial-page main {
  overflow-wrap: break-word;
}

.editorial-page main :is(h1, h2, h3) {
  text-wrap: balance;
}

.editorial-page main p {
  text-wrap: pretty;
}

/* Héroes: una jerarquía centrada y con líneas de longitud controlada. */
.editorial-page main :is(
  .e-hero__copy,
  .home3-hero__content,
  .company-hero__content,
  .budget-hero__content,
  .news-hero .e-wrap,
  .about-hero .e-wrap,
  .values-hero .e-wrap,
  .services-hero .e-wrap,
  .jobs-hero .e-wrap,
  .job-detail-hero .e-wrap,
  .access-main-hero__inner,
  .business-alarm-hero .e-wrap > div,
  .engineering-hero .e-wrap,
  .video-pro-hero__grid > div:first-child,
  .dist-hero__copy
) {
  text-align: center;
}

.editorial-page main :is(
  .e-hero__copy,
  .home3-hero__content,
  .company-hero__content,
  .budget-hero__content,
  .news-hero .e-wrap,
  .about-hero .e-wrap,
  .values-hero .e-wrap,
  .services-hero .e-wrap,
  .jobs-hero .e-wrap,
  .job-detail-hero .e-wrap,
  .access-main-hero__inner,
  .business-alarm-hero .e-wrap > div,
  .engineering-hero .e-wrap,
  .video-pro-hero__grid > div:first-child,
  .dist-hero__copy
) > :is(.e-kicker, .home3-label, h1, p) {
  margin-inline: auto;
  text-align: center;
}

.editorial-page main :is(
  .e-hero__copy,
  .home3-hero__content,
  .company-hero__content,
  .budget-hero__content,
  .news-hero .e-wrap,
  .about-hero .e-wrap,
  .values-hero .e-wrap,
  .services-hero .e-wrap,
  .jobs-hero .e-wrap,
  .job-detail-hero .e-wrap,
  .access-main-hero__inner,
  .business-alarm-hero .e-wrap > div,
  .engineering-hero .e-wrap,
  .video-pro-hero__grid > div:first-child,
  .dist-hero__copy
) > h1 {
  width: min(100%, var(--gh-title-measure));
}

.editorial-page main :is(
  .e-hero__lead,
  .home3-hero__content > p:not(.home3-label),
  .company-hero__content > p:not(.home3-label),
  .budget-hero__content > p:not(.home3-label),
  .news-hero .e-wrap > p:last-child,
  .about-hero .e-wrap > p:last-child,
  .values-hero .e-wrap > p:last-child,
  .services-hero .e-wrap > p:last-child,
  .jobs-hero .e-wrap > p:last-child,
  .job-detail-hero .e-wrap > p:last-child,
  .access-main-hero__inner > p:not(.home3-label),
  .business-alarm-hero .e-wrap > div > p:not(.home3-label),
  .engineering-hero .e-wrap > p:not(.home3-label),
  .video-pro-hero__grid > div:first-child > p:not(.home3-label),
  .dist-hero__copy > p:not(.home3-label)
) {
  width: min(100%, var(--gh-lead-measure));
  max-width: var(--gh-lead-measure);
  text-align: center;
}

.editorial-page main :is(
  .e-hero__actions,
  .company-hero__actions,
  .access-main-hero__inner > div,
  .dist-hero__actions
) {
  justify-content: center;
}

/* El formulario del hero conserva la alineación funcional de sus campos. */
.editorial-page main .home3-lead-form,
.editorial-page main :is(.home3-lead-form label, .home3-wizard, .home3-wizard label) {
  text-align: left;
}

/* Cabeceras de sección compartidas y cabeceras especiales. */
.editorial-page main section > :is(.e-wrap, .home3-wrap) > header,
.editorial-page main :is(.e-section-head, .company-centered-head, .dist-section-head) {
  text-align: center;
}

.editorial-page main section > :is(.e-wrap, .home3-wrap) > header > :is(.e-kicker, .home3-label, h2, p),
.editorial-page main :is(.e-section-head, .company-centered-head, .dist-section-head) > :is(.e-kicker, .home3-label, h2, p) {
  margin-inline: auto;
  text-align: center;
}

.editorial-page main section > :is(.e-wrap, .home3-wrap) > header > h2,
.editorial-page main :is(.e-section-head, .company-centered-head, .dist-section-head) > h2 {
  width: min(100%, var(--gh-section-title-measure));
  max-width: var(--gh-section-title-measure);
}

.editorial-page main section > :is(.e-wrap, .home3-wrap) > header > p:not(.e-kicker, .home3-label),
.editorial-page main :is(.e-section-head, .company-centered-head, .dist-section-head) > p:not(.e-kicker, .home3-label) {
  width: min(100%, var(--gh-copy-measure));
  max-width: var(--gh-copy-measure);
}

/* Introducciones que forman parte de composiciones asimétricas. */
.editorial-page main :is(
  .home3-intro__head,
  .home3-technology__head,
  .home3-estimator__copy,
  .home3-family > div,
  .home3-featured .home3-wrap > div,
  .home3-app__content,
  .home3-newsletter__grid > div:first-child,
  .company-since__copy,
  .company-story__copy,
  .company-statement .e-wrap > div,
  .e-dark__copy,
  .e-editorial__copy,
  .e-quote__copy,
  .about-intro__copy,
  .values-manifesto,
  .business-plan__copy,
  .business-multisite .e-wrap,
  .video-quality .e-wrap > div,
  .video-privacy .e-wrap,
  .dist-intro__grid > div,
  .dist-join__copy,
  .jobs-apply__grid > div:first-child
) {
  text-align: center;
}

.editorial-page main :is(
  .home3-estimator__copy,
  .home3-family > div,
  .home3-featured .home3-wrap > div,
  .home3-app__content,
  .home3-newsletter__grid > div:first-child,
  .company-since__copy,
  .company-story__copy,
  .company-statement .e-wrap > div,
  .e-dark__copy,
  .e-editorial__copy,
  .e-quote__copy,
  .about-intro__copy,
  .values-manifesto,
  .business-plan__copy,
  .business-multisite .e-wrap,
  .video-quality .e-wrap > div,
  .video-privacy .e-wrap,
  .dist-intro__grid > div,
  .dist-join__copy,
  .jobs-apply__grid > div:first-child
) > :is(.e-kicker, .home3-label, h2, p, small, a) {
  margin-inline: auto;
  text-align: center;
}

.editorial-page main :is(
  .home3-intro__head,
  .home3-technology__head
) > :is(div, p) {
  text-align: center;
}

.editorial-page main :is(
  .home3-intro__head,
  .home3-technology__head
) :is(.home3-label, h2, p) {
  margin-inline: auto;
  text-align: center;
}

.editorial-page main :is(
  .home3-intro__head,
  .home3-technology__head,
  .home3-estimator__copy,
  .home3-family > div,
  .home3-featured .home3-wrap > div,
  .home3-app__content,
  .home3-newsletter__grid > div:first-child,
  .company-since__copy,
  .company-story__copy,
  .company-statement .e-wrap > div,
  .e-dark__copy,
  .e-quote__copy,
  .about-intro__copy,
  .values-manifesto,
  .business-plan__copy,
  .business-multisite .e-wrap,
  .video-quality .e-wrap > div,
  .video-privacy .e-wrap,
  .dist-intro__grid > div,
  .dist-join__copy,
  .jobs-apply__grid > div:first-child
) h2 {
  width: min(100%, var(--gh-section-title-measure));
  max-width: var(--gh-section-title-measure);
}

.editorial-page main :is(
  .home3-intro__head,
  .home3-technology__head,
  .home3-estimator__copy,
  .home3-family > div,
  .home3-featured .home3-wrap > div,
  .home3-app__content,
  .home3-newsletter__grid > div:first-child,
  .company-since__copy,
  .company-story__copy,
  .company-statement .e-wrap > div,
  .e-dark__copy,
  .e-editorial__copy,
  .e-quote__copy,
  .about-intro__copy,
  .values-manifesto,
  .business-plan__copy,
  .business-multisite .e-wrap,
  .video-quality .e-wrap > div,
  .video-privacy .e-wrap,
  .dist-intro__grid > div,
  .dist-join__copy,
  .jobs-apply__grid > div:first-child
) > p:not(.e-kicker, .home3-label) {
  width: min(100%, var(--gh-copy-measure));
  max-width: var(--gh-copy-measure);
}

/* Los elementos de consulta y lectura larga siguen alineados a la izquierda. */
.editorial-page main :is(
  .e-article__body,
  .e-article__aside,
  .news-card__copy,
  .job-detail__grid > article,
  .e-contact__details,
  .e-office__details,
  .dist-list-panel,
  .dist-join__form,
  .budget-form,
  .e-form,
  .e-quote__form,
  .jobs-form,
  form,
  address,
  table
) {
  text-align: left;
}

.editorial-page main :is(
  .e-article__body,
  .news-card__copy,
  .job-detail__grid > article
) p {
  max-width: var(--gh-copy-measure);
}

.editorial-page main :is(
  .home3-app__content,
  .company-story__copy,
  .e-editorial__copy,
  .business-plan__copy,
  .dist-join__copy
) :is(ul, ol, dl) {
  text-align: left;
}

/* Títulos que no usan una cabecera semántica propia en sus plantillas. */
.editorial-page main :is(
  .home3-clients > .home3-wrap,
  .access-workflow__grid > div:first-child,
  .e-simulator__copy,
  .e-area,
  .service-row > div,
  .values-principles li > div,
  .home3-components article > div,
  .home3-benefits article
) {
  text-align: center;
}

.editorial-page main :is(
  .home3-clients > .home3-wrap,
  .access-workflow__grid > div:first-child,
  .e-simulator__copy,
  .e-area,
  .service-row > div,
  .values-principles li > div,
  .home3-components article > div,
  .home3-benefits article
) > :is(.e-kicker, .home3-label, h2, h3, p, a) {
  margin-inline: auto;
  text-align: center;
}

.editorial-page main :is(
  .home3-clients > .home3-wrap,
  .access-workflow__grid > div:first-child,
  .e-simulator__copy,
  .e-area,
  .service-row > div
) > h2 {
  width: min(100%, var(--gh-section-title-measure));
  max-width: var(--gh-section-title-measure);
}

.editorial-page main :is(
  .access-workflow__grid > div:first-child,
  .e-simulator__copy,
  .e-area,
  .service-row > div,
  .values-principles li > div,
  .home3-components article > div,
  .home3-benefits article
) > p {
  max-width: var(--gh-copy-measure);
}

.editorial-page main :is(
  .home3-lead-form > h2,
  .jobs-form > h2,
  .e-form > h3,
  .budget-form legend
) {
  text-align: center;
}

/* La introducción de distribuidores deja de parecer un bloque continuo. */
.editorial-page main .dist-intro__grid > div > p {
  max-width: 76ch;
}

@media (max-width: 62rem) {
  :root {
    --gh-title-measure: 14ch;
    --gh-section-title-measure: 20ch;
    --gh-lead-measure: 42ch;
    --gh-copy-measure: 62ch;
  }

  .editorial-page main :is(
    .home3-intro__head,
    .home3-technology__head
  ) {
    display: block;
  }

  .editorial-page main :is(
    .home3-intro__head,
    .home3-technology__head
  ) > p {
    margin-top: 1.35rem;
  }
}

@media (max-width: 42rem) {
  :root {
    --gh-title-measure: 12ch;
    --gh-section-title-measure: 18ch;
    --gh-lead-measure: 34ch;
    --gh-copy-measure: 38ch;
  }

  .editorial-page main :is(
    .e-hero__copy,
    .home3-hero__content,
    .company-hero__content,
    .budget-hero__content,
    .news-hero .e-wrap,
    .about-hero .e-wrap,
    .values-hero .e-wrap,
    .services-hero .e-wrap,
    .jobs-hero .e-wrap,
    .job-detail-hero .e-wrap,
    .access-main-hero__inner,
    .business-alarm-hero .e-wrap > div,
    .engineering-hero .e-wrap,
    .video-pro-hero__grid > div:first-child,
    .dist-hero__copy
  ) > h1 {
    font-size: clamp(2.65rem, 11.5vw, 4.1rem);
    line-height: 0.96;
  }

  .editorial-page main section > :is(.e-wrap, .home3-wrap) > header > h2,
  .editorial-page main :is(.e-section-head, .company-centered-head, .dist-section-head) > h2 {
    font-size: clamp(2.1rem, 9.5vw, 3.35rem);
    line-height: 1;
  }

  .editorial-page main :is(
    .home3-estimator__copy,
    .home3-family > div,
    .home3-featured .home3-wrap > div,
    .home3-app__content,
    .home3-newsletter__grid > div:first-child,
    .company-since__copy,
    .company-story__copy,
    .company-statement .e-wrap > div,
    .e-dark__copy,
    .e-quote__copy,
    .about-intro__copy,
    .values-manifesto,
    .business-plan__copy,
    .business-multisite .e-wrap,
    .video-quality .e-wrap > div,
    .video-privacy .e-wrap,
    .dist-intro__grid > div,
    .dist-join__copy,
    .jobs-apply__grid > div:first-child
  ) h2 {
    width: min(100%, var(--gh-section-title-measure));
    font-size: clamp(2rem, 9vw, 3.2rem);
    line-height: 1.02;
  }

  .editorial-page main :is(
    .home3-hero__content > p:not(.home3-label),
    .company-hero__content > p:not(.home3-label),
    .budget-hero__content > p:not(.home3-label),
    .e-hero__lead
  ) {
    font-size: 1.05rem;
    line-height: 1.55;
  }
}

/* Revisión final: jerarquía contenida y coherente en todas las páginas interiores. */
.editorial-page:not([data-page="home"]) main h1 {
  width: min(100%, 18ch);
  max-width: 18ch;
  margin-inline: auto;
  font-size: clamp(2.8rem, 5.2vw, 4.65rem);
  line-height: .98;
  text-align: center;
}

.editorial-page:not([data-page="home"]) main h2 {
  width: min(100%, 25ch);
  max-width: 25ch;
  margin-inline: auto;
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.04;
  text-align: center;
}

.editorial-page:not([data-page="home"]) main h3 {
  max-width: 32ch;
  margin-inline: auto;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.12;
  text-align: center;
}

.editorial-page main p {
  max-width: var(--gh-copy-measure);
}

.editorial-page:not([data-page="home"]) main :is(
  .about-intro__year strong,
  .company-since__year strong,
  .e-service-centre__visual strong
) {
  font-size: clamp(4rem, 7vw, 6.25rem);
}

.editorial-page:not([data-page="home"]) main :is(
  .values-manifesto blockquote,
  .company-statement blockquote
) {
  max-width: 26ch;
  margin-inline: auto;
  font-size: clamp(2rem, 3.8vw, 3.15rem);
  line-height: 1.08;
  text-align: center;
}

@media (max-width: 42rem) {
  .editorial-page:not([data-page="home"]) main h1 {
    width: min(100%, 15ch);
    max-width: 15ch;
    font-size: clamp(2.35rem, 9.8vw, 3.15rem);
    line-height: 1;
  }

  .editorial-page:not([data-page="home"]) main h2 {
    width: min(100%, 19ch);
    max-width: 19ch;
    font-size: clamp(1.8rem, 7.8vw, 2.45rem);
    line-height: 1.05;
  }

  .editorial-page:not([data-page="home"]) main h3 {
    max-width: 24ch;
    font-size: clamp(1.3rem, 6vw, 1.65rem);
  }

  .editorial-page:not([data-page="home"]) main :is(
    .about-intro__year strong,
    .company-since__year strong,
    .e-service-centre__visual strong
  ) {
    font-size: clamp(3.5rem, 17vw, 5rem);
  }
}
