/* Component: polish — interior-page finishing pass. Enqueued after main.css
   via the assets/css/components/*.css glob in functions.php.

   Scope discipline:
   - Uses only existing main.css vars (--scs-red, --scs-ink, --scs-body,
     --scs-muted, --scs-surface, --scs-surface-2, --scs-radius, --scs-shadow).
   - No @keyframes / animation here — motion is owned by motion-enhance.css and
     must respect prefers-reduced-motion. Nothing below animates.
   - Only touches interior pages; the home hero, the material/service/guideline
     single heroes (which carry their own .scs-crumbs + .scs-hero__title), and
     the query-loop card titles are all explicitly excluded. */

/* --------------------------------------------------------------------------
   1. Horizontal-overflow safety guard (HIGH)
   -------------------------------------------------------------------------- */
/* Defensive clip so interior content can never spill past the viewport and
   clip the H1 / intro on narrow screens. `clip` (unlike `hidden`) does not
   create a scroll container, so sticky/position:sticky and focus scrolling
   still behave. Scoped to the constrained page/archive <main> so it never
   affects the home hero's intentional full-bleed sections. */
body.page:not(.home) > main.is-layout-constrained,
body.archive > main.is-layout-constrained {
	overflow-x: clip;
}

/* Belt-and-suspenders: the document itself should never scroll sideways on
   interior/archive views. Home keeps default behaviour (full-bleed hero). */
body.page:not(.home),
body.archive {
	overflow-x: clip;
}

/* --------------------------------------------------------------------------
   2. Interior page-title band (MED)
   -------------------------------------------------------------------------- */
/* Give the page's own H1 a designed header: comfortable top breathing room,
   a tuned display size, and a thin hairline that reads as a band separator.

   Targeting notes — this must NOT fire on:
   - the home page          -> excluded via :not(.home)
   - single material/service/guideline heroes -> those are body.single (not
     body.page) AND their title carries .scs-hero__title; excluded twice
   - query-loop card titles -> those render as <h3>/<h2>, never the page <h1>;
     the h1.wp-block-post-title element selector already skips them. */
body.page:not(.home) main h1.wp-block-post-title:not(.scs-hero__title),
body.archive main .wp-block-query-title {
	margin-top: 0;
	margin-bottom: clamp(1.25rem, 3vw, 2rem);
	padding-top: clamp(1.5rem, 4vw, 2.75rem);
	padding-bottom: clamp(1rem, 2.5vw, 1.5rem);
	border-bottom: 1px solid var(--scs-surface-2);
	font-size: clamp(2rem, 1.3rem + 3.2vw, 3rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--scs-ink);
}

/* A whisper of surface tint behind the band's inner padding keeps it from
   sitting cold on bare white without needing a full-bleed break-out. Applied
   only to the intro paragraph that immediately follows the titled band so the
   header + lede read as one unit. */
body.page:not(.home) main h1.wp-block-post-title:not(.scs-hero__title) + .entry-content > p:first-child,
body.page:not(.home) main h1.wp-block-post-title:not(.scs-hero__title) + p {
	color: var(--scs-muted);
	font-size: 1.05rem;
	line-height: 1.6;
	margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   3. FAQ duplicate heading (MED)
   -------------------------------------------------------------------------- */
/* /faq/ renders the page H1 "Frequently Asked Questions" directly above the
   FAQ pattern's own styled <h2> "Frequently asked questions" — a redundant
   double heading. The orchestrator adds body.page-slug-faq on that page; hide
   only the redundant page post-title there and keep the pattern's h2. (Rule is
   inert until that body class is present, then takes effect automatically.) */
body.page-slug-faq main h1.wp-block-post-title {
	display: none;
}
