/* ============================================================================
   GORY Header — gory-header.css
   Naming convention: .gory-* classes, --gory-* custom properties
   ============================================================================ */

/* ── Screen-reader utility ─────────────────────────────────────────────────── */
.gory-sr-only {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* ── CSS Tokens ────────────────────────────────────────────────────────────── */
:root {
	--gory-nb-h:         36px;
	--gory-r1-h:         64px;
	--gory-r2-h:         0px;
	--gory-header-total: calc(var(--gory-nb-h) + var(--gory-r1-h));
	--gory-adminbar:     0px;
	--gory-red:          #d71d24;
	--gory-font:         Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
	                     "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--gory-font-size:    16px;
	--gory-line-height:  1.6;
	--gory-inner-max:    9999px;
	--gory-inner-pad:    16px;
	--gory-transition:   150ms linear;
}

body.admin-bar {
	--gory-adminbar: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--gory-adminbar: 46px;
	}
}

@media (max-width: 768px) {
	:root {
		--gory-nb-h:      32px;
		--gory-r1-h:      56px;
		--gory-r2-h:      0px;
		--gory-inner-pad: 12px;
	}
}

/* ============================================================================
   NEWS BAR
   ============================================================================ */

.gory-nb {
	position: fixed;
	top: var(--gory-adminbar);
	left: 0;
	right: 0;
	height: var(--gory-nb-h);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	font-family: var(--gory-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	/* background + color injected inline via PHP style= attribute */
}

.gory-nb__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: var(--gory-inner-max);
	padding: 0 var(--gory-inner-pad);
	box-sizing: border-box;
	text-align: center;
}

.gory-nb__text {
	display: inline;
}

.gory-nb__text a {
	color: inherit;
	text-decoration: underline;
}

.gory-nb__text a:hover {
	opacity: .8;
}

/* ============================================================================
   HEADER WRAPPER
   ============================================================================ */

.gory-hdr {
	/* Wrapper itself has no background — individual rows handle it */
	font-family: var(--gory-font);
}

/* ============================================================================
   ROW 1  —  Logo · Search · Icons
   ============================================================================ */

.gory-hdr__r1 {
	position: fixed;
	top: calc(var(--gory-adminbar) + var(--gory-nb-h));
	left: 0;
	right: 0;
	height: var(--gory-r1-h);
	z-index: 9999;
	transition: background var(--gory-transition), color var(--gory-transition),
	            box-shadow var(--gory-transition);
}

.gory-hdr__r1-inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0;
	height: 100%;
	width: 100%;
	padding: 0 var(--gory-inner-pad);
	box-sizing: border-box;
}

/* ============================================================================
   ROW 2  —  Desktop nav
   ============================================================================ */

.gory-hdr__r2 {
	display: none;
}

/* ============================================================================
   LOGO
   ============================================================================ */

.gory-hdr__logo {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	width: clamp(120px, 10vw, 200px);
	height: calc(var(--gory-r1-h) - 20px);
	overflow: visible;
}

.gory-hdr__logo-img {
	position: absolute;
	top: 50%;
	left: 0;
	transform: translateY(-50%);
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: left center;
	display: block;
	transition: opacity var(--gory-transition);
}

/* ============================================================================
   SEARCH FORM  —  Row 1, desktop only
   ============================================================================ */

/* ============================================================================
   SEARCH WRAPPER — contains toggle icon + expandable form
   ============================================================================ */

.gory-hdr__search-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.gory-hdr__search-toggle {
	display: flex;
	z-index: 10;
}

.gory-hdr__search-wrapper.is-open .gory-hdr__search-toggle {
	display: none;
}

.gory-hdr__search {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: stretch;
	height: 40px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .15);
	box-sizing: border-box;
	overflow: hidden;
	z-index: 9999;
	/* Collapsed state */
	width: 0;
	opacity: 0;
	pointer-events: none;
	transition: width 0.3s ease, opacity 0.2s ease, overflow 0s 0.3s;
}

.gory-hdr__search-wrapper.is-open .gory-hdr__search {
	width: clamp(320px, 45vw, 550px);
	opacity: 1;
	pointer-events: auto;
	overflow: visible;
	transition: width 0.3s ease, opacity 0.2s ease, overflow 0s 0s;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

/* Make search wrapper cover sibling icons and nav when open */
.gory-hdr__search-wrapper.is-open {
	position: relative;
	z-index: 9999;
}

/* Hide nav menu when search is open */
.gory-hdr__r1-inner:has(.gory-hdr__search-wrapper.is-open) .gory-hdr__nav {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.gory-hdr__search-wrapper.is-open ~ .gory-iconbtn,
.gory-hdr__search-wrapper.is-open ~ .gory-iconbtn--cart,
.gory-hdr__search-wrapper.is-open ~ .gory-hdr__mobile-search,
.gory-hdr__search-wrapper.is-open ~ .gory-hdr__hamburger {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.gory-hdr__search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	border: 0;
	background: transparent;
	padding: 0 12px;
	font-family: var(--gory-font);
	font-size: 14px;
	color: #000;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
}

.gory-hdr__search-input:focus {
	outline: none;
}

.gory-hdr__search-input::placeholder {
	color: rgba(0, 0, 0, .5);
	font-weight: 300;
}

.gory-hdr__search-close {
	flex: 0 0 36px;
	width: 36px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-right: 1px solid rgba(0, 0, 0, .12);
	background: transparent;
	background-image: none;
	color: rgba(0, 0, 0, .7);
	cursor: pointer;
	padding: 0;
	font: inherit;
	line-height: 1;
	text-decoration: none;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	transition: color var(--gory-transition);
}

.gory-hdr__search-close:hover {
	color: #000;
}

.gory-hdr__search-btn {
	flex: 0 0 44px;
	width: 44px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-left: 1px solid rgba(0, 0, 0, .12);
	background: transparent;
	color: rgba(0, 0, 0, .7);
	cursor: pointer;
	padding: 0;
	transition: color var(--gory-transition), background var(--gory-transition);
	box-sizing: border-box;
}

.gory-hdr__search-btn:hover,
.gory-hdr__search-btn:focus {
	color: #000;
	outline: none;
}

/* Search form focus-within ring */
.gory-hdr__search:focus-within {
	border-color: rgba(0, 0, 0, .25);
}

/* ============================================================================
   SEARCH RESULTS DROPDOWN
   ============================================================================ */

.gory-search-results {
	position: absolute;
	top: calc(100% + 1px);
	left: 0;
	right: 0;
	min-width: 100%;
	background: #fff;
	color: #000;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
	z-index: 200;
	display: none;
	max-height: 60vh;
	overflow-y: auto;
	border: 1px solid rgba(0, 0, 0, .1);
	border-top: 0;
	overscroll-behavior: contain;
}

.gory-search-results.is-open {
	display: block;
}

.gory-sr__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	text-decoration: none;
	color: #000;
	border-bottom: 1px solid rgba(0, 0, 0, .07);
	transition: background 100ms;
}

.gory-sr__item:last-child {
	border-bottom: 0;
}

.gory-sr__item:hover {
	background: #f5f5f5;
}

.gory-sr__thumb {
	width: 58px;
	height: 58px;
	flex-shrink: 0;
	overflow: hidden;
	background: #f4f4f4;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gory-sr__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.gory-sr__info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.gory-sr__name {
	font-family: var(--gory-font);
	font-size: 15px;
	font-weight: 600;
	color: #111;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gory-sr__price {
	font-family: var(--gory-font);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.2;
	color: #888;
}

.gory-sr__price del {
	color: #888;
	font-weight: 400;
	font-size: 12px;
	margin-right: 8px;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
	text-decoration-color: currentColor;
}

.gory-sr__price ins {
	text-decoration: none;
	color: var(--gory-red, #c00);
	font-weight: 600;
}

/* ============================================================================
   ICON BUTTONS
   ============================================================================ */

.gory-hdr__icons {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: 0 0 auto;
}

.gory-iconbtn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	background: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit !important;
	cursor: pointer;
	text-decoration: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	transition: color var(--gory-transition);
	-webkit-tap-highlight-color: transparent;
}

.gory-iconbtn:hover,
.gory-iconbtn:active,
.gory-iconbtn:focus,
.gory-iconbtn:focus-visible {
	background: transparent !important;
	background-image: none !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: var(--gory-red) !important;
}

/* ============================================================================
   CART BADGE
   ============================================================================ */

.gory-cartcount {
	position: absolute;
	top: 3px;
	right: 2px;
	min-width: 17px;
	height: 17px;
	line-height: 17px;
	padding: 0 3px;
	font-family: var(--gory-font);
	font-size: 10px;
	font-weight: 700;
	text-align: center;
	border-radius: 999px;
	background: var(--gory-red);
	color: #fff !important;
	box-sizing: border-box;
	pointer-events: none;
	display: none;
}

.gory-cartcount.has-items {
	display: block;
}

/* ============================================================================
   HAMBURGER  —  mobile only, hidden on desktop
   ============================================================================ */

.gory-hdr__hamburger {
	display: none;
}

/* ============================================================================
   MOBILE SEARCH TOGGLE ICON  —  visible only on mobile
   ============================================================================ */

.gory-hdr__mobile-search {
	display: none;
}

/* ============================================================================
   DESKTOP NAV  —  Centered
   ============================================================================ */

.gory-hdr__nav {
	position: absolute;
	left: 0;
	right: 0;
	width: fit-content;
	margin: 0 auto;
	display: flex;
	align-items: center;
	height: 100%;
	overflow: visible;
}

.gory-hdr__nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	height: 100%;
	font-family: var(--gory-font);
}

/* Top-level items — position:static so mega panel anchors to the fixed .gory-hdr__r2 row */
.gory-hdr__nav-list > li {
	position: static;
	height: 100%;
	display: flex;
	align-items: center;
}

/* Explicit color — beats any global WooCommerce/theme  a { color } rule */
.gory-hdr__nav-list > li > a {
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 18px;
	font-family: var(--gory-font);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	color: #111;
	white-space: nowrap;
	transition: color var(--gory-transition);
}

.gory-hdr__nav-list > li > a:hover {
	color: var(--gory-red);
}

/* Home transparent: white nav links */
.gory-hdr--home:not(.is-solid) .gory-hdr__nav-list > li > a {
	color: #fff;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__nav-list > li > a:hover {
	color: rgba(255, 255, 255, .75);
}
/* Home solid: dark nav links */
.gory-hdr--home.is-solid .gory-hdr__nav-list > li > a {
	color: #111;
}

/* Top-level items with children: hover-only, not directly clickable */
.gory-hdr__nav-list > li.menu-item-has-children > a {
	pointer-events: none;
	cursor: default;
}

/* Suppress WordPress auto-chevrons on top-level */
.gory-hdr__nav-list > li.menu-item-has-children > a::after,
.gory-hdr__nav-list > li.menu-item-has-children > a::before {
	content: none !important;
}

/* ── MEGA MENU PANEL  (first-level sub-menu only) ─────────────────────────── */

/* Open on hover / focus-within */
.gory-hdr__nav-list > li:hover > .sub-menu,
.gory-hdr__nav-list > li:focus-within > .sub-menu {
	display: flex;
}

/* Full-width panel — position:fixed to span full viewport width */
.gory-hdr__nav-list > li > .sub-menu {
	display: none;
	position: fixed;
	top: calc(var(--gory-adminbar) + var(--gory-nb-h) + var(--gory-r1-h));
	left: 0;
	right: 0;
	width: 100vw;
	min-width: 0;
	background: #fff;
	color: #111;
	list-style: none;
	margin: 0;
	/* no horizontal padding — justify-content:center handles centering */
	padding: 24px 0 28px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .1);
	border-top: 1px solid rgba(0, 0, 0, .22);
	z-index: 100;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: center;
	gap: 0 56px;
}

/* Each column inside the mega panel — natural width, no growth */
.gory-hdr__nav-list > li > .sub-menu > li {
	position: static;
	flex: 0 0 auto;
	min-width: 180px;
	padding-bottom: 8px;
}

/* Column header link — bold, uppercase, red rule underneath */
.gory-hdr__nav-list > li > .sub-menu > li > a {
	display: block;
	padding: 0 0 10px;
	margin-bottom: 10px;
	font-family: var(--gory-font);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: #111 !important;
	border-bottom: 2px solid var(--gory-red);
	transition: color var(--gory-transition);
	white-space: nowrap;
}

.gory-hdr__nav-list > li > .sub-menu > li > a:hover {
	color: var(--gory-red) !important;
}

/* ── Level-3: displayed inline below column header (no extra click needed) ── */

.gory-hdr__nav-list > li > .sub-menu > li > .sub-menu {
	display: block !important; /* always visible — it IS the column body */
	position: static;
	background: transparent;
	box-shadow: none;
	border-top: none;
	padding: 0;
	margin: 0;
	list-style: none;
	min-width: 0;
}

.gory-hdr__nav-list > li > .sub-menu > li > .sub-menu > li {
	position: static;
}

.gory-hdr__nav-list > li > .sub-menu > li > .sub-menu > li > a {
	display: block;
	padding: 6px 0;
	font-family: var(--gory-font);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.01em;
	text-transform: none;
	text-decoration: none;
	color: #444 !important;
	transition: color var(--gory-transition);
	white-space: nowrap;
}

.gory-hdr__nav-list > li > .sub-menu > li > .sub-menu > li > a:hover {
	color: var(--gory-red) !important;
}

/* ── Wspinanie column: split its items into 2 sub-columns (depth-1 target) ── */

/* Wspinanie column: fixed wider width to hold its 2 sub-columns comfortably */
.gory-hdr__nav-list > li > .sub-menu > li.gory-mega--two-col {
	flex: 0 0 auto;
	min-width: 400px;
}

/* Items flow top→bottom, auto-balanced between the 2 sub-columns */
.gory-hdr__nav-list > li > .sub-menu > li.gory-mega--two-col > .sub-menu {
	column-count: 2;
	column-gap: 16px;
	column-fill: balance;
}

/* Prevent any single item from being clipped by a column break */
.gory-hdr__nav-list > li > .sub-menu > li.gory-mega--two-col > .sub-menu > li {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
}


/* Current-page items: no permanent accent colour */
.gory-hdr__nav-list li.current-menu-item > a,
.gory-hdr__nav-list li.current-menu-ancestor > a,
.gory-hdr__nav-list li.current-menu-parent > a,
.gory-hdr__nav-list li.current_page_item > a,
.gory-hdr__nav-list li.current_page_ancestor > a {
	color: inherit;
}

/* ============================================================================
   SPACER  —  non-home pages only; pushes body content below the fixed header
   ============================================================================ */

.gory-hdr__spacer {
	display: block;
	height: calc(var(--gory-adminbar) + var(--gory-nb-h) + var(--gory-r1-h));
}

.page-template-page-marki .gory-hdr__spacer {
	height: calc(var(--gory-adminbar) + var(--gory-nb-h));
}

/* ============================================================================
   VARIANTS
   ============================================================================ */

/* ── Default: always solid white ───────────────────────────────────────────── */

.gory-hdr--default .gory-hdr__r1 {
	background: #fff;
	color: #000;
	border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.gory-hdr--default .gory-hdr__logo-img--light { opacity: 0; }
.gory-hdr--default .gory-hdr__logo-img--dark  { opacity: 1; }

/* ── Home: transparent (over hero) by default ──────────────────────────────── */

.gory-hdr--home .gory-hdr__r1 {
	background: transparent;
	color: #fff;
	border-bottom: 1px solid transparent;
}

.gory-hdr--home .gory-hdr__logo-img--light { opacity: 1; }
.gory-hdr--home .gory-hdr__logo-img--dark  { opacity: 0; }

/* Nav links: explicit white on transparent home header */
.gory-hdr--home:not(.is-solid) .gory-hdr__nav-list > li > a {
	color: #fff;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__nav-list > li > a:hover {
	color: rgba(255, 255, 255, .7);
}

/* Home: search bar styled for transparent background */
.gory-hdr--home:not(.is-solid) .gory-hdr__search {
	background: #fff;
	border-color: rgba(0, 0, 0, .15);
}

.gory-hdr--home:not(.is-solid) .gory-hdr__search-wrapper.is-open .gory-hdr__search-input {
	color: #111;
}

.gory-hdr--home:not(.is-solid) .gory-hdr__search-wrapper.is-open .gory-hdr__search-input::placeholder {
	color: rgba(0, 0, 0, .45);
}

.gory-hdr--home:not(.is-solid) .gory-hdr__search-btn {
	color: rgba(0, 0, 0, .7);
	border-left-color: rgba(0, 0, 0, .12);
}

.gory-hdr--home:not(.is-solid) .gory-hdr__search-btn:hover {
	color: #000;
}

/* Mega panel is always white/dark regardless of header transparency */
.gory-hdr--home .gory-hdr__nav-list > li > .sub-menu {
	background: #fff;
	color: #111;
}

/* ── Home transparent: turn bar white when mega menu is open ──────────────── */
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) {
	background: #fff;
	color: #000;
	border-bottom-color: rgba(0, 0, 0, .06);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
	transition: none;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-hdr__logo-img--light {
	opacity: 0;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-hdr__logo-img--dark {
	opacity: 1;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-hdr__nav-list > li > a {
	color: #111;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-hdr__search-wrapper.is-open .gory-hdr__search {
	border-color: rgba(0, 0, 0, .22);
	background: #fff;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-hdr__search-wrapper.is-open .gory-hdr__search-input {
	color: #111;
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-hdr__search-wrapper.is-open .gory-hdr__search-input::placeholder {
	color: rgba(0, 0, 0, .45);
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-hdr__search-wrapper.is-open .gory-hdr__search-btn {
	color: rgba(0, 0, 0, .7);
	border-left-color: rgba(0, 0, 0, .12);
}
.gory-hdr--home:not(.is-solid) .gory-hdr__r1:has(.gory-hdr__nav-list > li:hover) .gory-iconbtn {
	color: #111;
}

/* Nav links: back to dark when header turns solid */
.gory-hdr--home.is-solid .gory-hdr__nav-list > li > a {
	color: #111;
}
.gory-hdr--home.is-solid .gory-hdr__nav-list > li > a:hover {
	color: var(--gory-red);
}

/* ── Home + scrolled (JS adds .is-solid to .gory-hdr) ─────────────────────── */

.gory-hdr--home.is-solid .gory-hdr__r1 {
	background: #fff;
	color: #000;
	border-bottom-color: rgba(0, 0, 0, .06);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.gory-hdr--home.is-solid .gory-hdr__logo-img--light { opacity: 0; }
.gory-hdr--home.is-solid .gory-hdr__logo-img--dark  { opacity: 1; }

/* Search bar keeps white styling even when header is solid */
.gory-hdr--home.is-solid .gory-hdr__search-wrapper.is-open .gory-hdr__search {
	border-color: rgba(0, 0, 0, .15);
	background: #fff;
}

.gory-hdr--home.is-solid .gory-hdr__search-wrapper.is-open .gory-hdr__search-input {
	color: #111;
}

.gory-hdr--home.is-solid .gory-hdr__search-wrapper.is-open .gory-hdr__search-input::placeholder {
	color: rgba(0, 0, 0, .45);
}

.gory-hdr--home.is-solid .gory-hdr__search-wrapper.is-open .gory-hdr__search-btn {
	color: rgba(0, 0, 0, .7);
	border-left-color: rgba(0, 0, 0, .12);
}

/* ── Default (white) header: light/transparent search bar ─────────────────── */
.gory-hdr--default .gory-hdr__search {
	background: rgba(255, 255, 255, 0.95);
	border-color: rgba(0, 0, 0, .15);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.gory-hdr--default .gory-hdr__search-wrapper.is-open .gory-hdr__search {
	box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

.gory-hdr--default .gory-hdr__search-input {
	color: #111;
}

.gory-hdr--default .gory-hdr__search-input::placeholder {
	color: rgba(0, 0, 0, .45);
}

.gory-hdr--default .gory-hdr__search-close {
	color: rgba(0, 0, 0, .5);
	border-right-color: rgba(0, 0, 0, .1);
	background: transparent;
	background-image: none;
	box-shadow: none;
}

.gory-hdr--default .gory-hdr__search-close:hover {
	color: #000;
}

.gory-hdr--default .gory-hdr__search-btn {
	color: rgba(0, 0, 0, .5);
	border-left-color: rgba(0, 0, 0, .1);
}

.gory-hdr--default .gory-hdr__search-btn:hover {
	color: #000;
}

/* ── Row 1 shadow: only on solid state (both variants) ─────────────────────── */
.gory-hdr--default .gory-hdr__r1 {
	box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

/* ============================================================================
   MOBILE DRAWER
   ============================================================================ */

.gory-drawer {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: none;
	pointer-events: none;
}

.gory-drawer.is-open {
	display: block;
	pointer-events: auto;
}

.gory-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .52);
	cursor: pointer;
}

.gory-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	left: auto;
	bottom: 0;
	width: min(340px, 92vw);
	background: #fff;
	color: #000;
	transform: translateX(100%);
	transition: transform 280ms cubic-bezier(.4, 0, .2, 1);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	box-shadow: -4px 0 32px rgba(0, 0, 0, .22);
	overscroll-behavior: contain;
	/* iPhone home-indicator / notch safe areas */
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

.gory-drawer.is-open .gory-drawer__panel {
	transform: translateX(0);
}

/* Drawer header row: logo + close button */
.gory-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 12px 14px 18px;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
	flex: 0 0 auto;
}

.gory-drawer__logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.gory-drawer__logo img {
	height: 38px;
	width: auto;
	object-fit: contain;
	display: block;
}

/* Close button inherits .gory-iconbtn */
.gory-drawer__close {
	color: #333 !important;
}



/* Nav list */
.gory-drawer__nav {
	list-style: none;
	margin: 0;
	padding: 8px 0 32px;
	flex: 1 0 auto;
}

/* Each nav item */
.gory-drawer__item {
	position: relative;
	border-bottom: 1px solid rgba(0, 0, 0, .07);
}

.gory-drawer__item:last-child {
	border-bottom: 0;
}

/* Link inside each item */
.gory-drawer__link {
	display: flex;
	align-items: center;
	min-height: 52px;
	padding: 14px 56px 14px 18px; /* right padding makes room for toggle btn */
	font-family: var(--gory-font);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	color: #111;
	transition: color var(--gory-transition);
	-webkit-tap-highlight-color: transparent;
}

.gory-drawer__link:hover,
.gory-drawer__link:active {
	color: var(--gory-red);
}

/* Items without children: full-width link */
.gory-drawer__item:not(.has-children) > .gory-drawer__link {
	padding-right: 18px;
}

/* Parent items: extra right padding to make room for the larger toggle */
.gory-drawer__item.has-children > .gory-drawer__link {
	padding-right: 72px;
}

/* Active / current page indicator — red left bar */
.gory-drawer__item.is-current:not(.has-children) > .gory-drawer__link,
.gory-drawer__item.is-ancestor:not(.has-children) > .gory-drawer__link {
	color: var(--gory-red);
	border-left: 3px solid var(--gory-red);
	padding-left: 15px; /* compensate for the border so text stays aligned */
}

.gory-drawer__item.is-current > .gory-drawer__toggle,
.gory-drawer__item.is-ancestor > .gory-drawer__toggle,
.gory-drawer__item.is-open > .gory-drawer__toggle {
	color: #888;
	background-color: transparent;
}

/* Accordion toggle button */
.gory-drawer__toggle {
	position: absolute;
	top: 0;
	right: 0;
	/* fixed height = link row height — do NOT use bottom:0 or it stretches
	   into the expanded sub-menu and the chevron floats in the wrong place */
	height: 52px;
	width: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: transparent;
	background-image: none;
	border: none;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
	tap-highlight-color: transparent;
	/* no border-left — avoids the fake "two-column" look */
	color: #888;
	cursor: pointer;
	padding: 0;
	transition: color var(--gory-transition);
}

.gory-drawer__toggle:hover,
.gory-drawer__toggle:active,
.gory-drawer__toggle:focus,
.gory-drawer__toggle:focus-visible,
.gory-drawer__item.is-open > .gory-drawer__toggle,
.gory-drawer__item.is-open > .gory-drawer__toggle:hover,
.gory-drawer__item.is-open > .gory-drawer__toggle:active,
.gory-drawer__item.is-open > .gory-drawer__toggle:focus,
.gory-drawer__item.is-open > .gory-drawer__toggle:focus-visible {
	background-color: transparent;
	background-image: none;
	border: none;
	box-shadow: none;
	outline: none;
	color: #888;
}

.gory-drawer__toggle .gory-drawer__chevron,
.gory-drawer__toggle:hover .gory-drawer__chevron,
.gory-drawer__toggle:active .gory-drawer__chevron,
.gory-drawer__toggle:focus .gory-drawer__chevron,
.gory-drawer__toggle:focus-visible .gory-drawer__chevron,
.gory-drawer__item.is-open > .gory-drawer__toggle .gory-drawer__chevron,
.gory-drawer__item.is-open > .gory-drawer__toggle:hover .gory-drawer__chevron,
.gory-drawer__item.is-open > .gory-drawer__toggle:active .gory-drawer__chevron,
.gory-drawer__item.is-open > .gory-drawer__toggle:focus .gory-drawer__chevron,
.gory-drawer__item.is-open > .gory-drawer__toggle:focus-visible .gory-drawer__chevron {
	color: #888;
}

.gory-drawer__item.is-open > .gory-drawer__toggle .gory-drawer__chevron {
	transform: rotate(225deg);
}

.gory-drawer__toggle .gory-drawer__chevron {
	width: 14px;
	height: 14px;
	display: block;
	pointer-events: none;
	border-right: 3px solid currentColor;
	border-bottom: 3px solid currentColor;
	color: currentColor;
	transform: rotate(45deg) translateY(-1px);
	transform-origin: 50% 50%;
	transition: transform 260ms cubic-bezier(.4, 0, .2, 1), color var(--gory-transition);
	box-sizing: border-box;
}

/* Sub-menu accordion panel */
.gory-drawer__sub {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 280ms cubic-bezier(.4, 0, .2, 1);
	background: #f5f5f5;
	border-top: 1px solid rgba(0, 0, 0, .06);
}

.gory-drawer__item.is-open > .gory-drawer__sub {
	max-height: 600px; /* CSS fallback; JS overrides with precise scrollHeight */
}

/* Level-2 links */
/* Level-2 links — smaller, lighter, not uppercase */
.gory-drawer__sub > .gory-drawer__item > .gory-drawer__link {
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.01em;
	text-transform: none;
	color: #444;
	min-height: 46px;
	padding-left: 28px;
}

/* Level-3 links */
/* Level-3 links */
.gory-drawer__sub .gory-drawer__sub > .gory-drawer__item > .gory-drawer__link {
	font-size: 13px;
	padding-left: 40px;
	color: #666;
	min-height: 42px;
}

.gory-drawer__sub .gory-drawer__sub {
	background: #ebebeb;
	border-top: 1px solid rgba(0, 0, 0, .05);
}

/* ============================================================================
   RESPONSIVE  —  Mobile (≤ 768px)
   ============================================================================ */

@media (max-width: 768px) {

	/* Row 2 is hidden entirely on mobile */
	.gory-hdr__r2 {
		display: none;
	}

	/* Search form hidden in row 1 on mobile */
	.gory-hdr__search-wrapper {
		display: none;
	}

	/* Hamburger becomes visible */
	.gory-hdr__hamburger {
		display: inline-flex;
	}

	/* Mobile search icon becomes visible */
	.gory-hdr__mobile-search {
		display: inline-flex;
	}

	/* Logo narrower on mobile */
	.gory-hdr__logo {
		width: clamp(110px, 30vw, 160px);
	}

	/* Spacer: only accounts for nb + r1 (no r2 on mobile) */
	.gory-hdr__nav {
		display: none;
	}
	.gory-hdr__spacer {
		height: calc(var(--gory-adminbar) + var(--gory-nb-h) + var(--gory-r1-h));
	}

	.page-template-page-marki .gory-hdr__spacer {
		height: calc(var(--gory-adminbar) + var(--gory-nb-h));
	}

	/* Push icons + hamburger to the far right on mobile */
	.gory-hdr__icons {
		gap: 0;
		margin-left: auto;
	}

	.gory-nb {
		font-size: 12px;
	}
}

/* ============================================================================
   PRINT
   ============================================================================ */

/* ============================================================================
   MOBILE SEARCH OVERLAY
   Full-width panel that slides down from below the header bar.
   Shares .gory-sr__* classes with the desktop live-search dropdown.
   ============================================================================ */

.gory-mobile-search {
	position: fixed;
	top: calc(var(--gory-adminbar) + var(--gory-nb-h) + var(--gory-r1-h));
	left: 0;
	right: 0;
	z-index: 10000;
	pointer-events: none;
	visibility: hidden;
}

.gory-mobile-search.is-open {
	pointer-events: auto;
	visibility: visible;
}

/* Slide-down panel */
.gory-mobile-search__inner {
	position: relative;
	z-index: 1;
	background: #fff;
	padding: 12px 16px 4px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
	transform: translateY(-6px);
	opacity: 0;
	transition: transform 220ms cubic-bezier(.4, 0, .2, 1),
	            opacity   220ms cubic-bezier(.4, 0, .2, 1);
	max-height: calc(100svh - var(--gory-adminbar) - var(--gory-nb-h) - var(--gory-r1-h));
	overflow-y: auto;
	overscroll-behavior: contain;
}

.gory-mobile-search.is-open .gory-mobile-search__inner {
	transform: translateY(0);
	opacity: 1;
}

/* Semi-transparent backdrop — tap to close */
.gory-mobile-search__backdrop {
	position: fixed;
	inset: 0;
	top: calc(var(--gory-adminbar) + var(--gory-nb-h) + var(--gory-r1-h));
	background: rgba(0, 0, 0, .4);
	opacity: 0;
	transition: opacity 220ms;
	z-index: 0;
}

.gory-mobile-search.is-open .gory-mobile-search__backdrop {
	opacity: 1;
}

/* Input row: icon + input + clear button */
.gory-mobile-search__row {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 50px;
	padding: 0 14px;
	background: #f5f5f5;
	border: 1px solid rgba(0, 0, 0, .14);
}

.gory-mobile-search__icon {
	flex-shrink: 0;
	color: #888;
}

.gory-mobile-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	font-family: var(--gory-font);
	font-size: 16px; /* 16 px prevents iOS auto-zoom */
	color: #111;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
}

.gory-mobile-search__input:focus {
	outline: none;
}

.gory-mobile-search__input::placeholder {
	color: rgba(0, 0, 0, .38);
}

/* Hide the browser's native × clear button on search inputs */
.gory-mobile-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	display: none;
}

/* ×  clear button — hidden until the user types something */
.gory-mobile-search__clear {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 0;
	color: #888;
	cursor: pointer;
	padding: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 150ms, color 150ms;
	-webkit-tap-highlight-color: transparent;
}

.gory-mobile-search__clear.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.gory-mobile-search__clear:hover {
	color: var(--gory-red);
}

/* ↵  submit / enter button — always visible */
.gory-mobile-search__submit {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 32px;
	background: transparent;
	border: 0;
	border-left: 1px solid rgba(0, 0, 0, .12);
	color: #555;
	cursor: pointer;
	padding: 0;
	transition: color 150ms;
	-webkit-tap-highlight-color: transparent;
}

.gory-mobile-search__submit:hover,
.gory-mobile-search__submit:active {
	color: var(--gory-red);
}

/* Results list — reuses .gory-sr__* from the desktop dropdown */
.gory-mobile-search__results {
	margin-top: 6px;
	padding-bottom: 8px;
}

.gory-mobile-search__results .gory-sr__item {
	padding: 12px 4px;
	gap: 14px;
}

.gory-mobile-search__results .gory-sr__thumb {
	width: 52px;
	height: 52px;
}

/* "No results" hint */
.gory-mobile-search__empty {
	padding: 14px 4px;
	font-family: var(--gory-font);
	font-size: 14px;
	color: #888;
	text-align: center;
}

/* ============================================================================
   PRINT
		display: none !important;
	}
}