/* ════════════════════════════════════════════════════════════
   Phase D3 — Universal widget token cascade
   Applies font + Persian-digit feature to ALL widgets via
   [data-pb-widget] attribute (set on every PageSection wrapper).
   Per-widget CSS files still handle their own radius/density/scale
   conversions for fine-grained control.
   ════════════════════════════════════════════════════════════ */

[data-pb-widget] {
    font-family: var(--w-font, var(--font-body));
    /* Persian digit OpenType features — Vazirmatn (ss01), IRANSansX (rdot), Shabnam (ss01/ss02) */
    font-feature-settings: "ss01" 1, "ss02" 1, "rdot" 1;
    -moz-font-feature-settings: "ss01=1, ss02=1, rdot=1";
}

/* Force descendants to inherit font + feature settings.
   Excludes icon font classes so they keep their glyph fonts.
   Specificity (0,1,1) wins over global body p/a/span (0,0,2). */
[data-pb-widget] *:not(i):not([class*="fa-"]):not([class*="ti-"]):not([class*="mdi-"]) {
    font-family: inherit;
    font-feature-settings: inherit;
}

/* ════════════════════════════════════════════════════════════
   Phase 3A — modular type scale adoption
   :where() = zero specificity: any widget CSS that sets its own
   font-size still wins. Only "un-styled" headings adopt the scale,
   so themes get typographic personality without breaking layouts.
   ════════════════════════════════════════════════════════════ */
[data-pb-widget] :where(h1, .h1) { font-size: var(--fs-h1); }
[data-pb-widget] :where(h2, .h2) { font-size: var(--fs-h2); }
[data-pb-widget] :where(h3, .h3) { font-size: var(--fs-h3); }
[data-pb-widget] :where(h4, .h4) { font-size: var(--fs-h4); }
[data-pb-widget] :where(h5, .h5) { font-size: var(--fs-h5); }
[data-pb-widget] :where(h6, .h6) { font-size: var(--fs-h6); }
[data-pb-widget] :where(.lead)   { font-size: var(--fs-lead); }

/* Section rhythm — applied by the wrapper when style_props.rhythm is set */
[data-pb-widget].pb-rhythm-sm { padding-top: var(--rhythm-sm); padding-bottom: var(--rhythm-sm); }
[data-pb-widget].pb-rhythm-md { padding-top: var(--rhythm-md); padding-bottom: var(--rhythm-md); }
[data-pb-widget].pb-rhythm-lg { padding-top: var(--rhythm-lg); padding-bottom: var(--rhythm-lg); }
[data-pb-widget].pb-rhythm-xl { padding-top: var(--rhythm-xl); padding-bottom: var(--rhythm-xl); }

/* Alternating surface — style_props.surface=alt */
[data-pb-widget].pb-surface-alt { background-color: var(--surface-alt); }

/* Phase 5B — bottom shape divider host */
[data-pb-widget].pb-has-divider { position: relative; }
