/* =====================================================================
   Pranishth — 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 {
	--primary-color: #2563eb;
	--heading-color: #111827;
	--text-color: #374151;
	--border-color: #e5e7eb;
}

/* ---------------------------------------------------------------
   2. Mobile navigation ([data-sp-toggle] toggles `.is-open`)
   --------------------------------------------------------------- */
@media (max-width: 991.98px) {
	.primary-nav:not(.is-open) {
		display: none;
	}
	.primary-nav.is-open {
		display: block;
	}
}

/* Submenus: MenuHelper adds a .submenu-toggle button to each top-level
   primary item with children. Closed by default in the mobile drawer;
   a dropdown on hover, focus or toggle at desktop widths. */
.primary-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.primary-nav .menu-item-has-children {
	position: relative;
}
.submenu-toggle {
	background: none;
	border: 0;
	padding: .5rem;
	color: inherit;
	line-height: 1;
}
.submenu-toggle::after {
	content: "";
	display: inline-block;
	width: .5em;
	height: .5em;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: translateY(-25%) rotate(45deg);
	transition: transform .2s ease;
}
.menu-item-has-children.is-open > .submenu-toggle::after {
	transform: translateY(25%) rotate(-135deg);
}
.menu-item-has-children:not(.is-open) > .sub-menu {
	display: none;
}
@media (min-width: 992px) {
	.primary-nav .menu-item-has-children {
		display: flex;
		align-items: center;
	}
	.primary-nav .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 1000;
		min-width: 12rem;
		padding: .5rem 0;
		background: var(--bs-body-bg, #fff);
		border: 1px solid var(--border-color);
	}
	.primary-nav .menu-item-has-children:hover > .sub-menu,
	.primary-nav .menu-item-has-children:focus-within > .sub-menu {
		display: block;
	}
}

/* A sticky or fixed #site-header publishes --nav-height (global.js), so
   anchor jumps land below it instead of underneath. */
html {
	scroll-padding-top: var(--nav-height, 0px);
}

/* Media Library logos may include a complete wordmark, rather than a square icon. */
img.pg-brand-logo {
	width: auto;
	height: auto;
	max-width: 96px;
	max-height: 32px;
	object-fit: contain;
	flex-shrink: 0;
}
img.pg-brand-logo--footer { max-height: 28px; }
img.pg-brand-logo--header.pg-brand-logo--standalone {
	width: clamp(110px, 38vw, 152px);
	max-width: none;
	max-height: 56px;
}
img.pg-brand-logo--footer.pg-brand-logo--standalone {
	width: 220px;
	max-width: 100%;
	max-height: none;
}
@media (min-width: 640px) {
	img.pg-brand-logo--header { max-height: 36px; }
	img.pg-brand-logo--header.pg-brand-logo--standalone {
		width: 172px;
		max-height: 64px;
	}
}

/* ---------------------------------------------------------------
   3. Scroll-reveal animations ([data-animate])
   --------------------------------------------------------------- */
/* The hidden state carries no transition. Declared here, adding `aos-ready`
   animated the first screen TOWARD hidden, and the reveal then reversed a fade
   that had barely started. It belongs on .is-visible, where it runs from
   hidden to visible. */
.aos-ready [data-animate] {
	opacity: 0;
	transform: translateY(24px);
}
.aos-ready [data-animate="fade-left"]  { transform: translateX(-24px); }
.aos-ready [data-animate="fade-right"] { transform: translateX(24px); }
.aos-ready [data-animate="zoom"]       { transform: scale(.94); }
.aos-ready [data-animate="fade"]       { transform: none; }
.aos-ready [data-animate].is-visible {
	opacity: 1;
	transform: none;
	transition: opacity .6s ease, transform .6s ease;
}

/* ---------------------------------------------------------------
   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: rgba(17, 24, 39, .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: rgba(255, 255, 255, .82);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	backdrop-filter: blur(20px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(17, 24, 39, .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 var(--border-color);
	/* Magnifier glyph 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='%236b7280' 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;
	padding: .75rem .5rem .75rem 2rem;
	font-size: 1.1rem;
	color: var(--text-color);
	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;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--text-color);
	opacity: .7;
}
.search-form__close:hover, .search-form__close:focus-visible { 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; }
.search-result__type { font-size: .8rem; color: var(--text-color); }
body.search-open { overflow: hidden; }

/* ---------------------------------------------------------------
   5. Components (template-parts/components/*). Structural defaults
      only; restyle freely. Kept here, not in a page stylesheet,
      because a component is used on more than one page.
   --------------------------------------------------------------- */
.text-accent { color: var(--primary-color); }
.eyebrow {
	display: inline-block;
	margin-bottom: .5rem;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--primary-color);
}

.stars { display: inline-flex; gap: 2px; color: #f5a623; }
.stars__star { fill: currentColor; }
.stars__star--empty { opacity: .25; }

.snackbar {
	position: fixed;
	inset-inline: 0;
	bottom: 1.5rem;
	z-index: 1090;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .5rem;
	pointer-events: none;
}
.snackbar__item {
	padding: .75rem 1.25rem;
	border-radius: .5rem;
	color: #fff;
	background: #111827;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease;
}
.snackbar__item--error { background: #b91c1c; }
.snackbar__item.is-visible { opacity: 1; transform: none; }

details[data-accordion] > summary { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
	.snackbar__item,
	.submenu-toggle::after { transition: none; }
}
