/* ==========================================================
   Phase 08-G.18.9.7 — Source-level typography cascade
   Loaded after every public component stylesheet.

   Contract:
   - selected Body family owns normal UI text;
   - selected Heading family owns headings only when configured separately;
   - no universal * selector;
   - no generic span/svg/pseudo-element override, so WooCommerce/Dashicons/icon
     fonts keep their own font-family declarations.
   ========================================================== */

/* Central document contract. */
html body{
  font-family:var(--mkp-font)!important;
}

/* Native controls and authored text buttons commonly get browser/plugin fonts. */
html body :where(
  button,
  input,
  select,
  textarea,
  option,
  label,
  legend,
  .button,
  .wp-element-button,
  .wc-block-components-button
){
  font-family:var(--mkp-font)!important;
}

/* Site-owned component roots. Descendants inherit unless they intentionally own a font. */
html body :where(
  .mkp-header,
  .mkp-mobile-nav,
  .mkp-footer,
  .mkp-footer-newsletter,
  .mkp-plugin-form-shell,
  .mkp-public-page,
  .entry-content,
  .mkp-cart-popup,
  .mkp-commerce-page,
  .mkp-woo-stage,
  .mkp-checkout-page,
  .mkp-checkout-x,
  .mkp-order-complete,
  .mkp-account-page,
  .mkp-authv2
){
  font-family:var(--mkp-font)!important;
}

/* WooCommerce text roots. Keep child icon-font classes free to override inheritance. */
html body :where(
  .woocommerce,
  .woocommerce-notices-wrapper,
  .woocommerce-message,
  .woocommerce-info,
  .woocommerce-error,
  .wc-block-cart,
  .wc-block-checkout,
  .wc-block-components-form,
  .wc-block-components-notice-banner,
  .wc-block-components-sidebar,
  .wc-block-components-main
){
  font-family:var(--mkp-font)!important;
}

/* Product summary/description/tabs: explicit roots, not blanket descendants. */
html body.single-product :where(
  .summary,
  .woocommerce-product-details__short-description,
  .woocommerce-tabs,
  .woocommerce-Tabs-panel,
  .product_meta
){
  font-family:var(--mkp-font)!important;
}

/* SelectWoo/Select2 dropdowns can be appended directly under <body>. */
html body :where(
  .select2-container,
  .select2-results,
  .select2-search__field,
  .select2-selection
){
  font-family:var(--mkp-font)!important;
}

/*
 * Intentional Heading family.
 * This comes after component-root rules so a separately configured heading
 * family remains authoritative without turning every component label into a heading.
 */
html body :where(
  h1,h2,h3,h4,h5,h6,
  .mkp-heading,
  .mkp-v2-title,
  .mkp-footer__brand,
  .woocommerce-loop-product__title,
  .product_title
){
  font-family:var(--mkp-heading-font,var(--mkp-font))!important;
}

/*
 * Icon safety is inheritance-based by design:
 * - WooCommerce rating/icon classes explicitly declare font-family:WooCommerce.
 * - Dashicons explicitly declare font-family:dashicons.
 * - SVG icons do not use font-family.
 * No selector above writes font-family to generic span/svg or ::before/::after.
 */

/* ==========================================================
   Phase 08-G.18.9.7.1 — Explicit component font scopes

   Why this exists:
   - Footer and Woo product descriptions are authored components, not generic
     document text. Their descendants can carry stronger component rules or
     legacy inline font-family values from edited content.
   - Apply the central Font Manager family to text-bearing descendants only.
   - Headings remain on --mkp-heading-font.
   - Dashicons, SVGs, pseudo-elements and known icon containers are untouched.
   ========================================================== */

/* Scope roots: selected Body family is authoritative inside these components. */
html body .mkp-font-scope--footer,
html body.single-product .mkp-font-scope--product-intro,
html body.single-product .mkp-font-scope--product-details{
  font-family:var(--mkp-font)!important;
}

/* Footer markup is fully theme-owned: bind each real text element explicitly. */
html body .mkp-font-scope--footer :where(
  p,
  a,
  li,
  span:not(.dashicons):not([class*="icon"]),
  small,
  label,
  input,
  button,
  textarea,
  select,
  option
){
  font-family:var(--mkp-font)!important;
}

/* Product short description / intro text. */
html body.single-product .mkp-font-scope--product-intro :where(
  .woocommerce-product-details__short-description,
  .woocommerce-product-details__short-description p,
  .woocommerce-product-details__short-description li,
  .woocommerce-product-details__short-description a,
  .woocommerce-product-details__short-description strong,
  .woocommerce-product-details__short-description b,
  .woocommerce-product-details__short-description em,
  .woocommerce-product-details__short-description small,
  .woocommerce-product-details__short-description span:not(.dashicons):not([class*="icon"]),
  .price,
  .price del,
  .price ins,
  .stock
){
  font-family:var(--mkp-font)!important;
}

/*
 * Long description/review shell. Reset text nodes and legacy editor inline
 * font-family values without using a universal selector. This is deliberately
 * limited to the custom product-details scope.
 */
html body.single-product .mkp-font-scope--product-details :where(
  .woocommerce-Tabs-panel,
  .woocommerce-Tabs-panel p,
  .woocommerce-Tabs-panel li,
  .woocommerce-Tabs-panel a,
  .woocommerce-Tabs-panel strong,
  .woocommerce-Tabs-panel b,
  .woocommerce-Tabs-panel em,
  .woocommerce-Tabs-panel small,
  .woocommerce-Tabs-panel blockquote,
  .woocommerce-Tabs-panel figcaption,
  .woocommerce-Tabs-panel table,
  .woocommerce-Tabs-panel th,
  .woocommerce-Tabs-panel td,
  .woocommerce-Tabs-panel dt,
  .woocommerce-Tabs-panel dd,
  .woocommerce-Tabs-panel font,
  .woocommerce-Tabs-panel span:not(.dashicons):not([class*="icon"]),
  #reviews p,
  #reviews label,
  #reviews input,
  #reviews textarea,
  #reviews button
){
  font-family:var(--mkp-font)!important;
}

/* Old editor content may contain inline font-family. Override only that legacy
   declaration inside the product description scope; headings are restored below. */
html body.single-product .mkp-font-scope--product-details
.woocommerce-Tabs-panel [style*="font-family"]{
  font-family:var(--mkp-font)!important;
}

/* Exact Woo success-notice binding on single product; pseudo icon is untouched. */
html body.single-product .mkp-commerce-page .woocommerce-message,
html body.single-product .mkp-commerce-page .woocommerce-message a.button.wc-forward{
  font-family:var(--mkp-font)!important;
}

/* Heading family stays intentionally independent when configured as separate. */
html body .mkp-font-scope--footer .mkp-footer__brand,
html body .mkp-font-scope--footer :where(h1,h2,h3,h4,h5,h6),
html body.single-product .mkp-font-scope--product-intro :where(h1,h2,h3,h4,h5,h6,.product_title),
html body.single-product .mkp-font-scope--product-details :where(h1,h2,h3,h4,h5,h6){
  font-family:var(--mkp-heading-font,var(--mkp-font))!important;
}
