/*
 * Header, site-wide. Two states:
 *  - default (inner pages): ivory bar with the colour logo
 *  - body.home: transparent bar laid over the dark hero, on-ink logo, ivory links
 * Logical properties only.
 *
 * Two angles, never mixed:
 *  - 23deg (--ayh-skew): the logo's lean (a "/" shape, never mirrored). Buttons and the cuts that separate sections.
 *  - 6deg (--ayh-skew-el): everything inside a section (tiles, bars, hover panels, reel edges, markers).
 */

:root {
	--ayh-skew-el: -6deg;
}

.ayh-header {
	--ayh-header-fg: var(--wp--preset--color--stone);
	--ayh-header-fg-hover: var(--wp--preset--color--ink);
	--ayh-header-line: var(--wp--preset--color--brass);
	--ayh-cta-bg: var(--wp--preset--color--ink);
	--ayh-cta-fg: var(--wp--preset--color--ivory);
	--ayh-cta-bg-hover: var(--wp--preset--color--brass-dark);
	--ayh-skew: -23deg;
	position: relative;
	z-index: 20;
}

.ayh-header__bar {
	padding-block: 0.75rem;
	gap: 1.5rem;
}

.ayh-header__end {
	gap: 1.5rem;
	flex-wrap: nowrap;
}

/* Logo */
.ayh-header .ayh-logo img {
	block-size: 3.25rem;
	inline-size: auto;
}

.ayh-logo__ink {
	display: none !important;
}

/* Links */
.ayh-header .ayh-nav .wp-block-navigation-item__content.wp-block-navigation-item__content {
	position: relative;
	color: var(--ayh-header-fg);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	padding-block: 0.6rem;
	text-decoration: none;
}

.ayh-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0.15rem;
	block-size: 2px;
	background: var(--ayh-header-line);
	transform: scaleX(0) skewX(var(--ayh-skew-el));
	transform-origin: center;
	transition: transform 0.25s ease;
}

.ayh-header .ayh-nav .wp-block-navigation-item__content.wp-block-navigation-item__content:hover,
.ayh-header .ayh-nav .wp-block-navigation-item__content.wp-block-navigation-item__content:focus-visible {
	color: var(--ayh-header-fg-hover);
}

.ayh-nav .wp-block-navigation-item__content:hover::after,
.ayh-nav .wp-block-navigation-item__content:focus-visible::after,
.ayh-nav .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1) skewX(var(--ayh-skew-el));
}

/* CTA: slanted plate behind the text, so the label is never clipped */
.ayh-btn-slant .wp-block-button__link {
	position: relative;
	isolation: isolate;
	background: none;
	color: var(--ayh-cta-fg);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.4;
	padding: 0.7rem 1.6rem;
	min-block-size: 2.75rem;
	display: inline-flex;
	align-items: center;
	border-radius: 0;
	transition: color 0.2s ease;
}

.ayh-btn-slant .wp-block-button__link::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--ayh-cta-bg);
	border-radius: 0.65rem;
	transform: skewX(var(--ayh-skew));
	transition: background-color 0.2s ease;
}

.ayh-btn-slant .wp-block-button__link:hover::before,
.ayh-btn-slant .wp-block-button__link:focus-visible::before {
	background: var(--ayh-cta-bg-hover);
}

/* Mobile: hamburger target and overlay */
.ayh-header .ayh-nav .wp-block-navigation__responsive-container-open,
.ayh-header .ayh-nav .wp-block-navigation__responsive-container-close {
	min-inline-size: 2.75rem;
	min-block-size: 2.75rem;
	align-items: center;
	justify-content: center;
	color: var(--ayh-header-fg);
}

.ayh-header .ayh-nav .wp-block-navigation__responsive-container.is-menu-open {
	--ayh-header-fg: var(--wp--preset--color--ivory);
	--ayh-header-fg-hover: var(--wp--preset--color--brass-light);
	--ayh-header-line: var(--wp--preset--color--brass-light);
	padding: 1.25rem;
}

.ayh-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--peyda);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	line-height: 1.5;
	color: var(--wp--preset--color--ivory);
}

.ayh-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.ayh-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--brass-light);
}

.ayh-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	gap: 1rem;
	padding-block-start: 3rem;
}

@media (max-width: 37.4375rem) {
	.ayh-header .ayh-logo img {
		block-size: 2.75rem;
	}

	.ayh-header__bar,
	.ayh-header__end {
		gap: 0.5rem;
	}

	.ayh-theme-toggle {
		inline-size: 2rem;
		block-size: 2rem;
	}
}

/* Front page: header floats over the dark hero */
.home .wp-site-blocks {
	position: relative;
}

.home .wp-site-blocks > header {
	position: absolute;
	inset-inline: 0;
	inset-block-start: 0;
	border-block-end: 0;
}

.home .wp-site-blocks > main {
	margin-block-start: 0;
}

.home .ayh-header {
	--ayh-header-fg: var(--wp--preset--color--ivory);
	--ayh-header-fg-hover: var(--wp--preset--color--brass-light);
	--ayh-header-line: var(--wp--preset--color--brass-light);
	--ayh-cta-bg: var(--wp--preset--color--brass-light);
	--ayh-cta-fg: var(--wp--preset--color--ink);
	--ayh-cta-bg-hover: var(--wp--preset--color--ivory);
}

.home .ayh-logo__color {
	display: none;
}

.home .ayh-logo__ink {
	display: block !important;
}

@media (prefers-reduced-motion: reduce) {
	.ayh-nav .wp-block-navigation-item__content::after,
	.ayh-btn-slant .wp-block-button__link,
	.ayh-btn-slant .wp-block-button__link::before {
		transition: none;
	}
}
