/*
 * Shared chrome for the bespoke PHP pages (home, cenik).
 *
 * Everything both pages have in common lives here: design tokens, the reset,
 * the fixed nav and phone menu, the floating CTA, the footer, and the reveal
 * animation states. Page-specific layout goes in editorial.css / cenik.css,
 * both of which depend on the tokens defined here.
 *
 * Breakpoints:
 *   1024px  two-column sections collapse
 *    700px  phone layout — narrower gutter, nav collapses to a menu overlay
 */

/* Both pages are anchor-linked scrolls, so jumps are animated. */
html:has(.g-page) {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html:has(.g-page) {
		scroll-behavior: auto;
	}
}

.g-page {
	/*
	 * Beige ground, near-black type. --g-ink is "the page" and --g-bone is
	 * "the type on it"; every component asks for the pair by role rather than
	 * by colour, so this block is the one place the scheme is decided.
	 *
	 * The -rgb twins hold the same colour as bare channels, for the scrims and
	 * hairlines that need an alpha. Keep each pair in step.
	 */
	--g-ink: #eae0d2;
	--g-ink-rgb: 234, 224, 210;
	--g-bone: #17130f;
	--g-bone-rgb: 23, 19, 15;
	--g-surface: #dfd3c1;
	--g-panel: #e2d7c6;

	/*
	 * One gold cannot serve both ends of the page on beige: the tone that still
	 * reads as gold at 100px falls under 4.5:1 at 10px. --g-gold is the
	 * accessible one and stays the default; display type opts into the warmer
	 * one, where the bar is 3:1.
	 */
	--g-gold: #785f2e;
	--g-gold-rgb: 120, 95, 46;
	--g-gold-display: #96772f;

	/*
	 * The grey ramp runs from the most present down to the faintest. Every step
	 * clears 4.5:1 on the beige.
	 */
	--g-text-dim: #3a322a;
	--g-text-muted: #4a4238;
	--g-text-soft: #574f44;
	--g-text-faint: #625a4e;
	--g-text-quiet: #6a6255;
	--g-quote: #241e18;
	--g-rule: #a99c88;

	--g-line: rgba(var(--g-bone-rgb), 0.16);
	--g-line-soft: rgba(var(--g-bone-rgb), 0.11);
	--g-line-mid: rgba(var(--g-bone-rgb), 0.13);
	--g-line-strong: rgba(var(--g-bone-rgb), 0.34);

	--g-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
	--g-sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	--g-gutter: 40px;
	--g-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	background: var(--g-ink);
	color: var(--g-bone);
	font-family: var(--g-sans);
	font-weight: 300;
	overflow-x: hidden;
}

/*
 * .g-page paints the beige over everything it covers, but the body behind it
 * is still theme.json's dark background, which shows on an overscroll bounce.
 * :has() is both what beats theme.json's bare `body` selector and what keeps
 * this off the block templates, which have no .g-page and stay dark.
 */
body:has(.g-page) {
	background: #eae0d2;
}

/*
 * Links inherit their colour from whatever they sit in, so a component only
 * has to state a colour when it wants a different one.
 *
 * The selector is .g-page rather than :where(.g-page) on purpose. theme.json
 * colours every link at `:root :where(a:where(:not(.wp-element-button)))`,
 * which is one class worth of specificity, and its <style> is printed before
 * this file. A zero-specificity rule here loses to it, and every link on the
 * page silently takes theme.json's contrast colour instead of inheriting.
 * Matching that one class wins on source order.
 *
 * Losing to the components is then a matter of position, not weight: the pill
 * CTAs, the skip link and the menu CTA all set their own colour at the same
 * one-class specificity further down this file, so they still come out on top
 * without needing !important or a longer selector.
 */
.g-page :where(a) {
	color: inherit;
	text-decoration: none;
}

.g-page :where(a:hover) {
	color: var(--g-gold);
}

.g-page ::selection {
	background: var(--g-gold);
	color: var(--g-ink);
}

.g-page :focus-visible {
	outline: 2px solid var(--g-gold);
	outline-offset: 3px;
}

.g-page img {
	display: block;
	max-width: 100%;
}

/*
 * figure and blockquote carry large default margins in every browser. Left in
 * place they push cards away from their grid cells, so a grid's 1px divider
 * background shows through as thick bands.
 */
.g-page h1,
.g-page h2,
.g-page h3,
.g-page p,
.g-page figure,
.g-page blockquote,
.g-page figcaption {
	margin: 0;
}

/* Display-size italics only — see --g-gold-display above. */
.g-page em {
	font-style: italic;
	color: var(--g-gold-display);
}

/* Visible only to screen readers, and to keyboard users once focused. */
.g-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 14px 22px;
	background: var(--g-bone);
	color: var(--g-ink);
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: lowercase;
}

.g-skip:focus {
	left: 12px;
	top: 12px;
	color: var(--g-ink);
}

/* Small caps-ish label used for section eyebrows throughout. */
.g-label {
	font-size: 11px;
	letter-spacing: 0.26em;
	text-transform: lowercase;
	color: var(--g-text-soft);
}

/* ---------------------------------------------------------------- nav ---- */

.g-nav {
	position: fixed;
	inset: 0 0 auto;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 26px var(--g-gutter);
	/*
	 * Transparent to begin with, so the hero reads as one uninterrupted image.
	 * The border is declared here at zero alpha rather than added with the
	 * scrolled state, so gaining it does not shift the page by a pixel.
	 */
	border-bottom: 1px solid transparent;
	transition: background 0.4s ease, border-color 0.4s ease;
}

/*
 * Set by site.js a few pixels into the scroll.
 *
 * A fixed bar with nothing behind it only works while the hero is under it.
 * Once the page moves, photographs and body copy pass behind the links and
 * the labels stop being readable, so from that point the bar carries the page
 * colour. Slightly short of opaque, with a blur, so it still reads as glass
 * over the page rather than as a separate slab.
 */
.g-nav.is-stuck {
	background: rgba(var(--g-ink-rgb), 0.92);
	border-bottom-color: var(--g-line-soft);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

/* With no blur to help it, the tint has to do the work on its own. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.g-nav.is-stuck {
		background: var(--g-ink);
	}
}

/*
 * The home page nav sits over full-bleed photography. difference blending is
 * what lets one nav stay legible over both the dark gradient at the top of the
 * hero and the pale imagery further down. Pages with a flat background opt out.
 */
.g-nav--blend {
	mix-blend-mode: difference;
}

.g-nav__brand {
	font-family: var(--g-serif);
	font-size: 22px;
	letter-spacing: 0.02em;
	color: var(--g-bone);
}

.g-nav__links {
	display: flex;
	gap: 34px;
	font-size: 11px;
	letter-spacing: 0.24em;
	text-transform: lowercase;
	color: var(--g-bone);
}

/* Blending inverts colours, so a tinted resting state only works without it. */
.g-nav:not(.g-nav--blend) .g-nav__links {
	color: var(--g-text-dim);
}

.g-nav__link.is-current {
	color: var(--g-gold);
}

/* Phone only — see the 700px breakpoint. */
.g-nav__toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	padding: 8px;
	border: 0;
	background: none;
	cursor: pointer;
}

.g-nav__bar {
	display: block;
	width: 22px;
	height: 1px;
	background: var(--g-bone);
}

.g-menu {
	position: fixed;
	inset: 0;
	z-index: 45;
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 22px;
	padding: 40px 26px;
	background: var(--g-ink);
	opacity: 0;
	transform: translateY(-12px);
	transition: opacity 0.5s ease, transform 0.6s var(--g-ease);
	pointer-events: none;
}

.g-menu.is-open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.g-menu__close {
	position: absolute;
	top: 20px;
	right: 22px;
	padding: 8px;
	border: 0;
	background: none;
	font: inherit;
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: lowercase;
	color: var(--g-text-soft);
	cursor: pointer;
}

.g-menu__link {
	font-family: var(--g-serif);
	font-size: 40px;
	line-height: 1;
	text-transform: lowercase;
}

.g-menu__link--cta {
	color: var(--g-gold);
}

.g-menu__contact {
	margin-top: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 12px;
	letter-spacing: 0.12em;
	color: var(--g-text-soft);
}

.g-cta-float {
	position: fixed;
	right: var(--g-gutter);
	bottom: 36px;
	z-index: 41;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 28px;
	border-radius: 999px;
	background: var(--g-bone);
	color: var(--g-ink);
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: lowercase;
	transition: background 0.4s ease, color 0.4s ease;
}

.g-cta-float:hover {
	background: var(--g-gold);
	color: var(--g-ink);
}

/* ------------------------------------------------------------- footer ---- */

.g-footer {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 44px;
	padding: 70px var(--g-gutter) 90px;
	border-top: 1px solid var(--g-line-mid);
	font-size: 13px;
	color: var(--g-text-soft);
}

.g-footer__col {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.g-footer__brand {
	font-family: var(--g-serif);
	font-size: 26px;
	color: var(--g-bone);
	text-transform: lowercase;
}

.g-footer__tagline {
	letter-spacing: 0.02em;
}

.g-footer__col--links {
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: lowercase;
}

/* ----------------------------------------------------- sticky index ------ */

/*
 * The chapter/section index used by the price list and the about page. Sticks
 * beside the content on desktop; see the 1024px breakpoint for the phone form.
 */
.g-index {
	position: sticky;
	top: 110px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.g-index__label {
	margin-bottom: 14px;
	font-size: 10px;
	letter-spacing: 0.28em;
	text-transform: lowercase;
	color: var(--g-text-faint);
}

.g-index__link {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 11px 0;
	border-bottom: 1px solid var(--g-line-soft);
	font-size: 13px;
	color: var(--g-text-dim);
	transition: padding-left 0.4s ease;
}

.g-index__link:hover {
	padding-left: 8px;
}

.g-index__no {
	font-size: 9px;
	letter-spacing: 0.2em;
	color: var(--g-text-faint);
}

.g-index__cta {
	align-self: flex-start;
	margin-top: 26px;
	padding-bottom: 5px;
	border-bottom: 1px solid rgba(var(--g-gold-rgb), 0.45);
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: lowercase;
	color: var(--g-gold);
}

/* ---------------------------------------------------------- stat strip --- */

/*
 * A horizontal run of figures divided by hairlines, used under the about page
 * headline and in the course hero. The 1px gaps let the container background
 * through — which is why the strip must not stretch, or that background trails
 * past the last cell as a grey slab.
 *
 * The home page's studio block is a 2-up grid rather than a strip; it has its
 * own .g-studio-stats in editorial.css.
 */
.g-stats {
	--g-stat-accent: var(--g-bone);
	--g-stat-size: 40px;

	align-self: flex-start;
	display: flex;
	gap: 1px;
	background: var(--g-line);
}

/* Course facts: gold figures, a touch smaller. */
.g-stats--gold {
	--g-stat-accent: var(--g-gold);
	--g-stat-size: 34px;

	background: rgba(var(--g-bone-rgb), 0.18);
}

.g-stat {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 22px 30px;
	background: var(--g-ink);
}

/* Aligns the first figure flush with the copy above it rather than indenting. */
.g-stats--flush .g-stat:first-child {
	padding-left: 0;
}

.g-stat__value {
	font-family: var(--g-serif);
	font-size: var(--g-stat-size);
	line-height: 1;
	color: var(--g-stat-accent);
}

.g-stat__label {
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: lowercase;
	color: var(--g-text-soft);
}

/* --------------------------------------------------- word-reveal line ---- */

/*
 * A large serif statement whose words animate in one at a time. The home page
 * and the about page both use it at different sizes; each sets its own.
 */
.g-manifesto {
	padding: clamp(90px, 13vh, 180px) var(--g-gutter);
}

.g-manifesto__text {
	max-width: 1180px;
	font-family: var(--g-serif);
	font-size: clamp(30px, 4.1vw, 72px);
	line-height: 1.14;
	letter-spacing: -0.01em;
}

.g-manifesto__text [data-word] {
	display: inline-block;
}

.g-manifesto__text .is-emphasis {
	font-style: italic;
	color: var(--g-gold-display);
}

/* ------------------------------------------------------- booking band ---- */

/*
 * Closing call to action on the pages with no photography of their own. Depth
 * comes from a gold bloom under a darkening scrim; the two scrim stops are
 * variables because the source designs tune them per page.
 */
.g-booking-cta {
	--g-scrim-from: rgba(var(--g-ink-rgb), 0.6);
	--g-scrim-to: rgba(var(--g-ink-rgb), 0.92);

	position: relative;
	overflow: hidden;
	padding: clamp(100px, 16vh, 190px) var(--g-gutter);
	border-top: 1px solid var(--g-line-mid);
}

.g-booking-cta--deep {
	--g-scrim-from: rgba(var(--g-ink-rgb), 0.8);
	--g-scrim-to: rgba(var(--g-ink-rgb), 0.94);
}

.g-booking-cta__glow {
	position: absolute;
	inset: 0;
}

.g-booking-cta__glow::before,
.g-booking-cta__glow::after {
	content: "";
	position: absolute;
	inset: 0;
}

.g-booking-cta__glow::before {
	background: radial-gradient(100% 80% at 50% 0%, rgba(var(--g-gold-rgb), 0.18), rgba(var(--g-ink-rgb), 0) 65%);
}

.g-booking-cta__glow::after {
	background: linear-gradient(180deg, var(--g-scrim-from), var(--g-scrim-to));
}

.g-booking-cta__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 26px;
	text-align: center;
}

.g-booking-cta__label {
	font-size: 11px;
	letter-spacing: 0.3em;
	text-transform: lowercase;
	color: var(--g-gold);
}

.g-booking-cta__title {
	font-family: var(--g-serif);
	font-weight: 400;
	font-size: clamp(44px, 7vw, 120px);
	line-height: 0.94;
	text-transform: lowercase;
}

.g-booking-cta__button {
	margin-top: 6px;
	padding: 19px 46px;
	border-radius: 999px;
	background: var(--g-bone);
	color: var(--g-ink);
	font-size: 11px;
	letter-spacing: 0.24em;
	text-transform: lowercase;
	transition: background 0.4s ease;
}

.g-booking-cta__button:hover {
	background: var(--g-gold);
	color: var(--g-ink);
}

/* ---------------------------------------------------- reveal defaults ---- */

/*
 * The hidden state is applied by JS, not here, so that a failed or blocked
 * script leaves the page fully readable rather than blank.
 */
.g-page [data-reveal].is-hidden,
.g-page [data-word].is-hidden {
	opacity: 0;
}

.g-page [data-reveal].is-hidden {
	transform: translateY(24px);
}

.g-page [data-word].is-hidden {
	transform: translateY(16px);
}

.g-page [data-reveal].is-shown,
.g-page [data-word].is-shown {
	opacity: 1;
	transform: none;
}

.g-page [data-reveal].is-shown {
	transition: opacity 1.1s var(--g-ease), transform 1.1s var(--g-ease);
}

/* -------------------------------------------------------- ≤1024px ------- */

@media (max-width: 1024px) {
	/*
	 * A sticky sidebar has nowhere to sit in one column, so the index becomes a
	 * horizontal row of chips above the content.
	 */
	.g-index {
		position: static;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 10px;
	}

	.g-index__label {
		width: 100%;
		margin-bottom: 4px;
	}

	.g-index__link {
		padding: 9px 16px;
		border: 1px solid var(--g-line-mid);
		border-radius: 999px;
		font-size: 12px;
	}

	.g-index__link:hover {
		padding-left: 16px;
		border-color: var(--g-gold);
	}

	.g-index__cta {
		margin-top: 0;
		margin-left: 4px;
	}
}

/* --------------------------------------------------------- ≤700px ------- */

@media (max-width: 700px) {
	.g-page {
		--g-gutter: 20px;
	}

	.g-manifesto {
		padding: 70px var(--g-gutter);
	}

	.g-manifesto__text {
		font-size: clamp(26px, 8vw, 32px);
		line-height: 1.18;
	}

	.g-booking-cta {
		padding: 80px var(--g-gutter) 90px;
	}

	/*
	 * Wrapping the flex row leaves an orphan cell and a dangling divider, so on
	 * a phone the strip becomes a fixed three-column grid. Tighter type keeps
	 * the longest label to two lines.
	 */
	.g-stats {
		--g-stat-size: 28px;

		align-self: stretch;
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.g-stat {
		padding: 18px 14px;
	}

	.g-stat__label {
		font-size: 9px;
		letter-spacing: 0.14em;
	}

	.g-nav,
	.g-nav--blend {
		mix-blend-mode: normal;
		padding: 18px var(--g-gutter) 14px;
		background: linear-gradient(180deg, rgba(var(--g-ink-rgb), 0.85), rgba(var(--g-ink-rgb), 0));
	}

	.g-nav__brand {
		font-size: 19px;
	}

	.g-nav__links {
		display: none;
	}

	.g-nav__toggle {
		display: flex;
	}

	.g-menu {
		display: flex;
	}

	/* The floating CTA becomes a full-width bar, as in the phone design. */
	.g-cta-float {
		left: var(--g-gutter);
		right: var(--g-gutter);
		bottom: 20px;
		justify-content: center;
		padding: 16px 0;
	}

	/* Extra bottom padding clears the fixed CTA bar. */
	.g-footer {
		gap: 24px;
		padding: 44px var(--g-gutter) 120px;
	}

	.g-footer__brand {
		font-size: 24px;
	}
}

/* ------------------------------------------------- reduced motion ------- */

/*
 * Everything decorative stops. The reveal classes still resolve to the shown
 * state, so no content is left hidden.
 */
@media (prefers-reduced-motion: reduce) {
	.g-page *,
	.g-page *::before,
	.g-page *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

	.g-page [data-reveal],
	.g-page [data-word] {
		opacity: 1 !important;
		transform: none !important;
	}
}
