/* ==========================================================================
   EA Hero Generator — front-end styles
   Design tokens follow the EasyAccurate system: navy #0d2240 / amber #f59e0b,
   Syne display + DM Sans body (falls back gracefully if theme doesn't load them).
   ========================================================================== */

.ea-hg {
	--ea-hg-primary: #0d2240;
	--ea-hg-accent: #f59e0b;
	--ea-hg-ink: #ffffff;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
	isolation: isolate;
	background: var(--ea-hg-primary);
	font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--ea-hg-ink);
}

.ea-hg--dark { --ea-hg-ink: #0d2240; }

/* Heights */
.ea-hg--h-compact { min-height: 380px; }
.ea-hg--h-medium  { min-height: 520px; }
.ea-hg--h-large   { min-height: 660px; }
.ea-hg--h-full    { min-height: 100vh; min-height: 100svh; }

/* Background image layer */
.ea-hg__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: -2;
}

/* ==========================================================================
   Overlay styles
   ========================================================================== */

.ea-hg__overlay {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

/* 1. Gradient scrim — classic left-weighted readability gradient */
.ea-hg--overlay-gradient .ea-hg__overlay {
	background: linear-gradient(
		100deg,
		color-mix(in srgb, var(--ea-hg-primary) 96%, black) 0%,
		color-mix(in srgb, var(--ea-hg-primary) 82%, transparent) 45%,
		color-mix(in srgb, var(--ea-hg-primary) 30%, transparent) 100%
	);
}

/* 2. Split panel — solid content column, image breathes on the right */
.ea-hg--overlay-split .ea-hg__overlay {
	background: linear-gradient(
		90deg,
		var(--ea-hg-primary) 0%,
		var(--ea-hg-primary) 48%,
		transparent 48.01%
	);
}
.ea-hg--overlay-split.ea-hg--align-center .ea-hg__overlay {
	background: color-mix(in srgb, var(--ea-hg-primary) 78%, transparent);
}

/* 3. Diagonal wedge */
.ea-hg--overlay-diagonal .ea-hg__overlay {
	background: linear-gradient(
		112deg,
		var(--ea-hg-primary) 0%,
		var(--ea-hg-primary) 44%,
		color-mix(in srgb, var(--ea-hg-primary) 55%, transparent) 62%,
		transparent 100%
	);
}
.ea-hg--overlay-diagonal .ea-hg__overlay::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 42%;
	width: 4px;
	background: var(--ea-hg-accent);
	transform: skewX(-14deg);
	opacity: 0.9;
}

/* 4. Glass card — frosted panel around content */
.ea-hg--overlay-glass .ea-hg__overlay {
	background: color-mix(in srgb, var(--ea-hg-primary) 35%, transparent);
}
.ea-hg--overlay-glass .ea-hg__content {
	background: color-mix(in srgb, var(--ea-hg-primary) 45%, transparent);
	-webkit-backdrop-filter: blur(14px) saturate(1.2);
	backdrop-filter: blur(14px) saturate(1.2);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 18px;
	padding: clamp(1.5rem, 4vw, 3rem);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* 5. Duotone wash */
.ea-hg--overlay-duotone .ea-hg__overlay {
	background:
		linear-gradient(135deg,
			color-mix(in srgb, var(--ea-hg-primary) 85%, transparent) 0%,
			color-mix(in srgb, var(--ea-hg-accent) 45%, transparent) 100%);
	mix-blend-mode: multiply;
}
.ea-hg--overlay-duotone .ea-hg__bg { filter: grayscale(1) contrast(1.05); }

/* 6. Grid pattern — subtle blueprint texture over solid primary */
.ea-hg--overlay-pattern .ea-hg__overlay {
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
	background-size: 44px 44px;
}
.ea-hg--overlay-pattern .ea-hg__overlay::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 25% 40%, transparent 0%, color-mix(in srgb, var(--ea-hg-primary) 65%, black) 130%);
}

/* 7. Cinematic dark — heavy vignette + accent glow */
.ea-hg--overlay-cinematic .ea-hg__overlay {
	background:
		radial-gradient(ellipse at 70% 20%, color-mix(in srgb, var(--ea-hg-accent) 22%, transparent) 0%, transparent 45%),
		linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 40%, rgba(0, 0, 0, 0.75) 100%);
}
.ea-hg--overlay-cinematic { background: #08131f; }

/* ==========================================================================
   Motion effects
   ========================================================================== */

@keyframes ea-hg-kenburns {
	from { transform: scale(1); }
	to   { transform: scale(1.12); }
}
.ea-hg--effect-kenburns .ea-hg__bg {
	animation: ea-hg-kenburns 22s ease-out both alternate infinite;
}

.ea-hg--effect-parallax .ea-hg__bg {
	top: -14%;
	bottom: -14%;
	will-change: transform;
}

@keyframes ea-hg-gradientshift {
	0%   { background-position: 0% 50%; }
	50%  { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}
.ea-hg--effect-gradientshift .ea-hg__overlay {
	background: linear-gradient(
		115deg,
		color-mix(in srgb, var(--ea-hg-primary) 95%, black),
		color-mix(in srgb, var(--ea-hg-primary) 70%, var(--ea-hg-accent)),
		color-mix(in srgb, var(--ea-hg-primary) 95%, black)
	);
	background-size: 240% 240%;
	animation: ea-hg-gradientshift 14s ease infinite;
	opacity: 0.94;
}

.ea-hg__particles {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

/* ==========================================================================
   Layout & typography
   ========================================================================== */

.ea-hg__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 4vw, 2.5rem);
	display: flex;
}

.ea-hg--align-left  .ea-hg__inner { justify-content: flex-start; }
.ea-hg--align-center .ea-hg__inner { justify-content: center; text-align: center; }

.ea-hg__content { max-width: 640px; }
.ea-hg--overlay-split .ea-hg__content { max-width: 520px; }

.ea-hg__eyebrow {
	margin: 0 0 0.9rem;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ea-hg-accent);
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}
.ea-hg--align-left .ea-hg__eyebrow::before {
	content: "";
	width: 34px;
	height: 2px;
	background: var(--ea-hg-accent);
}

.ea-hg__headline {
	margin: 0 0 1.1rem;
	font-family: "Syne", "DM Sans", sans-serif;
	font-size: clamp(2.1rem, 5.2vw, 3.9rem);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.015em;
	color: inherit;
}

.ea-hg__highlight {
	color: var(--ea-hg-accent);
	position: relative;
	white-space: nowrap;
}
.ea-hg__highlight::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.06em;
	height: 0.14em;
	background: color-mix(in srgb, var(--ea-hg-accent) 35%, transparent);
	z-index: -1;
	border-radius: 2px;
}

/* Rotating words */
.ea-hg__rotator {
	display: inline-grid;
	vertical-align: bottom;
	color: var(--ea-hg-accent);
}
.ea-hg__rotate-word {
	grid-area: 1 / 1;
	opacity: 0;
	transform: translateY(0.35em);
	transition: opacity 0.45s ease, transform 0.45s ease;
	white-space: nowrap;
}
.ea-hg__rotate-word.is-active {
	opacity: 1;
	transform: translateY(0);
}

.ea-hg__sub {
	margin: 0 0 1.8rem;
	font-size: clamp(1.02rem, 1.6vw, 1.2rem);
	line-height: 1.6;
	opacity: 0.92;
	max-width: 56ch;
}
.ea-hg--align-center .ea-hg__sub { margin-inline: auto; }

/* ==========================================================================
   CTAs
   ========================================================================== */

.ea-hg__ctas {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.9rem;
	margin-bottom: 1.6rem;
}
.ea-hg--align-center .ea-hg__ctas { justify-content: center; }

.ea-hg__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1.7rem;
	border-radius: 10px;
	font-size: 1rem;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.ea-hg__btn:focus-visible {
	outline: 3px solid var(--ea-hg-accent);
	outline-offset: 3px;
}

.ea-hg__btn--primary {
	background: var(--ea-hg-accent);
	color: #1a1206;
	box-shadow: 0 8px 24px color-mix(in srgb, var(--ea-hg-accent) 40%, transparent);
}
.ea-hg__btn--primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 30px color-mix(in srgb, var(--ea-hg-accent) 55%, transparent);
	color: #1a1206;
}

.ea-hg__btn--secondary {
	background: transparent;
	color: inherit;
	border: 2px solid color-mix(in srgb, currentColor 45%, transparent);
}
.ea-hg__btn--secondary:hover {
	border-color: currentColor;
	transform: translateY(-2px);
	color: inherit;
}

.ea-hg__call {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	font-size: 1.05rem;
	color: inherit;
	text-decoration: none;
	border-bottom: 2px solid var(--ea-hg-accent);
	padding-bottom: 2px;
}
.ea-hg__call:hover { color: var(--ea-hg-accent); }
.ea-hg__call-icon { color: var(--ea-hg-accent); }

/* ==========================================================================
   Trust layer
   ========================================================================== */

.ea-hg__trust { display: grid; gap: 0.75rem; }

.ea-hg__rating {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	font-size: 1.05rem;
}
.ea-hg--align-center .ea-hg__rating { justify-content: center; }
.ea-hg__star { color: color-mix(in srgb, currentColor 25%, transparent); }
.ea-hg__star--full { color: var(--ea-hg-accent); }
.ea-hg__star--half {
	background: linear-gradient(90deg, var(--ea-hg-accent) 50%, color-mix(in srgb, currentColor 25%, transparent) 50%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.ea-hg__rating-text {
	margin-left: 0.55rem;
	font-size: 0.92rem;
	font-weight: 600;
	opacity: 0.92;
}

.ea-hg__badges {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.2rem;
}
.ea-hg--align-center .ea-hg__badges { justify-content: center; }
.ea-hg__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.92rem;
	font-weight: 600;
}
.ea-hg__badge svg { color: var(--ea-hg-accent); flex-shrink: 0; }

.ea-hg__meta {
	margin: 0;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	opacity: 0.75;
}
.ea-hg__meta-sep { margin: 0 0.35rem; color: var(--ea-hg-accent); opacity: 1; }

/* ==========================================================================
   Emergency banner
   ========================================================================== */

.ea-hg__emergency {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem 0.9rem;
	padding: 0.6rem 1rem;
	background: linear-gradient(90deg, #b91c1c, #dc2626, #b91c1c);
	color: #fff;
	font-size: 0.92rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-align: center;
}
.ea-hg__emergency-pulse {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #fff;
	animation: ea-hg-pulse 1.6s ease-in-out infinite;
}
@keyframes ea-hg-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
	50%      { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
}
.ea-hg__emergency-call {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 800;
}

/* ==========================================================================
   Divider
   ========================================================================== */

.ea-hg__divider {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	width: 100%;
	height: clamp(40px, 7vw, 110px);
	color: #ffffff; /* Matches the section below; themes can override. */
	z-index: 2;
	display: block;
}

/* ==========================================================================
   Missing-hero editor notice
   ========================================================================== */

.ea-hg-missing {
	padding: 1rem;
	background: #fef3c7;
	border-left: 4px solid #f59e0b;
	color: #78350f;
	font-weight: 600;
}

/* ==========================================================================
   Responsive & accessibility
   ========================================================================== */

@media (max-width: 782px) {
	.ea-hg--overlay-split .ea-hg__overlay {
		background: color-mix(in srgb, var(--ea-hg-primary) 88%, transparent);
	}
	.ea-hg--overlay-diagonal .ea-hg__overlay::after { display: none; }
	.ea-hg__ctas .ea-hg__btn { flex: 1 1 auto; }
	.ea-hg--h-full { min-height: 88svh; }
}

@media (prefers-reduced-motion: reduce) {
	.ea-hg--effect-kenburns .ea-hg__bg,
	.ea-hg--effect-gradientshift .ea-hg__overlay,
	.ea-hg__emergency-pulse {
		animation: none;
	}
	.ea-hg__rotate-word { transition: none; }
	.ea-hg--effect-parallax .ea-hg__bg { top: 0; bottom: 0; }
}
