/* ============================================================
   JSB — site-wide sticky public header (Astra theme, CSS only)
   Enqueued on every front-end page by the JSB Resources Hub plugin.
   No theme files are edited; the header element is never cloned.
   ============================================================ */

/* Astra (free) sets body{overflow-x:hidden} and the child theme also
   sets html{overflow-x:hidden}. overflow-x on <body> makes <body> a
   scroll container, which silently disables position:sticky on the
   header. Fix: keep the horizontal clipping on <html> (so no horizontal
   page scrollbar can appear) and restore a scrollable <body> so sticky
   works on every page and every viewport size. */
html { overflow-x: hidden; }
body { overflow-x: visible !important; }

/* The whole public header (logo + nav + mobile bar + mobile dropdown)
   sticks to the top of the viewport. position:sticky keeps the header in
   normal document flow, so no content jump / layout shift on load. */
#masthead,
.site-header {
	position: sticky !important;
	top: 0 !important;
	z-index: 9999 !important;
	width: 100%;
	left: 0;
	right: 0;
}

/* Logged-in: keep the sticky header just below the WP admin bar. */
body.admin-bar #masthead,
body.admin-bar .site-header {
	top: 32px !important;
}
@media (max-width: 782px) {
	body.admin-bar #masthead,
	body.admin-bar .site-header {
		top: 46px !important;
	}
}

/* WP core (wp-includes/css/admin-bar.css) switches #wpadminbar to
   position:absolute at <=600px ("Smartphone") so the bar scrolls away
   with the page, while html keeps margin-top:46px and the masthead
   stays sticky at top:46px - leaving a ~46px strip of page content
   visible ABOVE the nav once scrolled (the "floating nav" bug).
   Fix: pin the admin bar back to position:fixed at every breakpoint
   (exactly WPs own behavior above 600px) so the sticky masthead
   always sits flush below the admin bar; nothing can float above it.
   Guests (no admin bar) are unaffected - masthead stays top:0. */
@media (max-width: 600px) {
	#wpadminbar {
		position: fixed !important;
	}
}

/* Dropdown menus / mobile menu live inside #masthead; they inherit the
   header's own stacking context (z-index 9999 < admin bar's 99999), so
   they always paint above page content but never above the admin bar. */
#ast-desktop-header,
#ast-mobile-header {
	position: relative;
	z-index: 9999;
}

/* ============================================================
   Top white-gap above the sticky header (site-wide, CSS only)
   ------------------------------------------------------------
   The page templates emit whitespace-only text nodes directly
   inside <body> (before the skip-link / #page). Browsers lay those
   out as an anonymous line box at the very top of <body> whose
   height equals body's line-height (26.4px desktop, 24.1px on
   narrow viewports) — the white strip above the header.
   body::first-line collapses ONLY that first, invisible line to
   0 height. Specificity (0,0,2) beats the theme's body rule, and
   because body's first line contains only whitespace, no visible
   text, page height or hero layout is affected. Verified at
   1280px and 390px on every public page (home, contact, product
   hub, resources, why, how-it-works, services).
   ============================================================ */
body::first-line {
	line-height: 0 !important;
}

/* ============================================================
   Mobile footer grid fix (site-wide, CSS only)
   ------------------------------------------------------------
   Every page ships an inline <style> inside .site-content that pins
   the footer to five columns even on phones:
     .footer-grid { display:grid!important;
       grid-template-columns:1.3fr 1fr 1fr 1.1fr 1fr!important;
       gap:40px!important; max-width:1240px!important; }
   At a 390px viewport that grid's five min-content tracks plus the
   160px of gaps force document.scrollWidth to ~730px (horizontal
   overflow on every page). We do NOT edit the page content — instead
   we override it here, site-wide. The inline rule and this rule are
   both author !important; ours wins because the selectors below have
   higher specificity than the inline `.footer-grid` (specificity is
   compared before document order for equal origin+importance).
   Desktop (>900px) keeps the original five-column layout untouched.
   ============================================================ */

/* ≤900px: two columns that can shrink below their min-content width,
   smaller gap, grid itself never wider than the viewport. */
@media (max-width: 900px) {
	.site-footer .footer-grid,
	#colophon .footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 32px 24px !important;
		max-width: 100% !important;
	}

	/* Grid children may shrink to zero (no min-content blow-out) and any
	   long URL / e-mail wraps instead of forcing a horizontal scrollbar. */
	.site-footer .footer-col,
	#colophon .footer-col {
		min-width: 0 !important;
	}
	.site-footer .footer-col *,
	#colophon .footer-col * {
		overflow-wrap: break-word !important;
	}
}

/* ≤560px: single column, comfortable vertical spacing. */
@media (max-width: 560px) {
	.site-footer .footer-grid,
	#colophon .footer-grid {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 28px !important;
	}
}

/* ============================================================
   Privacy Policy page (post ID 3, slug "privacy-policy") —
   unified deep-navy first-screen hero (CSS only).
   ------------------------------------------------------------
   Reuses the exact first-screen visual language already shipped
   by the other pages: Home (.hp-hero), Contact (/contact-us/
   .jsb-cu-hero), Resources (.jsb-res-hero) and Product Hub
   (.jsb-hub-hero) all render a full-width deep-navy band
   (#081845 → #060F2E gradient + matte-gold radial sheen) that
   starts flush under the sticky masthead with a white Plus
   Jakarta Sans 800 title inside the 1240px reading column.

   This block styles the page's own Astra .entry-header /
   .entry-title (the existing H1) as that hero, so NO theme file,
   no page content, no menu, no product and no other page is
   modified. Every rule is scoped under body.page-id-3 (verified
   on the live page's body class list), so the Home page, Contact,
   Resources, Product Hub, OEM/ODM and all other pages stay
   byte-for-byte untouched.
   ============================================================ */

/* Kill Astra's 60px desktop gap above the hero so the deep-navy band
   sits flush under the sticky nav (same as body.jsb-hub-page and
   body.jsb-cu-active do for their pages). Mobile has no gap already. */
body.page-id-3 #primary,
body.page-id-3 .content-area {
	margin-top: 0 !important;
}

/* Full-width deep-navy hero band, flush under the sticky masthead. */
body.page-id-3 .entry-header {
	position: relative;
	width: 100%;
	margin: 0;
	padding: 84px 0 92px;
	background:
		radial-gradient(1000px 420px at 85% -10%, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0) 60%),
		linear-gradient(180deg, #081845 0%, #060F2E 100%);
	color: #ffffff;
	overflow: hidden;
}

/* White hero title inside the 1240px reading column.
   font-size/line-height need !important: Astra's dynamic inline CSS
   (astra-theme-css-inline-css) ships header.entry-header .entry-title
   {font-size:32px;line-height:1.2} with the SAME specificity (0,2,1)
   as body.page-id-3 .entry-title and is printed after this stylesheet,
   so without !important it would win on document order (verified). */
body.page-id-3 .entry-title {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px;
	font-family: 'Plus Jakarta Sans', sans-serif;
	font-size: 46px !important;
	font-weight: 800;
	line-height: 1.12 !important;
	letter-spacing: -0.5px;
	color: #ffffff;
}

/* Same responsive rhythm as the Contact hero (jsb-cu-hero). */
@media (max-width: 1024px) {
	body.page-id-3 .entry-header { padding: 72px 0 80px; }
	body.page-id-3 .entry-title { font-size: 38px !important; }
}
@media (max-width: 820px) {
	body.page-id-3 .entry-header { padding: 60px 0 68px; }
	body.page-id-3 .entry-title { padding: 0 18px; font-size: 32px !important; }
}
@media (max-width: 480px) {
	body.page-id-3 .entry-header { padding: 48px 0 56px; }
	body.page-id-3 .entry-title { font-size: 28px !important; }
}
