/**
 * CIYWR native site header (no Elementor)
 * Sticky bar: logo | desktop mega-menu | donate + hamburger
 */

.ciywr-site-header {
	--ciywr-sh-bg: rgba(16, 19, 24, 0.98);
	--ciywr-sh-bg-solid: #101318;
	--ciywr-sh-text: #ffffff;
	--ciywr-sh-muted: rgba(255, 255, 255, 0.86);
	--ciywr-sh-accent: #c43c30;
	--ciywr-sh-accent-hover: #d14f42;
	--ciywr-sh-border: rgba(255, 255, 255, 0.1);
	--ciywr-sh-font: "Source Sans 3", var(--ciywr-font-sans, Verdana, Geneva, sans-serif);
	--ciywr-sh-height: 72px;

	position: sticky;
	top: 0;
	z-index: 10050;
	width: 100%;
	background: var(--ciywr-sh-bg);
	border-bottom: 1px solid var(--ciywr-sh-border);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-sizing: border-box;
}

html.admin-bar .ciywr-site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	html.admin-bar .ciywr-site-header {
		top: 46px;
	}
}

.ciywr-site-header__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 20px;
	min-height: var(--ciywr-sh-height);
	display: flex;
	align-items: center;
	gap: 16px;
	box-sizing: border-box;
}

.ciywr-site-header__brand {
	flex: 0 0 auto;
	min-width: 0;
	line-height: 0;
}

.ciywr-site-header__logo-link,
.ciywr-site-header__brand .custom-logo-link {
	display: inline-block;
	line-height: 0;
	text-decoration: none;
}

.ciywr-site-header__logo-img,
.ciywr-site-header__brand img,
.ciywr-site-header__brand .custom-logo {
	display: block;
	width: 200px;
	max-width: min(200px, 42vw);
	height: auto;
}

.ciywr-site-header__logo-text {
	font-family: var(--ciywr-sh-font);
	font-size: 18px;
	font-weight: 700;
	color: var(--ciywr-sh-text);
	line-height: 1.2;
}

.ciywr-site-header__nav {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.ciywr-site-header__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ciywr-site-header__donate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 11px 18px;
	background: var(--ciywr-sh-accent);
	color: #ffffff !important;
	font-family: var(--ciywr-sh-font);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none !important;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.ciywr-site-header__donate:hover,
.ciywr-site-header__donate:focus {
	background: var(--ciywr-sh-accent-hover);
	color: #ffffff !important;
}

.ciywr-site-header__menu-btn {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.ciywr-site-header__menu-bar {
	display: block;
	width: 22px;
	height: 2px;
	background: #ffffff;
	border-radius: 1px;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

body.ciywr-mnav-open .ciywr-site-header__menu-btn .ciywr-site-header__menu-bar:nth-child(1),
.ciywr-site-header__menu-btn[aria-expanded="true"] .ciywr-site-header__menu-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

body.ciywr-mnav-open .ciywr-site-header__menu-btn .ciywr-site-header__menu-bar:nth-child(2),
.ciywr-site-header__menu-btn[aria-expanded="true"] .ciywr-site-header__menu-bar:nth-child(2) {
	opacity: 0;
}

body.ciywr-mnav-open .ciywr-site-header__menu-btn .ciywr-site-header__menu-bar:nth-child(3),
.ciywr-site-header__menu-btn[aria-expanded="true"] .ciywr-site-header__menu-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Desktop mega-menu (always in header, no JS mount) ---------- */
.ciywr-site-header .ciywr-dnav {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	font-family: var(--ciywr-sh-font);
	background: transparent !important;
	text-shadow: none !important;
	filter: none !important;
}

.ciywr-site-header .ciywr-dnav__list {
	display: flex !important;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: nowrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0;
}

.ciywr-site-header .ciywr-dnav__list > li {
	position: relative;
	margin: 0;
}

.ciywr-site-header .ciywr-dnav__top {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	background: transparent !important;
	border: 0 !important;
	cursor: pointer;
	font-family: var(--ciywr-sh-font) !important;
	font-weight: 600 !important;
	font-size: 15px !important;
	letter-spacing: 0.02em;
	color: #ffffff !important;
	padding: 12px 14px !important;
	position: relative;
	text-decoration: none !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	white-space: nowrap;
	opacity: 1 !important;
	text-shadow: none !important;
	filter: none !important;
	box-shadow: none !important;
}

.ciywr-site-header .ciywr-dnav__top::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 6px;
	height: 2px;
	background: var(--ciywr-sh-accent);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.18s ease;
}

.ciywr-site-header .ciywr-dnav__top:hover,
.ciywr-site-header .ciywr-dnav__top:focus,
.ciywr-site-header .ciywr-dnav__has-dd:hover > .ciywr-dnav__top,
.ciywr-site-header .ciywr-dnav__has-dd.is-open > .ciywr-dnav__top {
	color: #ffffff !important;
	outline: none;
}

.ciywr-site-header .ciywr-dnav__top:hover::after,
.ciywr-site-header .ciywr-dnav__top:focus::after,
.ciywr-site-header .ciywr-dnav__has-dd:hover > .ciywr-dnav__top::after,
.ciywr-site-header .ciywr-dnav__has-dd.is-open > .ciywr-dnav__top::after {
	transform: scaleX(1);
}

.ciywr-site-header .ciywr-dnav__caret {
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid var(--ciywr-sh-accent);
	font-size: 0;
	line-height: 0;
	transition: transform 0.18s ease;
	transform-origin: center 2px;
}

.ciywr-site-header .ciywr-dnav__has-dd:hover > .ciywr-dnav__top .ciywr-dnav__caret,
.ciywr-site-header .ciywr-dnav__has-dd.is-open > .ciywr-dnav__top .ciywr-dnav__caret {
	transform: rotate(180deg);
}

.ciywr-site-header .ciywr-dnav__panel {
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 8px;
	background: #161b22 !important;
	border: 1px solid var(--ciywr-sh-border);
	border-radius: 4px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
	padding: 10px 0;
	display: flex;
	flex-direction: column;
	min-width: 220px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
	z-index: 10080;
	pointer-events: none;
}

.ciywr-site-header .ciywr-dnav__panel a {
	display: block;
	padding: 10px 18px;
	font-family: var(--ciywr-sh-font) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: rgba(255, 255, 255, 0.82) !important;
	text-decoration: none !important;
	white-space: nowrap;
	background: transparent !important;
}

.ciywr-site-header .ciywr-dnav__panel a:hover,
.ciywr-site-header .ciywr-dnav__panel a:focus {
	background: rgba(196, 60, 48, 0.12) !important;
	color: #ffffff !important;
}

.ciywr-site-header .ciywr-dnav__panel--wide {
	flex-direction: row;
	align-items: stretch;
	min-width: 560px;
	max-width: min(720px, 70vw);
	padding: 18px 8px;
}

.ciywr-site-header .ciywr-dnav__col {
	display: flex;
	flex-direction: column;
	min-width: 160px;
	flex: 1 1 0;
	padding: 0 10px;
	border-right: 1px solid var(--ciywr-sh-border);
}

.ciywr-site-header .ciywr-dnav__col:last-child {
	border-right: 0;
}

.ciywr-site-header .ciywr-dnav__col-title {
	display: block;
	font-family: var(--ciywr-sh-font) !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ciywr-sh-accent) !important;
	padding: 4px 18px 12px;
	border-bottom: 1px solid var(--ciywr-sh-border);
	margin-bottom: 6px;
}

.ciywr-site-header .ciywr-dnav__panel--wide .ciywr-dnav__col a {
	padding: 8px 18px;
	white-space: normal;
	line-height: 1.35 !important;
}

.ciywr-site-header .ciywr-dnav__has-dd:hover > .ciywr-dnav__panel,
.ciywr-site-header .ciywr-dnav__has-dd.is-open > .ciywr-dnav__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.ciywr-site-header .ciywr-dnav__has-dd::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 10px;
}

.ciywr-site-header .ciywr-dnav__list > li:nth-last-child(-n + 2) .ciywr-dnav__panel {
	left: auto;
	right: 0;
}

/* ---------- Kill leftover Elementor / OceanWP header chrome ---------- */
body.ciywr-native-header .elementor-location-header,
body.ciywr-native-header [data-elementor-type="header"],
body.ciywr-native-header #site-header,
body.ciywr-native-header #site-header-sticky-wrapper,
body.ciywr-native-header .oceanwp-sticky-header-holder,
body.ciywr-native-header .she-header-yes:not(.ciywr-site-header),
body.ciywr-native-header .elementor-1788,
body.ciywr-native-header .ehf-header,
body.ciywr-native-header .elementor-sticky__spacer,
body.ciywr-native-header .elementor-location-header + .elementor-sticky__spacer {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
	visibility: hidden !important;
	pointer-events: none !important;
	opacity: 0 !important;
}

/* White gap under header — old sticky clearance / spacers / top offsets */
body.ciywr-native-header,
body.ciywr-native-header #outer-wrap,
body.ciywr-native-header #wrap,
body.ciywr-native-header #main,
body.ciywr-native-header #content-wrap {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

body.ciywr-native-header .page-header {
	margin-top: 0 !important;
	padding-top: 16px !important;
}

/* Elementor often left top padding equal to sticky header height → empty white band */
body.ciywr-native-header #main > .elementor:first-child > .elementor-section:first-child,
body.ciywr-native-header #main > .elementor > .elementor-top-section:first-child,
body.ciywr-native-header #main > .elementor > .e-con-full:first-child,
body.ciywr-native-header #main > .elementor > .e-parent:first-child {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.home.ciywr-native-header #main > .elementor > .elementor-top-section:first-child,
body.home.ciywr-native-header #main > .elementor > .e-con:first-child {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* When mobile menu open, keep header above overlay for close button */
body.ciywr-mnav-open .ciywr-site-header {
	z-index: 10070;
}

/* ---------- Mobile / tablet ---------- */
@media (max-width: 1024px) {
	.ciywr-site-header {
		--ciywr-sh-height: 64px;
	}

	.ciywr-site-header__inner {
		padding: 8px 16px;
		gap: 12px;
	}

	.ciywr-site-header__nav,
	.ciywr-site-header .ciywr-dnav {
		display: none !important;
	}

	.ciywr-site-header__menu-btn {
		display: inline-flex !important;
	}

	.ciywr-site-header__logo-img,
	.ciywr-site-header__brand img,
	.ciywr-site-header__brand .custom-logo {
		width: 160px;
		max-width: min(160px, 48vw);
	}

	.ciywr-site-header__donate {
		padding: 10px 14px;
		font-size: 11px;
		min-height: 38px;
	}
}

@media (max-width: 480px) {
	.ciywr-site-header__donate {
		padding: 9px 10px;
		letter-spacing: 0.04em;
	}
}
