/* Content typography, excluding illustrations and display numbers.
   Section headings retain site-section-headings.css / site-heading-rules.css.
   Set sizes here by component role; preserve each component's weight and leading. */
:root {
  --content-body-size: 16px;
  --content-lead-size: 18px;
  --content-note-size: 14px;
  --content-label-size: 12px;
  --content-compact-title-size: 22px;
  --content-detail-title-size: clamp(24px,1.7vw,26px);
  --content-card-title-size: 26px;
  --content-case-title-size: 24px;
  --content-product-title-size: 26px;
  --content-panel-title-size: 28px;
  --content-entry-title-size: 28px;
  --content-form-compact-size: 24px;
}
@media (max-width: 1099px) {
  :root { --content-panel-title-size: 24px; }
}
@media (min-width: 681px) and (max-width: 980px) {
  :root { --content-card-title-size: 24px; --content-case-title-size: 22px; }
}
@media (max-width: 680px) {
  :root {
    --content-label-size: 11px;
    --content-detail-title-size: 22px;
    --content-card-title-size: 22px;
    --content-case-title-size: 20px;
    --content-product-title-size: 24px;
    --content-panel-title-size: 24px;
    --content-entry-title-size: 26px;
  }
}

/* Service pages and the AIDD top share the primary first-view lead. */
@layer service-hero-lead {
  [data-service-hero-lead] {
    color: #fff !important;
    font-size: var(--service-hero-lead-size, 1.125rem) !important;
    font-weight: 500 !important;
    line-height: var(--service-hero-lead-line-height, 1.65) !important;
    letter-spacing: normal !important;
  }
  @media (max-width: 767px) {
    [data-service-hero-lead] { --service-hero-lead-size: 1rem; }
  }
  @media (max-height: 620px), (max-width: 360px) {
    [data-service-hero-lead] { --service-hero-lead-line-height: 1.5; }
  }
  @media (max-width: 767px) and (max-height: 620px), (max-width: 360px) {
    [data-service-hero-lead] { --service-hero-lead-size: .9375rem; }
  }
  @media (max-height: 470px) and (min-aspect-ratio: 4/3) {
    [data-service-hero-lead] { --service-hero-lead-size: 1rem; }
  }
}

/* Justify running copy where the browser sets the line breaks. */
@layer section-heading-system {
  body[data-site-page] main :is([data-box-prose]:not(:has(br)), .method-mobile-detail p) {
    text-align: justify !important;
    text-align-last: start;
    text-justify: inter-character;
    hyphens: auto;
  }
  body[data-site-page] main :is(span, q)[data-box-prose] {
    display: block;
  }
  @media (max-width: 767px) {
    body:is(.editorial-site,.aitria-panel)[data-site-page] main
      p[data-mobile-prose-justify]:not([data-jp-centered]):not([data-centered-copy]) {
      text-align: justify !important;
      text-align-last: start;
      text-justify: inter-character;
      hyphens: auto;
    }
  }
}

/* A named layer takes precedence over legacy unlayered important declarations.
   It follows the section-heading layer so chapter typography keeps ownership. */
@layer site-content-type {
  body[data-site-page] main :is(.case-card h3, #cases .case h3):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-case-title-size) !important;
  }
  body[data-site-page] main :is(
    .wcard h3, .why-body h4:not(:where(#outcome *)),
    .study-card .training-panel-copy h4,
    .about-card-txt
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-card-title-size) !important;
  }
  body[data-site-page] main :is(
    .quality-card h3, .sphase h3
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-detail-title-size) !important;
  }
  body[data-site-page] main :is(
    .sol-body h3, .program-row-heading h3
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-product-title-size) !important;
  }
  body[data-site-page] main :is(
    .workshop-program-copy h3,
    #co-creation-team h4,
    .logo-section-title,
    .diag-form-row .dintro h3,
    .diag-form-row .cform > h3
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-panel-title-size) !important;
  }
  body[data-site-page] main .entry-card h3:not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-entry-title-size) !important;
  }
  body[data-site-page] main :is(
    .method-step-full h3, .method-mobile-detail h3,
    .eb-ph-feature h4, .cp-title
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-compact-title-size) !important;
  }
  @media (max-width: 980px) {
    body[data-site-page] main .about-card-txt {
      --content-card-title-size: var(--content-compact-title-size);
    }
  }
  @media (max-width: 680px) {
    body[data-site-page] main .sp-lead {
      --content-lead-size: var(--content-body-size);
    }
  }
  body[data-site-page="training"] main #contact-form > .contact-form-title:not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-form-compact-size) !important;
  }
  body[data-site-page="ux-workshop"] main #contact-form > .contact-form-title:not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-panel-title-size) !important;
  }
  body[data-site-page] main :is(
    .cb, .case-body, .service-description,
    .why-body > p:not(:where(.why-num, #outcome *)), .number-list-copy > p,
    .about-step-description, .fnote,
    .contact-info-note, .cp-desc, .workshop-form-intro,
    .workshop-case-copy > p:not(.workshop-case-company)
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-body-size) !important;
  }
  body[data-site-page] main :is(
    .prob-card-txt, .sp-lead, .cov,
    .case-outcome > p, .program-row-goal,
    .workshop-program-note, .entry-note,
    .voice-text
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-lead-size) !important;
  }
  body[data-site-page] main :is(
    .ch-cause-text, .event-note, .program-row-target,
    .program-row-label, .voice-name
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-note-size) !important;
  }
  body[data-site-page] main :is(
    .sprint-small-label, .cok, .case-tags > li
  ):not(:where(#top *, [data-service-hero] *, .thanks-hero *)) {
    font-size: var(--content-label-size) !important;
  }
}
