/* ==========================================================================
   Avanzato — fixed-viewport luxury layout
   Every page occupies exactly one screen. Nothing scrolls on desktop.
   ========================================================================== */

:root {
	--avz-header-h: clamp(96px, 14.5vh, 158px);
	/* The splash monogram. The artwork now fills its box edge to edge (the
	   PNG was cropped to its ink), so these are the visible dimensions. */
	--avz-splash-logo-w: clamp(170px, 18vw, 362px);
	--avz-footer-h: clamp(48px, 5.6vh, 64px);
	--avz-gutter: clamp(20px, 4.6vw, 88px);
	--avz-hairline: rgba(218, 171, 112, 0.22);
	--avz-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--avz-ease-luxe: cubic-bezier(0.16, 1, 0.3, 1);
	--avz-dur: 900ms;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

html,
body {
	height: 100%;
}

body.avz {
	margin: 0;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	font-synthesis-weight: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow: hidden; /* The one-screen promise. */
	overscroll-behavior: none;
}

/* The editor canvas and admin screens must stay scrollable. */
body.wp-admin,
body.block-editor-page {
	overflow: auto;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

::selection {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}

/* Focus visibility — never remove it, only make it match the brand. */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--gold-light);
	outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Shell: header / stage / footer in a single non-scrolling grid
   -------------------------------------------------------------------------- */

.wp-site-blocks {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	min-height: 100vh;
	min-height: 100dvh;
	max-height: 100dvh;
	overflow: hidden;
}

.wp-site-blocks > header {
	grid-row: 1;
}

/* WordPress adds a block-gap margin between top-level blocks; in a fixed
   viewport that margin is the difference between fitting and not. */
.wp-site-blocks > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

.wp-site-blocks > main {
	grid-row: 2;
	min-height: 0;
	overflow: hidden;
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 0;
}

.wp-site-blocks > main > * {
	margin-block: 0;
}

/* post-content wraps the page's blocks, so the chain from main down to the
   stage all has to stretch for the stage to own the leftover height. */
.wp-site-blocks > main > .wp-block-post-content {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.wp-block-post-content > .avz-stage,
.wp-block-post-content > .avz-splash-stage,
.wp-site-blocks > main > .avz-stage,
.wp-site-blocks > main > .avz-splash-stage {
	flex: 1 1 auto;
	min-height: 0;
}

.wp-site-blocks > footer {
	grid-row: 3;
}

/* The stage is the editable canvas of each page: it fills whatever is left. */
.avz-stage {
	min-height: 0;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
}

.avz-stage > * {
	min-height: 0;
}

/* A stage child that should soak up the remaining space. */
.avz-stage .avz-fill {
	flex: 1 1 auto;
	min-height: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.avz-header {
	height: var(--avz-header-h);
	/* Equal outer tracks put the menu on the true centre of the page, whatever
	   the logo and the call to action measure. */
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: clamp(16px, 2vw, 40px);
	padding-inline: var(--avz-gutter);
	position: relative;
	z-index: 60;
	background: transparent;
}

/* WordPress gives block children a 1em top margin, which would drop them
   below the header's centre line. */
.avz-header > * {
	margin-block: 0 !important;
}

/* On image-led pages the header floats over the hero. */
.avz-header--overlay {
	position: absolute;
	inset-inline: 0;
	top: 0;
}

.avz-header::after {
	content: "";
	position: absolute;
	inset-inline: var(--avz-gutter);
	bottom: 0;
	height: 1px;
	background: linear-gradient(90deg, rgba(218, 171, 112, 0) 0%, var(--avz-hairline) 18%, var(--avz-hairline) 82%, rgba(218, 171, 112, 0) 100%);
	opacity: 0;
	transition: opacity 600ms var(--avz-ease);
}

.avz-header--ruled::after {
	opacity: 1;
}

.avz-header__brand {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	text-decoration: none;
}

.avz-header__brand,
.wp-block-site-logo.avz-header__brand {
	margin: 0;
	/* The site-logo block writes an inline width; height drives this header. */
	width: auto !important;
}

.avz-header__brand img,
.avz-header__brand .custom-logo,
.wp-block-site-logo.avz-header__brand img {
	/* The cropped logo has no transparent padding of its own any more, so this
	   factor is the mark's real height against the header. */
	height: calc(var(--avz-header-h) * 0.74);
	width: auto;
	max-width: none;
	object-fit: contain;
}

/* The site-logo block wraps the image in a sized div; let the CSS win. */
.wp-block-site-logo.avz-header__brand .custom-logo-link,
.wp-block-site-logo.avz-header__brand a {
	display: block;
	line-height: 0;
}

/* The middle grid track. */
.avz-header__nav {
	display: flex;
	justify-content: center;
}

/* The last track, pushed to the right edge. */
.avz-header__tools {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: clamp(12px, 1.6vw, 28px);
}

/* Navigation: uppercase Cinzel with gold hairline dividers, as drawn. */
.avz-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 0;
}

.avz-nav li {
	position: relative;
	display: flex;
	align-items: center;
}

.avz-nav li + li::before {
	content: "";
	width: 1px;
	height: 1.1em;
	margin-inline: clamp(10px, 1.5vw, 26px);
	background: var(--avz-hairline);
	flex: 0 0 auto;
}

/* Core's navigation rules are specific and load late, so match their weight
   rather than relying on inheritance. */
.avz-nav a,
.avz-nav .wp-block-navigation-item__content,
.avz-header .wp-block-navigation a {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(0.72rem, 0.861vw, 1.008rem);
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--wp--preset--color--white);
	text-decoration: none;
	padding-block: 0.5em;
	position: relative;
	transition: color 420ms var(--avz-ease);
	white-space: nowrap;
}

.avz-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.1em;
	height: 1px;
	background: var(--wp--preset--color--gold-light);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 520ms var(--avz-ease-luxe);
}

.avz-nav a:hover,
.avz-nav .current-menu-item > a,
.avz-nav [aria-current="page"] {
	color: var(--wp--preset--color--gold-light);
}

.avz-nav a:hover::after,
.avz-nav .current-menu-item > a::after,
.avz-nav [aria-current="page"]::after {
	transform: scaleX(1);
}

/* Search toggle */
.avz-search-toggle {
	appearance: none;
	background: none;
	border: 0;
	padding: 6px;
	cursor: pointer;
	color: var(--wp--preset--color--white);
	line-height: 0;
	transition: color 380ms var(--avz-ease), transform 380ms var(--avz-ease);
}

.avz-search-toggle:hover {
	color: var(--wp--preset--color--gold-light);
	transform: scale(1.06);
}

/* Gold CTA button, used in the header and across the site. */
.avz-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.7em;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(0.74rem, 0.893vw, 1.064rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--gradient--gold-bar);
	background-size: 200% 100%;
	background-position: 0% 50%;
	padding: 0.95em 2.1em;
	border: 1px solid rgba(240, 213, 168, 0.5);
	text-decoration: none;
	position: relative;
	overflow: hidden;
	transition: background-position 1100ms var(--avz-ease-luxe), color 400ms var(--avz-ease);
	white-space: nowrap;
}

.avz-cta:hover,
.avz-cta:focus-visible {
	background-position: 100% 50%;
	color: var(--wp--preset--color--ink-deep);
}

/* The sheen that sweeps across the gold on hover. */
.avz-cta::after {
	content: "";
	position: absolute;
	top: -50%;
	bottom: -50%;
	width: 40%;
	left: -60%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
	transform: skewX(-18deg);
	transition: left 900ms var(--avz-ease-luxe);
	pointer-events: none;
}

.avz-cta:hover::after {
	left: 120%;
}

/* Outlined variant (the splash screen button). */
.avz-cta--ghost {
	background: transparent;
	color: var(--wp--preset--color--gold-light);
	border: 1px solid rgba(218, 171, 112, 0.55);
	font-family: var(--wp--preset--font-family--body);
	letter-spacing: 0.04em;
	text-transform: none;
	font-size: clamp(0.95rem, 1.155vw, 1.288rem);
	padding: 0.85em 2.6em;
}

.avz-cta--ghost:hover,
.avz-cta--ghost:focus-visible {
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--gradient--gold-bar);
	border-color: rgba(240, 213, 168, 0.75);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.avz-footer {
	height: var(--avz-footer-h);
	/* Equal outer tracks, so the motto sits on the true centre of the page
	   rather than halfway between two items of different widths. */
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: clamp(12px, 2vw, 40px);
	padding-inline: var(--avz-gutter);
	border-top: 1px solid var(--avz-hairline);
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(0.66rem, 0.819vw, 0.952rem);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	position: relative;
	z-index: 50;
}

.avz-footer__motto {
	display: flex;
	align-items: center;
	gap: clamp(8px, 1vw, 18px);
	color: var(--wp--preset--color--gold-light);
	white-space: nowrap;
}

.avz-footer__motto::before,
.avz-footer__motto::after {
	content: "";
	width: clamp(24px, 3vw, 54px);
	height: 1px;
	background: var(--wp--preset--color--gold);
}

/* WordPress gives block-level children a 1em top margin, which pushed the
   motto and the social icons below the footer's centre line. */
.avz-footer > * {
	margin-block: 0 !important;
}

.avz-footer__social {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: clamp(12px, 1.4vw, 22px);
	padding-left: 0;
	list-style: none;
}

.avz-footer__motto {
	justify-content: center;
}

.avz-footer__social a {
	color: var(--wp--preset--color--white);
	line-height: 0;
	transition: color 380ms var(--avz-ease), transform 380ms var(--avz-ease);
}

.avz-footer__social a:hover {
	color: var(--wp--preset--color--gold-light);
	transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Light ("cream") pages — the products screen
   -------------------------------------------------------------------------- */

/* Only the stage goes cream. The header and footer stay ink on every page,
   so the tone must not be set on the body or the whole block wrapper. */
body.avz-tone-light {
	background: var(--wp--preset--color--cream);
}

.avz-tone-light .avz-stage {
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--ink);
}

.avz-tone-light .avz-stage :is(h1, h2, h3, h4) {
	color: var(--wp--preset--color--ink);
}

.avz-tone-light .avz-stage p {
	color: #35414d;
}

/* The header and footer stay ink-dark even on cream pages, as designed. */
.avz-tone-light .avz-header,
.avz-tone-light .avz-footer {
	background: var(--wp--preset--color--ink);
}

.avz-tone-light .avz-header {
	position: relative;
}

/* --------------------------------------------------------------------------
   Reusable page furniture
   -------------------------------------------------------------------------- */

.avz-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	font-size: clamp(0.8rem, 0.998vw, 1.12rem);
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--gold-light);
	margin: 0 0 0.35em;
}

.avz-eyebrow--caps {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: clamp(0.68rem, 0.84vw, 0.963rem);
	color: var(--wp--preset--color--white);
}

.avz-lede {
	font-style: italic;
	color: var(--wp--preset--color--muted);
	/* Wide enough to hold the standfirst on two lines. */
	max-width: 88ch;
	margin-inline: auto;
}

/* The watermark monogram that sits behind several screens. */
.avz-watermark {
	position: absolute;
	pointer-events: none;
	user-select: none;
	opacity: 0.05;
	filter: grayscale(1) brightness(2);
	z-index: 0;
}

.avz-watermark--right {
	right: calc(var(--avz-gutter) * -0.4);
	top: 50%;
	translate: 0 -50%;
	width: clamp(220px, 24vw, 460px);
}

.avz-watermark--center {
	left: 50%;
	top: 52%;
	translate: -50% -50%;
	width: clamp(260px, 30vw, 560px);
}

/* Full-bleed media layer behind a stage. */
.avz-media {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.avz-media img,
.avz-media video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.avz-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--wp--preset--gradient--ink-veil);
}

.avz-media--bottom::after {
	background: var(--wp--preset--gradient--ink-veil-bottom);
}

.avz-layer {
	position: relative;
	z-index: 1;
}

/* --------------------------------------------------------------------------
   Splash screen (the first page — logo and CTA only)
   -------------------------------------------------------------------------- */

body.avz-splash .wp-site-blocks {
	grid-template-rows: minmax(0, 1fr);
}

.avz-splash-stage {
	height: 100dvh;
	display: grid;
	place-items: center;
	text-align: center;
	background: var(--wp--preset--color--ink);
	padding: var(--avz-gutter);
}

/* The splash button is title case in the design, not the uppercase the gold
   and ghost styles use elsewhere. The selector carries .is-style-avz-ghost so
   it outranks that style's own text-transform. */
.avz-splash-cta .wp-block-button.is-style-avz-ghost > .wp-block-button__link {
	/* Bodoni Moda, not Cinzel — Cinzel has no true lowercase and would set
	   this in small capitals. */
	font-family: var(--wp--preset--font-family--body);
	text-transform: none;
	letter-spacing: 0.04em;
	font-size: clamp(0.92rem, 1.218vw, 1.4rem);
	padding: 0.66em 2.8em;
	border-color: rgba(218, 171, 112, 0.5);
	/* The splash sits on a flat background, so it takes none of the frosted
	   panel the ghost style uses over photography. */
	background: transparent;
	backdrop-filter: none;
	/* Sized so the gradient can slide in from the left on hover. */
	background-image: var(--wp--preset--gradient--gold-bar);
	background-repeat: no-repeat;
	background-size: 0% 100%;
	background-position: 0 50%;
	transition:
		background-size 620ms var(--avz-ease-luxe),
		color 420ms var(--avz-ease),
		border-color 420ms var(--avz-ease);
}

/* Hover fills with the same gold gradient as the header call to action. */
.avz-splash-cta .wp-block-button.is-style-avz-ghost > .wp-block-button__link:hover,
.avz-splash-cta .wp-block-button.is-style-avz-ghost > .wp-block-button__link:focus-visible {
	/* The ghost style's own :hover uses the `background` shorthand, which
	   resets background-image to none — so the gradient has to be restated
	   here or the button just goes dark. */
	background-color: transparent;
	background-image: var(--wp--preset--gradient--gold-bar);
	background-size: 100% 100%;
	border-color: var(--wp--preset--color--champagne);
	color: var(--wp--preset--color--ink);
}

.avz-splash-stage__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	/* The design sets the monogram and the button about 7% of the screen
	   height apart. */
	gap: clamp(30px, 6.6vh, 74px);
}

.avz-splash-logo {
	width: var(--avz-splash-logo-w);
	height: auto;
}

/* --------------------------------------------------------------------------
   Motion — the luxury entrance and page transitions
   -------------------------------------------------------------------------- */

/* Elements marked for reveal start hidden, then settle in sequence.
   Add the class "avz-reveal" to any block in the editor to opt it in. */
.avz-reveal {
	opacity: 0;
	transform: translateY(18px);
	/* Only opacity and transform are animated. letter-spacing and filter were
	   in here too, and both force a layout or repaint on every frame — that
	   was the stutter on entrance. */
	transition:
		opacity var(--avz-dur) var(--avz-ease-luxe),
		transform var(--avz-dur) var(--avz-ease-luxe);
	transition-delay: var(--avz-delay, 0ms);
	will-change: opacity, transform;
}

/* Released once the element has arrived, so the compositor is not holding a
   layer for every revealed block for the life of the page. */
.avz-reveal.is-in {
	will-change: auto;
}

.avz-reveal.is-in {
	opacity: 1;
	transform: none;
}

/* The logo settles up out of a slight scale — transform only, so it runs on
   the compositor. */
.avz-reveal--logo {
	transform: scale(0.94);
}

.avz-reveal--logo.is-in {
	transform: scale(1);
}

/* Headlines rise a little further than the rest. Their tracking is fixed:
   animating letter-spacing reflows the text on every frame. */
.avz-reveal--title {
	transform: translateY(26px);
}

/* Optional hand-tuned delays, settable from the editor. */
.avz-delay-1 { --avz-delay: 180ms; }
.avz-delay-2 { --avz-delay: 360ms; }
.avz-delay-3 { --avz-delay: 540ms; }
.avz-delay-4 { --avz-delay: 760ms; }
.avz-delay-5 { --avz-delay: 1000ms; }
.avz-delay-6 { --avz-delay: 1280ms; }

/* A thin gold rule that draws itself. */
.avz-rule {
	height: 1px;
	width: min(320px, 40vw);
	background: var(--wp--preset--gradient--gold-rule);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 1400ms var(--avz-ease-luxe);
}

.avz-rule.is-in {
	transform: scaleX(1);
}

/* Whole-page arrival. */
.avz-stage,
.avz-splash-stage {
	animation: avz-page-in 1100ms var(--avz-ease-luxe) both;
}

@keyframes avz-page-in {
	from {
		/* Opacity only. The scale used to run at the same time as each block's
		   own reveal transform, and the two fighting is what made the entrance
		   look like it jumped. */
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* A very slow drift on hero imagery keeps a still page feeling alive. */
.avz-media--drift img {
	animation: avz-drift 26s var(--avz-ease) infinite alternate;
}

@keyframes avz-drift {
	from {
		transform: scale(1.04) translate3d(0, 0, 0);
	}
	to {
		transform: scale(1.12) translate3d(-1.2%, -1%, 0);
	}
}

/* --------------------------------------------------------------------------
   Respect the user's motion preference
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.avz-reveal {
		opacity: 1;
		transform: none;
		filter: none;
		letter-spacing: normal;
	}

	.avz-rule {
		transform: scaleX(1);
	}
}
