/* Sneaky global shell — consolidation Phase C. Loaded only on Sneaky requests
 * (body.sh-shell). Consumes the design-system tokens; owns page titles, system
 * templates, breadcrumbs, the header Search item, the phone menu panel and
 * shell overflow. */

/* 1. Page title (parent theme H1) — the Customizer hides .page-header globally;
 * on Sneaky the title is shown only where no other H1 exists (inc/sneaky-shell.php). */
body.sh-shell .page-header {
	display: block !important;
	width: min(var(--sh-width), calc(100% - 32px));
	margin: 28px auto 8px;
}
body.sh-shell .page-header .entry-title,
body.sh-shell h1[data-sh-promoted-title] {
	margin: 0;
	color: var(--sh-ink);
	font-family: var(--sh-font-display);
	font-size: clamp(30px, 4.4vw, 48px);
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: 0;
}

/* 2. System pages: search, 404, exercise taxonomies. */
body.sh-shell main#content.site-main.sh-system-page {
	box-sizing: border-box;
	width: min(var(--sh-width), calc(100% - 32px));
	max-width: none;
	margin: 24px auto 56px;
	padding: 0;
	font-family: var(--sh-font-body);
	color: var(--sh-ink);
}
body.sh-shell .sh-system-page *, body.sh-shell .sh-system-page *::before, body.sh-shell .sh-system-page *::after { box-sizing: border-box; }
.sh-system-hero {
	display: grid;
	gap: 12px;
	padding: clamp(20px, 4vw, 40px);
	border: 1px solid var(--sh-line);
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(110, 196, 232, .16), #fff 60%), var(--sh-surface);
	box-shadow: var(--sh-shadow);
}
.sh-system-kicker {
	display: inline-flex;
	width: fit-content;
	padding: 6px 10px;
	border-radius: var(--sh-radius-pill);
	background: var(--sh-sky);
	color: var(--sh-on-sky);
	font-size: 12px;
	font-weight: 900;
	line-height: 1;
}
.sh-system-hero h1 {
	margin: 0;
	color: var(--sh-ink);
	font-size: clamp(30px, 4.6vw, 52px);
	font-weight: 900;
	line-height: 1.04;
	overflow-wrap: anywhere;
}
.sh-system-hero p { margin: 0; max-width: var(--sh-reading); color: var(--sh-copy); font-size: var(--sh-text-base); line-height: 1.5; }
.sh-search-form { display: grid; gap: 6px; max-width: 640px; }
.sh-search-form label { color: var(--sh-copy); font-size: var(--sh-text-sm); font-weight: 800; }
.sh-search-row { display: flex; gap: 8px; }
.sh-search-row input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--sh-line);
	border-radius: 12px;
	background: #fff;
	color: var(--sh-ink);
	font-size: 16px;
}
.sh-search-row button,
.sh-system-actions .sh-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px 20px;
	border: 0;
	border-radius: var(--sh-radius-pill);
	background: var(--sh-action);
	color: var(--sh-on-action) !important;
	font-size: 15px;
	font-weight: 900;
	text-decoration: none;
	cursor: pointer;
}
.sh-search-row button:hover, .sh-system-actions .sh-action:hover { background: var(--sh-action-hover); }
.sh-system-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.sh-system-actions .sh-action-secondary {
	display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px;
	border: 1px solid var(--sh-action); border-radius: var(--sh-radius-pill);
	color: var(--sh-action) !important; font-size: 15px; font-weight: 900; text-decoration: none;
}
.sh-result-list { display: grid; gap: 10px; margin: 20px 0; padding: 0; list-style: none; }
.sh-result a {
	display: grid; gap: 4px; padding: 16px 18px;
	border: 1px solid var(--sh-line); border-radius: var(--sh-radius); background: #fff;
	color: var(--sh-ink); text-decoration: none;
}
.sh-result a:hover, .sh-result a:focus-visible { border-color: var(--sh-action); }
.sh-result-type { color: var(--sh-teal); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.sh-result-title { font-size: 18px; font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
.sh-result-excerpt { color: var(--sh-copy); font-size: 15px; line-height: 1.45; }
.sh-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.sh-pagination a, .sh-pagination span {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px;
	border: 1px solid var(--sh-line); border-radius: var(--sh-radius-pill); color: var(--sh-ink); font-weight: 800; text-decoration: none;
}
.sh-pagination .current { background: var(--sh-action); border-color: var(--sh-action); color: var(--sh-on-action); }
.sh-empty { margin: 20px 0 4px; }
.sh-empty h2 { margin: 0 0 6px; color: var(--sh-ink); font-size: 22px; font-weight: 900; }
.sh-empty p { margin: 0; color: var(--sh-copy); }
.sh-pillar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.sh-pillar-grid a {
	display: grid; gap: 4px; min-height: 96px; padding: 16px;
	border: 1px solid var(--sh-line); border-radius: var(--sh-radius); background: var(--sh-surface-soft);
	color: var(--sh-ink); text-decoration: none;
}
.sh-pillar-grid a:hover, .sh-pillar-grid a:focus-visible { border-color: var(--sh-action); background: #fff; }
.sh-pillar-grid strong { font-size: 17px; font-weight: 900; }
.sh-pillar-grid span { color: var(--sh-copy); font-size: var(--sh-text-sm); line-height: 1.4; }
.sh-term-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
@media (max-width: 1024px) { .sh-pillar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sh-term-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .sh-pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
	.sh-pillar-grid, .sh-term-grid { grid-template-columns: 1fr; }
	.sh-search-row { flex-direction: column; }
	.sh-search-row button { width: 100%; }
}

/* 3. Breadcrumbs: one quiet line on deep pages. */
.sh-breadcrumbs { margin: 0 0 12px; font-family: var(--sh-font-body); }
.sh-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-size: var(--sh-text-sm); line-height: 1.4; }
.sh-breadcrumbs li { display: inline-flex; align-items: center; min-width: 0; color: var(--sh-muted); }
.sh-breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--sh-line); }
.sh-breadcrumbs a { color: var(--sh-teal); font-weight: 800; text-decoration: none; }
.sh-breadcrumbs a:hover, .sh-breadcrumbs a:focus-visible { text-decoration: underline; }
.sh-breadcrumbs [aria-current="page"] { overflow: hidden; max-width: 42ch; color: var(--sh-copy); text-overflow: ellipsis; white-space: nowrap; }
body.sh-shell .sh-breadcrumbs-slot { width: min(var(--sh-width), calc(100% - 32px)); margin: 18px auto 0; }

/* 4. Header Search item (inline SVG: Elementor's underline pointer owns ::before/::after). */
body.sh-shell .elementor-location-header .sh-nav-search > a { display: inline-flex; align-items: center; gap: 6px; }
body.sh-shell .elementor-location-header .sh-nav-search-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
/* Tablet (768-1100px): keep the header on one row; Search becomes icon-only (accessible name stays "Search"). */
@media (min-width: 768px) and (max-width: 1100px) {
	body.sh-shell .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li > a.elementor-item { padding-left: 9px !important; padding-right: 9px !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--main { --e-nav-menu-horizontal-menu-item-margin: 2px; }
}
@media (min-width: 768px) and (max-width: 900px) {
	body.sh-shell .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li > a.elementor-item { padding-left: 6px !important; padding-right: 6px !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li:not(:last-child) { margin-right: 2px !important; margin-inline-end: 2px !important; }
	/* Logged in, "About Me" needs ~4px more than "Log In" at 768; tighten the dropdown arrows. */
	body.sh-shell .elementor-location-header .elementor-nav-menu--main .elementor-item .sub-arrow { margin-inline-start: 2px !important; margin-left: 2px !important; padding-left: 0 !important; padding-right: 0 !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--main .sh-nav-search-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Sprint 2026-10-04: with Support in the menu, the logged-in row ("About Me" is wider than "Log In") wrapped at
 * 768–800, 920, 1050–1080 and 1150–1200px. Logged in only (guests already fit): Search is icon-only below 1280px
 * (accessible name stays "Search") and items sit a little closer below 901px. */
@media (min-width: 901px) and (max-width: 1279px) {
	body.sh-shell.logged-in .elementor-location-header .elementor-nav-menu--main .sh-nav-search-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 768px) and (max-width: 900px) {
	body.sh-shell.logged-in .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li > a.elementor-item { padding-left: 4px !important; padding-right: 4px !important; }
	body.sh-shell.logged-in .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li:not(:last-child) { margin-right: 0 !important; margin-inline-end: 0 !important; }
}
/* Everyone: the menu's width grows with the viewport but its spacing jumps at 901 (padding 6→9px), 1025 (14→16px
 * type) and 1101px (desktop spacing), so the first ~50px after each jump overflowed by up to 51px. Soften those bands. */
@media (min-width: 901px) and (max-width: 959px) {
	body.sh-shell .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li > a.elementor-item { padding-left: 6px !important; padding-right: 6px !important; }
}
@media (min-width: 1025px) and (max-width: 1100px) {
	body.sh-shell .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li > a.elementor-item { padding-left: 5px !important; padding-right: 5px !important; }
}
@media (min-width: 1101px) and (max-width: 1149px) {
	/* The tablet look carries on to 1149px: 14px type and an icon-only Search (accessible name unchanged). */
	body.sh-shell .elementor-location-header .elementor-nav-menu--main > .elementor-nav-menu > li > a.elementor-item { font-size: 14px !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--main .sh-nav-search-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* 4b. Header dropdowns (≥768px). The global "menu polish" in style.css clips every
 * sub-menu (overflow:hidden), which hid SmartMenus' third-level flyout: the Religions
 * list opened invisibly beside Helpers, so the first click/tap/Enter seemed to do
 * nothing and the next one navigated. Sub-menus must never clip their own flyouts. */
body.sh-shell .elementor-location-header .elementor-nav-menu--main .elementor-nav-menu ul.sub-menu { overflow: visible; }
body.sh-shell .elementor-location-header .elementor-nav-menu--main ul.sub-menu a.elementor-sub-item { min-height: 44px; }

/* 5. Phone menu panel (Elementor dropdown <768px). A fixed panel inside the
 * viewport (the closed dropdown used to hang 8px past every phone page). Train,
 * Eat and the account menu list their links directly (`sh-nav-tools`, set by
 * inc/sneaky-nav.php), so every tool is Menu + one tap. Assess's tests stay on
 * the Assess hub. Helpers (every category) and Religions (every religion) are
 * `sh-nav-disclosable`: their links still go to their hubs and a separate button
 * (sneaky-shell.js) opens the list in place. Category groups read as headings. */
@media (max-width: 767px) {
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown.elementor-nav-menu__container {
		position: fixed !important;
		top: var(--sh-header-bottom, 64px) !important;
		left: 12px !important;
		right: 12px !important;
		width: auto !important;
		max-height: calc(100dvh - var(--sh-header-bottom, 64px) - 24px);
		overflow-y: auto;
		border: 1px solid var(--sh-line);
		border-radius: var(--sh-radius);
		background: #fff;
		box-shadow: var(--sh-shadow);
	}
	body.sh-shell .elementor-location-header nav.elementor-nav-menu--dropdown[aria-hidden="true"] { visibility: hidden; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown a.elementor-item,
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown a.elementor-sub-item {
		min-height: 48px;
		color: var(--sh-ink) !important;
		background: transparent !important;
		font-family: var(--sh-font-body) !important;
	}
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown a.elementor-item { font-weight: 900 !important; font-size: 17px !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown :is(.sh-nav-tools, .sh-nav-disclosable.sh-nav-open, .sh-nav-disclosable.sh-nav-open .sh-nav-group) > .sub-menu {
		display: block !important;
		position: static !important;
		width: auto !important;
		max-height: none !important;
		margin: 0 0 6px 14px !important;
		border-left: 2px solid var(--sh-line);
		border-radius: 0 !important;
		box-shadow: none !important;
		background: transparent !important;
	}
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown :is(.sh-nav-tools, .sh-nav-disclosable) > .sub-menu a.elementor-sub-item { font-size: 15px !important; font-weight: 800 !important; color: var(--sh-copy) !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown li.sh-nav-group > a.elementor-sub-item { min-height: 32px; padding-top: 12px !important; padding-bottom: 2px !important; color: var(--sh-muted) !important; font-size: 12px !important; letter-spacing: .04em; text-transform: uppercase; pointer-events: none; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown :is(.sh-nav-assess, .sh-nav-disclosable:not(.sh-nav-open)) > .sub-menu { display: none !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown .menu-item-has-children > a .sub-arrow { display: none !important; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown li.sh-nav-disclosable { position: relative; }
	body.sh-shell .elementor-location-header .elementor-nav-menu--dropdown li.sh-nav-disclosable > a { padding-right: 56px !important; }
	body.sh-shell .sh-nav-disclosure {
		position: absolute;
		top: 2px;
		right: 4px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid var(--sh-line);
		border-radius: var(--sh-radius-pill);
		background: #fff;
		color: var(--sh-ink);
		cursor: pointer;
	}
	body.sh-shell .sh-nav-disclosure::before { content: ""; width: 9px; height: 9px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }
	body.sh-shell .sh-nav-disclosure[aria-expanded="true"]::before { margin-top: 4px; transform: rotate(-135deg); }
}
.sh-nav-disclosure-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 6. Shell overflow (content-box widths wider than their parents). */
body.sh-shell.single-exercise .single-exercise-hub { width: min(var(--sh-width), 100%); }
body.sh-shell.single-food .single-food-after > :is(.rf-section-title, .rf-grid, .google-login-wrap, div, section) { box-sizing: border-box; max-width: min(960px, 100%); }
body.sh-shell.woocommerce-account .woocommerce-form-login,
body.sh-shell.woocommerce-account .woocommerce-form-register { box-sizing: border-box; max-width: 100%; }
body.sh-shell .sh-powered-strip-sites a { box-sizing: border-box; max-width: 100%; }
/* The product shell: Hello's main has inline padding, so a 100% width must be border-box. */
body.sh-shell :is(main#content, main#main).site-main { box-sizing: border-box; }
body.sh-shell .fl-table-wrap { max-width: 100%; overflow-x: auto; }
/* Food: the related sections are a one-column grid whose implicit auto track grew to the
 * legacy foods table's min-content (~680px on phones). Pin the track; the table scrolls in place. */
body.sh-shell.single-food .single-food-after { grid-template-columns: minmax(0, 1fr) !important; }
body.sh-shell.single-food .single-food-after > [class*="food-listing"] { overflow-x: auto; }
/* Helpers legacy category carousel: slick's negative right margin pushed phones 3px (and ~930px tablets 2px) wide. */
@media (max-width: 1100px) { body.sh-shell #ai-categories .slick-list { margin-right: 0 !important; } body.sh-shell #ai-categories.slick-slider { overflow-x: clip; } }
@media (max-width: 767px) { body.sh-shell #ai-categories .slick-list { margin-right: 0 !important; } body.sh-shell #ai-categories.slick-slider { overflow-x: clip; } body.sh-shell #ai-categories .slick-prev { left: 0 !important; } body.sh-shell #ai-categories .slick-next { right: 0 !important; } }
/* One floating action: Connections opens from the account menu instead of its own pill. */
body.sh-shell .rcon-sitewide-button.rcon-floating-button { display: none !important; }
