/* Glow Button — structural styles. Per-instance colors/size/font are set as
   inline CSS custom properties by the [glow_button] shortcode, so these
   var() fallbacks only apply if something goes unset. */

.glow-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--glow-gap, 10px);
	overflow: hidden;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	/* Reset <button>-tag defaults (popup-mode buttons render as <button>, not <a>). */
	border: none;
	margin: 0;
	background-color: transparent;
	appearance: none;
	font-weight: 600;
	letter-spacing: -0.01em;
	font-family: var(--glow-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	font-size: var(--glow-font-size, 14px);
	padding: var(--glow-pad-y, 14px) var(--glow-pad-x, 24px);
	border-radius: var(--glow-radius, 12px);
	color: var(--glow-text, #ffffff);
	background-image: linear-gradient(180deg, var(--glow-1, #ff8a3a) 0%, var(--glow-2, #ff6b00) 50%, var(--glow-3, #e55c00) 100%);
	box-shadow:
		0 18px 36px -12px rgba(var(--glow-shadow-rgb, 255, 107, 0), 0.6),
		0 8px 16px -6px rgba(var(--glow-shadow-rgb, 255, 107, 0), 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.28),
		0 0 0 1px rgba(10, 10, 10, 0.15);
	transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 500ms cubic-bezier(0.16, 1, 0.3, 1),
		color 250ms ease;
}

.glow-btn:hover {
	color: var(--glow-text-hover, var(--glow-text, #ffffff));
	box-shadow:
		0 26px 48px -12px rgba(var(--glow-shadow-rgb, 255, 107, 0), 0.7),
		0 12px 24px -6px rgba(var(--glow-shadow-rgb, 255, 107, 0), 0.5),
		inset 0 1px 0 rgba(255, 255, 255, 0.36),
		0 0 0 1px rgba(10, 10, 10, 0.15);
}

.glow-btn.is-animated:hover { transform: scale(1.025); }
.glow-btn.is-animated:active { transform: scale(0.98); }

/* diagonal shine sweep */
.glow-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
	transform: translateX(-100%);
}
.glow-btn.is-animated::before { transition: transform 700ms ease-out; }
.glow-btn.is-animated:hover::before { transform: translateX(100%); }

/* soft top highlight */
.glow-btn::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: inherit;
	background: radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%);
	opacity: 0;
}
.glow-btn.is-animated::after { transition: opacity 500ms ease-out; }
.glow-btn.is-animated:hover::after { opacity: 1; }

.glow-btn__icon {
	position: relative;
	flex: none;
	width: var(--glow-icon-size, 16px);
	height: var(--glow-icon-size, 16px);
}
.glow-btn.is-animated .glow-btn__icon { transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1); }
.glow-btn.is-animated:hover .glow-btn__icon { transform: rotate(14deg) scale(1.1); }

/* Dashicons are a font icon, not an SVG: size via font-size and center the glyph. */
.glow-btn__icon.dashicons {
	font-size: var(--glow-icon-size, 16px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.glow-btn__icon.dashicons:before {
	line-height: 1;
}

.glow-btn__label { position: relative; }

.glow-btn__arrow {
	position: relative;
	flex: none;
	width: var(--glow-arrow-size, 13px);
	height: var(--glow-arrow-size, 13px);
	margin-left: -4px;
	opacity: 0;
	transform: translateX(-4px);
}
.glow-btn.is-animated .glow-btn__arrow {
	transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.glow-btn.is-animated:hover .glow-btn__arrow { opacity: 1; transform: translateX(0); }

/* without hover animation, show the arrow at rest instead of hiding it forever */
.glow-btn:not(.is-animated) .glow-btn__arrow { opacity: 1; transform: translateX(0); }

/* ------------------------------------------------------------------
 * Popup (click action = "Open a popup")
 * ------------------------------------------------------------------ */

.glow-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.glow-popup[hidden] { display: none; }

.glow-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 20, 0.55);
}

/* Outer dialog owns the rounded shape and clips to it — it does NOT scroll
   itself. border-radius + overflow-y:auto on the SAME element lets the
   scrollbar square off the corner it sits against once content is tall
   enough to scroll; a plain inner wrapper (.glow-popup__scroll) handles
   scrolling instead, so corners stay rounded regardless of content height.
   Width/height are per-button settings, each clamped with min() so any
   value chosen degrades to internal scrolling on small screens rather
   than overflowing them. */
.glow-popup__dialog {
	position: relative;
	width: 100%;
	max-width: min(var(--glow-popup-width, 480px), 100%);
	max-height: min(var(--glow-popup-height, 640px), 85vh);
	display: flex;
	flex-direction: column;
	background: #ffffff;
	color: #14142b;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.35);
}
@media (max-width: 480px) {
	.glow-popup { padding: 12px; }
	.glow-popup__dialog { border-radius: 14px; }
	.glow-popup__scroll { padding: 20px; }
}

.glow-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: #f0f0f1;
	color: #1d2327;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.glow-popup__close:hover { background: #e2e2e3; }

.glow-popup__scroll {
	min-height: 0;
	overflow-y: auto;
	padding: 32px;
}

.glow-popup__heading {
	margin: 0 0 16px;
	padding-right: 32px;
	font-size: 1.4rem;
	font-weight: 700;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.glow-popup__visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.glow-popup__dialog {
		animation: glow-popup-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
	}
}
@keyframes glow-popup-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
