/* ==========================================================================
   ESC 2026 : compléments au CSS d'esc2022
   (couleur et polices pilotées par les variables définies dans le Customizer)
   ========================================================================== */

/* --- Header : sous-menus au survol --------------------------------------- */

header .menu.esc-menu > li {
	position: relative;
}

header .menu.esc-menu > li.has-sub > a::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
}

header .menu.esc-menu .esc-submenu {
	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 1000;
	min-width: 230px;
	margin: 0;
	padding: 14px 0;
	list-style: none;
	text-align: left;
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .10);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 10px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

header .menu.esc-menu .esc-submenu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -16px;
	height: 16px;
}

header .menu.esc-menu > li:hover > .esc-submenu,
header .menu.esc-menu > li:focus-within > .esc-submenu {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

header .menu.esc-menu .esc-submenu li {
	display: block;
	margin: 0;
	padding: 0;
	font-family: var(--esc-font-body, 'sofia-pro'), sans-serif;
}

header .menu.esc-menu .esc-submenu a {
	display: block;
	padding: 8px 22px;
	font-family: var(--esc-font-body, 'sofia-pro'), sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	color: #1a1a1a;
	white-space: nowrap;
	text-decoration: none;
}

header .menu.esc-menu .esc-submenu a:hover,
header .menu.esc-menu .esc-submenu a:focus,
header .menu.esc-menu .esc-submenu a.is-active {
	color: var(--esc-primary, #0f73ee);
}

/* --- Burger : mobile uniquement (réglable dans le Customizer) ------------ */

@media (min-width: 992px) {
	body.esc-burger-mobile-only .right-decor .esc-burger-item {
		display: none;
	}
}

.cbp-spmenu .nav-panel li.is-active > a {
	text-decoration: underline;
}

/* --- Accueil : carte "Les Réseaux régionaux" avec image ------------------ */

.single-news.focus {
	background-color: var(--esc-primary, #0f73ee);
}

.single-news.focus.has-image {
	position: relative;
	background-image: var(--esc-focus-img);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.single-news.focus.has-image::after {
	content: "";
	position: absolute;
	right: 34px;
	bottom: 30px;
	z-index: 3;
	width: 50px;
	height: 50px;
	background: var(--esc-focus-arrow) no-repeat center / contain;
	pointer-events: none;
}

.single-news.focus.has-image > h3,
.single-news.focus.has-image > h2 {
	position: relative;
	z-index: 2;
}

/* --- Divers ------------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

.custom-inner .nav-links {
	margin: 30px 0;
}

/* --- Police du menu du header (indépendante des titres) ----------------- */

header .menu.esc-menu > li,
header .menu.esc-menu > li > a {
	font-family: var(--esc-font-menu, var(--esc-font-titles, 'Harbour'));
}

/* --- Sans la colonne du logo « e s c » : mise en page décalée à gauche --- */

@media (min-width: 993px) {
	header {
		left: 40px;
		width: calc(100% - 160px);
	}
	.content-holder {
		padding-left: 40px;
	}
	.full-height-wrap {
		left: 40px;
		width: calc(50% - 40px);
	}
	.fixed-wrap:before {
		width: 40px;
	}
}

/* --- Accueil : grand menu des 4 rubriques (environ 2/3 de la photo) ----- */

@media (min-width: 993px) {
	body.home header .menu.esc-menu > li > a {
		font-size: clamp(22px, 1.45vw, 42px);
		line-height: 1.2;
	}
	body.home header .menu.esc-menu {
		margin-top: 16px;
	}
	body.home header .menu.esc-menu > li {
		padding-left: 0.6em;
		padding-right: 0.6em;
	}
	body.home header .menu.esc-menu > li.has-sub > a::after {
		width: 0.3em;
		height: 0.3em;
		margin-left: 0.35em;
		transform: translateY(-0.18em) rotate(45deg);
	}
}

/* --- Bloc « Cartes » (partenaires, dispositifs) ------------------------- */

.esc-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin: 20px 0 40px;
}
.esc-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.esc-cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1200px) {
	.esc-cards--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.esc-cards,
	.esc-cards--3,
	.esc-cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 480px) {
	.esc-cards,
	.esc-cards--2,
	.esc-cards--3,
	.esc-cards--4 { grid-template-columns: 1fr; }
}

.esc-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e3e3e3;
	background: #fff;
	color: inherit;
	text-decoration: none !important;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
a.esc-card:hover,
a.esc-card:focus {
	border-color: var(--esc-primary, #0f73ee);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
	transform: translateY(-2px);
}

.esc-card__img {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f4f4f4;
}
.esc-card__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.esc-cards--logo .esc-card__img {
	background: #fff;
	padding: 20px;
}
.esc-cards--logo .esc-card__img img {
	object-fit: contain;
}

.esc-card__body {
	display: block;
	padding: 14px 16px 18px;
}
.esc-card__title {
	display: block;
	margin-bottom: 6px;
	font-family: var(--esc-font-titles, 'Harbour'), serif;
	font-size: 18px;
	line-height: 1.25;
	color: #1a1a1a;
}
a.esc-card:hover .esc-card__title {
	color: var(--esc-primary, #0f73ee);
}
.esc-card__text {
	display: block;
	font-family: var(--esc-font-body, 'sofia-pro'), sans-serif;
	font-size: 13px;
	line-height: 1.5;
	color: #555;
}

/* --- Pleine largeur : sans la grande image à gauche --------------------- */

body.esc-full-width .custom-inner {
	float: none;
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
}

/* --- Maison « Accueil » : premier élément du menu du haut ---------------- */

header .baseline .esc-home-link {
	display: inline-flex;
	align-items: center;
	margin-right: 24px;
	color: inherit;
	text-decoration: none;
}
@media (max-width: 992px) {
	header .baseline .esc-home-link {
		display: none;
	}
}
header .menu.esc-menu > li.esc-menu-home > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 1.2em;
	vertical-align: middle;
	color: inherit;
	transition: color .2s, transform .2s;
}
header .menu.esc-menu > li.esc-menu-home .esc-home-icon {
	display: block;
	width: 1.15em;
	height: 1.15em;
	transform: translateY(-0.13em);
}
header .menu.esc-menu > li.esc-menu-home > a:hover,
header .menu.esc-menu > li.esc-menu-home > a:focus-visible {
	color: var(--esc-primary, #0f73ee);
	transform: translateY(-1px);
}

/* --- Burger mobile dans l'en-tête ---------------------------------------- */

.esc-mobile-burger {
	display: none;
}
@media (max-width: 992px) {
	header .inner-flex {
		position: relative;
	}
	.esc-mobile-burger {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		right: 16px;
		top: 50%;
		transform: translateY(-50%);
		width: 46px;
		height: 46px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: var(--esc-primary, #0f73ee);
		box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
		cursor: pointer;
		z-index: 20;
		transition: transform .2s, box-shadow .2s;
	}
	.esc-mobile-burger:active {
		transform: translateY(-50%) scale(.94);
	}
	.esc-burger-lines {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		gap: 5px;
		width: 20px;
	}
	.esc-burger-lines span {
		display: block;
		height: 2px;
		border-radius: 2px;
		background: #fff;
		transition: width .25s, transform .25s, opacity .2s;
	}
	.esc-burger-lines span:nth-child(1) { width: 20px; }
	.esc-burger-lines span:nth-child(2) { width: 13px; }
	.esc-burger-lines span:nth-child(3) { width: 17px; }
	.esc-mobile-burger:hover .esc-burger-lines span { width: 20px; }
	.esc-mobile-burger.is-open .esc-burger-lines span:nth-child(1) { width: 20px; transform: translateY(7px) rotate(45deg); }
	.esc-mobile-burger.is-open .esc-burger-lines span:nth-child(2) { opacity: 0; }
	.esc-mobile-burger.is-open .esc-burger-lines span:nth-child(3) { width: 20px; transform: translateY(-7px) rotate(-45deg); }
}

/* --- Panneau du menu : fond assombri, maison, fermeture ------------------- */

.esc-panel-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, .55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .35s, visibility .35s;
	cursor: pointer;
}
body.esc-panel-open .esc-panel-overlay {
	opacity: 1;
	visibility: visible;
}
body.esc-panel-open {
	overflow: hidden;
}
.cbp-spmenu {
	z-index: 1001;
}
.cbp-spmenu .esc-panel-home {
	position: absolute;
	top: 14px;
	left: 40px;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 44px;
	height: 44px;
	color: #fff;
	text-decoration: none;
	transition: opacity .2s;
	z-index: 2;
}
.cbp-spmenu .esc-panel-home .esc-home-icon {
	display: block;
	width: 26px;
	height: 26px;
}
.cbp-spmenu .esc-panel-home:hover,
.cbp-spmenu .esc-panel-home:focus-visible {
	opacity: .7;
}

/* --- Menu mobile : mêmes polices que le menu de l'ordinateur -------------- */

/* Rubriques = police du menu ; sous-rubriques = police des sous-menus (texte). */
.cbp-spmenu .nav-panel li.title,
.cbp-spmenu .nav-panel li.title a {
	font-family: var(--esc-font-menu, var(--esc-font-titles, 'Harbour'));
}
.cbp-spmenu .nav-panel li:not(.title),
.cbp-spmenu .nav-panel li:not(.title) a,
.cbp-spmenu .nav-footer li,
.cbp-spmenu .nav-footer a {
	font-family: var(--esc-font-body, 'sofia-pro'), sans-serif;
}

.cbp-spmenu .esc-panel-home + #close + .nav-panel {
	margin-top: 48px;
}
