@charset "UTF-8";

/**
 * navigations.css 2.2.0 (wip)
 * Author: hybrid.
 * Type: core
 *
 * Navigation components — nav base, anchors, sticky, swiperable, alignment, social, menus, alerts.
 * Button styles defined in buttons.css.
 * Submit button styles shared via --button-* tokens.
 *
 * Sections
 * CONFIG     — nav, anchor, swiperable, menu, social and alert tokens
 * ANIMATIONS — anchor transitions, menus, sticky, alert
 * NAV        — nav base, anchors, hover, modifiers (full, fit, vertical, uniform), list in nav, link button, sticky, sizes
 * SWIPERABLE — swiperable nav
 * ALIGNMENT  — is-center, is-right, is-justify, is-stretch
 * SOCIAL     — socialbar, sharebar
 * SKIP LINKS — skip links (each link fixed off-screen, shown alone on focus)
 * MENUS      — menu, has-menu, hovering submenus
 * ALERTS     — admin-only, hidden label, copy toast
 *
 * Classes set by the JS layer
 * .hover (touch), .is-stuck (sticky nav), .expanded (open nav)
 *
 * Shared with buttons.css
 * --nav-anchor-gap
 * --nav-anchor-transition   must list every animated property of buttons (incl. box-shadow, outline-color, outline-offset)
 *
 * Note
 * .uniform: children share the width of the widest one (inline-grid, columns
 * minmax(max-content, 1fr)). It sets --nav-width: auto, so the nav no longer
 * fills its parent: justify-content (.is-center, .is-right) has no effect on it,
 * align from the parent instead. .uniform.vertical stacks the children in one column.
 *
 * .nav (container of several <nav> or .nav): a .nav replaces a <nav> where the element
 * is not a site navigation (actions, controls: RGAA 9.2), so .nav > .nav is expected.
 * Token-based modifiers (.fit, .large, .small) reach the inner nav by inheritance;
 * property-based ones (.vertical, .uniform, .is-center, .is-right, .is-justify) list
 * the inner nav in their selectors (:where(.nav.x) > :where(nav, .nav), specificity
 * kept low). Anchors and sharebar/socialbar work the same on a <nav> or a .nav.
 *
 * .large / .small on .nav set --nav-font-size (links) and, through buttons.css,
 * --button-font-size (buttons): the two token families stay separate.
 *
 * Lists and buttons in a nav
 * <nav><ul><li><a>: the <ul> (no class) is laid out by :where(nav, .nav) > ul. .menu is reserved to the WP menus
 * (sub-menus, collapsible). A <button> (JS action) that must look like an anchor takes .link (single) or sits
 * in a .links container, mirror of .button / .buttons. Memo in CSS-NAVIGATIONS.md.
 *
 * Active and focus
 * .active and :focus-visible share the hover look (--nav-anchor-hover-*, anchors and button.link). The outline of
 * reset.css stays: on an .active link the focus would otherwise change nothing. Submenus open on :focus-visible too.
 * Anchors and button.link keep the inset outline of reset.css (no border to clear): buttons.css leaves .link buttons out of its outside outline.
 *
 * Font size of nested navs
 * --nav-font-size is applied once, by the outermost nav (or .nav inside a .nav). Navs nested in it inherit the
 * font size, they do not rescale. An inner nav that needs its own size: override it in the project.
 *
 * Dependencies
 * --gutter-gap, --header-height  defined in layout.css
 * --accent-color, --alert-color, --bright-color, --bright-rgb, --dark-color  defined in colors.css
 * --font-weight-bold             defined in fonts.css
 * --duration-fast, --ease, --elastic  defined in animations.css
 * --z-nav-sticky, --z-overlay    defined in layout.css (optional, fallback provided)
 */



/* ================================================================================================== */
/* ============================================= CONFIG ============================================= */
/* ================================================================================================== */


/* ============================== NAV ============================== */

:root {
	--nav-font-size: 1em;
	--nav-line-height: 1;
	--nav-width: 100%;
	--nav-gap: .5em;
	--nav-wrap: wrap;
	--nav-background-color: var(--background-color, #FFF);
	--nav-background-opacity: 1;
	--nav-sticky-top: var(--header-height, 0px);
}


/* ============================== ANCHORS ============================== */

:root {
	--nav-anchor-padding-x: 1em;
	--nav-anchor-padding-y: 1em;
	--nav-anchor-gap: .5em;
	--nav-anchor-color: currentColor;
	--nav-anchor-hover-color: var(--accent-color, currentColor);
	--nav-anchor-opacity: 1;
	--nav-anchor-hover-opacity: 1;
	--nav-anchor-transform: none;
	--nav-anchor-transition:
		color var(--duration-fast) var(--ease),
		text-decoration var(--duration-fast) var(--ease),
		background var(--duration-fast) var(--ease),
		opacity var(--duration-fast) var(--ease),
		border var(--duration-fast) var(--ease),
		box-shadow var(--duration-fast) var(--ease),
		outline-color var(--duration-fast) var(--ease),
		outline-offset var(--duration-fast) var(--ease),
		width var(--duration-fast) var(--elastic),
		transform var(--duration-fast) var(--elastic),
		filter var(--duration-fast) var(--elastic);
}


/* ============================== SWIPERABLE ============================== */

:root {
	--swiperable-gap-x: 1em;
	--swiperable-fx-rgb: var(--background-rgb, var(--bright-rgb));
	--swiperable-fx: linear-gradient(90deg,
		rgba(var(--swiperable-fx-rgb), 1) 0%,
		rgba(var(--swiperable-fx-rgb), 0) calc(var(--gutter-gap) * 2),
		rgba(var(--swiperable-fx-rgb), 0) calc(100% - var(--gutter-gap) * 2),
		rgba(var(--swiperable-fx-rgb), 1) 100%
	);
}


/* ============================== MENUS ============================== */

:root {
	--menu-font-size: 1em;
	--submenu-background-color: var(--background-color, #FFF);
	--submenu-offset: -2em; /* closed position, slides back on open */
}


/* ============================== SOCIAL ============================== */

:root {
	--social-icon-size: 1em;
	--sharebar-font-size: .875em;
	--social-title-gap: 1em;
	--sharebar-button-padding: 1em;
}


/* ============================== SKIP LINKS ============================== */

:root {
	--skip-links-z-index: var(--z-overlay, 10000);
	--skip-links-hidden-top: -10000px; /* closed position: off-screen, never display none (RGAA 12.7) */
	--skip-links-top: var(--gutter-gap);
	--skip-links-left: var(--gutter-gap);
	--skip-links-color: var(--background-color, #FFF);
	--skip-links-background-color: var(--text-color, #000);
}


/* ============================== ALERT ============================== */

:root {
	--alert-position-x: 50%;
	--alert-position-y: var(--gutter-gap);
	--alert-font-size: 1em;
	--alert-padding: 1em;
	--alert-border-radius: 0;
	--alert-text-color: var(--background-color, #FFF);
	--alert-background-color: var(--text-color, #000);
	--alert-error-background-color: var(--alert-color, #F00);
	--alert-label-font-weight: var(--font-weight-bold);
	--alert-label-font-size: .75em;
	--alert-label-padding: 1em;
	--alert-label-background-color: var(--alert-color, #F00);
}



/* ====================================================================================================== */
/* ============================================= ANIMATIONS ============================================= */
/* ====================================================================================================== */


/* ============================== DEFAULT ============================== */

a { transition: var(--nav-anchor-transition); }
:where(a)::before, :where(a)::after,
:where(a) span, :where(a) span::before, :where(a) span::after { transition: inherit; }


/* ============================== MENUS ============================== */

nav:not(.expanded) .has-menu .menu:not(.collapsible) {
	transition:
		opacity var(--duration-fast) var(--ease),
		transform var(--duration-fast) var(--elastic),
		visibility var(--duration-fast);
}


/* ============================== STICKY ============================== */

:where(nav, .nav).sticky::after,
:where(nav, .nav).sticky .swiperable::before {
	transition: opacity var(--duration-fast) var(--ease);
}


/* ============================== ALERT ============================== */

.copy-toast {
	transition:
		opacity var(--duration-fast) var(--ease),
		transform var(--duration-fast) var(--ease),
		visibility var(--duration-fast);
}


/* =============================================================================================== */
/* ============================================= NAV ============================================= */
/* =============================================================================================== */

/* .nav = container of several nav, or <div> replacing a <nav> (RGAA) */

/* ============================== DEFAULT ============================== */

:where(nav, .nav) {
	position: relative;
	display: inline-flex;
	flex-wrap: var(--nav-wrap);
	align-items: center;
	gap: var(--nav-gap);
	width: var(--nav-width);
	line-height: var(--nav-line-height);
	white-space: nowrap;
	pointer-events: none;
}

nav,
:where(.nav) > .nav { font-size: var(--nav-font-size); }

/* Applied once: a nav (or nested .nav) inside one that already applied --nav-font-size inherits it.
   The token is inherited too, applying it again would compound (.large: 1.25em x 1.25em) */
nav nav,
nav .nav > .nav,
.nav > .nav nav,
.nav > .nav .nav > .nav { font-size: inherit; }

.nav > :where(nav, .nav) { --nav-width: auto; }

nav > *,
.nav > * { pointer-events: auto; }

/* Not :where(): beats the spacing.css rules (.button + *, nav + *...) whatever the load order */
nav > * + *,
.nav > * + * { margin-top: 0; }


/* ============================== ANCHORS ============================== */

:where(nav, .nav) a {
	display: inline-flex;
	align-items: center;
	gap: var(--nav-anchor-gap);
	line-height: 1;
	text-decoration: none;
	text-transform: var(--nav-anchor-transform);
	color: var(--nav-anchor-color);
	width: auto;
	margin: 0;
	padding-inline: var(--nav-anchor-padding-x);
	padding-block: var(--nav-anchor-padding-y);
	opacity: var(--nav-anchor-opacity);
}


/* ============================== ACTIVE ============================== */

:where(nav, .nav) a.active,
:where(nav, .nav) a:focus-visible {
	color: var(--nav-anchor-hover-color);
	opacity: var(--nav-anchor-hover-opacity);
}


/* ============================== HOVER ============================== */

@media (hover: hover) {
	:where(nav, .nav) a:hover {
		color: var(--nav-anchor-hover-color);
		opacity: var(--nav-anchor-hover-opacity);
	}
}
@media (hover: none) {
	:where(nav, .nav) a.hover {
		color: var(--nav-anchor-hover-color);
		opacity: var(--nav-anchor-hover-opacity);
	}
}


/* ============================== LINK BUTTON ============================== */

/* button.link / .links button: a <button> (action) that looks like a nav anchor, mirror of .button / .buttons.
   Same tokens as the anchors. Class kept in the selector: beats the button rules of buttons.css whatever the load order */
button.link,
.links button {
	display: inline-flex;
	align-items: center;
	gap: var(--nav-anchor-gap);
	font-size: inherit;
	font-weight: inherit;
	line-height: var(--nav-line-height);
	letter-spacing: inherit;
	text-align: inherit;
	text-transform: var(--nav-anchor-transform);
	padding-inline: var(--nav-anchor-padding-x);
	padding-block: var(--nav-anchor-padding-y);
	color: var(--nav-anchor-color);
	background: none;
	box-shadow: none;
	border-radius: 0;
	cursor: pointer;
	opacity: var(--nav-anchor-opacity);
}


/* ============================== LINK BUTTON ACTIVE ============================== */

button.link.active,
.links button.active,
button.link:focus-visible,
.links button:focus-visible {
	color: var(--nav-anchor-hover-color);
	background: none;
	box-shadow: none;
	opacity: var(--nav-anchor-hover-opacity);
}


/* ============================== LINK BUTTON HOVER ============================== */

@media (hover: hover) {
	button.link:hover,
	.links button:hover {
		color: var(--nav-anchor-hover-color);
		background: none;
		box-shadow: none;
		opacity: var(--nav-anchor-hover-opacity);
	}
}
@media (hover: none) {
	button.link.hover,
	.links button.hover {
		color: var(--nav-anchor-hover-color);
		background: none;
		box-shadow: none;
		opacity: var(--nav-anchor-hover-opacity);
	}
}


/* ============================== MODIFIERS ============================== */

:where(nav, .nav).full { max-width: none; }
:where(nav, .nav).fit { --nav-gap: 0; }

/* list of links in a nav: <nav><ul><li><a> keeps the layout of the former direct links */
:where(nav, .nav) > ul {
	display: flex;
	flex-wrap: var(--nav-wrap);
	align-items: inherit;
	gap: var(--nav-gap);
}

:where(nav, .nav).vertical,
:where(nav, .nav).vertical > ul,
:where(.nav.vertical) > :where(nav, .nav) {
	flex-direction: column;
	align-items: flex-start;
}

:where(nav, .nav).uniform,
:where(nav, .nav).uniform > ul,
:where(.nav.uniform) > :where(nav, .nav) {
	--nav-width: auto;
	display: inline-grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(max-content, 1fr);
}
:where(nav, .nav).uniform.vertical,
:where(nav, .nav).uniform.vertical > ul,
:where(.nav.uniform.vertical) > :where(nav, .nav) {
	grid-auto-flow: row;
	grid-auto-columns: auto;
	grid-auto-rows: auto;
	justify-items: stretch;
}


/* ============================== STICKY ============================== */

:where(nav, .nav).sticky {
	position: sticky;
	z-index: var(--z-nav-sticky, 100);
	top: var(--nav-sticky-top);
	overflow: visible;
}
:where(nav, .nav).sticky::after {
	content: '';
	position: absolute;
	z-index: -1;
	top: 0;
	left: 50%;
	height: 100%;
	width: 100svw;
	transform: translateX(-50%);
	background: var(--nav-background-color);
	opacity: var(--nav-background-opacity);
	pointer-events: none;
}

:where(nav, .nav).sticky { --nav-background-opacity: 0; }
:where(nav, .nav).sticky.is-stuck { --nav-background-opacity: 1; }
:where(nav, .nav).sticky .swiperable::before { opacity: var(--nav-background-opacity); }


/* ============================== SIZES ============================== */

:where(nav, .nav).large { --nav-font-size: 1.25em; }
:where(nav, .nav).small { --nav-font-size: .75em; }



/* ====================================================================================================== */
/* ============================================= SWIPERABLE ============================================= */
/* ====================================================================================================== */

nav.swiperable { padding-inline: var(--swiperable-gap-x); }

nav.swiperable::before {
	content: "";
	position: absolute;
	z-index: 5;
	inset: 0;
	pointer-events: none;
	background: var(--swiperable-fx);
}

/* same specificity as .swiper-container (swipers.css, (0,1,0) both via :where()):
   this rule must stay more specific so it does not depend on the load order of the two files */
nav.swiperable.sticky { position: sticky; }
:where(nav, .nav) > nav.swiperable { overflow-y: visible; overflow-x: hidden; }



/* ===================================================================================================== */
/* ============================================= ALIGNMENT ============================================= */
/* ===================================================================================================== */

:where(nav, .nav).is-center,
:where(nav, .nav).is-center .menu,
:where(.nav.is-center) > :where(nav, .nav) { justify-content: center; }

:where(nav, .nav).vertical.is-center,
:where(nav, .nav).vertical.is-center .menu,
:where(.nav.vertical.is-center) > :where(nav, .nav) { align-items: center; }

:where(nav, .nav).is-right,
:where(nav, .nav).is-right .menu,
:where(.nav.is-right) > :where(nav, .nav) { justify-content: flex-end; }

:where(nav, .nav).vertical.is-right,
:where(nav, .nav).vertical.is-right .menu,
:where(.nav.vertical.is-right) > :where(nav, .nav) { align-items: flex-end; }

:where(nav, .nav).is-justify,
:where(nav, .nav).is-justify > ul,
:where(nav, .nav).is-justify .menu,
:where(.nav.is-justify) > :where(nav, .nav) { justify-content: space-between; }

:where(nav, .nav).is-justify > ul { flex-grow: 1; }

:where(nav, .nav).is-stretch,
:where(nav, .nav).is-stretch > ul,
:where(nav, .nav).is-stretch .menu { flex-wrap: nowrap; }

:where(nav, .nav).is-stretch > *,
:where(nav, .nav).is-stretch > ul > *,
:where(nav, .nav).is-stretch .menu > * { flex: 1 1 0; }

:where(nav, .nav).is-center nav.swiperable .swiper-slide:first-child,
nav.swiperable.is-center .swiper-slide:first-child { margin-left: auto; }

:where(nav, .nav).is-center nav.swiperable .swiper-slide:last-child,
nav.swiperable.is-center .swiper-slide:last-child { margin-right: auto; }



/* ================================================================================================== */
/* ============================================= SOCIAL ============================================= */
/* ================================================================================================== */

/* fit as default */

:where(nav, .nav):is(.socialbar, .sharebar) {
	--nav-gap: 0;
	white-space: nowrap;
}

:where(nav, .nav):is(.socialbar, .sharebar) a > :where([class^="icon-"], [class*=" icon-"]) { --icon-size: var(--social-icon-size); }

:where(nav, .nav).sharebar { font-size: var(--sharebar-font-size); }
:where(nav, .nav):is(.socialbar, .sharebar) > .title { margin-right: var(--social-title-gap); }
.buttons.sharebar > *:not(span) { padding: var(--sharebar-button-padding); }


/* ================================================================================================= */
/* ========================================== SKIP LINKS =========================================== */
/* ================================================================================================= */

/* nav.skip-links > ul > li > a (get_theme_skip_links()). Each link is fixed off-screen and comes back alone
   when it has the focus (RGAA 12.7): never display none / visibility hidden, the links must stay focusable */

.skip-links a {
	position: fixed;
	z-index: var(--skip-links-z-index);
	top: var(--skip-links-hidden-top);
	left: var(--skip-links-left);
	color: var(--skip-links-color);
	background-color: var(--skip-links-background-color);
}
.skip-links a:focus { top: var(--skip-links-top); }

/* Out of the flow: no line box (nav is inline-flex) and no margin from spacing.css (nav + *) on what follows */
.skip-links { display: block; }
.skip-links + * { margin-top: 0; }



/* ================================================================================================= */
/* ============================================= MENUS ============================================= */
/* ================================================================================================= */

/*
.menu = ul li
*/

/* ============================== DEFAULT ============================== */

.menu {
	--button-font-size: 1em; /* buttons (collapsible toggle) follow the list size */
	display: flex;
	flex-wrap: var(--nav-wrap);
	gap: var(--nav-gap);
	font-size: var(--menu-font-size);
	text-align: left;
}


/* ============================== HAS-MENU DEFAULT ============================== */

/* Nested submenus keep the size of their parent (an em value of --menu-font-size would compound) */
.has-menu .has-menu > .menu { font-size: inherit; }
.has-menu > * {
	margin-top: 0;
	vertical-align: top; /* link and toggle share a line: baseline alignment offsets them */
}


/* ============================== HAS-MENU HOVERING ============================== */

/* Hovering menus with submenus (default: closed) */

nav:not(.expanded) .has-menu .menu:not(.collapsible) {
	position: absolute;
	top: 100%;
	left: 0;
	flex-direction: column;
	background: var(--submenu-background-color);
	opacity: 0;
	pointer-events: none;
	transform: translateY(var(--submenu-offset));
	visibility: hidden;
}


/* ============================== HAS-MENU ACTIVE ============================== */

/* Keyboard: the submenu opens when the item has the focus (hidden links cannot be reached with Tab) */
nav:not(.expanded) .has-menu:has(:focus-visible) .menu:not(.collapsible) {
	opacity: 1;
	pointer-events: all;
	transform: none;
	visibility: visible;
}


/* ============================== HAS-MENU HOVER ============================== */

@media (hover: hover) {
	nav:not(.expanded) .has-menu:hover .menu:not(.collapsible) {
		opacity: 1;
		pointer-events: all;
		transform: none;
		visibility: visible;
	}
}
@media (hover: none) {
	nav:not(.expanded) .has-menu.hover .menu:not(.collapsible) {
		opacity: 1;
		pointer-events: all;
		transform: none;
		visibility: visible;
	}
}



/* ================================================================================================== */
/* ============================================= ALERTS ============================================= */
/* ================================================================================================== */

/* WIP */

/* ============================== ADMIN ONLY ============================== */

/* for hidden pages visible only to admins */

a.admin-only { text-decoration: line-through; }


/* ============================== LABEL ============================== */

.hidden-label {
	position: fixed;
	z-index: var(--z-overlay, 10000);
	bottom: 0;
	right: 0;
	font-size: var(--alert-label-font-size);
	line-height: 1;
	font-weight: var(--alert-label-font-weight);
	padding: var(--alert-label-padding);
	background: var(--alert-label-background-color);
}


/* ============================== COPY TOAST ============================== */

.copy-toast {
	position: fixed;
	z-index: var(--z-overlay, 10000);
	bottom: var(--alert-position-y);
	left: var(--alert-position-x);
	transform: translate(-50%, 0%);
	color: var(--alert-text-color);
	background: var(--alert-background-color);
	font-size: var(--alert-font-size);
	padding: var(--alert-padding);
	border-radius: var(--alert-border-radius);
	opacity: 0;
	visibility: hidden;
}
.copy-toast.show {
	opacity: 1;
	transform: translate(-50%, -50%);
	visibility: visible;
}
.copy-toast.error { background: var(--alert-error-background-color); }