/**
 * FRDP PK — the site header.
 *
 * A floating capsule rather than a bar across the page: the logo sits on a
 * purple block of its own with an angled edge, the menu and the icons in the
 * middle, and Donate on a red block with the same edge at the other end.
 *
 * On the home page the header floats over the purple hero as glass, with a
 * thin line of contact details above it. Once the page is scrolled — and on
 * every other page from the start — the capsule turns solid white. Scrolling
 * on down tucks it away; the first move back up brings it back.
 *
 * The header is fixed, so tightening it never moves the page under it. Pages
 * keep its height free at the top (--hdr-h, measured by header.js); the home
 * page lets the hero run up underneath instead.
 *
 * Below 1200px the menu moves into a panel that slides in from the right.
 */

:root {
	--color-frdp-purple: #50155b;
	--color-frdp-light: #f7f1f9;
	--color-accent-red: #d90429;
	--color-text-title: #1e1b24;
	--color-text-muted: #5e5868;
	--border-soft: #ede6f2;
	--shadow-menu: 0 25px 60px rgba(50, 10, 60, 0.16), 0 8px 20px rgba(0, 0, 0, 0.04);

	--hdr-h: 116px;          /* the full header, measured by header.js */
	--hdr-cap: 66px;         /* the capsule itself */
	--hdr-radius: 22px;
	--hdr-cut: 22px;         /* the angle on the brand and Donate blocks */
	--hdr-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body { padding-top: var(--hdr-h); }

/* The home page's hero runs up under the header instead. */
body.home { padding-top: 0; }

/* =========================================================
   THE SHELL
   ========================================================= */
#site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1030;
	transition: transform 0.4s var(--hdr-ease), background-color 0.35s ease;
}

/* The admin bar is fixed over the top of the page. */
body.admin-bar #site-header { top: 32px; }

@media (max-width: 782px) {
	body.admin-bar #site-header { top: 46px; }
}

/* On an ordinary page, before scrolling, the header sits on the same soft
   tint the pages open with, so it reads as part of the page. */
#site-header:not(.site-header--over):not(.is-stuck) { background: #f8f4fd; }

#site-header.is-tucked { transform: translateY(calc(-100% - 12px)); }

/* While the script measures the header: a size read mid-transition would set
   the thresholds wrong for as long as the page is open. */
#site-header.is-measuring,
#site-header.is-measuring * { transition: none !important; }

/* =========================================================
   THE CONTACT LINE
   ========================================================= */
.topbar {
	overflow: hidden;
	max-height: 60px;
	padding: 8px 0 0;
	font-size: 12.5px;
	transition: max-height 0.35s var(--hdr-ease), padding 0.35s var(--hdr-ease), opacity 0.25s ease;
}

.topbar__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 34px;
}

.topbar-contact { display: flex; flex-wrap: wrap; align-items: center; }

.topbar-contact a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--color-text-muted);
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s ease;
}

.topbar-contact a:hover { color: var(--color-frdp-purple); }
.topbar-contact i { color: var(--color-frdp-purple); font-size: 13px; }
.topbar-divider { margin: 0 14px; color: #cfc4d9; }

.topbar-socials { display: flex; align-items: center; gap: 6px; }

.topbar-socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(80, 21, 91, 0.08);
	color: var(--color-frdp-purple);
	font-size: 12px;
	text-decoration: none;
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.topbar-socials a:hover { background: var(--color-frdp-purple); color: #ffffff; transform: translateY(-1px); }

/* Over the purple hero the line is white. */
.site-header--over .topbar-contact a { color: rgba(255, 255, 255, 0.88); }
.site-header--over .topbar-contact a:hover { color: #ffffff; }
.site-header--over .topbar-contact i { color: #f2c14e; }
.site-header--over .topbar-divider { color: rgba(255, 255, 255, 0.3); }
.site-header--over .topbar-socials a { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.site-header--over .topbar-socials a:hover { background: #ffffff; color: var(--color-frdp-purple); }

#site-header.is-stuck .topbar {
	max-height: 0;
	padding-top: 0;
	opacity: 0;
}

/* =========================================================
   THE CAPSULE
   ========================================================= */
.header-main {
	position: relative;          /* the search card hangs from this */
	max-width: 1440px;
	margin: 0 auto;
	padding: 10px 20px;
	transition: padding 0.35s var(--hdr-ease);
}

#site-header.is-stuck .header-main { padding: 8px 20px; }

.hdr-capsule {
	position: relative;          /* the mega menu centres on this */
	isolation: isolate;
	display: flex;
	align-items: stretch;
	height: var(--hdr-cap);
	border: 1px solid var(--border-soft);
	border-radius: var(--hdr-radius);
	box-shadow: 0 14px 40px -18px rgba(50, 10, 60, 0.28);
	transition: height 0.35s var(--hdr-ease), border-color 0.35s ease, box-shadow 0.35s ease;
}

/* The fill lives on a layer of its own. A blur on the capsule itself would
   make it the frame for the fixed-position menu panel inside it, and the panel
   would open inside the capsule instead of over the page. */
.hdr-capsule::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: blur(16px) saturate(1.4);
	backdrop-filter: blur(16px) saturate(1.4);
	transition: background-color 0.35s ease;
}

#site-header.is-stuck { --hdr-cap: 58px; }

#site-header.is-stuck .hdr-capsule { box-shadow: 0 16px 44px -14px rgba(50, 10, 60, 0.32); }

/* --- as glass, over the hero --- */
.site-header--over:not(.is-stuck) .hdr-capsule {
	border-color: rgba(255, 255, 255, 0.22);
	box-shadow: 0 20px 50px -20px rgba(10, 0, 25, 0.6);
}

.site-header--over:not(.is-stuck) .hdr-capsule::before { background: rgba(255, 255, 255, 0.1); }

/* =========================================================
   THE BRAND BLOCK — the white logo on purple, angled edge
   ========================================================= */
.hdr-brand {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	margin: -1px 0 -1px -1px;    /* flush with the capsule's edge */
	padding: 0 calc(var(--hdr-cut) + 20px) 0 22px;
	border-radius: var(--hdr-radius) 0 0 var(--hdr-radius);
	background: linear-gradient(120deg, #2e0a4d 0%, #50155b 55%, #6b2596 100%);
	clip-path: polygon(0 0, 100% 0, calc(100% - var(--hdr-cut)) 100%, 0 100%);
	text-decoration: none;
	transition: filter 0.25s ease;
}

.hdr-brand:hover { filter: brightness(1.12); }
.hdr-brand:focus-visible { outline: 3px solid #f2c14e; outline-offset: -4px; }

.hdr-brand__logo {
	display: block;
	width: auto;
	height: 44px;
	transition: height 0.35s var(--hdr-ease);
}

#site-header.is-stuck .hdr-brand__logo { height: 38px; }

/* =========================================================
   THE MENU AND THE ICONS
   ========================================================= */
.header-nav.navbar {
	position: static;            /* so the mega menu centres on the capsule */
	flex: 1 1 auto;
	align-self: stretch;
	align-items: stretch;
	min-width: 0;
	padding: 0;
}

.header-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	padding: 0 12px 0 10px;
}

.hdr-icon-btn,
.cart-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1.5px solid var(--border-soft);
	border-radius: 50%;
	background: #ffffff;
	color: var(--color-frdp-purple);
	font-size: 16.5px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.hdr-icon-btn:hover,
.cart-btn:hover,
.hdr-icon-btn[aria-expanded="true"] {
	border-color: var(--color-frdp-purple);
	background: var(--color-frdp-light);
	color: var(--color-frdp-purple);
}

.hdr-icon-btn:focus-visible,
.cart-btn:focus-visible { outline: 3px solid rgba(80, 21, 91, 0.28); outline-offset: 2px; }

.site-header--over:not(.is-stuck) .hdr-icon-btn,
.site-header--over:not(.is-stuck) .cart-btn {
	border-color: rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.08);
	color: #ffffff;
}

.site-header--over:not(.is-stuck) .hdr-icon-btn:hover,
.site-header--over:not(.is-stuck) .cart-btn:hover,
.site-header--over:not(.is-stuck) .hdr-icon-btn[aria-expanded="true"] {
	border-color: #ffffff;
	background: #ffffff;
	color: var(--color-frdp-purple);
}

/* The search button turns into the way to close the card it opened. */
/* Signed in: a small green dot on the person. */
.hdr-account { position: relative; }
.hdr-account.is-in::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #17935c;
}

.hdr-icon-btn .bi-x-lg { display: none; font-size: 15px; }
.hdr-icon-btn[aria-expanded="true"] .bi-search { display: none; }
.hdr-icon-btn[aria-expanded="true"] .bi-x-lg { display: inline-block; }

/* The cart: a bag with a count on its shoulder once anything is in it. The
   total stays in the markup, for the script and for screen readers. */
.cart-btn__count {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border: 2px solid #ffffff;
	border-radius: 20px;
	background: var(--color-accent-red);
	color: #ffffff;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
}

.cart-btn__amount {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.cart-btn:not(.has-items) .cart-btn__count { display: none; }

/* --- Donate: a red block closing the capsule, the brand block's angle mirrored --- */
.donate-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	background: linear-gradient(135deg, #e0112f 0%, #b8001f 100%);
	color: #ffffff !important;
	font-size: 14.5px;
	font-weight: 700;
	letter-spacing: 0.2px;
	white-space: nowrap;
	transition: filter 0.25s ease;
}

.donate-btn:hover { filter: brightness(1.1); color: #ffffff !important; }

.hdr-donate {
	flex: 0 0 auto;
	margin: -1px -1px -1px 0;
	padding: 0 26px 0 calc(var(--hdr-cut) + 20px);
	border-radius: 0 var(--hdr-radius) var(--hdr-radius) 0;
	clip-path: polygon(var(--hdr-cut) 0, 100% 0, 100% 100%, 0 100%);
}

.hdr-donate:focus-visible { outline: 3px solid #f2c14e; outline-offset: -4px; }

.donate-btn i {
	font-size: 13px;
	animation: pulseHeart 1.6s infinite ease-in-out;
}

@keyframes pulseHeart {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.28); }
}

/* --- the menu toggle, for the sliding panel --- */
.navbar-toggler {
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1.5px solid var(--border-soft);
	border-radius: 12px;
	background: #ffffff;
}

.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(80, 21, 91, 0.15); }

/* Bootstrap only defines this icon inside .navbar; the toggler sits outside. */
.navbar-toggler-icon {
	width: 22px;
	height: 22px;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2350155b' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-header--over:not(.is-stuck) .navbar-toggler { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); }
.site-header--over:not(.is-stuck) .navbar-toggler-icon {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* =========================================================
   THE MENU, ON A WIDE SCREEN (1200px and up)
   ========================================================= */
@media (min-width: 1200px) {
	.header-nav .offcanvas-body {
		flex-grow: 1;
		justify-content: center;
		/* If the items ever outgrow the room, they run out to the right —
		   never left, under the brand block's angled edge. */
		justify-content: safe center;
		height: 100%;
	}

	.header-nav .navbar-nav {
		align-items: stretch;
		gap: 0;
		height: 100%;
	}

	.header-nav .nav-item { position: relative; display: flex; }

	.header-nav .navbar-nav > .nav-item > .nav-link {
		position: relative;
		display: flex;
		align-items: center;
		gap: 4px;
		height: 100%;
		padding: 0 10px !important;   /* 10, not 11: room for the account button */
		color: var(--color-text-title) !important;
		font-size: 14.5px;
		font-weight: 600;
		line-height: 1.2;
		white-space: nowrap;
		background: transparent !important;
		transition: color 0.25s ease;
	}

	/* A short bar under the item the reader is in. */
	.header-nav .navbar-nav > .nav-item > .nav-link::before {
		content: "";
		position: absolute;
		left: 50%;
		bottom: 12px;
		width: 18px;
		height: 3px;
		margin-left: -9px;
		border-radius: 3px;
		background: linear-gradient(90deg, var(--color-frdp-purple), var(--color-accent-red));
		transform: scaleX(0);
		transition: transform 0.3s var(--hdr-ease);
	}

	#site-header.is-stuck .header-nav .navbar-nav > .nav-item > .nav-link::before { bottom: 9px; }

	.header-nav .nav-item:hover > .nav-link::before,
	.header-nav .nav-item.show > .nav-link::before,
	.header-nav .nav-item.current-menu-item > .nav-link::before,
	.header-nav .nav-item.current-menu-ancestor > .nav-link::before { transform: scaleX(1); }

	.header-nav .nav-item:hover > .nav-link,
	.header-nav .nav-item.show > .nav-link,
	.header-nav .nav-item.current-menu-item > .nav-link,
	.header-nav .nav-item.current-menu-ancestor > .nav-link { color: var(--color-frdp-purple) !important; }

	/* Over the hero the menu is white, its bar gold. */
	.site-header--over:not(.is-stuck) .header-nav .navbar-nav > .nav-item > .nav-link { color: rgba(255, 255, 255, 0.92) !important; }

	.site-header--over:not(.is-stuck) .header-nav .nav-item:hover > .nav-link,
	.site-header--over:not(.is-stuck) .header-nav .nav-item.show > .nav-link,
	.site-header--over:not(.is-stuck) .header-nav .nav-item.current-menu-item > .nav-link { color: #ffffff !important; }

	.site-header--over:not(.is-stuck) .header-nav .navbar-nav > .nav-item > .nav-link::before {
		background: linear-gradient(90deg, #f2c14e, #ff8fb1);
	}

	.header-nav .dropdown-toggle::after { margin-left: 2px; transition: transform 0.25s ease; }

	.header-nav .nav-item:hover > .dropdown-toggle::after,
	.header-nav .nav-item.show > .dropdown-toggle::after { transform: rotate(180deg); }
}

/* The type steps down before anything is allowed to wrap. */
@media (min-width: 1200px) and (max-width: 1439.98px) {
	.header-main { padding-left: 14px; padding-right: 14px; }
	#site-header.is-stuck .header-main { padding-left: 14px; padding-right: 14px; }
	.topbar__row { padding: 0 26px; }
	.hdr-brand { padding: 0 calc(var(--hdr-cut) + 14px) 0 18px; }
	.hdr-brand__logo { height: 40px; }
	.header-nav .navbar-nav > .nav-item > .nav-link { padding: 0 9px !important; font-size: 13.5px; }
	.header-actions { gap: 6px; padding-right: 8px; }
	.hdr-donate { padding: 0 20px 0 calc(var(--hdr-cut) + 14px); font-size: 14px; }
}

@media (min-width: 1200px) and (max-width: 1339.98px) {
	.hdr-brand__logo { height: 36px; }
	.header-nav .navbar-nav > .nav-item > .nav-link { padding: 0 7px !important; font-size: 13px; }
	.donate-btn__now { display: none; }
}

/* =========================================================
   DROPDOWNS
   ========================================================= */
.header-nav .dropdown-menu {
	margin: 0;
	padding: 8px;
	min-width: 268px;
	overflow: hidden;
	border: 1px solid var(--border-soft);
	border-radius: 16px;
	background: #ffffff;
	box-shadow: var(--shadow-menu);
}

.dropdown-menu__label {
	display: block;
	margin-bottom: 4px;
	padding: 8px 14px 10px;
	border-bottom: 1px solid var(--border-soft);
	color: var(--color-text-muted);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 1.4px;
	list-style: none;
	text-transform: uppercase;
}

.header-nav .dropdown-menu .dropdown-item {
	position: relative;
	display: block;
	padding: 10px 14px 10px 20px;
	border-radius: 10px;
	color: var(--color-text-title);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.45;
	white-space: normal;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.header-nav .dropdown-menu .dropdown-item::before {
	content: "";
	position: absolute;
	left: 8px;
	top: 50%;
	width: 3px;
	height: 60%;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--color-frdp-purple), var(--color-accent-red));
	transform: translateY(-50%) scaleY(0);
	transition: transform 0.22s var(--hdr-ease);
}

.header-nav .dropdown-menu .dropdown-item:hover,
.header-nav .dropdown-menu .dropdown-item:focus-visible {
	background-color: var(--color-frdp-light);
	color: var(--color-frdp-purple);
}

.header-nav .dropdown-menu .dropdown-item:hover::before,
.header-nav .dropdown-menu .dropdown-item:focus-visible::before { transform: translateY(-50%) scaleY(1); }

.dropdown-mega .dropdown-menu .dropdown-item::before { content: none; }
.dropdown-mega .dropdown-menu { overflow: visible; }

@media (min-width: 1200px) {
	/* The panels drop a little below the capsule. This bridge keeps the pointer
	   on the item while it crosses the gap. */
	.header-nav .nav-item.dropdown:hover::after {
		content: "";
		position: absolute;
		left: -10px;
		right: -10px;
		top: 100%;
		height: 16px;
	}

	.header-nav .nav-item.dropdown:not(.dropdown-mega) > .dropdown-menu {
		position: absolute;
		top: calc(100% + 10px);
		left: 0;
		display: block;
		opacity: 0;
		visibility: hidden;
		transform: translateY(12px);
		transition: opacity 0.25s var(--hdr-ease), transform 0.25s var(--hdr-ease), visibility 0.25s ease;
	}

	.header-nav .nav-item.dropdown:not(.dropdown-mega):hover > .dropdown-menu,
	.header-nav .nav-item.dropdown:not(.dropdown-mega) > .dropdown-menu.show {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.header-nav .nav-item.dropdown:not(.dropdown-mega):nth-last-child(-n+2) > .dropdown-menu {
		left: auto;
		right: 0;
	}

	.header-nav .nav-item.dropdown:not(.dropdown-mega) > .dropdown-menu--wide {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2px 6px;
		align-content: start;
		min-width: 520px;
	}

	.header-nav .dropdown-menu--wide .dropdown-menu__label { grid-column: 1 / -1; }

	/* --- the mega menu: the programs in three columns, under the capsule --- */
	.navbar-nav .dropdown-mega { position: static !important; }

	.dropdown-mega .dropdown-menu {
		position: absolute;
		top: calc(100% + 10px);
		left: 50%;
		right: auto;
		width: min(940px, calc(100vw - 60px));
		margin: 0;
		padding: 22px 24px 18px;
		list-style: none;
		border: 1px solid var(--border-soft);
		border-radius: 18px;
		background: #ffffff;
		box-shadow: var(--shadow-menu);
		transform: translateX(-50%) translateY(18px) scale(0.985);
		display: none;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.28s var(--hdr-ease), transform 0.28s var(--hdr-ease), visibility 0.28s ease;
	}

	.dropdown-mega:hover .dropdown-menu,
	.dropdown-mega .dropdown-menu.show {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px 12px;
		opacity: 1;
		visibility: visible;
		transform: translateX(-50%) translateY(0) scale(1);
	}

	/* The mega item is static, so its bridge spans the capsule's bottom edge. */
	.navbar-nav .dropdown-mega:hover::after {
		left: 0;
		right: 0;
		top: auto;
		bottom: -16px;
		height: 20px;
	}
}

.dropdown-mega .dropdown-menu::before {
	content: "EXPLORE OUR CORE PROGRAMS";
	display: block;
	grid-column: 1 / -1;
	margin-bottom: 4px;
	padding-bottom: 11px;
	border-bottom: 1px solid var(--border-soft);
	color: var(--color-text-muted);
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 1.4px;
}

.dropdown-mega .dropdown-menu li { list-style: none; }

.dropdown-mega .dropdown-menu .dropdown-item {
	display: flex !important;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: 12px;
	background: transparent;
	color: var(--color-text-title);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	white-space: normal;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dropdown-mega .dropdown-menu .dropdown-item:hover,
.dropdown-mega .dropdown-menu .dropdown-item:focus-visible {
	border-color: var(--border-soft);
	background-color: var(--color-frdp-light);
	color: var(--color-frdp-purple);
}

.frdp-mega-label { flex: 1; }

.frdp-icon-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	min-width: 36px;
	height: 36px;
	border-radius: 10px;
	font-size: 16px;
	transition: transform 0.2s ease;
}

.dropdown-mega .dropdown-menu .dropdown-item:hover .frdp-icon-box { transform: scale(1.08); }

.frdp-ico-water     { background: #e0f2fe; color: #0284c7; }
.frdp-ico-food      { background: #fef3c7; color: #d97706; }
.frdp-ico-emergency { background: #fee2e2; color: #dc2626; }
.frdp-ico-edu       { background: #e0e7ff; color: #4f46e5; }
.frdp-ico-women     { background: #fce7f3; color: #db2777; }
.frdp-ico-community { background: #ccfbf1; color: #0d9488; }
.frdp-ico-climate   { background: #dcfce7; color: #16a34a; }
.frdp-ico-gov       { background: #ede9fe; color: var(--color-frdp-purple); }

.dropdown-mega .dropdown-menu::after {
	content: "View All Programs & Activities \2192";
	grid-column: 1 / -1;
	margin-top: 6px;
	padding-top: 13px;
	border-top: 1px solid var(--border-soft);
	color: var(--color-frdp-purple);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

/* =========================================================
   SEARCH — a card that drops from under the capsule
   ========================================================= */
.site-search {
	position: absolute;
	top: calc(100% - 2px);
	left: 20px;
	right: 20px;
	z-index: 5;
	padding: 24px 0 22px;
	border: 1px solid var(--border-soft);
	border-radius: 20px;
	background: #ffffff;
	box-shadow: 0 30px 60px -24px rgba(50, 10, 60, 0.4);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	clip-path: inset(0 0 100% 0 round 20px);
	transition: clip-path 0.45s var(--hdr-ease), transform 0.45s var(--hdr-ease), opacity 0.3s ease, visibility 0.45s ease;
}

.site-search.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	clip-path: inset(0 0 -40px 0 round 20px);
}

.site-search__inner {
	max-width: 860px;
	margin: 0 auto;
	padding: 0 24px;
}

.site-search__form {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 60px;
	padding: 0 8px 0 22px;
	border: 2px solid var(--border-soft);
	border-radius: 60px;
	background: #fbf9fc;
	transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.site-search__form:focus-within {
	border-color: var(--color-frdp-purple);
	background: #ffffff;
	box-shadow: 0 0 0 5px rgba(80, 21, 91, 0.1);
}

.site-search__form > i { color: var(--color-frdp-purple); font-size: 19px; }

.site-search__form input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--color-text-title);
	font: inherit;
	font-size: 17px;
}

.site-search__form input::placeholder { color: #9a94a3; }
.site-search__form input:focus { outline: none; }
.site-search__form input::-webkit-search-cancel-button { display: none; }

.site-search__form button {
	flex-shrink: 0;
	height: 44px;
	padding: 0 24px;
	border: 0;
	border-radius: 44px;
	background: var(--color-frdp-purple);
	color: #ffffff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease;
}

.site-search__form button:hover { background: #6a1f78; }

.site-search__hints {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 16px 0 0;
	padding: 0 6px;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.35s ease 0.08s, transform 0.45s var(--hdr-ease) 0.08s;
}

.site-search.is-open .site-search__hints { opacity: 1; transform: translateY(0); }

.site-search__hints > span:first-child {
	margin-right: 4px;
	color: var(--color-text-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.site-search__hints a {
	padding: 6px 14px;
	border: 1px solid var(--border-soft);
	border-radius: 30px;
	background: #ffffff;
	color: var(--color-text-title);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.site-search__hints a:hover { border-color: var(--color-frdp-purple); background: var(--color-frdp-light); color: var(--color-frdp-purple); }

.site-search__esc { flex-shrink: 0; color: #9a94a3; font-size: 12px; }
.site-search__esc kbd {
	padding: 2px 6px;
	border: 1px solid var(--border-soft);
	border-radius: 5px;
	background: #fbf9fc;
	color: var(--color-text-muted);
	font-family: inherit;
	font-size: 11px;
}

/* The page dims behind the open search card or the sliding menu. */
.site-search-scrim {
	position: fixed;
	inset: 0;
	z-index: 1020;
	background: rgba(24, 6, 38, 0.4);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.site-search-scrim.is-open { opacity: 1; visibility: visible; }

/* =========================================================
   BELOW 1200px — the menu slides in from the right
   ========================================================= */
.offcanvas-foot { display: none; }

@media (max-width: 1199.98px) {
	:root { --hdr-cap: 60px; }
	#site-header.is-stuck { --hdr-cap: 56px; }

	.header-main { padding: 8px 14px; }
	#site-header.is-stuck .header-main { padding: 6px 14px; }

	/* The menu leaves the capsule, so the icons move over to the right. */
	.header-nav.navbar { flex: 0 0 0; }
	.header-actions { margin-left: auto; }

	.hdr-brand__logo { height: 38px; }
	#site-header.is-stuck .hdr-brand__logo { height: 34px; }

	.header-nav .offcanvas {
		--bs-offcanvas-width: min(380px, 88vw);
		border-left: 0;
		box-shadow: -20px 0 60px rgba(30, 8, 45, 0.25);
	}

	.header-nav .offcanvas-header {
		padding: 18px 20px;
		border-bottom: 1px solid var(--border-soft);
	}

	.header-nav .offcanvas-header .custom-logo { width: auto; height: 38px; }

	.header-nav .offcanvas-body {
		display: flex;
		flex-direction: column;
		padding: 8px 20px 24px;
	}

	.header-nav .navbar-nav { gap: 0; }
	.header-nav .nav-item { display: block; }

	.header-nav .navbar-nav > .nav-item > .nav-link {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 4px !important;
		border-bottom: 1px solid var(--border-soft);
		color: var(--color-text-title) !important;
		font-size: 15px;
		font-weight: 600;
	}

	.header-nav .nav-item.show > .nav-link,
	.header-nav .nav-item.current-menu-item > .nav-link { color: var(--color-frdp-purple) !important; }

	.header-nav .dropdown-menu,
	.dropdown-mega .dropdown-menu {
		display: none;
		position: static;
		width: 100%;
		margin: 0;
		padding: 4px 0 10px 10px;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		transform: none;
	}

	.header-nav .dropdown-menu.show,
	.dropdown-mega .dropdown-menu.show { display: block; }

	.dropdown-mega .dropdown-menu::before,
	.dropdown-mega .dropdown-menu::after { display: none; }

	.dropdown-mega .dropdown-menu .dropdown-item { padding: 9px 6px; }
	.dropdown-menu__label { display: none; }

	/* What the contact line carries, for a phone that has no line. */
	.offcanvas-foot {
		display: block;
		margin-top: auto;
		padding-top: 22px;
	}

	.offcanvas-foot .donate-btn { width: 100%; height: 50px; border-radius: 50px; }

	.offcanvas-foot__contact {
		display: grid;
		gap: 8px;
		margin: 18px 0 14px;
		font-size: 14px;
	}

	.offcanvas-foot__contact a { color: var(--color-text-title); text-decoration: none; }
	.offcanvas-foot__contact i { width: 20px; color: var(--color-frdp-purple); }

	.offcanvas-foot .topbar-socials a {
		width: 34px;
		height: 34px;
		background: var(--color-frdp-light);
		color: var(--color-frdp-purple);
		font-size: 14px;
	}

	.site-search { left: 14px; right: 14px; padding: 18px 0; }
	.site-search__inner { padding: 0 18px; }
}

/* A phone: the contact line goes (it is in the menu panel), the brand block
   and Donate block tighten, and Donate keeps only its heart and first word. */
@media (max-width: 575.98px) {
	.topbar { display: none; }

	:root { --hdr-cap: 56px; --hdr-cut: 16px; --hdr-radius: 18px; }
	#site-header.is-stuck { --hdr-cap: 54px; }

	.header-main,
	#site-header.is-stuck .header-main { padding: 8px 10px; }

	.hdr-brand { padding: 0 calc(var(--hdr-cut) + 10px) 0 14px; }
	.hdr-brand__logo { height: 30px; }
	#site-header.is-stuck .hdr-brand__logo { height: 28px; }

	.header-actions { gap: 5px; padding: 0 6px 0 4px; }
	/* No room for a fourth button on a phone; the sliding menu carries the link. */
	.hdr-account { display: none; }
	.hdr-icon-btn, .cart-btn, .navbar-toggler { width: 36px; height: 36px; font-size: 15px; }
	.navbar-toggler-icon { width: 19px; height: 19px; }

	.hdr-donate { padding: 0 14px 0 calc(var(--hdr-cut) + 8px); font-size: 13px; }
	.donate-btn__now { display: none; }

	.site-search { left: 10px; right: 10px; }
	.site-search__form { height: 52px; padding-left: 16px; }
	.site-search__form input { font-size: 15.5px; }
	.site-search__form button { padding: 0 16px; }
	.site-search__esc { display: none; }
}

/* Very narrow: the Donate block would crowd the icons; it is in the menu panel. */
@media (max-width: 359.98px) {
	.hdr-donate { display: none; }
	.header-actions { padding-right: 10px; }
}

/* While the menu panel is open the header's layer rises above the scrim, so
   the panel inside it is never dimmed by its own backdrop. */
#site-header.menu-open { z-index: 1046; }

/* Logged in, the admin bar covers the top of a fixed panel. */
body.admin-bar .header-nav .offcanvas { top: 32px; }

@media (max-width: 782px) {
	body.admin-bar .header-nav .offcanvas { top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	#site-header, .topbar, .header-main, .hdr-capsule, .hdr-capsule::before, .hdr-brand__logo,
	.site-search, .site-search__hints, .site-search-scrim { transition: none; }
	.donate-btn i { animation: none; }
}
