/**
 * IB Editorial Theme 1.0.37
 * Unified Typography System & Individual Design Repair.
 * Loaded last so global roles and individual overrides beat legacy template CSS.
 */

/* --------------------------------------------------------------------------
   Global title roles — ordinary case by default, unless global setting says
   otherwise. This includes card titles and adaptive / migrated blocks.
   -------------------------------------------------------------------------- */
body.ib-et :is(
  .ib-article-hero h1,
  .ib-page-header h1,
  .ib-category-hero h1,
  .ib-section-heading h2,
  .ib-card-title,
  .entry-card-title,
  .ib-article-content h2,
  .ib-article-content h3
){
  text-transform:var(--ib-heading-transform,none)!important;
}

body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
  h1,h2,h3,
  .ib-card-title,
  .entry-card-title,
  .ib-ub-card-title,
  .ib-ub-card__body h3,
  .ib-ub-mini-card h3,
  .ib-acb-article-card__copy h2,
  .ib-acb-numbered__copy h2,
  .ib-acb-feature-list__head h2,
  .ib-acb-list-row__copy strong,
  .ib-acb-feature-list__lead-copy strong,
  .ib-acb-overlay__copy strong,
  .ib-acb-poster__copy strong,
  .ib-ub-hero-copy > strong,
  .ib-ub-hero-copy > a > strong,
  .ib-ub-dark-lead strong,
  .ib-ub-showcase-lead strong,
  a[class*="card"] > strong,
  a[class*="card"] > span > strong,
  a[class*="item"] > strong,
  a[class*="item"] > span > strong,
  [class*="__list"] > a > strong,
  [class*="__list"] > a > span > strong,
  [class*="__sidebar"] > a > strong,
  [class*="__sidebar"] > a > span > strong,
  [class*="__title"],
  [class*="-title"]
){
  text-transform:var(--ib-heading-transform,none)!important;
}

/* Global categories are one separate typography role, not generic metadata. */
body.ib-et :is(
  .ib-eyebrow,
  .ib-category-label,
  .ib-card-category,
  .ib-uem-category,
  .ib-uem-categories a,
  .ib-editorial-meta__categories a,
  .ib-article-category a,
  .ib-card-meta__categories a
),
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
  .ib-ub-eyebrow,
  .ib-acb-kicker,
  .ib-category-label,
  .ib-card-category,
  .ib-uem-category,
  .ib-uem-categories a,
  .ib-editorial-meta__categories a,
  [class*="__eyebrow"],
  [class*="__kicker"]
){
  font-family:var(--ib-category-font,var(--ib-meta-font,var(--ib-sans,Arial,sans-serif)))!important;
  font-size:var(--ib-category-size,11px)!important;
  font-weight:var(--ib-category-weight,600)!important;
  line-height:1.25!important;
  letter-spacing:var(--ib-category-letter-spacing,.12em)!important;
  text-transform:var(--ib-category-transform,none)!important;
  color:var(--ib-category-color,var(--ib-text,#050505))!important;
}

/* --------------------------------------------------------------------------
   Individual design: title controls can only affect title elements; body
   controls can only affect description/copy. This repairs the title/body
   cross-binding seen in new and migrated templates.
   -------------------------------------------------------------------------- */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-custom-style :is(
  h1,h2,h3,
  .ib-card-title,
  .entry-card-title,
  .ib-ub-card-title,
  .ib-ub-card__body h3,
  .ib-ub-mini-card h3,
  .ib-ub-hero-copy > strong,
  .ib-ub-hero-copy > a > strong,
  .ib-ub-dark-lead strong,
  .ib-ub-showcase-lead strong,
  .ib-acb-article-card__copy h2,
  .ib-acb-numbered__copy h2,
  .ib-acb-feature-list__head h2,
  .ib-acb-list-row__copy strong,
  .ib-acb-feature-list__lead-copy strong,
  .ib-acb-overlay__copy strong,
  .ib-acb-poster__copy strong,
  a[class*="card"] > strong,
  a[class*="card"] > span > strong,
  a[class*="item"] > strong,
  a[class*="item"] > span > strong,
  [class*="__list"] > a > strong,
  [class*="__list"] > a > span > strong,
  [class*="__sidebar"] > a > strong,
  [class*="__sidebar"] > a > span > strong,
  .ib-rrp__title,
  [class*="__title"],
  [class*="-title"]
){
  font-family:var(--ib-ub-heading-font,var(--ib-display,Georgia,serif))!important;
  font-weight:var(--ib-ub-title-weight,400)!important;
  line-height:var(--ib-ub-title-line,1.05)!important;
  letter-spacing:var(--ib-ub-title-tracking,-.02em)!important;
  text-transform:var(--ib-ub-title-transform,var(--ib-heading-transform,none))!important;
  color:var(--ib-ub-title-color,var(--ib-text,#050505))!important;
}

/* The principal block title receives the individual size control. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-custom-style :is(
  h1,
  section > h2,
  section > header h2,
  section > [class$="__intro"] > h2,
  section > [class$="__copy"] > h2,
  .ib-ub-hero-copy h1,
  .ib-ub-hero-copy h2,
  .ib-ub-heading > h2,
  .ib-ub-ref-simple-head > h2,
  .ib-ref072-head > h2,
  .ib-acb-heading h2,
  .ib-acb-article-card__copy h2,
  .ib-acb-numbered__copy h2,
  .ib-acb-feature-list__head h2,
  .ib-acb-poster__copy strong,
  .ib-acb-overlay__copy strong,
  .ib-acb-feature-list__lead-copy strong,
  .ib-rrp__title
){
  font-size:var(--ib-ub-title-size)!important;
}

/* Descriptions and excerpts explicitly use body controls, never heading font. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-custom-style :is(
  p,
  .ib-card-excerpt,
  .ib-excerpt,
  .entry-summary,
  .ib-ub-card__body p,
  .ib-acb-list-row__copy p,
  .ib-acb-article-card__copy p,
  .ib-acb-numbered__copy p,
  .ib-acb-overlay__copy p,
  .ib-acb-feature-list__lead-copy p,
  [class*="__excerpt"],
  [class*="__description"],
  [class*="__summary"]
){
  font-family:var(--ib-ub-body-font,var(--ib-sans,Arial,sans-serif))!important;
  font-size:var(--ib-ub-text-size,var(--ib-excerpt-size,var(--ib-body-size,15px)))!important;
  font-weight:var(--ib-body-weight,400)!important;
  line-height:var(--ib-ub-text-line,var(--ib-line-height,1.55))!important;
  letter-spacing:var(--ib-body-letter-spacing,.01em)!important;
  text-transform:none!important;
  color:var(--ib-ub-text-color,var(--ib-body-color,var(--ib-text,#050505)))!important;
}

/* Individual category role. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-custom-style :is(
  .ib-ub-eyebrow,
  .ib-acb-kicker,
  .ib-category-label,
  .ib-card-category,
  .ib-uem-category,
  .ib-uem-categories a,
  .ib-editorial-meta__categories a,
  [class*="__eyebrow"],
  [class*="__kicker"]
){
  font-family:var(--ib-ub-category-font,var(--ib-category-font,var(--ib-meta-font,Arial,sans-serif)))!important;
  font-size:var(--ib-ub-category-size,var(--ib-category-size,11px))!important;
  font-weight:var(--ib-ub-category-weight,var(--ib-category-weight,600))!important;
  line-height:1.25!important;
  letter-spacing:var(--ib-ub-category-tracking,var(--ib-category-letter-spacing,.12em))!important;
  text-transform:var(--ib-ub-category-transform,var(--ib-category-transform,none))!important;
  color:var(--ib-ub-category-color,var(--ib-category-color,var(--ib-text,#050505)))!important;
}

/* CTA remains its own role. */
body.ib-et .ib-ub-page .ib-ub-instance :is(
  .ib-ub-link,
  .ib-card-link,
  .ib-text-link,
  .ib-acb-cta,
  [class*="__cta"]
){
  font-family:var(--ib-button-font,var(--ib-sans,Arial,sans-serif))!important;
  font-size:var(--ib-button-size,11px)!important;
  font-weight:var(--ib-button-weight,700)!important;
  letter-spacing:var(--ib-button-letter-spacing,.12em)!important;
  text-transform:var(--ib-button-transform,uppercase)!important;
}

@media(max-width:900px){
  body.ib-et :is(
    .ib-eyebrow,.ib-category-label,.ib-card-category,.ib-uem-category,
    .ib-uem-categories a,.ib-editorial-meta__categories a,.ib-article-category a
  ),
  body.ib-et .ib-ub-page .ib-ub-instance :is(
    .ib-ub-eyebrow,.ib-acb-kicker,.ib-category-label,.ib-card-category,
    .ib-uem-category,.ib-uem-categories a,.ib-editorial-meta__categories a,
    [class*="__eyebrow"],[class*="__kicker"]
  ){
    font-size:var(--ib-category-mobile-size,var(--ib-category-size,10px))!important;
  }
}
