/*
 * Generation 22 — «Пробні дні» (P0 conversion page)
 * Auto-loaded by post_name (functions.php: assets/css/pages/{slug}.css),
 * cascades AFTER assets/css/inner-henna.css (dep 'g22-inner-henna') and
 * BEFORE nav-taste.css. Only touches classes that live on THIS page's
 * content (patterns/trial-days-page.php → page.php): .g22-page-section,
 * .g22-page-kicker/.g22-page-title/.g22-page-summary, .g22-surface-panel,
 * .g22-cta-panel, .g22-form. Everything else (header/footer chrome,
 * #reviews mosaic) is already styled sitewide — left alone on purpose.
 *
 * Visual language borrowed from front-page.php + home-studio.css (the
 * approved "Henna clean" system): #f4f4f2 cards, ~20px radius, Manrope H2
 * clamp(1.75rem,3.2vw,2.75rem), mono eyebrow with a yellow tick, purple
 * pill buttons (hover lift, active scale .98). This page does not carry
 * the .g22-henna--clean root, so those tokens are re-declared locally
 * (prefixed --g22pd-) instead of assumed from home-studio.css.
 */

/* ---------- Local motion tokens (scoped to this page's shell only) ---------- */

.g22-page-shell {
	--g22pd-ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
	--g22pd-ease: cubic-bezier(0.33, 1, 0.68, 1);
	--g22pd-dur-quick: 160ms;
	--g22pd-dur-std: 380ms;
	--g22pd-rise: 16px;
	--g22pd-stagger: 70ms;
}

/* ---------- Hero — offer must read instantly, in one breath ---------- */

/* Base .g22-page-title/.g22-page-summary (inner-henna.css) assume the old
   centered poster (.g22-page-intro__inner) — this page's hero renders
   straight inside .g22-page-content instead (page.php skips the poster
   when the content already contains an <h1>), so the inherited centering
   left a box-centered H1 with left-aligned text sitting over a
   left-aligned eyebrow: two different alignments on the same block. Pin
   all three lines to one left-aligned editorial column instead. */
.g22-page-content .g22-page-section {
	position: relative;
	overflow: clip;
	padding-block: 0 clamp(24px, 3vw, 36px);
	text-align: left;
}

/* Client review 2026-07-29: remove the oversized decorative "22" so the
   offer heading remains the sole dominant object in the hero. */
.g22-page-content .g22-page-section::before {
	content: none;
	display: none;
}

.g22-page-content .g22-page-section .g22-page-kicker,
.g22-page-content .g22-page-section .g22-page-title,
.g22-page-content .g22-page-section .g22-page-summary {
	position: relative;
	z-index: 1;
}

.g22-page-content .g22-page-section .g22-page-kicker {
	color: var(--g22h-ink-55);
}

.g22-page-content .g22-page-section .g22-page-summary {
	color: var(--g22h-ink-70);
}

/* ---------- Surface panel — the "про пробний день" card ---------- */

.g22-page-content .g22-surface-panel {
	box-sizing: border-box;
	max-width: 860px;
	margin: 0 auto;
	padding: clamp(24px, 3.4vw, 36px);
	border-radius: 20px;
	background: #f4f4f2;
	box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04);
}

.g22-page-content .g22-surface-panel > p {
	margin: 0;
	max-width: 60ch;
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--g22h-ink-70);
}

/* ---------- CTA panel — the single most important element on the page ---------- */

.g22-page-content .g22-surface-panel .g22-cta-panel {
	box-sizing: border-box;
	max-width: 100%;
	margin: clamp(28px, 4vw, 40px) 0 0;
	padding: clamp(24px, 3.4vw, 36px);
	border-radius: 20px;
	border: 0;
	background: #ffffff;
	box-shadow:
		0 1px 0 rgba(26, 26, 26, 0.06),
		0 24px 48px rgba(26, 26, 26, 0.08);
}

.g22-page-content .g22-cta-panel h2 {
	position: relative;
	margin: 0 0 20px;
	max-width: 18ch;
	font-family: "Manrope", var(--g22h-font);
	font-weight: 700;
	font-size: clamp(1.75rem, 3.2vw, 2.75rem);
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--g22h-ink);
}

/* Henna-жест B — одна зірка-іскра поруч із заголовком форми, маргінальна
   нотатка, що позначає найважливішу дію на сторінці. Mask-технікa —
   один-в-один з .g22-cta-panel .g22-form::before у vartist.css. */
.g22-page-content .g22-cta-panel h2::after {
	content: "";
	position: absolute;
	top: -14px;
	right: -8px;
	width: 36px;
	height: 36px;
	background-color: var(--g22h-yellow);
	-webkit-mask-image: url("../../images/brand/doodles/star-spark.svg");
	mask-image: url("../../images/brand/doodles/star-spark.svg");
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
	pointer-events: none;
}

/* ---------- Form — inputs with a soft purple focus ring, big submit ---------- */

.g22-page-content .g22-cta-panel .g22-form {
	gap: 18px;
}

.g22-page-content .g22-cta-panel .g22-form label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--g22h-ink-70);
}

.g22-page-content .g22-cta-panel .g22-form input,
.g22-page-content .g22-cta-panel .g22-form textarea {
	min-height: 50px;
	border-radius: 12px;
	border: 1px solid var(--g22h-ink-10);
	background: var(--g22h-soft-gray);
	font-size: 1rem;
	transition:
		border-color var(--g22pd-dur-quick, 160ms) var(--g22pd-ease, ease),
		box-shadow var(--g22pd-dur-quick, 160ms) var(--g22pd-ease, ease);
}

.g22-page-content .g22-cta-panel .g22-form textarea {
	min-height: 110px;
}

.g22-page-content .g22-cta-panel .g22-form input:focus-visible,
.g22-page-content .g22-cta-panel .g22-form textarea:focus-visible {
	outline: 0;
	border-color: var(--g22h-purple);
	box-shadow: 0 0 0 4px var(--g22h-purple-soft, rgba(63, 39, 128, 0.12));
}

/* Submit — biggest, most confident pill on the page. Same system as
   home-studio.css .g22-clean__btn: hover lift, active scale .98.
   Sitewide pill-button normalization (2026-07-22): 48px / 24px / +0.02em,
   matching the canonical spec (was a local 58px/32px/-0.01em one-off). */
.g22-page-content .g22-cta-panel .g22-form button {
	min-height: 48px;
	margin-top: 4px;
	padding: 0 24px;
	border-radius: 999px;
	background: var(--g22h-purple);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	box-shadow: 0 12px 28px rgba(63, 39, 128, 0.24);
	transition:
		background-color var(--g22pd-dur-quick, 160ms) var(--g22pd-ease, ease),
		box-shadow var(--g22pd-dur-quick, 160ms) var(--g22pd-ease, ease),
		transform var(--g22pd-dur-quick, 160ms) var(--g22pd-ease-enter, ease);
}

.g22-page-content .g22-cta-panel .g22-form button:hover,
.g22-page-content .g22-cta-panel .g22-form button:focus-visible {
	background: var(--g22h-purple-hover);
	box-shadow: 0 16px 36px rgba(63, 39, 128, 0.32);
	transform: translateY(-1px);
}

.g22-page-content .g22-cta-panel .g22-form button:active {
	box-shadow: 0 6px 16px rgba(63, 39, 128, 0.22);
	transform: translateY(0) scale(0.98);
}

.g22-page-content .g22-cta-panel .g22-form button:focus-visible {
	outline: 3px solid var(--g22h-yellow);
	outline-offset: 3px;
}

/* ---------- Reveal, built as its own insurance ----------
 * assets/reveal.js only observes a fixed selector list (home/inner-studio
 * pages) that does not include .g22-page-section / .g22-surface-panel /
 * .g22-cta-panel — an IntersectionObserver-gated reveal on this page would
 * therefore depend on a class (.g22-be-reveal--in / .is-in) that never
 * gets added and would leave the offer + form stuck at opacity:0
 * permanently. Instead of copying that scroll-gated pattern, this reveal
 * fires from paint (no JS, no observer to miss), the same guarantee
 * assets/css/home-studio.css's g22-reveal-fallback-in provides as a
 * fallback for its own scroll-gated blocks — here it IS the mechanism,
 * not a backstop for one. */
@media (prefers-reduced-motion: no-preference) {
	.g22-page-content .g22-page-section .g22-page-kicker,
	.g22-page-content .g22-page-section .g22-page-title,
	.g22-page-content .g22-page-section .g22-page-summary,
	.g22-page-content .g22-surface-panel,
	.g22-page-content .g22-cta-panel {
		opacity: 0;
		transform: translateY(var(--g22pd-rise, 16px));
		animation: g22pd-reveal-in var(--g22pd-dur-std, 380ms) var(--g22pd-ease-enter, ease) forwards;
	}

	.g22-page-content .g22-page-section .g22-page-kicker { animation-delay: 0ms; }
	.g22-page-content .g22-page-section .g22-page-title { animation-delay: calc(var(--g22pd-stagger, 70ms) * 1); }
	.g22-page-content .g22-page-section .g22-page-summary { animation-delay: calc(var(--g22pd-stagger, 70ms) * 2); }
	.g22-page-content .g22-surface-panel { animation-delay: calc(var(--g22pd-stagger, 70ms) * 3); }
	.g22-page-content .g22-cta-panel { animation-delay: calc(var(--g22pd-stagger, 70ms) * 4); }

	@keyframes g22pd-reveal-in {
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.g22-page-content .g22-page-section .g22-page-kicker,
	.g22-page-content .g22-page-section .g22-page-title,
	.g22-page-content .g22-page-section .g22-page-summary,
	.g22-page-content .g22-surface-panel,
	.g22-page-content .g22-cta-panel,
	.g22-page-content .g22-cta-panel .g22-form button,
	.g22-page-content .g22-cta-panel .g22-form input,
	.g22-page-content .g22-cta-panel .g22-form textarea {
		opacity: 1 !important;
		transform: none !important;
		animation: none !important;
		transition: none !important;
	}
}

/* ---------- Mobile — 390px: no horizontal scroll, ≥44px touch targets ---------- */

@media (max-width: 640px) {
	.g22-page-content .g22-page-section {
		padding-block: 0 clamp(20px, 6vw, 28px);
	}

	.g22-page-content .g22-cta-panel h2::after {
		top: -10px;
		right: -4px;
		width: 28px;
		height: 28px;
	}

	.g22-page-content .g22-surface-panel {
		padding: 20px;
		border-radius: 18px;
	}

	.g22-page-content .g22-surface-panel .g22-cta-panel {
		padding: 20px;
		border-radius: 16px;
		margin-top: 22px;
	}

	.g22-page-content .g22-cta-panel h2 {
		max-width: none;
	}

	.g22-page-content .g22-cta-panel .g22-form button {
		width: 100%;
	}
}

/* Client deck: form left, real school moment right. */
.g22-page-content .g22-surface-panel {
	max-width: 1120px;
}

.g22-page-content .g22-cta-panel {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
	grid-template-rows: auto 1fr;
	gap: 20px clamp(28px, 4vw, 56px);
	width: 100%;
	max-width: 1120px;
	box-sizing: border-box;
	margin-inline: auto;
	padding: clamp(28px, 4vw, 48px);
	/* Ira 2026-07-29: overflow:hidden clipped button drop-shadows ("тенюшки"). */
	overflow: visible;
}

.g22-page-content .g22-cta-panel > .wp-block-group__inner-container {
	display: contents;
}

.g22-page-content .g22-cta-panel h2,
.g22-page-content .g22-cta-panel .g22-form {
	grid-column: 1;
}

.g22-page-content .g22-cta-panel::after {
	content: "";
	grid-column: 2;
	grid-row: 1 / span 2;
	min-height: 460px;
	border-radius: 20px;
	background: url("../../images/photos/g22-probni.webp?v3") center / cover no-repeat;
}

@media (max-width: 820px) {
	.g22-page-content .g22-cta-panel {
		grid-template-columns: 1fr;
	}

	.g22-page-content .g22-cta-panel::after {
		grid-column: 1;
		grid-row: auto;
		min-height: 280px;
	}
}
