/**
 * Typography application layer for Tokyo Studio Capture.
 *
 * OWNERSHIP RULE FOR THIS PHASE: Phase 1C.1 applies Inter only to normal
 * non-home, non-checkout #content -- font-family only. Nothing else.
 *
 *   - HEADER: untouched here. Header Builder typography (still Oswald) is
 *     addressed explicitly in Phase 1C.3.
 *   - FOOTER: untouched here, deferred alongside the header/global-shell work.
 *   - ELEMENTOR HOMEPAGE: excluded from these rules (see below). Homepage
 *     typography is handled later in a dedicated Elementor/home phase.
 *   - WOOCOMMERCE / CARTFLOWS CHECKOUT: excluded from these rules (see
 *     below). Checkout typography is explicitly out of scope and stays
 *     governed solely by its existing wp_head inline-style fix.
 *   - Inter Display: not used anywhere in this file.
 *
 * Background: an earlier version of this file applied Inter via a global
 * `body { font-family: ... }` rule. Live regression testing proved that
 * change altered the Astra Header Builder's layout (item wrapping, spacing)
 * through inherited font metrics, even though the header's own font-FAMILY
 * was never targeted -- Astra's header geometry is computed against
 * inherited body font metrics regardless of which family is active. That
 * approach is abandoned; this file now scopes every rule to the theme's
 * main-content wrapper so it structurally cannot reach the header.
 *
 * Enqueued after tokens.css (so var(--tsc-font-body) is available) and
 * before woocommerce.css / audioigniter.css / forms.css / site-fixes.css
 * (see astra-child/functions.php -> tsc_enqueue_assets()); enqueue
 * architecture is unchanged from earlier Phase 1C.1 work.
 */

/**
 * Main-content wrapper, verified from Astra's own source (not assumed):
 *
 *   astra/header.php line 61: astra_header() renders <header id="masthead">
 *     ...and closes it BEFORE line 67 opens <div id="content" class="site-content">.
 *   astra/footer.php: explicitly closes </div><!-- #content --> BEFORE
 *     astra_footer() renders the footer.
 *
 * So header and footer are DOM SIBLINGS of #content under the same #page
 * wrapper -- never descendants -- in every template this theme ships
 * (index.php and friends all follow get_header() -> #primary/#content ->
 * get_footer()). A selector of the form "#content <descendant>" can
 * therefore never match anything inside <header id="masthead"> or the
 * footer, by construction, regardless of Customizer or Elementor state.
 *
 * Elementor exclusion: the task's suggested `body:not(.elementor-page)`
 * could not be verified -- the Elementor plugin itself is not present in
 * this local project, so its exact body-class output cannot be confirmed
 * from source. Using `:not(.home)` instead: astra/header.php calls
 * WordPress core's own body_class() directly (line 35), and WordPress core
 * unconditionally adds the `home` class on the site's front page
 * (is_front_page()) -- independent of Elementor, fully verifiable, and a
 * precise match for the one Elementor-built page in scope for this project
 * (the homepage / front page). If the Elementor homepage's content happens
 * to render inside #content on that page, :not(.home) still excludes it;
 * if it uses a template that bypasses #content entirely, these selectors
 * simply have nothing to match there either way.
 *
 * Checkout exclusion: live inspection confirmed the CartFlows checkout page
 * carries the `woocommerce-checkout` body class (alongside
 * `cartflows_step-template` / `cartflows-instant-checkout`, not needed here
 * since `woocommerce-checkout` alone is the sufficient, semantic exclusion).
 * `:not(.woocommerce-checkout)` keeps checkout typography exactly as it is,
 * governed solely by the existing tsc_checkout_inline_styles() wp_head fix
 * -- these two systems must never overlap.
 *
 * Specificity: `#content` is an ID selector (1,0,0,0). Combined with
 * `body:not(.home):not(.woocommerce-checkout)` (0,2,1,0) and a descendant
 * tag, every rule below is at minimum (1,2,1,0) -- comfortably higher than
 * any of Astra's own body, button/input/select/textarea, or heading rules
 * (all 0,0,1,0 or 0,1,1,0 at most, per astra/inc/class-astra-dynamic-css.php).
 * This wins cleanly by specificity alone; no !important is used or needed.
 */

/* Body copy and inline text inside main content (font-family only;
   inherits down to paragraphs, spans, list items, etc. -- nothing else in
   Astra's CSS sets font-family directly on generic content tags). */
body:not(.home):not(.woocommerce-checkout) #content {
	font-family: var(--tsc-font-body);
}

/* Buttons and form controls inside main content -- font-family only.
   Astra sets font-family directly on these bare tags (not just inherited),
   so a direct override here is required; inheritance alone would not win
   against Astra's own direct rule. Deliberately does NOT set font-size,
   font-weight, or line-height: Astra's existing values for these elements
   continue to apply untouched. */
body:not(.home):not(.woocommerce-checkout) #content button,
body:not(.home):not(.woocommerce-checkout) #content input,
body:not(.home):not(.woocommerce-checkout) #content select,
body:not(.home):not(.woocommerce-checkout) #content textarea {
	font-family: var(--tsc-font-body);
}

/* Headings inside main content -- font-family only. Deliberately does NOT
   set font-size, font-weight, or line-height: Astra's existing per-level
   H1-H6 Customizer output continues to control those untouched.
   `#content h1 a`..`#content h6 a` is included because Astra directly
   targets anchors nested in headings (e.g. a hyperlinked post title) with
   its own rule; without this, such a heading's visible link text would stay
   in Oswald even though the heading element itself switched to Inter. */
body:not(.home):not(.woocommerce-checkout) #content h1,
body:not(.home):not(.woocommerce-checkout) #content h2,
body:not(.home):not(.woocommerce-checkout) #content h3,
body:not(.home):not(.woocommerce-checkout) #content h4,
body:not(.home):not(.woocommerce-checkout) #content h5,
body:not(.home):not(.woocommerce-checkout) #content h6,
body:not(.home):not(.woocommerce-checkout) #content :where(h1, h2, h3, h4, h5, h6) a {
	font-family: var(--tsc-font-body);
}
