/*
 * Crashing Elegance — main.css
 *
 * Theme-level base styles only. Per-component CSS (page-hero, section-head,
 * subniche cards, method steps, frames gallery, pricing tiers, FAQ, CTA,
 * testimonials, a-la-carte menu, etc.) ships from the crashingelegance-blocks
 * plugin's per-block style.scss bundles — register_block_type loads them
 * automatically on both front-end and editor.
 *
 * What lives here:
 *   - Design tokens (CSS custom properties)
 *   - Reset + base typography
 *   - .container / .h / .eyebrow / .btn primitives
 *   - .site-header (with mobile fix)
 *   - .footer
 *   - Page hero overrides for non-overlay pages (about) — scoped by body class
 *
 * Source: extracted from mockup-*-v2.html design source-of-truth.
 */

/* ---------- Design tokens ---------- */

:root {
	--ff-display: "mixta-didone", "Cormorant Garamond", Georgia, serif;
	--ff-body: "adelle-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	--ink: #13110e;
	--ink-deep: #0a0907;
	--ink-soft: #3a3530;
	--ink-mute: #7a7068;

	--paper: #f6f0e4;
	--paper-warm: #ede4d2;
	--paper-cool: #f0e9da;
	--bone: #dccfb6;

	--accent: #a16a3b;
	--accent-soft: #c9a572;

	--sp-3: 16px;
	--sp-4: 24px;
	--sp-5: 32px;
	--sp-6: 48px;
	--sp-7: 80px;
	--sp-8: 120px;
	--sp-9: 200px;

	--fs-display-xl: clamp(2.75rem, 6.5vw, 5.75rem);
	--fs-display-lg: clamp(2.125rem, 4.25vw, 3.75rem);
	--fs-display-md: clamp(1.625rem, 2.75vw, 2.5rem);
	--fs-display-sm: clamp(1.25rem, 1.875vw, 1.75rem);
	--fs-body-lg: 1.125rem;
	--fs-body: 1rem;
	--fs-label: 0.6875rem;

	/* Header height — used to reserve space below the (overlay) header so
	   hero content never collides with multi-line nav on small viewports. */
	--header-height: 88px;
	--header-height-mobile: 64px;
}

/* ---------- Reset + base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink-soft);
	font-family: var(--ff-body);
	font-weight: 400;
	font-size: var(--fs-body);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container { width: min(86vw, 1320px); margin-inline: auto; }
.container--narrow { width: min(86vw, 760px); margin-inline: auto; }

/* ---------- Type primitives ---------- */

.eyebrow {
	font-family: var(--ff-body);
	font-weight: 500;
	font-size: var(--fs-label);
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.h {
	font-family: var(--ff-display);
	font-weight: 400;
	line-height: 1.02;
	letter-spacing: -0.012em;
	color: var(--ink);
	margin: 0;
}
.h--xl { font-size: var(--fs-display-xl); }
.h--lg { font-size: var(--fs-display-lg); }
.h--md { font-size: var(--fs-display-md); }
.h--sm { font-size: var(--fs-display-sm); }
.h--it { font-style: italic; line-height: 1.08; }

.lead,
.lede {
	font-size: var(--fs-body-lg);
	line-height: 1.65;
	color: var(--ink-soft);
	max-width: 42ch;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	height: 54px;
	padding: 0 28px;
	font-family: var(--ff-body);
	font-weight: 500;
	font-size: var(--fs-label);
	letter-spacing: 0.24em;
	text-transform: uppercase;
	cursor: pointer;
	border: 1px solid var(--ink);
	background: var(--ink);
	color: var(--paper);
	transition: background 250ms ease, color 250ms ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--ghost-light {
	background: transparent;
	color: var(--paper);
	border-color: var(--paper);
}
.btn--ghost-light:hover { background: var(--paper); color: var(--ink); }

/* ---------- Sections ---------- */

.section { padding: var(--sp-8) 0; }

/* When two .section blocks are siblings (e.g. ce/section-head followed by
 * ce/method-recap or ce/pricing-grid), the doubled padding-top + padding-
 * bottom creates an awkward gap. Reduce — but don't eliminate — so blocks
 * still feel like related content with breathing room. */
.section + .section { padding-top: calc(var(--sp-5) * 3); }

/* A .section containing only a section-head (the block-composition pattern:
 * section-head emits its own <section>, then the actual content follows in
 * another block) should be tighter on the bottom — it's a header that
 * introduces the next block, not a standalone section. */
.section > .container > .section-head:only-child { margin-bottom: 0; }
.section:has(> .container > .section-head:only-child) { padding-bottom: calc(var(--sp-5) * 3); }
.section:has(> .container > .section-head:only-child) + .pricing-grid,
.section:has(> .container > .section-head:only-child) + .frames { margin-top: 0; }

.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .h { color: var(--paper); }
.section--ink .eyebrow { color: var(--accent-soft); }
.section--ink p { color: var(--paper); opacity: 0.85; }
.section--cool { background: var(--paper-cool); }
.section--warm { background: var(--paper-warm); }
.section--paper { background: var(--paper); }

/* ---------- Header ---------- */

.site-header {
	position: relative;
	padding: 20px 0 24px;
	color: var(--ink);
	min-height: var(--header-height);
}

.site-header:not(.site-header--overlay) {
	margin-top: -72px;
}

/* Overlay variant — used on home + niche pages over the page hero. */
.site-header--overlay {
	position: absolute;
	top: -72px;
	left: 0;
	right: 0;
	z-index: 30;
	color: var(--paper);
	background: transparent;
}

.site-header .container {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--sp-5);
	width: min(100% - 48px, 1320px);
}

.site-header .nav-l,
.site-header .nav-r {
	display: flex;
	gap: var(--sp-6);
	font-size: 0.8125rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	font-weight: 500;
}
.site-header .nav-l { justify-self: end; }
.site-header .nav-r { justify-self: start; }

.site-header--overlay .nav-l,
.site-header--overlay .nav-r,
.site-header--overlay a { color: var(--paper); }

.site-header a { opacity: 0.9; transition: opacity 200ms; }
.site-header a:hover { opacity: 1; }
.site-header .logo { justify-self: center; width: 280px; display: block; }
.site-header .logo img { width: 100%; height: auto; }

/* Hide mobile-only elements at desktop sizes. */
.site-header__toggle { display: none; }
.site-header__hamburger { display: none; }
.site-header .nav-r-spacer { display: none; }

@media (max-width: 1400px) {
	.site-header .container {
		gap: clamp(22px, 2.2vw, 32px);
	}

	.site-header .nav-l,
	.site-header .nav-r {
		gap: clamp(22px, 2.6vw, 48px);
		font-size: 0.75rem;
		letter-spacing: clamp(1.6px, 0.16vw, 2.86px);
		white-space: nowrap;
	}
	.site-header .logo { width: clamp(220px, 19vw, 280px); }
}

@media (max-width: 1200px) {
	.site-header .container {
		width: min(100% - 32px, 1320px);
	}
}

/* ---------- Mobile nav: full-screen overlay drawer ----------
 *
 * Production bug fix 2026-05-09: the desktop 3-column nav collapses into
 * nav rows that overlap the hero headline. Keep the full editorial nav on
 * laptop widths by compressing spacing above; switch to the drawer only
 * when the full nav no longer has enough room to breathe.
 *   - Logo centered, hamburger top-right, nav-l + nav-r hidden.
 *   - Tap hamburger -> full-screen overlay slides in with all links.
 *   - Toggle is a hidden checkbox; CSS-only, works with JS off.
 */

@media (max-width: 1060px) {
	:root { --header-height: var(--header-height-mobile); }

	.site-header:not(.site-header--overlay) {
		margin-top: 0;
	}

	.site-header--overlay {
		top: 0;
	}

	/* Reset desktop 3-column grid: logo only. */
	.site-header .container {
		grid-template-columns: 1fr;
		justify-items: center;
		align-items: center;
		gap: 0;
	}
	.site-header .logo { width: 220px; justify-self: center; }

	/* Hamburger pinned to the top-right of the header. */
	.site-header__hamburger {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		width: 44px;
		height: 44px;
		position: absolute;
		top: 12px;
		right: 16px;
		z-index: 50;
		cursor: pointer;
		padding: 10px 8px;
		margin: 0;
	}
	.site-header__hamburger span {
		display: block;
		width: 100%;
		height: 1.5px;
		background: currentColor;
		transition: transform 200ms ease, opacity 200ms ease;
	}

	/* Both nav columns hidden by default. */
	.site-header .nav-l,
	.site-header .nav-r {
		display: none;
	}

	/* When the toggle is checked, the entire .container becomes a full-screen
	 * overlay drawer. nav-l (4 links) renders first, then a divider, then
	 * nav-r (4 links) — visually a single centered list of all 8 destinations
	 * with the logo dimmed at the bottom. */
	.site-header__toggle:checked ~ .container {
		position: fixed;
		inset: 0;
		width: 100%;       /* override the desktop max-width:86vw */
		max-width: none;
		margin: 0;
		z-index: 40;
		background: var(--ink-deep);
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: var(--sp-4);
		padding: var(--sp-7) var(--sp-5);
		grid-template-columns: none; /* override desktop grid */
	}

	.site-header__toggle:checked ~ .container .nav-l,
	.site-header__toggle:checked ~ .container .nav-r {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: var(--sp-4);
		text-align: center;
		font-size: 1.125rem;
		letter-spacing: 0.24em;
		font-weight: 500;
		color: var(--paper);
		background: transparent;
		padding: 0;
		position: static;
	}
	.site-header__toggle:checked ~ .container .nav-l { order: 1; position: relative; }
	.site-header__toggle:checked ~ .container .nav-r { order: 3; }

	/* Decorative divider between nav-l and nav-r groups. */
	.site-header__toggle:checked ~ .container .nav-l::after {
		content: "";
		display: block;
		width: 60px;
		height: 1px;
		background: rgba( 255, 255, 255, 0.25 );
		margin-top: var(--sp-3);
	}

	.site-header__toggle:checked ~ .container .nav-l a,
	.site-header__toggle:checked ~ .container .nav-r a { color: var(--paper); }

	.site-header__toggle:checked ~ .container .logo {
		order: 4;
		width: 160px;
		opacity: 0.8;
		margin-top: var(--sp-5);
	}

	/* Hamburger morphs into an X, sitting above the drawer at top-right. */
	.site-header__toggle:checked ~ .container .site-header__hamburger {
		position: fixed;
		top: 12px;
		right: 16px;
		color: var(--paper);
		z-index: 60;
	}
	.site-header__toggle:checked ~ .container .site-header__hamburger span:nth-child(1) {
		transform: translateY(6.5px) rotate(45deg);
	}
	.site-header__toggle:checked ~ .container .site-header__hamburger span:nth-child(2) {
		opacity: 0;
	}
	.site-header__toggle:checked ~ .container .site-header__hamburger span:nth-child(3) {
		transform: translateY(-6.5px) rotate(-45deg);
	}
}

/* ---------- Hero spacing fix on niche pages (overlay header) ----------
 * Adversarial review #15 / production bug fix: when the header overlays a
 * full-bleed hero, the hero content needs to leave room for the (collapsed
 * or expanded) header so the headline doesn't read directly under the logo.
 */

.site-header--overlay + main .page-hero,
.site-header--overlay + main .hero {
	padding-top: var(--header-height);
}

@media (max-width: 1060px) {
	.site-header--overlay + main .page-hero,
	.site-header--overlay + main .hero {
		padding-top: calc(var(--header-height-mobile) + var(--sp-3));
	}
	/* Niche heroes use a bottom-anchored copy block; on small phones add
	   bottom safe-area so the lede doesn't sit on the gradient edge. */
	.page-hero,
	.hero { min-height: 520px; }
	.page-hero__inner,
	.hero__inner { padding-bottom: var(--sp-6); }
}

/* ---------- About-page hero override ----------
 * The About page uses a typographic hero (no full-bleed image). Scope under
 * body class so it doesn't collide with the niche-page .page-hero rules.
 */

body.page-about .page-hero {
	position: static;
	height: auto;
	min-height: 0;
	padding: var(--sp-9) 0 var(--sp-7);
	background: var(--paper);
	overflow: visible;
}
body.page-about .page-hero .page-hero__bg { display: none; }
body.page-about .page-hero__inner {
	position: static;
	padding: 0;
	display: block;
}
body.page-about .page-hero .container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--sp-7);
	align-items: end;
	color: var(--ink);
}
body.page-about .page-hero .h,
body.page-about .page-hero .eyebrow { color: var(--ink); }
body.page-about .page-hero .lede { color: var(--ink-soft); }

@media (max-width: 1024px) {
	body.page-about .page-hero .container {
		grid-template-columns: 1fr;
		gap: var(--sp-4);
	}
}

/* ---------- Footer ---------- */

.footer {
	background: var(--ink-deep);
	color: var(--paper);
	padding: var(--sp-8) 0 var(--sp-5);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer .container {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr;
	gap: var(--sp-6);
}
.footer .brand-block .logo {
	width: 200px;
	margin-bottom: var(--sp-4);
	display: block;
}
.footer .brand-block p {
	opacity: 0.7;
	max-width: 32ch;
	font-size: 0.9375rem;
}
.footer .brand-block .contact-line {
	margin-top: var(--sp-3);
	font-size: 0.875rem;
	opacity: 0.85;
}
.footer h4 {
	font-family: var(--ff-body);
	font-size: var(--fs-label);
	font-weight: 500;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--accent-soft);
	margin: 0 0 var(--sp-4);
}
.footer ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.footer ul a { opacity: 0.85; }
.footer ul a:hover { opacity: 1; }
.footer .meta-line {
	grid-column: 1 / -1;
	margin-top: var(--sp-7);
	padding-top: var(--sp-5);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--fs-label);
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--ink-mute);
	flex-wrap: wrap;
	gap: var(--sp-3);
}

@media (max-width: 1024px) {
	.footer .container { grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
}
@media (max-width: 700px) {
	.footer .container { grid-template-columns: 1fr; gap: var(--sp-5); }
}

/* ---------- Journal archive / empty state ---------- */

.journal-empty {
	min-height: calc(100vh - var(--header-height));
	display: flex;
	align-items: center;
}

.journal-empty .eyebrow {
	display: block;
	margin-bottom: var(--sp-4);
}

.journal-empty .h {
	max-width: 10ch;
	margin-bottom: var(--sp-4);
}

.journal-empty .lede {
	max-width: 46ch;
	margin: 0;
}

.journal-empty__actions {
	display: flex;
	gap: var(--sp-3);
	flex-wrap: wrap;
	margin-top: var(--sp-5);
}

.journal-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
	gap: var(--sp-5);
}

.journal-card {
	padding: var(--sp-5);
	border: 1px solid var(--bone);
	background: rgba(255, 255, 255, 0.22);
}

.journal-card__date {
	display: block;
	font-size: var(--fs-label);
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--ink-mute);
	margin-bottom: var(--sp-3);
}

.journal-card__excerpt {
	margin-top: var(--sp-3);
}

@media (max-width: 700px) {
	.journal-empty {
		min-height: auto;
		align-items: flex-start;
	}

	.journal-empty__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.journal-empty__actions .btn {
		justify-content: center;
	}
}

/* ---------- Editor-canvas tweaks ---------- */

.editor-styles-wrapper {
	background: var(--paper);
	color: var(--ink-soft);
}
.editor-styles-wrapper .h {
	font-family: var(--ff-display);
}

/* ---------- Page-hero base (niche pages, overlay variant) ---------- */

.page-hero {
	position: relative;
	height: 80vh;
	min-height: 620px;
	background: var(--ink-deep);
	overflow: hidden;
	color: var(--paper);
}
.page-hero__bg { position: absolute; inset: 0; z-index: 0; }
.page-hero__bg img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.85;
}
.page-hero__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(19, 17, 14, 0.5) 0%,
		rgba(19, 17, 14, 0.15) 22%,
		rgba(19, 17, 14, 0.15) 38%,
		rgba(19, 17, 14, 0.55) 60%,
		rgba(19, 17, 14, 0.85) 100%
	);
	pointer-events: none;
}
.page-hero__inner {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: var(--sp-8) 0 var(--sp-7);
}
.page-hero__inner .container {
	position: relative;
	z-index: 1;
	color: var(--paper);
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--sp-7);
	align-items: end;
}
.page-hero .eyebrow {
	color: var(--paper);
	opacity: 0.95;
	display: inline-block;
	margin-bottom: var(--sp-4);
}
.page-hero .h {
	color: var(--paper);
	max-width: 14ch;
}
.page-hero .lede {
	color: var(--paper);
	opacity: 0.92;
	max-width: 42ch;
	margin: 0;
}

@media (max-width: 1024px) {
	.page-hero__inner .container {
		grid-template-columns: 1fr;
		gap: var(--sp-4);
	}
}

/* ---------- Home hero (full-bleed, taller) ---------- */

.hero {
	position: relative;
	height: 100vh;
	min-height: 780px;
	background: var(--ink-deep);
	overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.85;
	transform: scale(1.04);
	transform-origin: center center;
}
.hero__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(19, 17, 14, 0.55) 0%,
		rgba(19, 17, 14, 0.18) 22%,
		rgba(19, 17, 14, 0.18) 38%,
		rgba(19, 17, 14, 0.55) 60%,
		rgba(19, 17, 14, 0.85) 100%
	);
	pointer-events: none;
}
.hero__inner {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: var(--sp-8) 0 var(--sp-7);
}
.hero__inner .container {
	position: relative;
	z-index: 1;
	color: var(--paper);
}
.hero .eyebrow { color: var(--paper); opacity: 0.95; }
.hero .h { color: var(--paper); max-width: 18ch; }
.hero p {
	color: var(--paper);
	opacity: 0.92;
	max-width: 42ch;
	margin-top: var(--sp-4);
}
.hero .actions {
	margin-top: var(--sp-5);
	display: flex;
	gap: var(--sp-3);
	flex-wrap: wrap;
}

/* ---------- Section-head shared (also rendered by ce/section-head block) ---------- */

.section-head {
	display: grid;
	grid-template-columns: 1fr 1.6fr;
	gap: var(--sp-7);
	align-items: end;
	margin-bottom: var(--sp-7);
}
.section-head__lhs .eyebrow { display: block; margin-bottom: var(--sp-3); }
.section-head__lhs .h { margin: 0; }
.section-head__rhs p { max-width: 48ch; margin: 0; }

@media (max-width: 1024px) {
	.section-head { grid-template-columns: 1fr; gap: var(--sp-3); }
}

/* ---------- Reveal animation (progressive enhancement) ---------- */

.js .reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 800ms ease, transform 800ms cubic-bezier(.2, .6, .2, 1);
}
.js .reveal.in { opacity: 1; transform: translateY(0); }
