/* Site chrome */

/* Page scaffold */

/* Establish the containing block and height for the page background. */
body { position: relative; min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px)); }
.site-content { position: relative; z-index: var(--z-content); }

.site-main { padding-top: var(--nav-height); }
.site-main.has-hero { padding-top: 0; }

/* Leaf background — document-anchored so the compositor scrolls leaves in sync
   with the page; JS adds only the small per-layer parallax differential and
   recycles leaves while they are off screen. */
.leaf-bg,
.leaf-bg-fore {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	contain: layout paint style;
}
.leaf-bg { z-index: var(--z-leaf-back); background: var(--cream-ground); }
.leaf-bg-fore { z-index: var(--z-leaf-fore); }

.leaf-bg__layer { position: absolute; inset: 0; will-change: transform; }

.leaf {
	position: absolute;
	width: var(--size, 120px);
	height: var(--size, 120px);
}
.leaf__sprite {
	display: block;
	width: 100%;
	height: 100%;
	background-image: var(--leaf-image);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: var(--op, 0.36);
	filter: blur(var(--blur, 3px));
	transform: rotate(var(--rot, 0deg));
	animation: leaf-sway var(--dur, 9s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes leaf-sway {
	from { transform: translate3d(calc(var(--ax, 10px) * -1), calc(var(--ay, 12px) * -1), 0) rotate(var(--rot, 0deg)); }
	to   { transform: translate3d(var(--ax, 10px), var(--ay, 12px), 0) rotate(calc(var(--rot, 0deg) + 12deg)); }
}

/* Navigation */
.site-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: var(--z-nav);
	display: flex;
	align-items: stretch;
	gap: 26px;
	height: var(--nav-height);
	padding: 0 var(--rail);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(252, 250, 246, 0.18));
	-webkit-backdrop-filter: blur(4px) saturate(1.7);
	        backdrop-filter: blur(4px) saturate(1.7);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 44px rgba(20, 16, 11, 0.12);
}
.site-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: rgba(255, 255, 255, 0.45);
}

.brand {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	align-self: center;
}
.brand:hover { color: inherit; }
.brand__wordmark { height: 27px; width: auto; opacity: 0.97; }
.brand:hover .brand__wordmark { opacity: 1; }

/* Primary links */
.primary-nav { display: none; }

.nav-tray {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: 0 0 auto;
	align-self: center;
	margin-left: auto;
	padding: 3px 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.75);
	box-shadow: 0 2px 8px rgba(20, 16, 11, 0.1);
}

/* Language switcher */
.lang-switch { position: relative; }
.lang-switch__toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 999px;
	font-family: var(--font-display);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.18em;
	color: rgba(20, 16, 11, 0.82);
	transition: background 0.25s, color 0.25s;
}
.lang-switch__toggle:hover,
.lang-switch.is-open .lang-switch__toggle { background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.lang-switch__toggle svg { transition: transform 0.25s; }
.lang-switch.is-open .lang-switch__toggle svg { transform: rotate(180deg); }

.lang-switch__flag {
	flex: 0 0 auto;
	width: 20px;
	height: 15px;
	object-fit: contain;
	border-radius: 2px;
}

.lang-switch__menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: var(--z-menu);
	min-width: 190px;
	padding: 6px;
	background: var(--cream);
	border: 1px solid rgba(20, 16, 11, 0.12);
	border-radius: 10px;
	box-shadow: 0 14px 34px rgba(20, 16, 11, 0.16);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.lang-switch.is-open .lang-switch__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-switch__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 7px;
	transition: background 0.2s;
}
.lang-switch__item:hover { background: rgba(212, 168, 67, 0.1); }
.lang-switch__item.is-current { background: rgba(212, 168, 67, 0.14); }
.lang-switch__item.is-current::after {
	content: "";
	width: 5px;
	height: 5px;
	margin-left: auto;
	background: var(--gold);
	transform: rotate(45deg);
}
.lang-switch__code {
	min-width: 24px;
	font-family: var(--font-display);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold-deep);
}
.lang-switch__name { font-family: var(--font-body); font-size: 13.5px; color: var(--ink-soft); }
.lang-switch__item:hover .lang-switch__name,
.lang-switch__item.is-current .lang-switch__name { color: var(--ink); }

/* Hamburger */
.nav-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: rgba(20, 16, 11, 0.82);
	transition: background 0.25s, color 0.25s;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease-out), opacity 0.2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Dark-background navigation */
.nav-on-dark .site-header {
	background: linear-gradient(180deg, rgba(22, 15, 9, 0.46), rgba(10, 8, 7, 0.3));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 44px rgba(0, 0, 0, 0.35);
}
.nav-on-dark .site-header::after { background: rgba(212, 168, 67, 0.35); }
.nav-on-dark .lang-switch__toggle,
.nav-on-dark .nav-toggle { color: rgba(234, 215, 167, 0.85); }
.nav-on-dark .nav-tray { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }

/* Menu overlay */
.menu-overlay {
	position: fixed;
	top: var(--nav-height);
	left: 0;
	right: 0;
	bottom: 0;
	z-index: calc(var(--z-nav) - 1);
	background: rgba(20, 16, 11, 0.32);
	-webkit-backdrop-filter: blur(6px) saturate(1.4);
	        backdrop-filter: blur(6px) saturate(1.4);
	overflow-y: auto;
	overscroll-behavior: contain;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s ease-out, visibility 0.22s;
}
.menu-overlay.is-open { opacity: 1; visibility: visible; }

.menu-overlay__panel {
	position: relative;
	background-color: var(--surface-paper-solid);
	background-image: var(--egg-grain);
	color: var(--ink);
	padding: var(--space-6) var(--rail) var(--space-7);
	border-bottom: 1px solid var(--line-gold);
	box-shadow: 0 30px 64px rgba(20, 16, 11, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.45);
	transform: translateY(-20px);
	transition: transform 0.35s var(--ease-out);
}
.menu-overlay.is-open .menu-overlay__panel { transform: translateY(0); }

/* Overlay header */
.menu-overlay__head {
	margin-bottom: var(--space-6);
	font-size: var(--fs-eyebrow);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-mute);
}
.menu-overlay__socials {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-2) var(--space-5);
	margin-top: var(--space-6);
}
.menu-overlay__socials a {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	min-height: var(--space-6);
	font-size: 14px;
	color: var(--ink-mute);
}
.menu-overlay__socials a:hover { color: var(--gold-deep); }

/* Overlay sections */
.menu-overlay__list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.menu-overlay__link {
	display: grid;
	grid-template-columns: 1fr 28px;
	gap: 16px;
	align-items: center;
	padding: 16px 20px;
	color: var(--ink);
	background: var(--card-bg);
	border: 1px solid var(--card-line);
	border-radius: 12px;
	box-shadow: 0 4px 14px rgba(20, 16, 11, 0.035);
	transition: transform 0.3s var(--ease-out), background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.menu-overlay__link:hover,
.menu-overlay__link:focus-visible {
	transform: translateY(-2px);
	background: var(--cream);
	border-color: var(--gold);
	box-shadow: 0 6px 18px rgba(20, 16, 11, 0.06);
	color: var(--ink);
}
.menu-overlay__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.menu-overlay__title { font-family: var(--font-display); font-size: 19px; font-weight: 500; letter-spacing: 0; line-height: 1.2; color: var(--ink); }
.menu-overlay__desc {
	font-family: var(--font-body);
	font-style: normal;
	font-weight: 400;
	font-size: 13.5px;
	line-height: 1.5;
	letter-spacing: 0;
	color: var(--ink-mute);
}
@media (min-width: 681px) {
	.menu-overlay__title { font-size: 20px; }
}
.menu-overlay__arrow {
	justify-self: end;
	color: var(--gold);
	opacity: 0.5;
	transition: opacity 0.25s, color 0.25s;
}
.menu-overlay__link:hover .menu-overlay__arrow,
.menu-overlay__link:focus-visible .menu-overlay__arrow { opacity: 1; color: var(--gold-deep); }

/* Fixed overlays need WordPress's admin-bar offset. */
.admin-bar .menu-overlay { top: calc(var(--nav-height) + var(--wp-admin--admin-bar--height, 32px)); }

/* Below 600px core makes #wpadminbar position:absolute and expects the viewport as its
   containing block; our positioned body catches it instead, dropping the bar below the
   html bump margin. Lift it back up into that margin. */
@media screen and (max-width: 600px) {
	.admin-bar #wpadminbar { top: calc(-1 * var(--wp-admin--admin-bar--height, 46px)); }
}

.language-suggestion {
	position: fixed;
	z-index: calc(var(--z-nav) + 2);
	right: 16px;
	bottom: 16px;
	width: min(420px, calc(100vw - 32px));
	padding: 18px 20px;
	border: 1px solid rgba(168, 126, 48, 0.42);
	background: var(--surface-paper-solid);
	box-shadow: 0 20px 54px rgba(34, 24, 10, 0.2);
}

/* The docked player owns the viewport bottom edge; keep the toast above it. */
body.has-site-player .language-suggestion {
	bottom: calc(var(--site-player-height) + 16px);
}

.language-suggestion p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ink);
}
.language-suggestion__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
}
.language-suggestion__accept,
.language-suggestion__dismiss {
	padding: 8px 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.language-suggestion__accept { background: var(--ink); color: var(--gold-light); }
.language-suggestion__dismiss { color: var(--ink-mute); }

.menu-overlay__socials .social-icon { width: var(--space-4); height: var(--space-4); }

/* Footer */
.site-footer {
	position: relative;
	z-index: calc(var(--z-leaf-fore) + 5); /* Keep leaves behind the footer. */
	background: var(--blackbrown-foot);
	color: var(--cream-text);
	padding: var(--space-9) var(--rail) var(--space-6);
	overflow: hidden;
	text-align: center;
}
.site-footer::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: url("../img/damask-tile.png");
	background-size: 250px 250px;
	opacity: 0.16;
}
.site-footer > * { position: relative; z-index: 1; }
.site-footer__crest { width: 132px; margin: 0 auto 18px; }
.site-footer__wordmark { width: 360px; max-width: 80%; margin: 0 auto var(--space-4); filter: drop-shadow(0 0 30px rgba(212, 168, 67, 0.22)); }
.site-footer__est {
	font-family: var(--font-body);
	font-size: 12px;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: rgba(216, 176, 116, 0.6);
	margin-bottom: var(--space-8);
}
.site-footer__rule { width: 200px; height: 1px; background: rgba(212, 168, 67, 0.6); margin: 0 auto var(--space-7); }

.site-footer__cols {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-6);
	margin-bottom: var(--space-7);
	text-align: center;
}
.site-footer__col h2 {
	font-family: var(--font-display);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--gold-light);
	margin-bottom: var(--space-4);
}
.site-footer__col li { margin-bottom: 10px; }
.site-footer__col a { font-size: 14px; color: rgba(234, 215, 167, 0.75); transition: color 0.25s; }
.site-footer__col a:hover { color: var(--cream-text); }
.social-icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}

.site-footer__bot {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
	padding-top: var(--space-5);
	border-top: 1px solid rgba(234, 215, 167, 0.18);
	font-family: var(--font-display);
	font-size: 12px;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: rgba(234, 215, 167, 0.5);
}
.site-footer__dot { display: inline-block; width: 4px; height: 4px; margin: 0 12px; background: currentColor; transform: rotate(45deg); vertical-align: middle; }

/* Desktop */
@media (min-width: 1101px) {
	.primary-nav { position: relative; display: flex; align-items: stretch; margin-left: 6px; margin-right: var(--space-5); }
	.primary-nav__link {
		display: flex;
		align-items: center;
		padding: 0 18px;
		font-family: var(--font-display);
		font-size: 13.5px;
		font-weight: 600;
		letter-spacing: 0.11em;
		text-transform: uppercase;
		color: rgba(20, 16, 11, 0.78);
		transition: color 0.25s;
	}
	.primary-nav__link:hover,
	.primary-nav__link.is-active { color: var(--ink); }
	.nav-on-dark .primary-nav__link { color: rgba(234, 215, 167, 0.8); }
	.nav-on-dark .primary-nav__link:hover,
	.nav-on-dark .primary-nav__link.is-active { color: var(--gold-light); }

	.nav-needle {
		position: absolute;
		bottom: 0;
		height: 2.5px;
		background: var(--needle);
		transform: scaleX(1);
		transform-origin: center;
		transition: left 0.35s var(--ease-out), width 0.35s var(--ease-out), opacity 0.25s, transform 0.25s var(--ease-out);
	}
	.nav-needle::after { content: ""; position: absolute; left: 50%; top: -4px; width: 7px; height: 7px; transform: translateX(-50%) rotate(45deg); background: var(--needle); }
	.nav-needle.is-hidden { opacity: 0; transform: scaleX(0); }
	.primary-nav.is-navigating .nav-needle { opacity: 0.5 }
	.nav-on-dark .nav-needle,
	.nav-on-dark .nav-needle::after { background: #c9a25e; }

	.menu-overlay__list { grid-template-columns: 1fr 1fr; gap: 16px; }

	.site-footer__cols { grid-template-columns: repeat(3, max-content); justify-content: space-evenly; gap: 40px 64px; text-align: left; }
	.site-footer__bot { flex-direction: row; justify-content: space-between; }
	.site-footer__wordmark { width: 440px; }
}

@media (max-width: 430px) {
	.site-header { gap: var(--space-3); }
	.brand { flex: 0 0 min(42vw, 181px); min-width: 0; }
	.brand__wordmark { width: 100%; height: auto; }
}
