/*
 * Neon Glass Menu. Inspired by Simon Goellner's (simeydotme) "Neon Glass
 * Context Menu" CodePen; rewritten for WordPress by Talkinggod Labs.
 * The glass colour, opacity and blur come from the settings (--ngm-bg,
 * --ngm-blur); the two neon accents from --hue1 / --hue2.
 */
@font-face {
	font-family: 'NGM Asap';
	src: url('fonts/Asap-Variable.woff2') format('woff2');
	font-weight: 100 900;
	font-stretch: 75% 100%;
	font-display: swap;
}

@property --item-opacity {
	syntax: "<number>";
	inherits: false;
	initial-value: 0;
}

#ngm {
	--border: 1px;
	--border-color: hsl(var(--hue2) 12% 20%);
	--radius: 22px;
	--ease: cubic-bezier(0.5, 1, 0.89, 1);

	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition-property: visibility, opacity, filter, transform;
	transition-duration: 0s, 0.25s, 0.25s, 0.3s;
	transition-delay: 0.5s, 0s, 0s, 0s;
	transition-timing-function: var(--ease);
	filter: blur(4px);

	font-family: 'NGM Asap', 'Asap', system-ui, sans-serif;
	color: #9aa0ab;
	position: fixed;
	z-index: 2147483000;
	top: 140px;
	left: 2vw;
	min-width: 275px;
	max-height: calc(100dvh - 24px);
	box-sizing: border-box;
	border-radius: var(--radius);
	border: var(--border) solid var(--border-color);
	padding: 1em;
	background:
		linear-gradient(235deg, hsl(var(--hue1) 50% 10% / 0.6), hsl(var(--hue1) 50% 10% / 0) 33%),
		linear-gradient(45deg, hsl(var(--hue2) 50% 10% / 0.6), hsl(var(--hue2) 50% 10% / 0) 33%),
		linear-gradient(var(--ngm-bg, rgb(16 16 20 / 0.51)), var(--ngm-bg, rgb(16 16 20 / 0.51)));
	-webkit-backdrop-filter: blur(var(--ngm-blur, 0px));
	backdrop-filter: blur(var(--ngm-blur, 0px));
	box-shadow: hsl(var(--hue2) 50% 2%) 0 10px 16px -8px, hsl(var(--hue2) 50% 4%) 0 20px 36px -14px;
	text-align: left;
	line-height: 1.2;
}

#ngm.open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition-delay: 0s;
	filter: blur(0);
}

/* Sidebar mode: docked to the left edge, full height. */
#ngm.ngm--sidebar {
	top: 10px;
	left: 10px;
	bottom: 10px;
	width: min(320px, calc(100vw - 56px));
	max-height: none;
	transform: translateX(-24px);
}
#ngm.ngm--sidebar.open { transform: none; }

/* Scrim behind the sidebar. */
.ngm-scrim {
	position: fixed;
	inset: 0;
	z-index: 2147482999;
	background: rgb(0 0 0 / 0.35);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s, visibility 0s .25s;
}
.ngm-scrim.open { opacity: 1; visibility: visible; transition-delay: 0s; }

#ngm:not(.open) .glow,
#ngm:not(.open) .shine {
	opacity: 0;
	animation: ngm-glowoff 0.25s var(--ease) both;
}

#ngm.open .glow,
#ngm.open .shine { animation: ngm-glow 1s var(--ease) both; }
#ngm.open .shine { animation-delay: 0s; animation-duration: 2s; }
#ngm.open .glow { animation-delay: 0.2s; }
#ngm.open .glow-bright { animation-delay: 0.1s; animation-duration: 1.5s; }
#ngm.open .shine-bottom { animation-delay: 0.1s; animation-duration: 1.8s; }
#ngm.open .glow-bottom { animation-delay: 0.3s; }
#ngm.open .glow-bright.glow-bottom { animation-delay: 0.3s; animation-duration: 1.1s; }

#ngm .shine,
#ngm .glow { --hue: var(--hue1); }
#ngm .shine-bottom,
#ngm .glow-bottom { --hue: var(--hue2); --conic: 135deg; }

#ngm .shine,
#ngm .shine::before,
#ngm .shine::after {
	pointer-events: none;
	border-radius: 0;
	border-top-right-radius: inherit;
	border-bottom-left-radius: inherit;
	border: 1px solid transparent;
	width: 75%;
	max-width: 300px;
	height: auto;
	min-height: 0;
	aspect-ratio: 1;
	display: block;
	position: absolute;
	right: calc(var(--border) * -1);
	top: calc(var(--border) * -1);
	left: auto;
	z-index: 1;
	--start: 12%;
	background: conic-gradient(from var(--conic, -45deg) at center in oklch, transparent var(--start, 0%), hsl(var(--hue), var(--sat, 80%), var(--lit, 60%)), transparent var(--end, 50%)) border-box;
	mask: linear-gradient(transparent), linear-gradient(black);
	mask-repeat: no-repeat;
	mask-clip: padding-box, border-box;
	mask-composite: subtract;
}
#ngm .shine::before,
#ngm .shine::after { content: ""; width: auto; inset: -2px; mask: none; }
#ngm .shine::after {
	z-index: 2;
	--start: 17%;
	--end: 33%;
	background: conic-gradient(from var(--conic, -45deg) at center in oklch, transparent var(--start, 0%), hsl(var(--hue), var(--sat, 80%), var(--lit, 85%)), transparent var(--end, 50%));
}
#ngm .shine-bottom {
	top: auto;
	bottom: calc(var(--border) * -1);
	left: calc(var(--border) * -1);
	right: auto;
}

#ngm .glow {
	pointer-events: none;
	border-top-right-radius: calc(var(--radius) * 2.5);
	border-bottom-left-radius: calc(var(--radius) * 2.5);
	border: calc(var(--radius) * 1.25) solid transparent;
	inset: calc(var(--radius) * -2);
	width: 75%;
	max-width: 300px;
	height: auto;
	min-height: 0;
	aspect-ratio: 1;
	display: block;
	position: absolute;
	left: auto;
	bottom: auto;
	mask: var(--ngm-noise);
	mask-mode: luminance;
	mask-size: 29%;
	opacity: 1;
	filter: blur(12px) saturate(1.25) brightness(0.5);
	mix-blend-mode: plus-lighter;
	z-index: 3;
}
#ngm .glow.glow-bottom { inset: calc(var(--radius) * -2); top: auto; right: auto; }
#ngm .glow::before,
#ngm .glow::after {
	content: "";
	position: absolute;
	inset: 0;
	border: inherit;
	border-radius: inherit;
	background: conic-gradient(from var(--conic, -45deg) at center in oklch, transparent var(--start, 0%), hsl(var(--hue), var(--sat, 95%), var(--lit, 60%)), transparent var(--end, 50%)) border-box;
	mask: linear-gradient(transparent), linear-gradient(black);
	mask-repeat: no-repeat;
	mask-clip: padding-box, border-box;
	mask-composite: subtract;
	filter: saturate(2) brightness(1);
}
#ngm .glow::after {
	--lit: 70%;
	--sat: 100%;
	--start: 15%;
	--end: 35%;
	border-width: calc(var(--radius) * 1.75);
	border-radius: calc(var(--radius) * 2.75);
	inset: calc(var(--radius) * -0.25);
	z-index: 4;
	opacity: 0.75;
}
#ngm .glow-bright {
	--lit: 80%;
	--sat: 100%;
	--start: 13%;
	--end: 37%;
	border-width: 5px;
	border-radius: calc(var(--radius) + 2px);
	inset: -7px;
	left: auto;
	filter: blur(2px) brightness(0.66);
}
#ngm .glow-bright::after { content: none; }
#ngm .glow-bright.glow-bottom { inset: -7px; right: auto; top: auto; }

/* Content. */
#ngm .inner {
	position: relative;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	font-size: 0.95rem;
	max-height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: hsl(var(--hue1) 30% 30%) transparent;
}
#ngm.ngm--context .inner { max-height: calc(100dvh - 60px); }
#ngm section { display: flex; flex-direction: column; gap: 0.35em; }
#ngm section[hidden] { display: none; }

#ngm .ngm-close {
	position: absolute;
	top: -0.25em;
	right: -0.1em;
	z-index: 6;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: hsl(var(--hue1) 30% 75%);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
#ngm.ngm--context .ngm-close { display: none; }

#ngm hr {
	width: 100%;
	height: 0.5px;
	background: var(--border-color);
	border: none;
	margin: 0.25em 0 0.5em;
	opacity: 0.66;
	flex: 0 0 auto;
}
#ngm hr:last-child { display: none; }

#ngm header {
	font-size: 0.75rem;
	font-weight: 300;
	letter-spacing: 0.04em;
	padding: 0 0.66em;
	color: #737985;
	background: none;
	position: static;
	box-shadow: none;
}

#ngm ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25em; }
#ngm li { margin: 0; padding: 0; }

#ngm li > a {
	--item-hue: var(--hue2);
	position: relative;
	padding: 0.66em;
	min-height: 36px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 0.6em;
	color: #c9ced8;
	font-weight: 400;
	text-decoration: none;
	border-radius: calc(var(--radius) * 0.33333);
	border: 1px solid transparent;
	transition: all 0.3s ease-in, --item-opacity 0.3s ease-in;
	background: linear-gradient(90deg in oklch, hsl(var(--item-hue) 29% 13% / var(--item-opacity)), hsl(var(--item-hue) 30% 15% / var(--item-opacity)) 24% 32%, hsl(var(--item-hue) 5% 7% / 0) 95%) border-box;
}
#ngm li > a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: inherit;
	background: linear-gradient(90deg in oklch, hsl(var(--item-hue) 15% 16% / var(--item-opacity)), hsl(var(--item-hue) 40% 24% / var(--item-opacity)) 20% 32%, hsl(var(--item-hue) 2% 12% / 0) 95%) border-box;
	mask: linear-gradient(transparent), linear-gradient(to right, black, transparent);
	mask-repeat: no-repeat;
	mask-clip: padding-box, border-box;
	mask-composite: subtract;
	pointer-events: none;
}
#ngm li > a:hover,
#ngm li > a.selected,
#ngm li > a:focus-visible,
#ngm li > a:hover::after,
#ngm li > a.selected::after,
#ngm li > a:focus-visible::after {
	--item-opacity: 0.5;
	transition: all 0.1s ease-out, --item-opacity 0.1s ease-out;
	color: #fff;
	outline: none;
}
#ngm li > a.selected,
#ngm li > a.selected::after { animation: ngm-flash 0.75s ease-out 1 forwards; }
#ngm .ngm-features li > a { --item-hue: var(--hue1); }
#ngm li[hidden] { display: none; }

#ngm svg { fill: none; stroke-width: 1.25; width: 20px; height: 20px; flex: 0 0 20px; }
/* A coloured ring in place of the icon (the theme header's format rings). */
#ngm .ngm-ring { display: block; box-sizing: border-box; width: 16px; height: 16px; margin: 2px; flex: 0 0 16px; border: 2px solid var(--ring); border-radius: 50%; box-shadow: 0 0 8px color-mix(in srgb, var(--ring) 45%, transparent); }
#ngm .ngm-tag { display: inline-block; margin-left: 0.5em; padding: 1px 6px; border-radius: 4px; background: #ff3b5c; color: #fff; font-style: normal; font-size: 0.68em; font-weight: 700; letter-spacing: 0.04em; vertical-align: 0.15em; }

/* Search. */
#ngm .search {
	display: grid;
	grid-template: 1fr / 1fr;
	margin: 0 0 0.75em;
	width: 100%;
	padding-right: 28px;
	box-sizing: border-box;
}
#ngm.ngm--context .search { padding-right: 0; }
#ngm .search > * { grid-area: 1 / 1; align-self: center; }
#ngm .search svg { margin-left: 0.6em; opacity: 0.5; position: relative; z-index: 1; pointer-events: none; }
#ngm .search input {
	width: 100%;
	box-sizing: border-box;
	min-height: 36px;
	color: hsl(0 0% 100% / 0.75);
	font: 300 0.95rem/1.2 'NGM Asap', 'Asap', system-ui, sans-serif;
	box-shadow: 0 0 0 1px transparent;
	border: 1px solid hsl(var(--hue2) 13% 18.5% / 0.5);
	background: linear-gradient(to bottom, hsl(var(--hue1) 20% 20% / 0.1) 50%, hsl(var(--hue1) 50% 50% / 0.8) 180%);
	background-size: 100% 300%;
	background-position: 0% 0%;
	background-repeat: no-repeat;
	border-radius: calc(var(--radius) * 0.33333);
	padding: 0.4em 0.6em 0.4em 2.33em;
	transition: all 0.3s var(--ease);
	-webkit-appearance: none;
	appearance: none;
	outline: none;
}
#ngm .search input:focus {
	border-color: hsl(var(--hue1) 20% 70% / 0.5);
	background-position: 0% 50%;
	color: hsl(var(--hue1) 20% 85% / 1);
}
#ngm .search input::placeholder { color: hsl(0 0% 100% / 0.6); }
#ngm .search:has(input:focus) svg { stroke: hsl(var(--hue1) 60% 70% / 1); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
	#ngm, #ngm * { animation: none !important; transition-duration: 0s !important; }
}

@keyframes ngm-glow {
	0% { opacity: 0; }
	3% { opacity: 1; }
	10% { opacity: 0; }
	12% { opacity: 0.7; }
	16% { opacity: 0.3; animation-timing-function: var(--ease); }
	100% { opacity: 1; animation-timing-function: var(--ease); }
}
@keyframes ngm-glowoff { to { opacity: 0; } }
@keyframes ngm-flash {
	0% { opacity: 0; --item-opacity: 0; }
	7% { opacity: 0.5; --item-opacity: 1; }
	14% { opacity: 0; --item-opacity: 0.5; }
	21%, 100% { opacity: 1; --item-opacity: 1; }
}
