/* =========================================================
   NEDA eCAMPUS — THE TYPE SCALE
   Loaded on EVERY page. One file, two numbers.

   WHY THIS FILE EXISTS

   Body text was running at SIXTEEN different sizes across the site -
   13, 13.6, 14, 14.4, 15, 15.2, 16, 16.8, 17, 18, 19, 19.14, 20, 21.7,
   25.5 and 26px - and section headlines at four (24, 33.2, 44, 48.5).
   Measured on the live pages, not guessed. Nobody chose that; it is what
   you get when eight stylesheets each name their own size and the theme
   names a ninth underneath them all.

   The rule from here on is:

     BODY TEXT      15px      everything a visitor READS
     SECTION HEAD   24px      the headline over a section

   WHAT THIS FILE DOES NOT TOUCH, and why

     - PAGE TITLES (h1). The hero title is the page's entry point: 54px on
       About and Contact, 42px elsewhere, 68px on the front page. Dropping
       it to 24px would leave it 9px clear of body copy and the page would
       lose its top. If that IS wanted, it is one rule - see the end of
       this file.
     - SUB-HEADINGS (h3), which sit at 19px. They have to stay BELOW the
       24px section head or a section with both reads as one flat list.
     - ANYTHING ALREADY AT OR UNDER 15px: the navigation (15), the footer
       (11-15), buttons (14), the small badge and label text (13). That is
       chrome, not reading matter, and enlarging it to 15 would push the
       footer and the card badges out of shape.
     - DISPLAY NUMBERS - prices, seat counts, dashboard figures. They are
       read as objects, not as sentences.

   The theme's own base is 16px (`online-lms/theme.json`, styles.typography
   .fontSize). It is overridden here rather than there, because a theme
   file is replaced on every theme update and this must survive that.
   ========================================================= */

/*
 * `html body`, not `body`, and the doubled element is deliberate.
 *
 * The theme's base arrives in the `global-styles-inline-css` block that
 * WordPress prints in the head, as a plain `body { font-size: 16px }` at
 * (0,0,1). A plain `body` here would only TIE it, and the winner would come
 * down to which stylesheet the head happens to print last - which changes
 * when a plugin is activated. (0,0,2) settles it and cannot be undone by
 * load order.
 */
html body {
	font-size: 15px;
}

/*
 * AND THE BASE ABOVE IS NOT ENOUGH ON ITS OWN.
 *
 * WordPress prints `:root :where(p) { font-size: var(--wp--preset--font-size--regular) }`
 * in its global stylesheet. `:where()` contributes nothing but `:root` is a
 * pseudo-class, so that rule is (0,1,0) - and `html body` above is (0,0,2),
 * which loses to it. Every paragraph carrying NO class of its own therefore
 * stayed at the theme's 16px. It went unnoticed on most pages because our
 * components name their own size; the Accessibility Statement, which is
 * plain unclassed paragraphs from end to end, was 16px throughout.
 *
 * Fixed at the source rather than by out-specifying it: the preset itself
 * becomes 15px, which settles `:root :where(p)` and `.has-regular-font-size`
 * together. "Regular" IS the body size on this site, so redefining it says
 * exactly what is meant. `html:root` for (0,1,1), so this does not depend on
 * which stylesheet the head prints last.
 */
html:root {
	--wp--preset--font-size--regular: 15px;
}

/*
 * The same gap on the heading side: a heading with no inline size and no
 * class of ours was left on the theme's em-based default - 22.5px for an h2
 * on the Accessibility Statement, where every other section head is 24.
 *
 * (0,1,1), so it clears WordPress's `:root :where(…)` heading rules while
 * still losing to every component rule in this codebase - all of which
 * already ask for 24 and 19. This is a floor for headings nobody has styled,
 * not a new authority over the ones that are.
 */
:root main h2 {
	font-size: 24px;
}

:root main h3 {
	font-size: 19px;
}

/*
 * The presets that reach block markup. WordPress emits every one of these
 * with !important, so a block carrying "Regular" or "Large" in the editor
 * would otherwise keep 16px or 20px whatever this file says. Only the two
 * sizes used for BODY copy are pulled down; `extra-large` and up are left
 * alone because headings use them.
 *
 * `small` (13px) and `medium` (15px) are already at or under the body size
 * and are not touched.
 */
html body :where(p, li, dd, dt, figcaption, blockquote).has-regular-font-size,
html body :where(p, li, dd, dt, figcaption, blockquote).has-large-font-size {
	font-size: 15px !important;
}

/* ---------------------------------------------------------
   THE SITE EDITOR'S INLINE SIZES
   --------------------------------------------------------- */

/*
 * THE FRONT PAGE IS NOT STYLED BY ANY STYLESHEET, AND THAT IS WHY THIS
 * BLOCK EXISTS.
 *
 * Its headings and paragraphs are template blocks that carry their size
 * INLINE - `style="…font-size:clamp(25.984px, …, 44px)…"` on the element
 * itself, written by the Site Editor. An inline declaration outranks every
 * selector in every stylesheet, so `.neda-section > .wp-block-heading` and
 * friends were being dropped on the floor: measured 44px for "Why Choose
 * Neda eCampus?" and 68px for the hero, with the stylesheet asking for 24.
 * !important is the only thing that reaches an inline style at all.
 *
 * `[style*="font-size"]` is the whole point of the selector: it touches ONLY
 * the blocks the editor has given an explicit size, and leaves every other
 * heading and paragraph to the ordinary rules above. A blanket `main h2`
 * would have swept up components that are already correct.
 *
 * Scoped to `main`, so the header's and footer's own type is untouched.
 *
 * THE ALTERNATIVE WAS EDITING THE FRONT-PAGE TEMPLATE, and it is refused
 * here for the reason neda-faq.css already records: that template has been
 * clobbered once by a concurrent Site Editor save. Sizes that live in the
 * database are also invisible to a diff and cannot be rolled back with the
 * rest of a deploy.
 */
main h2[style*="font-size"] {
	font-size: 24px !important;
}

/* Sub-headings stay a step below the section head - see the note above. */
main :is(h3, h4, h5, h6)[style*="font-size"] {
	font-size: 19px !important;
}

main p[style*="font-size"] {
	font-size: 15px !important;
}

/*
 * h1 is deliberately absent. The page title is the one place a large size
 * still does work, and the front page's 68px hero is the site's opening
 * line. To bring it in with the rest, this is the rule - it is left
 * commented rather than deleted so the decision stays visible:
 *
 *   main h1[style*="font-size"] { font-size: 24px !important; }
 */

/* Form controls read as body text, not as chrome: a field the visitor types
   into is something they read back. Buttons are excluded - they are 14px
   sitewide and are labels on a control, not reading matter. */
main :is(label, input, select, textarea) {
	font-size: 15px;
}
