/**
 * Curlo Hero — layout glue for a Realo-Pro-style split marketing hero.
 * Surfaces/tokens come from the brand kit; this file owns the composition only.
 */

.curlo-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	width: 100%;
	box-sizing: border-box;
}

/* Full-bleed when nested inside .curlo-container (static pages). */
.curlo-container .curlo-hero.alignfull,
.entry-content .curlo-hero.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.curlo-hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: clamp(2rem, 4vw, 3.5rem);
	align-items: center;
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(3rem, 6vw, 5.5rem) 24px;
	box-sizing: border-box;
}

/* Editor: InnerBlocks list is the grid container (via useInnerBlocksProps). */
.curlo-hero__inner.block-editor-block-list__layout {
	display: grid;
}

.curlo-hero--min-md .curlo-hero__inner {
	min-height: 28rem;
}

.curlo-hero--min-lg .curlo-hero__inner {
	min-height: 34rem;
}

.curlo-hero--min-xl .curlo-hero__inner {
	min-height: 40rem;
}

.curlo-hero--media-left .curlo-hero__inner {
	grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.curlo-hero--media-left .curlo-hero__copy {
	order: 2;
}

.curlo-hero--media-left .curlo-hero__visual {
	order: 1;
}

/* ---- Surfaces ----------------------------------------------------------- */

/* Always-dark marketing plane (Realo navy → Curlo code chrome). */
.curlo-hero--pro {
	background-color: var(--curlo-code-bg);
	background-image:
		radial-gradient(650px circle at 12% -5%, rgb(20 53 31 / 0.45), transparent 60%),
		radial-gradient(700px circle at 100% 10%, rgb(16 35 58 / 0.5), transparent 55%);
	color: var(--curlo-code-text);
}

.curlo-hero--pro .curlo-hero__copy .curlo-eyebrow,
.curlo-hero--pro .curlo-hero__copy h1,
.curlo-hero--pro .curlo-hero__copy h2,
.curlo-hero--pro .curlo-hero__copy .curlo-page-title,
.curlo-hero--pro .curlo-hero__copy p {
	color: var(--curlo-code-text);
}

.curlo-hero--pro .curlo-hero__copy .curlo-eyebrow {
	color: var(--curlo-green);
}

.curlo-hero--pro .curlo-hero__copy p {
	color: var(--curlo-code-muted);
}

.curlo-hero--ink {
	background: var(--curlo-ink);
	color: var(--curlo-text);
}

.curlo-hero--surface {
	background: var(--curlo-surface);
	color: var(--curlo-text);
}

.curlo-hero--surface-2 {
	background: var(--curlo-surface-2);
	color: var(--curlo-text);
}

.curlo-hero--code {
	background: var(--curlo-code-bg);
	color: var(--curlo-code-text);
}

.curlo-hero--code .curlo-hero__copy .curlo-eyebrow {
	color: var(--curlo-green);
}

.curlo-hero--code .curlo-hero__copy p {
	color: var(--curlo-code-muted);
}

/* ---- Copy column -------------------------------------------------------- */

.curlo-hero__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.1rem;
	min-width: 0;
}

/* WP group inner wrapper (older markup) or direct children (newer). */
.curlo-hero__copy > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.1rem;
	width: 100%;
}

.curlo-hero__copy > :first-child {
	margin-top: 0;
}

.curlo-hero__copy > :last-child {
	margin-bottom: 0;
}

.curlo-hero__copy .curlo-eyebrow {
	margin: 0;
}

.curlo-hero__copy h1,
.curlo-hero__copy .curlo-page-title {
	margin: 0;
	font-size: clamp(2rem, 1.35rem + 2.4vw, 3.35rem);
	line-height: 1.12;
	letter-spacing: -0.035em;
	font-weight: 800;
	max-width: 18ch;
}

.curlo-hero__copy .curlo-page-title {
	font-family: var(--curlo-font-mono);
	font-weight: 700;
	max-width: 22ch;
}

.curlo-hero__copy > p,
.curlo-hero__copy .curlo-hero__lead {
	margin: 0;
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
	line-height: 1.65;
	max-width: 38ch;
}

.curlo-hero__actions,
.curlo-hero__copy .curlo-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.curlo-hero__actions > .wp-block-group__inner-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.curlo-hero__actions .curlo-btn,
.curlo-hero__copy .wp-block-curlo-button {
	margin: 0;
}

/* Keep secondary CTAs readable on the always-dark pro plane. */
.curlo-hero--pro .curlo-btn--ghost,
.curlo-hero--pro .curlo-btn--outline,
.curlo-hero--code .curlo-btn--ghost,
.curlo-hero--code .curlo-btn--outline {
	color: var(--curlo-code-text);
	border-color: var(--curlo-code-line);
}

.curlo-hero--pro .curlo-btn--ghost:hover,
.curlo-hero--pro .curlo-btn--outline:hover,
.curlo-hero--code .curlo-btn--ghost:hover,
.curlo-hero--code .curlo-btn--outline:hover {
	background: rgb(255 255 255 / 0.06);
	color: var(--curlo-code-text);
}

/* ---- Visual column ------------------------------------------------------ */

.curlo-hero__visual {
	position: relative;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.curlo-hero__visual > :first-child {
	margin-top: 0;
}

.curlo-hero__visual > :last-child {
	margin-bottom: 0;
}

.curlo-hero__visual .curlo-terminal,
.curlo-hero__visual .curlo-reconcile,
.curlo-hero__visual .curlo-card,
.curlo-hero__visual img,
.curlo-hero__visual figure {
	width: 100%;
	max-width: 36rem;
	margin: 0;
}

.curlo-hero__visual img,
.curlo-hero__visual figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--curlo-radius);
	border: 1px solid var(--curlo-code-line, var(--curlo-line));
	box-shadow: var(--curlo-shadow-lg);
}

.curlo-hero__visual .curlo-terminal,
.curlo-hero__visual .curlo-reconcile {
	box-shadow: var(--curlo-shadow-lg);
	animation: curlo-hero-rise 0.55s ease-out both;
}

.curlo-hero__visual .curlo-card {
	animation: curlo-hero-rise 0.55s 0.08s ease-out both;
}

@keyframes curlo-hero-rise {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.curlo-hero__copy {
	animation: curlo-hero-fade 0.45s ease-out both;
}

@keyframes curlo-hero-fade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Soft glow behind the visual on pro/code surfaces. */
.curlo-hero--pro .curlo-hero__visual::before,
.curlo-hero--code .curlo-hero__visual::before {
	content: "";
	position: absolute;
	inset: 12% 8% 8% 8%;
	background: radial-gradient(circle at 50% 40%, rgb(74 222 128 / 0.18), transparent 65%);
	filter: blur(18px);
	z-index: -1;
	pointer-events: none;
}

/* ---- Optional logo strip (third direct child) --------------------------- */

.curlo-hero__logos {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 1.5rem 2rem;
	padding-top: 0.5rem;
	margin-top: 0.5rem;
	border-top: 1px solid rgb(255 255 255 / 0.08);
	opacity: 0.72;
}

.curlo-hero--ink .curlo-hero__logos,
.curlo-hero--surface .curlo-hero__logos,
.curlo-hero--surface-2 .curlo-hero__logos {
	border-top-color: var(--curlo-line);
}

.curlo-hero__logos img {
	height: 1.35rem;
	width: auto;
	max-width: 7rem;
	object-fit: contain;
	filter: grayscale(1) brightness(1.2);
	opacity: 0.85;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 820px) {
	.curlo-hero__inner,
	.curlo-hero--media-left .curlo-hero__inner {
		grid-template-columns: 1fr;
		min-height: 0;
		padding-top: 2.75rem;
		padding-bottom: 2.75rem;
		gap: 2rem;
	}

	.curlo-hero--media-left .curlo-hero__copy,
	.curlo-hero--media-left .curlo-hero__visual {
		order: unset;
	}

	.curlo-hero__copy h1,
	.curlo-hero__copy .curlo-page-title {
		max-width: none;
	}

	.curlo-hero__copy > p,
	.curlo-hero__copy .curlo-hero__lead {
		max-width: none;
	}

	.curlo-hero__visual .curlo-terminal,
	.curlo-hero__visual .curlo-reconcile,
	.curlo-hero__visual .curlo-card,
	.curlo-hero__visual img,
	.curlo-hero__visual figure {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.curlo-hero__copy,
	.curlo-hero__visual .curlo-terminal,
	.curlo-hero__visual .curlo-reconcile,
	.curlo-hero__visual .curlo-card {
		animation: none;
	}
}
