/*
 * core/navigation — main menu (.sws-nav). Desktop from 1100px: inline menu in Condensed 700 at 15 px with the red edge
 * under the current section, and the red "Mitglied werden" button. Below 1100px: burger + full-screen navy menu
 * (DESIGN-POLISH §3): big condensed items with mono indices 01–06, the language rail and the red CTA at the bottom;
 * it opens as a circle from the burger (instantly with reduced motion). Core switches at 600px; we move it to 1100.
 */

.sws-nav.wp-block-navigation {
	gap: clamp(1rem, 1.5vw, 1.75rem);
	font-size: var(--wp--custom--nav-size);
	line-height: 1.2;
}

.sws-nav.wp-block-navigation .wp-block-navigation__container {
	gap: clamp(1rem, 1.5vw, 1.75rem);
	align-items: center;
}

.sws-nav.wp-block-navigation .wp-block-navigation-item__content {
	color: inherit;
	text-decoration: none;
}

.sws-nav.wp-block-navigation .wp-block-navigation-item__content:hover {
	color: inherit;
}

/* Burger and close buttons: 44px touch targets. */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-open,
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-close {
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--tap);
	height: var(--wp--custom--tap);
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-open {
	margin-inline-end: -0.5rem;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-open svg,
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-close svg {
	width: 28px;
	height: 28px;
}

/* Core shows the inline menu from 600px; it does not fit before 1100px. */
@media (min-width: 600px) and (max-width: 1099.98px) {
	.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* ---------- Desktop ---------- */

@media (min-width: 1100px) {
	.sws-nav.wp-block-navigation .wp-block-navigation__container > .wp-block-navigation-item:not(.sws-nav-cta) > .wp-block-navigation-item__content {
		position: relative;
		padding-block: 0.6rem;
	}

	/* The red edge, about 10 px under the text. */
	.sws-nav.wp-block-navigation .wp-block-navigation__container > .wp-block-navigation-item:not(.sws-nav-cta) > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		height: var(--wp--custom--edge);
		background-color: var(--wp--preset--color--red);
		transform: scaleX(0);
		transform-origin: left center;
	}

	.sws-nav.wp-block-navigation .wp-block-navigation__container > .wp-block-navigation-item:not(.sws-nav-cta) > .wp-block-navigation-item__content:hover::after,
	.sws-nav.wp-block-navigation .wp-block-navigation__container > .wp-block-navigation-item:not(.sws-nav-cta) > .wp-block-navigation-item__content:focus-visible::after,
	.sws-nav.wp-block-navigation .wp-block-navigation__container > .wp-block-navigation-item.sws-nav-current:not(.sws-nav-cta) > .wp-block-navigation-item__content::after {
		transform: scaleX(1);
	}

	/* Submenu toggle (Verein ▾): a 24 px target instead of core's 10 px chevron (AUDIT P2-2, WCAG 2.5.8). */
	.sws-nav.wp-block-navigation .wp-block-navigation-submenu__toggle.wp-block-navigation__submenu-icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 1.5rem;
		height: 1.5rem;
		margin-inline-start: 0.1rem;
		padding: 0.4rem;
	}

	.sws-nav.wp-block-navigation .wp-block-navigation-submenu__toggle.wp-block-navigation__submenu-icon svg {
		width: 0.75rem;
		height: 0.75rem;
		margin: 0;
	}

	/* Dropdown (Regatten ▾, Regeln ▾, Verein ▾): core gives submenus the overlay colours (navy-deep / white). No red
	   edge (Eric 28.11.2026: with core's right-aligned dropdowns it ran into the red mark under «Home»). */
	.sws-nav.wp-block-navigation .wp-block-navigation__submenu-container {
		min-width: 14rem;
		padding-block: 0.5rem;
		border: 0;
		border-radius: var(--wp--custom--radius--small);
		box-shadow: var(--wp--preset--shadow--card-hover);
	}

	/* Each dropdown opens under its own entry (core aligns them to the entry's right edge in a right-justified menu,
	   so they reached to the left under Home and News); only the last one, Verein, still opens to the left. */
	.sws-nav.wp-block-navigation .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-container,
	.sws-nav.wp-block-navigation.items-justified-right .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-container {
		right: auto;
		left: 0;
	}

	.sws-nav.wp-block-navigation .wp-block-navigation__container > .has-child:nth-last-child(-n + 2) > .wp-block-navigation__submenu-container,
	.sws-nav.wp-block-navigation.items-justified-right .wp-block-navigation__container > .has-child:nth-last-child(-n + 2) > .wp-block-navigation__submenu-container {
		right: 0;
		left: auto;
	}

	.sws-nav.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding: 0.7rem 1.1rem;
	}

	.sws-nav.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
	.sws-nav.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content[aria-current] {
		background-color: var(--wp--preset--color--navy);
		color: var(--wp--preset--color--white);
	}
}

@media (min-width: 1100px) and (prefers-reduced-motion: no-preference) {
	.sws-nav.wp-block-navigation .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content::after {
		transition: transform var(--wp--custom--transition);
	}
}

/* The "Mitglied werden" item is a red button (desktop and overlay). */
.sws-nav.wp-block-navigation .sws-nav-cta > .wp-block-navigation-item__content {
	padding: 0.65em 1.15em;
	border-radius: var(--wp--custom--radius--button);
	background-color: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
}

.sws-nav.wp-block-navigation .sws-nav-cta > .wp-block-navigation-item__content:hover,
.sws-nav.wp-block-navigation .sws-nav-cta > .wp-block-navigation-item__content:focus-visible {
	background-color: var(--wp--preset--color--red-hover);
	color: var(--wp--preset--color--white);
}

/* ---------- Full-screen menu (burger open) ---------- */

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
	isolation: isolate;
	padding: 0 var(--wp--custom--gutter);
}

/* Chart contours on the navy, 8 %. */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-color: var(--wp--preset--color--white);
	opacity: 0.08;
	-webkit-mask: url(../../images/contours.svg) 0 0 / 480px 480px repeat;
	mask: url(../../images/contours.svg) 0 0 / 480px 480px repeat;
	pointer-events: none;
}

/* Column that fills the screen, so the CTA sits at the bottom. */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open :is(.wp-block-navigation__responsive-close, .wp-block-navigation__responsive-dialog) {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	flex: 1 0 auto;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	flex: 1 0 auto;
	align-items: stretch;
	padding-block: calc(var(--wp--custom--header-height-mobile) + var(--wp--preset--spacing--50)) var(--wp--custom--gutter);
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	flex: 1 0 auto;
	gap: 0;
	align-items: stretch;
	width: 100%;
	max-width: 36rem;
	margin-inline: auto;
	counter-reset: sws-nav;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	align-items: stretch;
	text-align: start;
	border-block-end: 1px solid color-mix(in srgb, var(--wp--preset--color--white) 14%, transparent);
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:not(.sws-nav-cta) {
	counter-increment: sws-nav;
}

/* Items: Condensed 800 uppercase in 56 px rows, each with a mono index in navy-tint. */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:not(.sws-nav-cta) > .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	min-height: 3.5rem;
	padding-block: 0.35rem;
	font-size: var(--wp--preset--font-size--h-1);
	font-weight: 800;
	letter-spacing: 0.01em;
	line-height: 1;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:not(.sws-nav-cta) > .wp-block-navigation-item__content::before {
	content: counter(sws-nav, decimal-leading-zero);
	flex: none;
	width: 2.5ch;
	color: var(--wp--preset--color--navy-tint);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	letter-spacing: 0;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content[aria-current],
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .sws-nav-current > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--red);
	text-decoration-thickness: var(--wp--custom--edge);
	text-underline-offset: 0.18em;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container {
	align-items: flex-start;
	gap: 0;
	padding: 0 0 0.5rem calc(2.5ch + var(--wp--preset--spacing--40));
	color: var(--wp--preset--color--navy-tint);
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	min-height: var(--wp--custom--tap);
	padding-block: 0;
	font-size: var(--wp--preset--font-size--lead);
}

/* Red full-width "Mitglied werden" at the bottom (sticky when the list is longer than the screen). It sits on its own
   strip of the overlay navy, fading in above the button and running down to the screen edge, so the list scrolls
   under it instead of showing through (Eric's phone, 28.10.: "Infos" and "GV 2026" over the button). */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .sws-nav-cta {
	position: sticky;
	bottom: 0;
	z-index: 3; /* above core's submenu containers (z-index 2) */
	margin-block-start: auto;
	padding-block: var(--wp--preset--spacing--60) var(--wp--custom--gutter);
	border-block-end: 0;
}

/* The strip itself: core clears the background of menu items in the overlay, so it is painted underneath. */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .sws-nav-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: linear-gradient(to bottom, transparent, var(--wp--preset--color--navy-deep) var(--wp--preset--spacing--50));
	pointer-events: none;
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .sws-nav-cta > .wp-block-navigation-item__content {
	display: flex;
	box-sizing: border-box;
	justify-content: center;
	width: 100%;
	padding: 1rem 1.4rem;
	font-size: var(--wp--preset--font-size--lead);
}

/* Scrolled menu: the close button stays where it is, and a navy band under the header keeps the list from running
   under the logo and the language switcher. */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	position: fixed;
	z-index: 3;
	right: calc(var(--wp--custom--gutter) - 0.5rem);
}

.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog::before {
	content: "";
	position: fixed;
	inset: 0 0 auto;
	z-index: 2;
	height: var(--wp--custom--header-height-mobile);
	background-image: linear-gradient(to bottom, var(--wp--preset--color--navy-deep) 80%, transparent);
	pointer-events: none;
}

@media (min-width: 768px) {
	.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog::before {
		height: var(--wp--custom--header-height);
	}
}

/* Close button where the burger was. */
.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-close {
	top: calc((var(--wp--custom--header-height-mobile) - var(--wp--custom--tap)) / 2);
	right: -0.5rem;
}

@media (min-width: 768px) {
	.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container-close {
		top: calc((var(--wp--custom--header-height) - var(--wp--custom--tap)) / 2);
	}

	.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		padding-block-start: calc(var(--wp--custom--header-height) + var(--wp--preset--spacing--60));
	}
}

/* The logo tile and the language switcher stay on top of the open menu; the languages become a rail. */
.sws-site-header:has(.is-menu-open) :is(.sws-header__logo, .sws-header > .sws-lang) {
	position: relative;
	z-index: 100001;
}

.sws-site-header:has(.is-menu-open) .sws-header > .sws-lang {
	--sws-pill: var(--wp--preset--color--white);
	--sws-pill-text: var(--wp--preset--color--navy-deep);
	color: var(--wp--preset--color--white);
}

/* Open: a circle growing from the burger, 240 ms. Reduced motion: it just appears. */
@media (prefers-reduced-motion: no-preference) {
	.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
		animation: sws-menu-open 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sws-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
		animation: none;
	}
}

@keyframes sws-menu-open {
	from {
		clip-path: circle(1.375rem at calc(100% - 1.875rem) 2rem);
	}

	to {
		clip-path: circle(150vmax at calc(100% - 1.875rem) 2rem);
	}
}
