/* =====================================================================
   StackPress — global.css
   Design tokens + base styles. Loaded on every page (after Bootstrap).
   Add your project's reusable components and tokens here. The few rules
   below only support the bundled JS behaviours (nav toggle, scroll
   reveal, search overlay) — delete or restyle freely.
   ===================================================================== */

/* ---------------------------------------------------------------
   1. Design Tokens — define your palette / type scale here.
   --------------------------------------------------------------- */
:root {
	/* Aliased onto the project palette (tokens.css) so the boilerplate's own
	   components — search overlay, scroll reveal — inherit Walnut & Brass
	   instead of the starter blue. Real tokens live in tokens.css. */
	--primary-color: var(--brass-ink);
	--heading-color: var(--walnut);
	--text-color: var(--ink);
	--border-color: var(--rule);
}

/* ---------------------------------------------------------------
   2. Mobile navigation ([data-sp-toggle] toggles `.is-open`)
   Breakpoint matches the navbar's own `navbar-expand-xl` (1200px). At
   lg (991.98px) the toggler showed from 0-1199px but the panel only
   opened below 992px, leaving the hamburger dead across 992-1199px.
   --------------------------------------------------------------- */
@media (max-width: 1199.98px) {
	.primary-nav:not(.is-open) {
		display: none;
	}
	.primary-nav.is-open {
		display: block;
	}
}

/* ---------------------------------------------------------------
   3. Scroll reveal — motion-kit tuning
   Configured in global.js (Motion.init). The library staggers every
   member of one selector group by its index, which suits a row of
   cards but not page sections: they reveal one at a time as you
   scroll, so the eighth section on a page would wait 490ms after it
   arrives. No stagger for them. Keep this comment free of apostrophes,
   see the motion-kit README (doiuse stops parsing at the first one).
   --------------------------------------------------------------- */
.py-section > [data-reveal],
.sp-footer__main[data-reveal] {
	--mk-stagger: 0ms;
}

/* ---------------------------------------------------------------
   4. Header live-search overlay (rendered by SearchService)
   --------------------------------------------------------------- */
.search-overlay {
	position: fixed;
	inset: 0;
	z-index: 1080;
	/* Algolia-style: dim + blur what's behind the modal. */
	background: rgb(28 22 20 / 0.45);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 1rem 1rem;
	opacity: 0;
	transition: opacity .2s ease;
}
.search-overlay.is-open { opacity: 1; }
.search-overlay.is-open .search-panel { transform: none; }
.search-overlay[hidden] { display: none; }
.search-panel {
	width: 100%;
	max-width: 40rem;
	/* Translucent frosted card floating over the blurred backdrop. */
	background: rgb(250 246 239 / 0.82);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	backdrop-filter: blur(20px) saturate(180%);
	border: 1px solid rgb(255 255 255 / 0.5);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgb(28 22 20 / 0.35);
	overflow: hidden;
	transform: translateY(-8px);
	transition: transform .2s ease;
}
.search-panel .container { max-width: none; padding: 0; }
.search-form {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem .75rem .35rem 1rem;
	border-bottom: 1px solid rgb(28 22 20 / 0.1);
	/* Magnifier glyph, brass-toned, sized to the input. */
	background:
		no-repeat 1rem center / 20px 20px
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a67c33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}
.search-form__input {
	flex: 1;
	min-height: var(--tap-min);
	padding: 0.75rem 0.5rem 0.75rem 2rem;
	font-size: 1.1rem;
	color: var(--body);
	background: transparent;
	border: 0;
	border-radius: 0;
}
.search-form__input:focus,
.search-form__input:focus-visible { outline: none; box-shadow: none; }
.search-form__close {
	flex: none;
	color: var(--walnut);
	font-size: 1.5rem;
	line-height: 1;
	opacity: .7;
}
.search-form__close:hover, .search-form__close:focus-visible { color: var(--brass-ink); opacity: 1; }
.search-results:not(:empty) { padding: .5rem 1rem 1rem; max-height: 60vh; overflow-y: auto; }
.search-result { display: block; padding: .5rem 0; border-bottom: 1px solid var(--border-color); text-decoration: none; color: var(--heading-color); }
.search-result:hover, .search-result:focus-visible { color: var(--brass-ink); }
.search-result__type { font-size: .8rem; color: var(--brass-ink); }
body.search-open { overflow: hidden; }
