/**
 * Autoplex — styles globaux : base, en-tête, menu mobile, pied de page, pages génériques.
 * Les sections de la page d'accueil ont chacune leur feuille dans blocks/<bloc>/style.css.
 */

/* ==========================================================================
   Base
   ========================================================================== */

:root {
	--ap-green: var(--wp--preset--color--primary, #01bf63);
	--ap-green-dark: var(--wp--preset--color--primary-dark, #007f43);
	--ap-anthracite: var(--wp--preset--color--secondary, #2b313d);
	--ap-night: var(--wp--preset--color--dark, #12151b);
	--ap-light: var(--wp--preset--color--light, #f9f9f9);
	--ap-serif: var(--wp--preset--font-family--serif, "PT Serif", Georgia, serif);
	--ap-sans: var(--wp--preset--font-family--sans, "PT Sans", Arial, sans-serif);
	--ap-gutter: var(--wp--custom--gutter, clamp(1.25rem, 4.5vw, 4rem));
	--ap-ease: var(--wp--custom--ease, cubic-bezier(0.22, 1, 0.36, 1));
	--ap-header-h: 145px;
	--ap-header-h-scrolled: 88px;
	--ap-admin-bar: var(--wp-admin--admin-bar--height, 0px);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--ap-header-h-scrolled) + var(--ap-admin-bar) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* Sur téléphone, la barre d'administration WordPress défile avec la page : pas de décalage à réserver. */
@media screen and (max-width: 600px) {
	:root {
		--ap-admin-bar: 0px;
	}
}

body {
	margin: 0;
	background: #fff;
	color: var(--ap-anthracite);
	font-family: var(--ap-sans);
	font-size: 1rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body.is-home {
	background: var(--ap-anthracite);
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--ap-green-dark);
	text-underline-offset: 0.18em;
}

:focus-visible {
	outline: 2px solid var(--ap-green);
	outline-offset: 3px;
}

.site-main:focus {
	outline: none;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important;
}

.skip-link {
	position: fixed;
	z-index: 1000;
	top: calc(var(--ap-admin-bar) + 12px);
	left: 12px;
	padding: 0.75rem 1.25rem;
	background: var(--ap-green);
	color: var(--ap-night);
	font-weight: 700;
	text-decoration: none;
	transform: translateY(-200%);
	transition: transform 0.2s ease;
}

.skip-link:focus {
	transform: none;
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ==========================================================================
   En-tête
   ========================================================================== */

.site-header {
	position: sticky;
	z-index: 100;
	top: var(--ap-admin-bar);
	background: var(--ap-anthracite);
	border-bottom: 0.5px solid rgba(255, 255, 255, 0.9);
	transition: background-color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	height: var(--ap-header-h);
	padding-inline: var(--ap-gutter);
	transition: height 0.45s var(--ap-ease);
}

.site-logo {
	display: block;
	flex: 0 0 auto;
	line-height: 0;
}

.site-logo img {
	display: block;
	width: 94px;
	height: auto;
	transition: width 0.45s var(--ap-ease);
}

.site-header.is-scrolled {
	background: rgba(43, 49, 61, 0.94);
	border-bottom-color: rgba(255, 255, 255, 0.15);
	box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.6);
}

@supports (backdrop-filter: blur(8px)) {
	.site-header.is-scrolled {
		background: rgba(43, 49, 61, 0.82);
		backdrop-filter: saturate(140%) blur(12px);
		-webkit-backdrop-filter: saturate(140%) blur(12px);
	}
}

.site-header.is-scrolled .site-header__inner {
	height: var(--ap-header-h-scrolled);
}

.site-header.is-scrolled .site-logo img {
	width: 58px;
}

/* Navigation principale */
.site-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 26px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list a {
	position: relative;
	display: inline-block;
	padding-block: 0.5rem;
	color: #fff;
	font-size: 1rem;
	line-height: 1.5;
	letter-spacing: 0.05em;
	text-decoration: none;
}

.site-nav__list a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.25rem;
	height: 1px;
	background: var(--ap-green);
	transform: scaleX(0);
	transform-origin: right center;
	transition: transform 0.45s var(--ap-ease);
}

.site-nav__list a:hover::after,
.site-nav__list a:focus-visible::after,
.site-nav__list a.is-active::after,
.site-nav__list .current-menu-item > a::after {
	transform: scaleX(1);
	transform-origin: left center;
}

.site-nav__list a.is-active {
	color: var(--ap-green);
}

/* Entrée du header au chargement */
.js .site-header .site-logo,
.js .site-header .site-nav__list > li {
	animation: ap-header-in 0.9s var(--ap-ease) both;
}

.js .site-header .site-nav__list > li:nth-child(1) { animation-delay: 0.08s; }
.js .site-header .site-nav__list > li:nth-child(2) { animation-delay: 0.14s; }
.js .site-header .site-nav__list > li:nth-child(3) { animation-delay: 0.2s; }
.js .site-header .site-nav__list > li:nth-child(4) { animation-delay: 0.26s; }
.js .site-header .site-nav__list > li:nth-child(n + 5) { animation-delay: 0.32s; }

@keyframes ap-header-in {
	from {
		opacity: 0;
		transform: translate3d(0, -12px, 0);
	}
}

/* Bouton burger */
.menu-toggle {
	display: none;
	position: relative;
	z-index: 102;
	width: 48px;
	height: 48px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

.menu-toggle__bars {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 26px;
	height: 18px;
	transform: translate(-50%, -50%);
}

.menu-toggle__bars span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform 0.45s var(--ap-ease), opacity 0.3s ease, width 0.45s var(--ap-ease), top 0.45s var(--ap-ease);
}

.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { top: 8px; width: 70%; }
.menu-toggle__bars span:nth-child(3) { top: 16px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) {
	top: 8px;
	transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) {
	opacity: 0;
	width: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) {
	top: 8px;
	transform: rotate(-45deg);
}

/* ==========================================================================
   Menu mobile plein écran
   ========================================================================== */

.mobile-menu {
	position: fixed;
	z-index: 99;
	inset: 0;
	top: var(--ap-admin-bar);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: calc(var(--ap-header-h-scrolled) + 2.5rem) var(--ap-gutter) 2.5rem;
	background: var(--ap-anthracite);
	color: #fff;
	overflow-y: auto;
	overscroll-behavior: contain;
	opacity: 0;
	visibility: hidden;
	clip-path: circle(0 at calc(100% - 44px) 44px);
	transition:
		clip-path 0.7s var(--ap-ease),
		opacity 0.3s ease,
		visibility 0s linear 0.7s;
}

.mobile-menu[hidden] {
	display: none;
}

.mobile-menu.is-open {
	opacity: 1;
	visibility: visible;
	clip-path: circle(150% at calc(100% - 44px) 44px);
	transition:
		clip-path 0.7s var(--ap-ease),
		opacity 0.2s ease,
		visibility 0s;
}

/* Filet vert décoratif, comme sur le bandeau d'accueil */
.mobile-menu::before {
	content: "";
	position: absolute;
	top: var(--ap-header-h);
	left: 0;
	width: 38%;
	height: 10px;
	background: var(--ap-green);
}

.mobile-menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mobile-menu__list li {
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	opacity: 0;
	transform: translate3d(0, 24px, 0);
	transition: opacity 0.5s ease, transform 0.7s var(--ap-ease);
}

.mobile-menu.is-open .mobile-menu__list li {
	opacity: 1;
	transform: none;
}

.mobile-menu.is-open .mobile-menu__list li:nth-child(1) { transition-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu__list li:nth-child(2) { transition-delay: 0.22s; }
.mobile-menu.is-open .mobile-menu__list li:nth-child(3) { transition-delay: 0.29s; }
.mobile-menu.is-open .mobile-menu__list li:nth-child(4) { transition-delay: 0.36s; }
.mobile-menu.is-open .mobile-menu__list li:nth-child(n + 5) { transition-delay: 0.43s; }

.mobile-menu__list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.1rem 0;
	color: #fff;
	font-family: var(--ap-serif);
	font-size: clamp(1.75rem, 8vw, 2.5rem);
	line-height: 1.2;
	text-decoration: none;
}

.mobile-menu__list a::after {
	content: "";
	width: 12px;
	height: 12px;
	border-top: 2px solid var(--ap-green);
	border-right: 2px solid var(--ap-green);
	transform: rotate(45deg);
	transition: transform 0.3s var(--ap-ease);
}

.mobile-menu__list a:hover,
.mobile-menu__list a:focus-visible {
	color: var(--ap-green);
}

.mobile-menu__list a:hover::after {
	transform: translateX(4px) rotate(45deg);
}

.mobile-menu__baseline {
	margin: 2.5rem 0 0;
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.9375rem;
}

.mobile-menu__baseline:empty {
	display: none;
}

body.menu-open {
	overflow: hidden;
}

@media (max-width: 900px) {
	:root {
		--ap-header-h: 88px;
		--ap-header-h-scrolled: 72px;
	}

	.site-nav {
		display: none;
	}

	.menu-toggle {
		display: block;
	}

	.site-logo img {
		width: 62px;
	}

	.site-header.is-scrolled .site-logo img {
		width: 50px;
	}

	/* Le header reste au-dessus du menu ouvert pour garder le logo et le bouton de fermeture */
	body.menu-open .site-header {
		z-index: 101;
		background: var(--ap-anthracite);
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
		box-shadow: none;
		border-bottom-color: rgba(255, 255, 255, 0.12);
	}
}

@media (min-width: 901px) {
	.mobile-menu {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header,
	.site-header__inner,
	.site-logo img,
	.menu-toggle__bars span,
	.mobile-menu,
	.mobile-menu__list li {
		transition: none !important;
	}

	.js .site-header .site-logo,
	.js .site-header .site-nav__list > li {
		animation: none;
	}

	.mobile-menu,
	.mobile-menu.is-open {
		clip-path: none;
	}
}

/* ==========================================================================
   Pied de page
   ========================================================================== */

.site-footer {
	padding: clamp(3.5rem, 6vw, 5rem) var(--ap-gutter) 2.5rem;
	background: var(--ap-night);
	color: #fff;
}

.site-footer__inner {
	max-width: 1280px;
	margin-inline: auto;
}

.site-footer__top {
	display: flex;
	gap: clamp(2.5rem, 6vw, 5rem);
	align-items: flex-start;
}

.site-footer__logo {
	display: block;
	flex: 0 0 auto;
	line-height: 0;
}

.site-footer__logo img {
	display: block;
	width: 71px;
	height: auto;
}

.site-footer__cols {
	display: flex;
	flex-wrap: wrap;
	gap: 2.5rem 4rem;
}

.site-footer__title {
	margin: 0 0 1rem;
	color: var(--ap-green);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.site-footer__list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.site-footer__list a {
	color: rgba(255, 255, 255, 0.75);
	text-decoration: none;
	transition: color 0.25s ease;
}

.site-footer__list a:hover,
.site-footer__list a:focus-visible {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: var(--ap-green);
}

.site-footer__list--muted li {
	color: rgba(255, 255, 255, 0.6);
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 2rem;
	margin-top: clamp(2.5rem, 5vw, 4rem);
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 0.8125rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.55);
}

.site-footer__bottom p {
	margin: 0;
}

.site-footer__credit a {
	color: rgba(255, 255, 255, 0.75);
	text-decoration: none;
}

.site-footer__credit a:hover,
.site-footer__credit a:focus-visible {
	color: var(--ap-green);
}

@media (max-width: 600px) {
	.site-footer__top {
		flex-direction: column;
	}

	.site-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ==========================================================================
   Pages génériques, 404
   ========================================================================== */

.ap-page__container {
	width: min(768px, 100% - 2 * var(--ap-gutter));
	margin-inline: auto;
}

.ap-page__header {
	padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem);
	background: var(--ap-anthracite);
	color: #fff;
	position: relative;
}

.ap-page__header::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: min(485px, 38%);
	height: 10px;
	background: var(--ap-green);
}

.ap-page__title {
	margin: 0;
	font-family: var(--ap-serif);
	font-weight: 400;
	font-size: clamp(2.25rem, 1.8rem + 1.5vw, 3rem);
	line-height: 1.2;
}

.ap-page .entry-content {
	padding-block: clamp(3rem, 6vw, 5rem);
	font-size: 1.0625rem;
	line-height: 1.65;
}

.entry-content > * {
	margin-block: 0 1.25em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 2em;
	margin-bottom: 0.6em;
	font-family: var(--ap-serif);
	font-weight: 400;
	line-height: 1.25;
	color: var(--ap-night);
}

.entry-content h2 { font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); }
.entry-content h3 { font-size: 1.5rem; }
.entry-content h4 { font-size: 1.25rem; }

.entry-content ul,
.entry-content ol {
	padding-left: 1.25em;
}

.entry-content li::marker {
	color: var(--ap-green-dark);
}

.entry-content blockquote {
	margin-inline: 0;
	padding-left: 1.5rem;
	border-left: 3px solid var(--ap-green);
	font-family: var(--ap-serif);
	font-style: italic;
	font-size: 1.25rem;
}

.entry-content .wp-element-button,
.entry-content .wp-block-button__link {
	padding: 0.75rem 1.5rem;
	text-decoration: none;
}

.ap-post-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ap-post-list__item {
	padding-block: 2rem;
	border-bottom: 1px solid rgba(43, 49, 61, 0.12);
}

.ap-post-list__title {
	margin: 0 0 0.25rem;
}

.ap-post-list__title a {
	color: var(--ap-night);
	text-decoration: none;
}

.ap-post-list__title a:hover {
	color: var(--ap-green-dark);
}

.ap-post-list__meta {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	color: rgba(43, 49, 61, 0.75);
}

.ap-404 {
	display: flex;
	align-items: center;
	min-height: 70vh;
	padding-block: 5rem;
	background: var(--ap-anthracite);
	color: #fff;
	text-align: center;
}

.ap-404__code {
	margin: 0;
	font-family: var(--ap-serif);
	font-size: clamp(6rem, 20vw, 12rem);
	line-height: 1;
	color: var(--ap-green);
}

.ap-404__title {
	margin: 1rem 0;
	font-family: var(--ap-serif);
	font-weight: 400;
	font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
}

.ap-404__text {
	margin: 0 0 2rem;
	color: rgba(255, 255, 255, 0.85);
}

.ap-404__button {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border-radius: 4px;
	background: var(--ap-green);
	color: var(--ap-night);
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.3s ease;
}

.ap-404__button:hover {
	background: #fff;
}

/* ==========================================================================
   Impression
   ========================================================================== */

@media print {
	.site-header,
	.mobile-menu,
	.ap-marquee__controls,
	.ap-form {
		display: none !important;
	}

	.js [data-reveal] {
		opacity: 1 !important;
		transform: none !important;
		clip-path: none !important;
	}
}
