/*
 * CH Nanterre – ce que theme.json ne sait pas faire : en-tête, méga-menu, menu mobile,
 * accès rapides, recherche, pied de page. Mesures issues de la maquette Figma (1728 px / 428 px).
 */

:root {
	--chn-dark: var(--wp--preset--color--dark-blue);
	--chn-line: var(--wp--preset--color--light-purple-400);
	--chn-wide: var(--wp--style--global--wide-size);
	--chn-gutter: 20px;
	--chn-header-height: 108px;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	-webkit-font-smoothing: antialiased;
}

.chn-icon {
	display: inline-flex;
	flex: none;
}

.chn-icon svg {
	display: block;
}

:where(.chn-header, .chn-footer) :where(ul) {
	list-style: none;
	margin: 0;
	padding: 0;
}

:where(.chn-header) :where(button) {
	appearance: none;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font: inherit;
	margin: 0;
	padding: 0;
	text-align: inherit;
}

.chn-header a,
.chn-footer a {
	text-decoration: none;
}

.chn-footer__address a {
	font-weight: inherit;
}

:where(.chn-header, .chn-footer) :where(a, button):focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--chn-dark);
	outline-offset: 3px;
}

.chn-footer a:focus-visible {
	outline-color: #fff;
}

/* ---------- Boutons « pilule » (méta menu, menu mobile) ---------- */

.chn-pill {
	align-items: center;
	background: #fff;
	border: 1px solid var(--chn-dark);
	border-radius: 50px;
	box-sizing: border-box;
	color: var(--chn-dark);
	display: inline-flex;
	font-size: 14px;
	font-weight: 700;
	gap: 10px;
	height: 36px;
	justify-content: center;
	line-height: 1.219;
	padding: 6px 20px;
	transition: background-color 0.2s, color 0.2s;
	white-space: nowrap;
}

.chn-pill.is-highlight {
	background: var(--wp--preset--color--yellow);
	border-color: var(--wp--preset--color--yellow);
}

.chn-pill:hover,
.chn-pill:focus-visible {
	background: rgba(43, 40, 104, 0.6);
	border-color: transparent;
	color: #fff;
}

.chn-pill:not(.is-highlight)[aria-expanded="true"],
.chn-pill:not(.is-highlight).is-current {
	background: var(--chn-dark);
	color: #fff;
}

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

.chn-header {
	background: #fff;
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
}

/* Le conteneur de la partie de modèle ne doit pas limiter l'en-tête fixe (sticky). */
.wp-block-template-part:has(> .chn-header) {
	display: contents;
}

.chn-header.is-hidden {
	transform: translateY(-100%);
}

.admin-bar .chn-header.is-hidden {
	transform: translateY(calc(-100% - var(--wp-admin--admin-bar--height, 0px)));
}

.chn-header .skip-link:focus {
	background: #fff;
	clip: auto;
	clip-path: none;
	color: var(--chn-dark);
	height: auto;
	left: 10px;
	padding: 10px 20px;
	top: 10px;
	width: auto;
	z-index: 1000;
}

.chn-header__bar {
	align-items: center;
	box-sizing: content-box;
	display: flex;
	justify-content: space-between;
	margin-inline: auto;
	max-width: var(--chn-wide);
	padding: 10px var(--chn-gutter);
}

.chn-logo {
	align-items: center;
	color: var(--chn-dark);
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 3px;
	height: 83px;
	justify-content: center;
	width: 110px;
}

.chn-logo img {
	display: block;
	height: auto;
	width: 108.43px;
}

.chn-logo__text {
	font-size: 8.586px;
	font-weight: 700;
	line-height: 1.219;
	text-align: center;
	text-transform: uppercase;
	white-space: nowrap;
}

.chn-header__menus {
	align-items: flex-end;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.chn-top ul {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.chn-primary {
	width: min(1150px, 100vw - 110px - 2 * var(--chn-gutter) - 40px);
}

.chn-primary ul {
	align-items: flex-start;
	display: flex;
	justify-content: space-between;
}

.chn-primary__item {
	align-items: center;
	border-bottom: 2px solid transparent;
	color: var(--chn-dark);
	display: flex;
	font-size: 16px;
	font-weight: 700;
	gap: 10px;
	line-height: 1.219;
	padding: 6px 0 4px;
	white-space: nowrap;
}

.chn-primary__item {
	transition: color 0.2s, border-color 0.2s;
}

.chn-primary__item:hover {
	color: rgba(43, 40, 104, 0.6);
}

.chn-primary__item.is-current,
.chn-primary__item[aria-expanded="true"] {
	border-bottom-color: var(--chn-dark);
	color: var(--chn-dark);
}

.chn-primary__item .chn-icon {
	transition: transform 0.2s;
}

.chn-primary__item[aria-expanded="true"] .chn-icon {
	transform: rotate(180deg);
}

/* Méga-menu */

.chn-panel {
	background: #fff;
	border-block: 1px solid var(--chn-line);
	box-shadow: 0 20px 30px -20px rgba(43, 40, 104, 0.15);
	left: 0;
	max-height: calc(100vh - var(--chn-header-height));
	overflow-y: auto;
	position: absolute;
	right: 0;
	top: 100%;
}

.chn-panel__inner {
	box-sizing: content-box;
	display: flex;
	gap: 24px;
	margin-inline: auto;
	max-width: var(--chn-wide);
	padding: 40px var(--chn-gutter);
}

.chn-panel__title {
	align-items: flex-start;
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 20px;
	width: 314px;
}

.chn-panel__title p {
	font-size: 24px;
	font-weight: 600;
	line-height: 1.219;
	margin: 0;
}

.chn-panel__links {
	column-gap: 24px;
	columns: 2;
	flex: 1;
	max-width: 988px;
}

.chn-links {
	border-left: 1px solid var(--chn-line);
	break-inside: avoid;
	margin-bottom: 30px;
	padding-left: 10px;
}

.chn-links ul {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.chn-links__title {
	color: rgba(43, 40, 104, 0.4);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.219;
	margin: 0 0 20px;
}

.chn-links a {
	color: var(--chn-dark);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.219;
}

.chn-links a {
	transition: color 0.2s;
}

.chn-links a:hover {
	color: rgba(43, 40, 104, 0.6);
}

.chn-links a[aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.chn-links a[target="_blank"]::after {
	content: " ↗";
}

/* Bouton menu (mobile) */

.chn-burger {
	align-items: center;
	display: none;
	gap: 20px;
}

.chn-burger__label {
	font-size: 11px;
	font-weight: 700;
	line-height: 1.219;
	text-transform: uppercase;
}

.chn-burger__icon {
	display: grid;
	gap: 7px;
	width: 30px;
}

.chn-burger__icon i {
	background: #fff;
	border: 0.973px solid var(--chn-dark);
	border-radius: 97px;
	box-sizing: border-box;
	height: 2px;
}

.chn-burger > .chn-icon,
.chn-burger[aria-expanded="true"] .chn-burger__icon {
	display: none;
}

.chn-burger[aria-expanded="true"] > .chn-icon {
	display: inline-flex;
}

.chn-drawer {
	display: none;
}

/* ---------- Accès rapides flottants ---------- */

.chn-quick {
	position: fixed;
	right: 20px;
	top: 180px;
	z-index: 90;
}

.chn-quick ul {
	align-items: flex-end;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chn-quick__item {
	align-items: center;
	background: var(--chn-dark);
	border: 1px solid var(--wp--preset--color--light-purple-200);
	border-radius: 25px;
	box-sizing: border-box;
	color: var(--wp--preset--color--light-purple-200);
	display: flex;
	height: 50px;
	justify-content: flex-end;
	min-width: 50px;
	padding: 0 9.5px;
}

.chn-quick__item .chn-icon {
	align-items: center;
	height: 29px;
	justify-content: center;
	width: 29px;
}

.chn-quick__label {
	font-size: 14px;
	font-weight: 700;
	max-width: 0;
	overflow: hidden;
	transition: max-width 0.3s, padding 0.3s;
	white-space: nowrap;
}

.chn-quick__item:hover .chn-quick__label,
.chn-quick__item:focus-visible .chn-quick__label {
	max-width: 220px;
	padding: 0 12px 0 10px;
}

/* ---------- Recherche ---------- */

.chn-search {
	background: var(--wp--preset--color--light-purple-400);
	border: 0;
	border-radius: 30px;
	box-sizing: border-box;
	color: var(--chn-dark);
	max-width: calc(100vw - 40px);
	padding: 20px;
	width: 424px;
}

.chn-search::backdrop {
	background: rgba(43, 60, 130, 0.75);
}

.chn-search form {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.chn-search__head {
	align-items: center;
	align-self: stretch;
	display: flex;
	font-size: 20px;
	font-weight: 500;
	justify-content: space-between;
}

.chn-search__field {
	align-items: center;
	align-self: stretch;
	background: #fff;
	border: 1px solid rgba(43, 40, 104, 0.4);
	border-radius: 8px;
	display: flex;
	gap: 10px;
	padding: 0 16px;
}

.chn-search__field .chn-icon svg {
	height: 28px;
	width: 28px;
}

.chn-search__field input {
	appearance: none;
	background: none;
	border: 0;
	color: inherit;
	flex: 1;
	font: inherit;
	height: 52px;
	min-width: 0;
	outline: 0;
}

.chn-search__field:focus-within {
	border-color: var(--chn-dark);
	box-shadow: 0 0 0 1px var(--chn-dark);
}

.chn-search .wp-element-button {
	cursor: pointer;
	margin-top: 18px;
	padding-inline: 32px;
}

/* ---------- Bandeau de page : fil d'Ariane + titre ---------- */

.chn-breadcrumbs {
	background: var(--chn-dark);
	color: #fff;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.219;
	padding-block: 8px;
}

.chn-breadcrumbs a {
	color: inherit;
	font-weight: inherit;
	text-decoration: none;
}

.chn-breadcrumbs a:hover {
	text-decoration: underline;
}

.chn-page-title {
	background: var(--wp--preset--color--light-purple-300);
	padding-block: 40px;
}

.chn-page-title .wp-block-post-title,
.chn-page-title h1 {
	margin: 0;
}

.chn-main {
	margin-top: 0;
	padding-bottom: 60px;
}

.chn-main > * {
	margin-block: 0;
}

.wp-site-blocks > * {
	margin-block: 0;
}

.chn-main > .wp-block-post-content {
	margin-top: 30px;
}

/* ---------- Pied de page ---------- */

.chn-footer {
	background: var(--chn-dark);
	color: #fff;
	margin-top: 0;
	padding-block: 60px;
}

.chn-footer__inner {
	display: flex;
	justify-content: space-between;
}

.chn-footer__brand {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 462px;
}

.chn-footer__logos {
	display: flex;
	gap: 20px;
	margin: 0;
}

.chn-footer__logos .wp-block-image {
	align-items: center;
	background: #fff;
	border-radius: 30px;
	box-sizing: border-box;
	display: flex;
	height: 122px;
	justify-content: center;
	margin: 0;
}

.chn-footer__logos .wp-block-image img {
	border-radius: 0;
	display: block;
}

.chn-footer__logo-ch {
	color: var(--chn-dark);
	flex-direction: column;
	gap: 3px;
	width: 141px;
}

.chn-footer__logo-ch img {
	width: 107.57px;
}

.chn-footer__logo-ch figcaption {
	font-size: 8.518px;
	font-weight: 700;
	line-height: 1.219;
	margin: 0;
	text-transform: uppercase;
}

.chn-footer__logo-ght {
	width: 244px;
}

.chn-footer__logo-ght img {
	height: 98.37px;
	object-fit: cover;
	width: 166.17px;
}

.chn-footer__address {
	font-size: 16px;
	line-height: 1.219;
	margin: 0;
}

.chn-footer__address a {
	color: inherit;
}

.chn-footer__nav {
	align-items: flex-end;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding-bottom: 28px;
}

.chn-menu--legal ul {
	display: flex;
	flex-wrap: wrap;
	font-size: 16px;
	font-weight: 500;
	justify-content: flex-end;
	line-height: 1.219;
}

.chn-menu--legal li + li::before {
	content: "|";
	margin-inline: 0.55em;
}

.chn-menu--legal a {
	color: #fff;
	font-weight: 500;
}

.chn-menu--legal a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.chn-menu--social ul {
	display: flex;
	gap: 40px;
}

.chn-social {
	background: url(../images/social.svg) no-repeat -94px 0 / 336px 54px;
	border-radius: 50%;
	display: block;
	height: 54px;
	transition: opacity 0.2s;
	width: 54px;
}

.chn-social:hover {
	opacity: 0.8;
}

.chn-social--linkedin {
	background-position-x: -188px;
}

.chn-social--youtube {
	background-position-x: -282px;
}

/* ---------- Mobile / tablette : < 1200 px ---------- */

@media (max-width: 74.99em) {
	:root {
		--chn-header-height: 68px;
	}

	.chn-header {
		background: none;
	}

	/* Flou sur un pseudo-élément : un backdrop-filter sur l'en-tête piégerait le menu en position fixe. */
	.chn-header::before {
		-webkit-backdrop-filter: blur(9.7px);
		backdrop-filter: blur(9.7px);
		background: rgba(255, 255, 255, 0.95);
		content: "";
		inset: 0;
		position: absolute;
		z-index: -1;
	}

	html {
		scroll-padding-top: 88px;
	}

	.chn-header__bar {
		height: 58px;
		padding: 5px 16px;
	}

	.chn-logo {
		gap: 1.8px;
		height: 50px;
		width: 66px;
	}

	.chn-logo img {
		width: 65.06px;
	}

	.chn-logo__text {
		font-size: 5.152px;
	}

	.chn-header__menus,
	.chn-panel,
	.chn-quick {
		display: none;
	}

	.chn-burger {
		display: flex;
	}

	.chn-drawer:not([hidden]) {
		background: #fff;
		bottom: 0;
		display: block;
		left: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		position: fixed;
		right: 0;
		top: calc(var(--chn-header-height) + var(--wp-admin--admin-bar--height, 0px));
	}

	.chn-menu-open {
		overflow: hidden;
	}

	.chn-menu-open .chn-header::before {
		background: #fff;
	}

	.chn-drawer__level {
		padding: 30px 20px 40px;
	}

	.chn-drawer__main {
		display: flex;
		flex-direction: column;
		gap: 30px;
		padding-bottom: 40px;
	}

	.chn-drawer__main a,
	.chn-drawer__main button {
		align-items: center;
		color: var(--chn-dark);
		display: flex;
		font-size: 16px;
		font-weight: 700;
		justify-content: space-between;
		line-height: 1.219;
		padding: 6px 0;
		width: 100%;
	}

	.chn-drawer__pills {
		border-top: 1px solid var(--chn-dark);
		display: grid;
		gap: 20px 8px;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding-block: 40px;
	}

	.chn-drawer__pills .chn-pill {
		font-size: 12px;
		width: 100%;
	}

	.chn-pill--icon {
		justify-content: flex-start;
	}

	.chn-pill--icon .chn-icon {
		height: 16px;
		width: 16px;
	}

	.chn-pill--icon .chn-icon svg {
		height: 16px;
		width: 16px;
	}

	.chn-drawer__level--sub {
		background: #fff;
		inset: 0;
		overflow-y: auto;
		padding-top: 0;
		position: fixed;
		top: var(--wp-admin--admin-bar--height, 0px);
		z-index: 2;
	}

	.chn-drawer__top {
		align-items: center;
		background: #fff;
		display: flex;
		justify-content: space-between;
		margin-inline: -20px;
		padding: 20px;
		position: sticky;
		top: 0;
	}

	.chn-drawer__back {
		align-items: center;
		display: flex;
		font-size: 16px;
		font-weight: 700;
		gap: 10px;
	}

	.chn-drawer__close svg {
		height: 32px;
		width: 32px;
	}

	.chn-drawer__level--sub .chn-drawer__pills {
		border-top: 0;
		padding-block: 0 30px;
	}

	.chn-drawer__links {
		padding-top: 18px;
	}
}

/* Petits téléphones : les boutons du menu tiennent en deux colonnes, texte sur deux lignes si besoin. */

@media (max-width: 26.74em) {
	.chn-drawer__pills .chn-pill {
		height: auto;
		min-height: 36px;
		padding-inline: 12px;
		text-align: start;
		text-wrap: balance;
		white-space: normal;
	}

	.chn-drawer__pills .chn-pill:not(.chn-pill--icon) {
		text-align: center;
	}

	.chn-pill--icon .chn-icon {
		flex: none;
	}
}

/* Pied de page mobile : < 960 px */

@media (max-width: 59.99em) {
	.chn-footer {
		padding-block: 40px;
	}

	.chn-footer__inner {
		align-items: center;
		flex-direction: column;
		gap: 30px;
	}

	.chn-footer__nav {
		display: contents;
	}

	.chn-menu--legal {
		order: -1;
	}

	.chn-menu--legal ul {
		align-items: center;
		flex-direction: column;
		font-size: 14px;
		gap: 20px;
	}

	.chn-menu--legal li + li::before {
		content: none;
	}

	.chn-footer__brand {
		align-items: center;
		max-width: 100%;
		text-align: center;
		width: auto;
	}

	.chn-footer__logos {
		gap: 12px;
		max-width: 100%;
	}

	.chn-footer__address {
		font-size: 14px;
	}

	.chn-menu--social ul {
		gap: 33px;
	}

	.chn-social {
		background-position-x: -78.33px;
		background-size: 280px 45px;
		height: 45px;
		width: 45px;
	}

	.chn-social--linkedin {
		background-position-x: -156.67px;
	}

	.chn-social--youtube {
		background-position-x: -235px;
	}
}

/* ---------- Gabarits ---------- */

.chn-page-title .chn-page-title__h1 {
	font-size: 30px;
	font-weight: 700;
	margin: 0;
}

.chn-main > .wp-block-group:not(.chn-breadcrumbs, .chn-page-title) {
	margin-top: 30px;
}

/* Titres de section dans les fiches (services, offres, articles) : H2 au style « H3 » de la maquette. */
:where(.chn-service, .chn-job, .chn-article) :where(.wp-block-post-content, .wp-block-tab-panel) > h2 {
	font-size: 24px;
	font-weight: 600;
}

:where(.chn-service, .chn-job) :where(.wp-block-post-content, .wp-block-tab-panel) > h2 + * {
	margin-top: 10px;
}

:where(.chn-service, .chn-job, .chn-article) :where(.wp-block-post-content, .wp-block-tab-panel) > * + h2 {
	margin-top: 30px;
}

/* Service à onglets : les onglets passent au-dessus de l'image (chaque onglet porte sa propre image). */
.chn-service:has(.wp-block-post-content > .wp-block-tabs:first-child) > .wp-block-post-featured-image {
	display: none;
}

.chn-service .wp-block-tab-panel > .wp-block-image:first-child img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
}

.chn-service > * + *,
.chn-job > * + *,
.chn-article > * + * {
	margin-top: 30px;
}

.chn-service .wp-block-post-featured-image,
.chn-article .wp-block-post-featured-image {
	border-radius: 30px;
	margin-bottom: 0;
	overflow: hidden;
}

.chn-article .chn-post-meta {
	margin-top: 20px;
}

.chn-article .wp-block-post-content {
	margin-top: 30px;
}

.chn-job .chn-apply {
	margin-top: 40px;
}

.chn-job .wp-block-accordion {
	margin-top: 30px;
}

.chn-main--news {
	background: var(--wp--preset--color--light-purple-400);
	padding-block-end: 90px;
}

.chn-main--news > .wp-block-group:not(.chn-breadcrumbs, .chn-page-title) {
	margin-top: 60px;
}

/* Recherche */
.chn-searchform .wp-block-search__inside-wrapper {
	gap: 10px;
}

.chn-searchform .wp-block-search__input {
	border: 1px solid rgba(43, 40, 104, 0.4);
	border-radius: 8px;
	color: inherit;
	font: inherit;
	min-height: 48px;
	padding: 12px 16px;
}

.chn-searchform .wp-block-search__button {
	background: var(--chn-dark);
	border: 0;
	border-radius: 50px;
	color: #fff;
	font-weight: 700;
	margin-left: 0;
	padding: 12px 24px;
}

.chn-search-results__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	margin: 30px 0 0;
	padding: 0;
}

.chn-result {
	background: var(--wp--preset--color--light-purple-300);
	border-radius: 16px;
	padding: 20px;
	position: relative;
	transition: background-color 0.25s;
}

.chn-result:hover {
	background: var(--wp--preset--color--light-purple-400);
}

.chn-result > * {
	margin: 0;
}

.chn-result .chn-result__title {
	font-size: 18px;
	font-weight: 600;
}

.chn-result .chn-result__title a {
	font-weight: inherit;
	text-decoration: none;
}

.chn-result .chn-result__title a::after {
	content: "";
	inset: 0;
	position: absolute;
}

.chn-result__excerpt {
	font-weight: 500;
	margin-top: 10px;
}

.chn-result__excerpt .wp-block-post-excerpt__more-text {
	display: none;
}

.chn-query-pagination {
	margin-top: 30px;
}

@media (max-width: 59.99em) {
	.chn-page-title {
		padding-block: 24px;
	}

	.chn-page-title .chn-page-title__h1 {
		font-size: 22px;
	}

	.chn-main > .wp-block-group:not(.chn-breadcrumbs, .chn-page-title) {
		margin-top: 20px;
	}

	.chn-breadcrumbs {
		font-size: 10px;
	}
}
