/*
 * TJ Theme — pattern structure (always loaded)
 *
 * Pattern LAYOUTS live here. Vibe SKINS live in `vibe-{slug}.css`.
 *
 * Why split:
 *   - Pattern layouts (flex, positioning, sizing) must always render — switching
 *     vibes should re-skin, never break the bones.
 *   - Vibe CSS gets conditionally loaded; if a layout rule sits in there, the
 *     layout dies the moment that vibe deactivates.
 *
 * Convention for new patterns:
 *   1. Layout / structure / spacing → THIS FILE, unscoped class selectors.
 *   2. Colour / font-weight / decoration → vibe-{slug}.css, scoped under
 *      body.tj-vibe-{slug} so the vibe can override safely.
 *
 * Colour vars used here reference --wp--preset--color--* which map to whatever
 * the active vibe's theme.json defines — so the same pattern auto-tints to
 * whichever palette is live. Patterns stay portable across all 16+ vibes.
 *
 * Convention namespace:
 *   `.tj-prop-*` originated with the Property Editorial pack (Kinetik), but
 *   the rules are universal — any vibe can render the hero-backdrop / dark-
 *   strip / underline-form layouts. The `prop` prefix is kept for historical
 *   continuity; treat them as TJ-pattern primitives, not Property-only.
 */

/* ═════════════════════════════════════════════════════════════════════════
 * Display + text primitives — universal, used across many patterns
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-eyebrow {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent, var(--wp--preset--color--primary));
	margin-bottom: 24px;
}

.tj-text-balance {
	text-wrap: balance;
}

/* ═════════════════════════════════════════════════════════════════════════
 * Hero — full-viewport with faded backdrop image
 *
 * Pattern markup:
 *   <section class="tj-prop-hero">
 *     <div class="tj-prop-hero-image"><img /></div>
 *     <div class="tj-prop-hero-content">…copy + CTAs…</div>
 *   </section>
 *
 * Works in any vibe. Vibe CSS can override the gradient overlay's stops or
 * disable the backdrop entirely if a vibe prefers a different opener.
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-prop-hero {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 120px 60px 9vh;
	position: relative;
	overflow: hidden;
}

.tj-prop-hero-image {
	position: absolute;
	top: 80px;
	right: 0;
	width: 45%;
	height: calc(100% - 80px);
	z-index: 1;
	pointer-events: none;
}

.tj-prop-hero-image img {
	position: absolute;
	top: -8%;
	left: 0;
	width: 100%;
	height: 116%;
	object-fit: cover;
	display: block;
}

.tj-prop-hero-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to left, transparent 58%, var(--wp--preset--color--bg) 100%);
}

.tj-prop-hero-content {
	position: relative;
	z-index: 2;
	max-width: 1400px;
	width: 100%;
	margin: 0 auto;
}

.tj-prop-hero-content > .tj-eyebrow {
	margin-bottom: 30px;
}

.tj-prop-hero-content h1 {
	margin-bottom: 40px;
	max-width: 1100px;
	text-wrap: initial;
}

.tj-prop-hero-content p.has-lg-font-size {
	margin-bottom: 50px;
	max-width: 580px;
}

/* Ultrawide (>2:1, e.g. 3440×1440): a full 100vh hero bottom-anchors the
   headline and leaves a big dead gap up top. On these aspect ratios only,
   shorten the hero and centre the content vertically. Standard 16:9/laptop
   screens keep the intended full-viewport bottom-anchored hero. */
@media (min-aspect-ratio: 2 / 1) {
	.tj-prop-hero {
		min-height: clamp(600px, 82vh, 820px);
		justify-content: center;
	}
}

@media (max-width: 900px) {
	.tj-prop-hero {
		min-height: auto;
		padding: 124px 22px 76px;
		justify-content: center;
	}
	.tj-prop-hero-image {
		display: none;
	}
}

/* ═════════════════════════════════════════════════════════════════════════
 * Service cards — oversized thin number above title (services-numbered)
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-prop-number {
	font-size: clamp(56px, 7vw, 84px);
	font-weight: 200;
	color: var(--wp--preset--color--surface-2, var(--wp--preset--color--rule));
	line-height: 1;
	letter-spacing: -0.04em;
	transition: color 280ms cubic-bezier(.22,.61,.36,1);
	display: block;
	margin-bottom: 28px;
}

.tj-prop-number-card {
	cursor: default;
	transition: transform 280ms cubic-bezier(.22,.61,.36,1);
}

.tj-prop-number-card:hover .tj-prop-number {
	color: var(--wp--preset--color--accent, var(--wp--preset--color--primary));
}

.tj-prop-number-card:hover {
	transform: translateY(-4px);
}

/* ═════════════════════════════════════════════════════════════════════════
 * Stat numbers — editorial big-number treatment (cost-of-inaction, why-with-stats)
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-prop-stat-num {
	font-size: clamp(64px, 8vw, 120px);
	font-weight: 200;
	color: var(--wp--preset--color--ink);
	line-height: 1;
	letter-spacing: -0.04em;
	margin-bottom: 20px;
}

.tj-prop-stat-label {
	font-size: 12px;
	font-weight: 500;
	color: var(--wp--preset--color--mute);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	margin-top: 16px;
	max-width: 380px;
	line-height: 1.5;
}

/* Tablet band: a two-column narrative+stats section keeps its columns side by
   side down to WordPress's 781px stack point, so a nested 2×2 stat grid gets
   narrow cells (~190px on a 1024px iPad). At the full 8vw the numerals overrun
   and a word like "Global" breaks mid-word. Step the numerals down across this
   band so they fit their cell; full-width and stacked (<782px) layouts keep the
   larger editorial size. */
@media (min-width: 782px) and (max-width: 1200px) {
	.tj-prop-stat-num {
		font-size: clamp(44px, 5.5vw, 72px);
	}
}

/* ═════════════════════════════════════════════════════════════════════════
 * Dark strip — full-bleed dark section break (process-dark-strip)
 *
 * Uses surface-warm if defined (most vibes), falls back to ink. Vibes can
 * override the bg colour via body-scoped rule.
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-prop-dark-strip {
	background: var(--wp--preset--color--surface-warm, var(--wp--preset--color--ink));
	color: var(--wp--preset--color--bg);
	padding-top: clamp(100px, 12vw, 160px) !important;
	padding-bottom: clamp(100px, 12vw, 160px) !important;
}

.tj-prop-dark-strip h1,
.tj-prop-dark-strip h2,
.tj-prop-dark-strip h3 {
	color: var(--wp--preset--color--bg);
}

.tj-prop-dark-strip .tj-eyebrow {
	color: var(--wp--preset--color--accent, var(--wp--preset--color--primary-light));
}

.tj-prop-dark-card {
	background: var(--wp--preset--color--surface-warm, var(--wp--preset--color--ink));
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: 40px;
	transition: border-color 240ms ease, background 240ms ease;
}

.tj-prop-dark-card:hover {
	border-color: var(--wp--preset--color--accent, var(--wp--preset--color--primary-light));
	background: color-mix(in srgb, var(--wp--preset--color--accent, var(--wp--preset--color--primary-light)) 5%, transparent);
}

/* ═════════════════════════════════════════════════════════════════════════
 * Underline-input form (contact-split-underline)
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-prop-underline-form input,
.tj-prop-underline-form textarea {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	padding: 14px 0;
	font-family: inherit;
	font-size: 16px;
	color: var(--wp--preset--color--ink);
	width: 100%;
	border-radius: 0;
	transition: border-color 200ms ease;
}

.tj-prop-underline-form input:focus,
.tj-prop-underline-form textarea:focus {
	outline: none;
	border-bottom-color: var(--wp--preset--color--accent, var(--wp--preset--color--primary));
}

.tj-prop-underline-form label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--wp--preset--color--mute);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.tj-prop-underline-form .tj-prop-field {
	margin-bottom: 32px;
}

/* Two-up field row (e.g. Name + Phone side by side) — the fields
   inside keep their own bottom margin, so the row itself carries none. */
.tj-prop-underline-form .tj-prop-field-row {
	display: flex;
	gap: 24px;
}

.tj-prop-underline-form .tj-prop-field-row .tj-prop-field {
	flex: 1;
	min-width: 0;
}

@media (max-width: 600px) {
	.tj-prop-underline-form .tj-prop-field-row {
		flex-direction: column;
		gap: 0;
	}
}

.tj-prop-underline-form button[type="submit"] {
	margin-top: 24px;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--bg);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 18px 36px;
	border: 0;
	cursor: pointer;
	transition: background 220ms ease;
}

.tj-prop-underline-form button[type="submit"]:hover {
	background: var(--wp--preset--color--accent, var(--wp--preset--color--primary));
}

.tj-form-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.tj-form-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin: 1rem 0;
	font-size: 0.82rem;
	line-height: 1.45;
	color: var(--wp--preset--color--mute);
}

.tj-form-consent input {
	width: 1rem;
	height: 1rem;
	margin-top: 0.15rem;
	flex: 0 0 auto;
}

.tj-form-feedback {
	min-height: 1.5em;
	margin: 0.85rem 0 0;
	font-size: 0.88rem;
}

.tj-form-feedback.is-success { color: #166534; }
.tj-form-feedback.is-error { color: #b91c1c; }
.tj-form-feedback.is-sending { color: var(--wp--preset--color--mute); }

.tj-prop-underline-form .tj-prop-form-note {
	margin-top: 16px;
	font-size: 13px;
	color: var(--wp--preset--color--mute);
}

/* ═════════════════════════════════════════════════════════════════════════
 * Testimonial quote — large centred quote with decorative glyph
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-prop-quote {
	border: 0;
	padding: 0;
	margin: 0 auto;
	max-width: 940px;
}

.tj-prop-quote::before {
	content: '\201C';
	display: block;
	font-size: clamp(100px, 12vw, 180px);
	line-height: 0.6;
	color: var(--wp--preset--color--accent, var(--wp--preset--color--primary));
	text-align: center;
	margin-bottom: 30px;
	font-weight: 300;
}

/* ═════════════════════════════════════════════════════════════════════════
 * Tick list — checklist rows with hairline separators
 *
 * Pattern markup: a core/list with class `tj-ticklist`. Each <li> gets a
 * leading check glyph (skin sets the colour) and hairline top borders, with a
 * closing border on the last row. Structure here; check colour + font in the
 * vibe skin. Ported from the Kinetik "About" section (kp-ticklist).
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-ticklist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tj-ticklist li {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 0;
	border-top: 1px solid var(--wp--preset--color--rule, #E5E5E5);
	font-weight: 500;
	letter-spacing: -0.2px;
}

.tj-ticklist li:last-child {
	border-bottom: 1px solid var(--wp--preset--color--rule, #E5E5E5);
}

.tj-ticklist li::before {
	content: '\2713';
	flex-shrink: 0;
	font-weight: 700;
	color: var(--wp--preset--color--accent, var(--wp--preset--color--primary));
}

/* ═════════════════════════════════════════════════════════════════════════
 * Lead-capture modal — reusable auto-opening enquiry overlay (structure only)
 *
 * Markup: TJ_Theme::render_lead_modal() on wp_footer. Behaviour + tracking:
 * assets/js/lead-modal.js. Skin (heading font/weight, gold emphasis) lives in
 * the active vibe file. The form reuses the .tj-prop-underline-form primitive
 * so it inherits the vibe's field styling for free.
 *
 * The overlay stays visibility:hidden until JS adds `.is-open`, so if the JS
 * never loads the modal simply never appears (safe no-op) rather than sitting
 * open on top of the page. visibility:hidden also keeps it out of the a11y
 * tree until it's actually shown.
 * ═════════════════════════════════════════════════════════════════════════ */

.tj-lead-modal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	/* Solid-enough fallback so the backdrop never looks "broken" where
	   backdrop-filter is unsupported; the @supports block below layers on the
	   blur where it IS supported. */
	background: rgba(10, 20, 38, 0.72);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.3s;
}

@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
	.tj-lead-modal {
		background: rgba(10, 20, 38, 0.6);
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
	}
}

.tj-lead-modal.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.tj-lead-modal__card {
	position: relative;
	background: var(--wp--preset--color--bg, #ffffff);
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 56px 52px;
	border-radius: 4px;
	box-shadow: 0 40px 120px rgba(1, 30, 60, 0.32);
	/* Snappier than the mockup (0.6s → 0.32s) so it feels responsive, not laggy. */
	transform: translateY(24px) scale(0.98);
	opacity: 0;
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.tj-lead-modal.is-open .tj-lead-modal__card {
	transform: none;
	opacity: 1;
}

.tj-lead-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--wp--preset--color--mute, #8a94a6);
	transition: color 0.2s ease;
}

.tj-lead-modal__close:hover,
.tj-lead-modal__close:focus-visible {
	color: var(--wp--preset--color--ink, #0a1426);
}

.tj-lead-modal__eyebrow {
	margin-bottom: 16px;
}

.tj-lead-modal__heading {
	font-size: clamp(26px, 3.5vw, 34px);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 14px;
	color: var(--wp--preset--color--ink);
}

.tj-lead-modal__sub {
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--mute);
	margin: 0 0 32px;
}

@media (max-width: 768px) {
	.tj-lead-modal__card {
		padding: 46px 26px;
	}
}

/* Honour reduced-motion: no slide/scale, just an instant show. */
@media (prefers-reduced-motion: reduce) {
	.tj-lead-modal,
	.tj-lead-modal__card {
		transition: opacity 0.001s linear;
	}
	.tj-lead-modal__card {
		transform: none;
	}
}
