/**
 * File: typography.css
 * Path: /wp-content/themes/msi-theme/assets/css/typography.css
 * Version: 1.0.24-dev
 * Created: 2026-11-28
 * Last Updated: 2026-12-01
 * Author: Lucky Mahrus | https://geraisitus.co.id/
 * Description: Shared frontend title typography for MSI pages and section headings.
 * Changelog: 1.0.18-dev — Dark red homepage section titles; 1.0.2-dev — Global title typography derived from homepage mockup.
 */

/* Only the four requested typography properties. Layout, case and spacing
 * remain controlled by BeTheme/BeBuilder. Exclude catalog card labels, filter
 * controls and explicit opt-outs; do not target every generic .title. */
body.msi-theme :is(#Content, #Subheader, main, .msi-page-content) :is(
    h1, h2, h3, h4, h5, h6,
    .entry-title, .page-title, .post-title > .title,
    .fancy_heading .title, .column_heading .title,
    .mcb-item-heading-inner .title, .msi-article-title
):not(:where(
    .msi-title-keep, .msi-title-keep *,
    .gs-tag-grid__card, .gs-tag-grid__card *, .gs-tag-grid__name,
    .ts-card__title, .gs-featured-card__title, .gs-discover__card *,
    .gscfe-sidebar-title, .gscfe-sidebar-header *,
    .widget-title, .widgettitle, .widget *, .sidebar *,
    .accordion .question *, .faq .question *,
    .mfn-accordion .question *, .mfn-tabs *, .tabs_wrapper *
)),
body.msi-theme #Subheader .title:not(:where(.msi-title-keep, .msi-title-keep *)),
body.msi-theme .msi-title:not(:where(.msi-title-keep, .msi-title-keep *)) {
    font-family: var(--msi-title-font-family) !important;
    font-style: var(--msi-title-font-style) !important;
    font-size: var(--msi-title-font-size) !important;
    font-weight: var(--msi-title-font-weight) !important;
    color: var(--msi-title-color) !important;
}

/* Linked titles must retain the same typography, even when the parent theme
 * defines its own link styles. Preserve the link's layout and decoration. */
body.msi-theme :is(#Content, #Subheader, main, .msi-page-content) :is(
    h1, h2, h3, h4, h5, h6,
    .entry-title, .page-title, .post-title > .title,
    .fancy_heading .title, .column_heading .title,
    .mcb-item-heading-inner .title, .msi-article-title
):not(:where(
    .msi-title-keep, .msi-title-keep *,
    .gs-tag-grid__card, .gs-tag-grid__card *, .gs-tag-grid__name,
    .ts-card__title, .gs-featured-card__title, .gs-discover__card *,
    .gscfe-sidebar-title, .gscfe-sidebar-header *,
    .widget-title, .widgettitle, .widget *, .sidebar *,
    .accordion .question *, .faq .question *,
    .mfn-accordion .question *, .mfn-tabs *, .tabs_wrapper *
)) > a:not(:where(.msi-title-keep, .msi-title-keep *)),
body.msi-theme #Subheader .title:not(:where(.msi-title-keep, .msi-title-keep *)) > a:not(.msi-title-keep),
body.msi-theme .msi-title:not(:where(.msi-title-keep, .msi-title-keep *)) > a:not(.msi-title-keep) {
    font-family: inherit !important;
    font-style: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

@media (max-width: 1024px) {
    body.msi-theme { --msi-title-font-size: var(--msi-title-size-tablet); }
}
@media (max-width: 767px) {
    body.msi-theme { --msi-title-font-size: var(--msi-title-size-mobile); }
}

/* 1.0.18-dev: Homepage section titles only. Reuse the inner-page dark red
 * without changing global tokens, heading metrics, linked card titles or footer.
 * Explicit white-title / dark-surface utilities and opt-outs take precedence. */
body.msi-theme.home.page #Content .mfn-builder-content > .mcb-section
    .column_heading > .mcb-column-inner > .title:not(:where(
        .msi-title-keep, .msi-title-keep *,
        .msi-ui-title-white, .msi-ui-title-white *,
        .msi-ui-surface-red *, .msi-ui-surface-dark *,
        .msi-ui-panel-red *, .msi-ui-panel-dark *
    )) {
    --msi-title-color: var(--msi-red-dark);
}
