/* [file: wp-content/themes/storefront-storytheme/css/magical-header.css] */

/**
 * Calm Bedtime Header + Hero + Navigation
 * ------------------------------------------------------------
 * Single warm moon-gold accent on a deep, calm night-sky.
 * No shifting gradients, no twinkle/cloud animation, no sparkle
 * bursts, no per-item color variants. All variables come from
 * css/storytheme-tokens.css (--gng-*).
 * ------------------------------------------------------------
 */

/* Reset */
.gng-site-header,
.gng-site-header * {
	box-sizing: border-box;
}

.gng-site-header {
	background: var(--gng-bg-deep);
}

/* =============================================================
   Top bar — calm, solid, subtle bottom border
   ============================================================= */
.gng-top-bar {
	background: var(--gng-bg-deep);
	border-bottom: 1px solid var(--gng-border);
	position: relative;
	z-index: 1000;
	transition: box-shadow 0.3s ease;
}

.gng-top-bar.scrolled {
	box-shadow: var(--gng-shadow-soft);
}

.gng-top-bar-inner {
	max-width: var(--gng-container);
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
}

/* Branding */
.site-branding {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.site-logo-name {
	display: flex;
	align-items: center;
	gap: 12px;
}

.gng-brand-icon {
	font-size: 1.5rem;
	color: var(--gng-accent);
}

.site-title {
	margin: 0;
	font-family: var(--gng-font-title);
	font-weight: 700;
	font-size: 1.5rem;
	letter-spacing: 0.2px;
}

.site-title a {
	color: var(--gng-text);
	text-decoration: none;
	transition: color 0.22s ease;
}

.site-title a:hover {
	color: var(--gng-accent);
	text-decoration: none;
}

.site-description {
	color: var(--gng-text-muted);
	font-size: 0.9rem;
	margin: 0;
}

/* Top actions */
.gng-top-actions {
	display: flex;
	align-items: center;
	gap: 14px;
}

.gng-top-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 18px;
	border-radius: var(--gng-radius-pill);
	font-family: var(--gng-font-title);
	font-weight: 600;
	font-size: 14px;
	color: #2a2410;
	background: var(--gng-accent);
	text-decoration: none;
	transition: background-color 0.22s ease, transform 0.22s ease;
}

.gng-top-link:hover {
	background: var(--gng-accent-hover);
	color: #2a2410;
	transform: translateY(-1px);
	text-decoration: none;
}

.gng-top-link--ghost {
	background: transparent;
	color: var(--gng-text-muted);
	border: 1px solid var(--gng-border);
}

.gng-top-link--ghost:hover {
	background: rgba(255, 255, 255, 0.06);
	color: var(--gng-text);
}

.gng-top-link i {
	font-size: 14px;
}

/* Mobile menu toggle (hidden on desktop) */
.gng-menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: space-around;
	width: 40px;
	height: 40px;
	background: transparent;
	border: 1px solid var(--gng-border);
	border-radius: var(--gng-radius);
	cursor: pointer;
	padding: 8px;
}

.gng-menu-toggle-bar {
	height: 2px;
	background: var(--gng-text);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.gng-menu-toggle[aria-expanded="true"] .gng-menu-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.gng-menu-toggle[aria-expanded="true"] .gng-menu-toggle-bar:nth-child(2) {
	opacity: 0;
}
.gng-menu-toggle[aria-expanded="true"] .gng-menu-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* =============================================================
   Navigation — calm centered text links, gold underline hover
   ============================================================= */
.gng-nav {
	background: var(--gng-bg-deep);
	border-bottom: 1px solid var(--gng-border);
}

.gng-nav-container {
	max-width: var(--gng-container);
	margin: 0 auto;
	padding: 0 20px;
}

.gng-nav-menu {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 28px;
	list-style: none;
	margin: 0;
	padding: 14px 0;
}

.gng-nav-menu li {
	margin: 0;
}

.gng-nav-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 2px;
	color: var(--gng-text-muted);
	text-decoration: none;
	font-family: var(--gng-font-title);
	font-weight: 600;
	font-size: 15px;
	transition: color 0.22s ease;
}

.gng-nav-link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 0;
	background: var(--gng-accent);
	transition: width 0.22s ease;
}

.gng-nav-link:hover,
.gng-nav-link:focus {
	color: var(--gng-accent);
	text-decoration: none;
}

.gng-nav-link:hover::after,
.gng-nav-link:focus::after {
	width: 100%;
}

.gng-nav-link i {
	font-size: 13px;
	color: inherit;
}

/* Backwards-compat: a WP menu assigned to the "magical" location may
   render its own <li> items without the .gng-nav-link class. */
.gng-nav-menu a {
	color: var(--gng-text-muted);
	text-decoration: none;
	font-family: var(--gng-font-title);
	font-weight: 600;
	font-size: 15px;
	transition: color 0.22s ease;
}
.gng-nav-menu a:hover {
	color: var(--gng-accent);
}

/* =============================================================
   Hero — bedtime-magic illustration, emotional headline, dual CTA
   ============================================================= */
.gng-hero {
	position: relative;
	min-height: 560px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.gng-hero-illustration {
	position: absolute;
	inset: 0;
	background-image: url('../img/hero-bedtime-magic.png');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* Left-weighted gradient keeps the headline readable while the
   illustrated child + book stay visible on the right. */
.gng-hero-overlay {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(10, 12, 28, 0.72) 0%, rgba(10, 12, 28, 0.35) 55%, rgba(10, 12, 28, 0.15) 100%),
		linear-gradient(180deg, rgba(10, 12, 28, 0.25) 0%, rgba(10, 12, 28, 0.55) 100%);
}

/* Subtle twinkling stars (pure CSS, disabled via prefers-reduced-motion) */
.gng-hero-stars {
	position: absolute;
	inset: 0;
	z-index: 1;
	background-image:
		radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, 0.9), transparent),
		radial-gradient(1px 1px at 28% 12%, rgba(255, 255, 255, 0.7), transparent),
		radial-gradient(2px 2px at 44% 30%, rgba(244, 201, 122, 0.8), transparent),
		radial-gradient(1px 1px at 62% 18%, rgba(255, 255, 255, 0.6), transparent),
		radial-gradient(1.5px 1.5px at 80% 26%, rgba(255, 255, 255, 0.8), transparent),
		radial-gradient(1px 1px at 90% 14%, rgba(244, 201, 122, 0.7), transparent);
	background-repeat: no-repeat;
	animation: gng-hero-twinkle 4.5s ease-in-out infinite alternate;
	pointer-events: none;
}

@keyframes gng-hero-twinkle {
	from { opacity: 0.35; }
	to   { opacity: 1; }
}

.gng-hero-content {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--gng-container);
	padding: 80px 24px 120px;
	text-align: left;
}

.gng-hero-inner {
	max-width: 560px;
	margin: 0;
}

.gng-hero-title {
	font-family: var(--gng-font-title);
	font-weight: 700;
	font-size: clamp(1.9rem, 4.2vw, 3rem);
	color: #ffffff;
	margin: 0 0 16px;
	line-height: 1.2;
	letter-spacing: 0.2px;
	text-shadow: 0 2px 18px rgba(5, 6, 15, 0.55);
}

.gng-hero-highlight {
	color: var(--gng-accent);
}

.gng-hero-subtitle {
	font-size: clamp(1rem, 2vw, 1.15rem);
	color: var(--gng-text);
	margin: 0 0 30px;
	line-height: 1.65;
	text-shadow: 0 1px 12px rgba(5, 6, 15, 0.55);
}

.gng-hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

/* Ghost CTA — transparent pill next to the gold primary */
.gng-btn--ghost {
	background: rgba(15, 18, 38, 0.35);
	color: var(--gng-text);
	border: 1.5px solid rgba(255, 255, 255, 0.45);
	backdrop-filter: blur(2px);
}

.gng-btn--ghost:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: var(--gng-accent);
	color: var(--gng-accent);
}

/* Illustrated cloud band at the hero's bottom edge */
.gng-hero-clouds {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: clamp(70px, 12vw, 130px);
	z-index: 2;
	background-image: url('../img/divider-clouds.png');
	background-size: auto 200%;
	background-position: center bottom;
	background-repeat: repeat-x;
	pointer-events: none;
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 768px) {
	.gng-top-bar-inner {
		padding: 12px 16px;
	}

	.site-title {
		font-size: 1.25rem;
	}

	.gng-top-actions .gng-top-link span {
		display: none; /* icon-only on small screens */
	}
	.gng-top-actions .gng-top-link {
		padding: 0 14px;
	}

	.gng-menu-toggle {
		display: flex;
	}

	/* Nav collapses into the mobile toggle panel */
	.gng-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--gng-bg-deep);
		border-bottom: 1px solid var(--gng-border);
		box-shadow: var(--gng-shadow);
		z-index: 999;
	}
	.gng-nav.open {
		display: block;
	}
	.gng-nav-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
		padding: 16px 16px 20px;
	}
	.gng-nav-link {
		padding: 12px 8px;
		font-size: 16px;
	}
	.gng-nav-link::after {
		display: none;
	}

	.gng-hero {
		min-height: 440px;
	}
	.gng-hero-content {
		padding: 48px 18px 96px;
		text-align: center;
	}
	.gng-hero-inner {
		margin: 0 auto;
	}
	.gng-hero-actions {
		justify-content: center;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.gng-nav-menu {
		gap: 6px 18px;
	}
	.gng-nav-link {
		font-size: 14px;
	}
}
