/* Gold Rhombus age gate
 *
 * Colours come from the Astra global palette (Customizer → Global → Colors):
 *   --ast-global-color-0  Brand / primary (gold)
 *   --ast-global-color-5  Light text on the dark overlay
 *   --ast-global-color-6  Dark background / ink
 *   --ast-global-color-7  Muted / subtle text
 * Each has a hard-coded fallback (the current Gold Rhombus palette), so the gate
 * still looks right if Astra isn't the active theme.
 *
 * Buttons:
 *   .gr-ag--astra       → the site's own outline button classes do the styling.
 *   .gr-ag--standalone  → any other theme: a complete built-in button style (bottom of file).
 */

#gr-age-gate {
	--gr-gold: var(--ast-global-color-0, #edbd83);
	--gr-text: var(--ast-global-color-5, #e8e6e0);
	--gr-ink: var(--ast-global-color-6, #111111);
	--gr-muted: var(--ast-global-color-7, #d1d5db);
	--gr-gold-line: color-mix(in srgb, var(--gr-gold) 45%, transparent);
	--gr-panel: color-mix(in srgb, var(--gr-ink) 88%, transparent);

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	align-items: center;
	justify-content: center;
	padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
	overflow-y: auto;
	color: var(--gr-text);
	background:
		radial-gradient(ellipse at center, color-mix(in srgb, var(--gr-ink) 35%, transparent) 0%, color-mix(in srgb, var(--gr-ink) 85%, transparent) 100%),
		url("img/smoke.jpg") center / cover no-repeat,
		var(--gr-ink);
}

#gr-age-gate *,
#gr-age-gate *::before,
#gr-age-gate *::after { box-sizing: border-box; }

#gr-age-gate .gr-ag__card {
	position: relative;
	width: 100%;
	max-width: 460px;
	margin: auto;
	padding: 40px 32px 28px;
	text-align: center;
	background: var(--gr-panel);
	border: 1px solid var(--gr-gold-line);
	border-radius: 4px;
	box-shadow: 0 30px 80px color-mix(in srgb, var(--gr-ink) 60%, transparent);
	backdrop-filter: blur(6px);
	animation: gr-ag-in 0.5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes gr-ag-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

#gr-age-gate .gr-ag__brand { margin-bottom: 14px; }
#gr-age-gate .gr-ag__logo-img { max-height: 72px; width: auto; max-width: 100%; height: auto; margin: 0 auto; display: block; }
#gr-age-gate .gr-ag__sitename {
	font-size: 1.6em;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--gr-gold);
}

/* Gold rule with a rhombus in the middle */
#gr-age-gate .gr-ag__rule {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 auto 22px;
	width: 160px;
}
#gr-age-gate .gr-ag__rule::before,
#gr-age-gate .gr-ag__rule::after {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--gr-gold));
}
#gr-age-gate .gr-ag__rule::after { background: linear-gradient(90deg, var(--gr-gold), transparent); }
#gr-age-gate .gr-ag__rule span {
	width: 8px; height: 8px;
	background: var(--gr-gold);
	transform: rotate(45deg);
}

#gr-age-gate .gr-ag__lead { margin: 0 0 24px; font-size: 1.15em; line-height: 1.4; color: var(--gr-text); }

/* ---------- Yes / No buttons (shared) ----------
 * On Astra, font/size/padding come from .wp-block-button__link / .wp-element-button and
 * text colour from .has-ast-global-color-0-color. Only the Spectra outline settings are
 * repeated here (Spectra only loads its CSS on pages containing the block). */
#gr-age-gate .gr-ag__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}
#gr-age-gate .gr-ag__btn,
#gr-age-gate .gr-ag__btn:hover,
#gr-age-gate .gr-ag__btn:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background-color: transparent;
	border: 2px solid currentColor;
	border-radius: 0;
	cursor: pointer;
}
#gr-age-gate .gr-ag__btn svg { width: 16px; height: 16px; flex: none; }
#gr-age-gate .gr-ag__btn:focus-visible { outline: 2px solid var(--gr-gold); outline-offset: 3px; }

#gr-age-gate .gr-ag__fine {
	margin: 22px 0 0;
	font-size: .72em;
	line-height: 1.55;
	color: var(--gr-muted);
}

/* ---------- Standalone buttons (non-Astra themes) ----------
 * A full button style so the gate doesn't depend on the theme's button CSS.
 * Mirrors the Gold Rhombus outline button: gold text and border, uppercase. */
#gr-age-gate.gr-ag--standalone {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}
#gr-age-gate.gr-ag--standalone .gr-ag__btn,
#gr-age-gate.gr-ag--standalone .gr-ag__btn:hover,
#gr-age-gate.gr-ag--standalone .gr-ag__btn:focus,
#gr-age-gate.gr-ag--standalone .gr-ag__btn:active {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
	padding: 14px 28px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	color: var(--gr-gold);
	transition: background-color .2s ease, color .2s ease;
}
#gr-age-gate.gr-ag--standalone .gr-ag__btn:hover {
	background-color: var(--gr-gold);
	color: var(--gr-ink);
}

/* ---------- Mobile: no box, content bleeds full screen ---------- */
@media (max-width: 600px) {
	#gr-age-gate { padding: 0; }
	#gr-age-gate .gr-ag__card {
		max-width: none;
		min-height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: max(32px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
		background: color-mix(in srgb, var(--gr-ink) 72%, transparent);
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}
}

@media (max-width: 420px) {
	#gr-age-gate .gr-ag__card { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	#gr-age-gate .gr-ag__card { animation: none; }
}

/* Leaving: fade out */
#gr-age-gate.is-leaving { animation: gr-ag-out .35s ease forwards; }
@keyframes gr-ag-out { to { opacity: 0; visibility: hidden; } }
