/**
 * Coming Soon (Modern) Block Frontend Styles
 * Uses --lwp- CSS variables from the dynamic palette system.
 */

/* ===== SECTION ===== */

.lwp-csm {
	position: relative;
	min-height: 100vh;
	min-height: 100svh; /* small viewport height — iOS toolbar friendly (fallback above) */
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 96px 24px;
	box-sizing: border-box;
	background-color: var(--lwp-bg-primary, #0a0e17);
	color: var(--lwp-text-primary, #e8eaf0);
	text-align: center;
}

/* ===== HEIGHT =====
 * The `sectionHeight` attribute lowers that floor; render.php emits
 * lwp-csm-h-{value} (100vh is the default, so it needs no rule here). Two
 * things to keep if you edit this:
 *   - each rule repeats the vh/svh pair, svh last, exactly like the base rule
 *     above — a short section still wants the iOS-toolbar-friendly unit;
 *   - the selectors carry both classes. A single-class `.lwp-csm-h-60vh` would
 *     tie the base rule on specificity and win on source order alone, so a
 *     reshuffle in this file could quietly switch a section back to full
 *     height; the two-class form wins on specificity and cannot be reordered
 *     into silence.
 * `auto` removes the floor: the section becomes its content + the base padding.
 * These are minimums, never caps — content taller than the floor still wins.
 */

.lwp-csm.lwp-csm-h-80vh {
	min-height: 80vh;
	min-height: 80svh;
}

.lwp-csm.lwp-csm-h-60vh {
	min-height: 60vh;
	min-height: 60svh;
}

.lwp-csm.lwp-csm-h-50vh {
	min-height: 50vh;
	min-height: 50svh;
}

.lwp-csm.lwp-csm-h-auto {
	min-height: 0;
}

/* Background layers — the section's backdrop is composed of these, driven by
   the backgroundStyle attribute (flat / glow / image / image-glow). The glow
   layers reuse the Modern Hero's .layer-1/2/3 recipe (see
   blocks/modern-hero/style-index.css) scoped under .lwp-csm so the two blocks
   read as one design system. */
.lwp-csm-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover;
	background-position: center;
}

/* Darkening scrim — only the plain `image` preset gets it, so the centered
   copy stays readable on every palette. `image-glow` skips it: the hero glow
   layers already sit on top and carry their own contrast. */
.lwp-csm-bg-image .lwp-csm-bg::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		color-mix(in srgb, var(--lwp-bg-primary, #0a0e17) 72%, transparent) 0%,
		color-mix(in srgb, var(--lwp-bg-primary, #0a0e17) 88%, transparent) 100%
	);
}

/* The hero's three background layers, scoped to this block. */
.lwp-csm-layer {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.lwp-csm-layer-1 {
	background: radial-gradient(ellipse at 30% 50%, color-mix(in srgb, var(--lwp-accent, #7c5cbf) 15%, transparent) 0%, transparent 60%);
}

.lwp-csm-layer-2 {
	background: radial-gradient(ellipse at 70% 80%, color-mix(in srgb, var(--lwp-accent, #7c5cbf) 8%, transparent) 0%, transparent 50%);
}

.lwp-csm-layer-3 {
	/* Noise pattern tinted with the palette accent (matches the hero). */
	background-color: color-mix(in srgb, var(--lwp-accent, #7c5cbf) 3%, transparent);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2V6h4V4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ===== CONTENT ===== */

.lwp-csm-container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 640px;
}

.lwp-csm-eyebrow {
	font-family: var(--lwp-font-sans, 'Inter', -apple-system, sans-serif);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--lwp-accent-light, #a382de);
	margin: 0 0 16px;
}

.lwp-csm-title {
	font-family: var(--lwp-font-serif, 'Cormorant Garamond', Georgia, serif);
	font-size: clamp(2.6rem, 6vw, 4.5rem);
	font-weight: 300;
	line-height: 1.1;
	/* Reset the UA heading margin — the block owns spacing via margin-bottom only. */
	margin: 0 0 20px;
	color: var(--lwp-text-primary, #e8eaf0);
}

.lwp-csm-message {
	font-size: 1.05rem;
	line-height: 1.8;
	/* text-secondary (not text-muted): muted falls just under WCAG AA 4.5:1 on the dark palettes */
	color: var(--lwp-text-secondary, #9aa5b8);
}

.lwp-csm-message p {
	margin: 0 0 1em;
}

.lwp-csm-message p:last-child {
	margin-bottom: 0;
}

/* ===== SIGNUP =====
 * The form markup is the LWP Newsletter Bar plugin's (lwp_render_newsletter_block):
 * .lwp-newsletter-title / .lwp-newsletter-description / .lwp-newsletter-block-form
 * (input.lwp-email-input + button.lwp-subscribe-button) / .lwp-message + .alert-*.
 * The plugin's own stylesheet supplies the base layout (flex row, responsive
 * stacking, input/button padding); these scoped overrides re-skin it to the
 * palette. Only colors and radii are overridden — the plugin's own padding
 * and font metrics stand.
 */

.lwp-csm-signup {
	margin-top: 48px;
}

.lwp-csm-signup .lwp-newsletter-title {
	font-family: var(--lwp-font-serif, 'Cormorant Garamond', Georgia, serif);
	font-size: 1.75rem;
	font-weight: 500;
	margin: 0 0 8px;
	color: var(--lwp-text-primary, #e8eaf0);
}

.lwp-csm-signup .lwp-newsletter-description {
	font-size: 0.95rem;
	margin: 0 0 20px;
	color: var(--lwp-text-secondary, #9aa5b8);
}

.lwp-csm-signup .lwp-newsletter-block-form {
	max-width: 440px;
	margin: 0 auto 12px;
}

.lwp-csm-signup .lwp-email-input {
	background: var(--lwp-surface, rgba(20, 30, 50, 0.6));
	border: 1px solid var(--lwp-border, rgba(124, 92, 191, 0.2));
	border-radius: var(--lwp-radius-sm, 6px);
	color: var(--lwp-text-primary, #e8eaf0);
}

.lwp-csm-signup .lwp-email-input::placeholder {
	color: var(--lwp-text-muted, #6b7a94);
}

.lwp-csm-signup .lwp-email-input:focus {
	outline: none;
	border-color: var(--lwp-accent, #7c5cbf);
	box-shadow: 0 0 0 2px var(--lwp-accent-glow, rgba(124, 92, 191, 0.3));
}

.lwp-csm-signup .lwp-subscribe-button {
	background: var(--lwp-accent, #7c5cbf);
	border-radius: var(--lwp-radius-sm, 6px);
	color: #fff;
}

.lwp-csm-signup .lwp-subscribe-button:hover {
	background: var(--lwp-accent-light, #a382de);
}

.lwp-csm-signup .lwp-subscribe-button:disabled {
	background: var(--lwp-accent-secondary, #6a4bb8);
}

/* AJAX feedback line (plugin .alert-success / .alert-danger inside
   .lwp-message). The plugin's own alert styles are scoped to its block
   wrapper, which this embedded form is not inside — so the base alert
   geometry is provided here, not borrowed. */
.lwp-csm-signup .lwp-message .alert {
	box-sizing: border-box;
	width: 100%;
	padding: 10px;
	margin-top: 4px;
	font-size: 0.9rem;
	border: 1px solid transparent;
	border-radius: var(--lwp-radius-sm, 6px);
}

.lwp-csm-signup .lwp-message .alert-success {
	background: color-mix(in srgb, var(--lwp-accent, #7c5cbf) 18%, transparent);
	border-color: var(--lwp-accent, #7c5cbf);
	color: var(--lwp-text-primary, #e8eaf0);
}

.lwp-csm-signup .lwp-message .alert-danger {
	background: rgba(196, 30, 58, 0.15);
	border-color: #c41e3a;
	color: #f2c9d2;
}

/* ===== LAYOUTS =====
 * The `layout` attribute composes the same content four ways (render.php
 * emits lwp-csm-layout-{value}). The centered default rides on the base
 * rules above, so it only appears here as a comment. The other three are
 * the Modern Hero's editorial / split-screen / title-card languages,
 * re-skinned for this block. backgroundStyle still owns the backdrop for
 * every layout. The editor preview mirrors these values in lockstep
 * (editor.js LAYOUT_META — rule 6).
 */

/* Editorial + Bottom share the "statement" typography: a wide centered
   column with left-aligned copy and hero-scale serif type (the hero's
   editorial language). Only the vertical anchor differs — Bottom pins to
   the viewport's bottom edge like a film title card. */
.lwp-csm-layout-editorial .lwp-csm-container,
.lwp-csm-layout-bottom .lwp-csm-container {
	max-width: 1040px;
	text-align: left;
}

.lwp-csm-layout-editorial .lwp-csm-title,
.lwp-csm-layout-bottom .lwp-csm-title {
	font-size: clamp(3rem, 8vw, 6rem);
	letter-spacing: -0.02em;
	margin: 0 0 24px;
}

.lwp-csm-layout-editorial .lwp-csm-message,
.lwp-csm-layout-bottom .lwp-csm-message {
	max-width: 640px;
	font-size: 1.1rem;
}

/* The signup keeps its own measure and left-aligns with the copy (the base
   rule centers the form; these layouts are left-aligned statements). */
.lwp-csm-layout-editorial .lwp-csm-signup,
.lwp-csm-layout-bottom .lwp-csm-signup {
	max-width: 480px;
}

.lwp-csm-layout-editorial .lwp-csm-signup .lwp-newsletter-block-form,
.lwp-csm-layout-bottom .lwp-csm-signup .lwp-newsletter-block-form {
	margin: 0 0 12px;
}

/* Bottom — the viewport anchor: content sits on the bottom edge, with
   extra breathing room above it (the base 96px padding stays the floor). */
.lwp-csm-layout-bottom {
	align-items: flex-end;
	padding-bottom: max(96px, 12vh);
}

/* Split — two columns: editorial copy left, the signup as a raised surface
   card right (the hero's split-screen language). The card keeps centered
   content inside; the left alignment applies to the copy column only.
   render.php degrades the layout to `editorial` when the signup is hidden,
   so the grid never has an empty right half. */
.lwp-csm-layout-split .lwp-csm-container {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 64px;
	align-items: center;
	max-width: 1120px;
	text-align: left;
}

.lwp-csm-layout-split .lwp-csm-title {
	font-size: clamp(2.8rem, 6vw, 5rem);
}

.lwp-csm-layout-split .lwp-csm-signup {
	margin-top: 0;
	padding: 40px 32px;
	background: var(--lwp-surface, rgba(20, 30, 50, 0.6));
	border: 1px solid var(--lwp-border, rgba(124, 92, 191, 0.2));
	border-radius: var(--lwp-radius-lg, 20px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	text-align: center;
}

@media (max-width: 900px) {
	.lwp-csm-layout-split .lwp-csm-container {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.lwp-csm-layout-split .lwp-csm-signup {
		padding: 32px 24px;
	}
}
