/**
 * IB Editorial Theme 1.0.25
 * Global Block Style Runtime.
 *
 * Final bridge between Global Styles and Universal Builder templates.
 * Individual design (.ib-ub-custom-style) remains the highest-priority
 * per-block override. UB-24 and the section divider retain their dedicated
 * locked typography systems.
 */

body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt){
    color: var(--ib-ub-text-color, var(--ib-body-color, var(--ib-text, #050505)));
}

/* Primary block / hero headings. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(h1,h2){
    font-family: var(--ib-ub-heading-font, var(--ib-display, Georgia, serif)) !important;
    font-size: var(--ib-ub-title-size, var(--ib-h2-size, 32px)) !important;
    font-weight: var(--ib-ub-title-weight, var(--ib-h2-weight, 400)) !important;
    line-height: var(--ib-ub-title-line, var(--ib-h2-line-height, 1.05)) !important;
    letter-spacing: var(--ib-heading-letter-spacing, -.02em) !important;
    color: var(--ib-ub-title-color, var(--ib-h2-color, var(--ib-text, #050505))) !important;
}

/* A number of legacy editorial templates use strong instead of h1/h2 for
   the principal story title. Give those elements the same global role. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
    .ib-ub-hero-copy > strong,
    .ib-ub-hero-copy > a > strong,
    .ib-ub-dark-lead strong,
    .ib-ub-showcase-lead strong,
    [class*="__lead"] > span > strong,
    [class*="__feature"] > strong,
    [class*="__feature"] > span > strong
){
    font-family: var(--ib-ub-heading-font, var(--ib-display, Georgia, serif)) !important;
    font-size: var(--ib-ub-title-size, var(--ib-h2-size, 32px)) !important;
    font-weight: var(--ib-ub-title-weight, var(--ib-h2-weight, 400)) !important;
    line-height: var(--ib-ub-title-line, var(--ib-h2-line-height, 1.05)) !important;
    letter-spacing: var(--ib-heading-letter-spacing, -.02em) !important;
    color: var(--ib-ub-title-color, var(--ib-h2-color, var(--ib-text, #050505))) !important;
}

/* Card titles. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
    h3,
    .ib-card-title,
    .ib-ub-card-title,
    .entry-card-title,
    .ib-ub-card__body h3,
    .ib-ub-mini-card h3,
    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
){
    font-family: var(--ib-card-font, var(--ib-serif, Georgia, serif)) !important;
    font-size: var(--ib-ub-card-title-size, var(--ib-card-title-size, 22px)) !important;
    font-weight: var(--ib-ub-card-title-weight, var(--ib-card-title-weight, 500)) !important;
    line-height: var(--ib-ub-card-title-line, var(--ib-card-title-line-height, 1.12)) !important;
    letter-spacing: var(--ib-heading-letter-spacing, -.02em) !important;
    color: var(--ib-ub-card-title-color, var(--ib-card-title-color, var(--ib-text, #050505))) !important;
}

/* Standard copy / descriptions. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
    p,
    .ib-ub-card p,
    .ib-card-excerpt,
    .ib-excerpt,
    .entry-summary
){
    font-family: var(--ib-ub-body-font, var(--ib-sans, Arial, sans-serif)) !important;
    font-size: var(--ib-ub-excerpt-size, var(--ib-excerpt-size, var(--ib-body-size, 15px))) !important;
    font-weight: var(--ib-body-weight, 400) !important;
    line-height: var(--ib-line-height, 1.55) !important;
    letter-spacing: var(--ib-body-letter-spacing, .01em) !important;
    color: var(--ib-ub-text-color, var(--ib-body-color, var(--ib-text, #050505))) !important;
}

/* Categories, labels and metadata. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
    .ib-ub-eyebrow,
    .ib-category-label,
    .ib-card-meta,
    .ib-meta,
    .entry-meta,
    .ib-date,
    .ib-kicker,
    small
){
    font-family: var(--ib-meta-font, var(--ib-menu-font, Arial, sans-serif)) !important;
    font-size: var(--ib-meta-size, 10px) !important;
    font-weight: var(--ib-meta-weight, 600) !important;
    letter-spacing: var(--ib-meta-letter-spacing, .12em) !important;
    color: var(--ib-meta-color, var(--ib-muted, #5f5f5f)) !important;
}

/* CTAs inherit the global button role unless the block has individual style. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
    .ib-ub-link,
    .ib-button,
    .ib-card-link,
    .ib-text-link,
    [class*="button"],
    [class*="cta"]
){
    font-family: var(--ib-button-font, var(--ib-menu-font, 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;
    color: var(--ib-button-color, var(--ib-text, #050505)) !important;
}

/* Reassert standard image controls after every legacy template stylesheet.
   These settings are independent of the Individual Design switch. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style img:not(.avatar):not(.emoji):not(.wp-smiley):not(.ib-ub-logo):not([data-ib-preserve-fit]){
    object-fit: var(--ib-image-fit-final, var(--ib-ub-image-fit, cover)) !important;
    object-position: var(--ib-image-position-final, var(--ib-ub-image-position, center top)) !important;
}

body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style.ib-ub-image-fit-contain img:not(.avatar):not(.emoji):not(.wp-smiley):not(.ib-ub-logo):not([data-ib-preserve-fit]){
    object-fit: contain !important;
    background-color: var(--ib-ub-bg-color, var(--ib-surface, transparent)) !important;
}

body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style.ib-ub-image-fit-natural img:not(.avatar):not(.emoji):not(.wp-smiley):not(.ib-ub-logo):not([data-ib-preserve-fit]){
    object-fit: contain !important;
    height: auto !important;
    max-height: none !important;
    background-color: var(--ib-ub-bg-color, var(--ib-surface, transparent)) !important;
}

/* Dark blocks use the global dark role rather than a template's old color. */
body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style.ib-ub-scheme-dark:not(.ib-ub-global-style-exempt) :is(
    h1,h2,h3,p,strong,.ib-card-title,.ib-ub-card-title,.ib-ub-link,.ib-button,.ib-card-link,.ib-text-link
){
    color: var(--ib-dark-text, #ffffff) !important;
}

@media (max-width: 900px){
    body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style.ib-ub-family-hero:not(.ib-ub-global-style-exempt) :is(h1,h2),
    body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style.ib-ub-family-hero:not(.ib-ub-global-style-exempt) :is(
        .ib-ub-hero-copy > strong,
        .ib-ub-hero-copy > a > strong,
        .ib-ub-dark-lead strong,
        .ib-ub-showcase-lead strong
    ){
        font-size: var(--ib-h1-mobile-size, 46px) !important;
    }

    body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-family-hero):not(.ib-ub-global-style-exempt) h2{
        font-size: var(--ib-h2-mobile-size, 30px) !important;
    }

    body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(
        h3,
        .ib-card-title,
        .ib-ub-card-title,
        .entry-card-title,
        .ib-ub-card__body h3,
        .ib-ub-mini-card h3,
        a[class*="card"] > strong,
        a[class*="card"] > span > strong,
        a[class*="item"] > strong,
        a[class*="item"] > span > strong
    ){
        font-size: var(--ib-card-title-mobile-size, 21px) !important;
    }

    body.ib-et .ib-ub-page .ib-ub-instance.ib-ub-global-style:not(.ib-ub-global-style-exempt) :is(p,.ib-card-excerpt,.ib-excerpt,.entry-summary){
        font-size: var(--ib-excerpt-mobile-size, 15px) !important;
    }
}
