/* =========================================================
   SCIM Base — styles communs header/footer
   ========================================================= */

:root {
	--scim-primary: #0f172a;
	--scim-accent: #14b8a6;
	--scim-text: #111827;
	--scim-background: #ffffff;
	--scim-header-bg: #ffffff;
	--scim-footer-bg: #08131f;
	--scim-footer-text: #ffffff;
	--scim-container: 1200px;
	--scim-header-height: 78px;
	--scim-border: rgba(15, 23, 42, 0.10);
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--scim-background);
	color: var(--scim-text);
}

.scim-container {
	width: min(calc(100% - 40px), var(--scim-container));
	margin-inline: auto;
}

/* Accessibilité */
.scim-skip-link:focus {
	position: fixed !important;
	top: 10px;
	left: 10px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 10px 14px;
	clip: auto;
	clip-path: none;
	background: #ffffff;
	color: #000000;
	border-radius: 4px;
}

/* ======================== HEADER ======================== */
.scim-site-header {
	position: relative;
	z-index: 999;
	min-height: var(--scim-header-height);
	background: var(--scim-header-bg);
	border-bottom: 1px solid var(--scim-border);
}

.scim-site-header.is-sticky {
	position: sticky;
	top: 0;
}

.admin-bar .scim-site-header.is-sticky {
	top: 32px;
}

.scim-header-inner {
	min-height: var(--scim-header-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
}

.scim-brand {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.scim-brand .custom-logo-link,
.scim-footer-brand .custom-logo-link {
	display: inline-flex;
	align-items: center;
}

.scim-brand .custom-logo {
	display: block;
	width: auto;
	max-width: 220px;
	max-height: calc(var(--scim-header-height) - 22px);
}

.scim-site-title {
	color: var(--scim-primary);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
}

.scim-primary-nav {
	margin-left: auto;
}

.scim-menu,
.scim-menu .sub-menu,
.scim-footer-menu,
.scim-footer-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.scim-menu {
	display: flex;
	align-items: center;
	gap: 28px;
}

.scim-menu > li {
	position: relative;
}

.scim-menu a {
	display: block;
	padding: 10px 0;
	color: var(--scim-primary);
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	transition: color .18s ease;
}

.scim-menu a:hover,
.scim-menu a:focus,
.scim-menu .current-menu-item > a,
.scim-menu .current-menu-ancestor > a {
	color: var(--scim-accent);
}

.scim-menu .sub-menu {
	position: absolute;
	top: calc(100% + 2px);
	left: -18px;
	min-width: 230px;
	padding: 10px 0;
	background: var(--scim-header-bg);
	border: 1px solid var(--scim-border);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.scim-menu .sub-menu a {
	padding: 10px 18px;
	font-weight: 500;
}

.scim-menu li:hover > .sub-menu,
.scim-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.scim-menu .sub-menu .sub-menu {
	top: -10px;
	left: 100%;
}

.scim-menu-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
}

.scim-menu-toggle > span:not(.screen-reader-text) {
	display: block;
	width: 24px;
	height: 2px;
	margin: 5px auto;
	background: var(--scim-primary);
	transition: transform .2s ease, opacity .2s ease;
}

.scim-menu-toggle[aria-expanded="true"] > span:nth-of-type(2) {
	transform: translateY(7px) rotate(45deg);
}

.scim-menu-toggle[aria-expanded="true"] > span:nth-of-type(3) {
	opacity: 0;
}

.scim-menu-toggle[aria-expanded="true"] > span:nth-of-type(4) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ================== RESPONSIVE GLOBAL ================== */
/* Empêche le contenu du thème et d'Elementor de provoquer un débordement horizontal. */
html,
body {
	max-width: 100%;
	overflow-x: clip;
}

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

img,
video {
	height: auto;
}

/* Les longs liens, IBAN et chaînes techniques restent dans l'écran sur mobile. */
p,
li,
a,
button,
input,
textarea,
select,
.elementor-widget-container {
	overflow-wrap: anywhere;
}

/* Compatibilité avec les conteneurs Elementor : aucun enfant flex ne force la largeur. */
.e-con,
.e-con-inner,
.elementor-element,
.elementor-widget,
.elementor-widget-container {
	min-width: 0;
	max-width: 100%;
}

/* Tables éditoriales : défilement horizontal plutôt que débordement de page. */
.elementor-widget-text-editor table,
.entry-content table {
	max-width: 100%;
}

/* ======================== FOOTER ======================== */
.scim-site-footer {
	margin-top: 0;
	padding: 58px 0 0;
	background: var(--scim-footer-bg);
	color: var(--scim-footer-text);
}

.scim-footer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 44px;
	align-items: start;
}

.scim-footer-column {
	min-width: 0;
}

.scim-footer-brand .custom-logo {
	display: block;
	width: auto;
	max-width: 190px;
	max-height: 62px;
	margin-bottom: 18px;
}

.scim-footer-brand .scim-site-title {
	display: inline-block;
	margin-bottom: 18px;
	color: var(--scim-footer-text);
}

.scim-footer-title {
	margin: 0 0 16px;
	color: var(--scim-footer-text);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.scim-footer-intro {
	max-width: 300px;
	margin: 0 0 16px;
	color: var(--scim-footer-text);
	opacity: .78;
	font-size: .94rem;
	line-height: 1.6;
}

.scim-footer-menu {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 9px;
}

.scim-footer-menu li {
	width: 100%;
}

.scim-footer-menu a {
	display: inline-block;
	color: var(--scim-footer-text);
	opacity: .82;
	font-size: .94rem;
	line-height: 1.45;
	text-decoration: none;
	transition: opacity .18s ease, color .18s ease;
}

.scim-footer-menu a:hover,
.scim-footer-menu a:focus,
.scim-footer-menu .current-menu-item > a {
	color: var(--scim-accent);
	opacity: 1;
}

.scim-footer-menu .sub-menu {
	margin-top: 8px;
	padding-left: 14px;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.scim-footer-bottom {
	margin-top: 46px;
	padding: 19px 0 22px;
	border-top: 1px solid rgba(255, 255, 255, .14);
	color: var(--scim-footer-text);
	opacity: .72;
	font-size: .86rem;
	text-align: center;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1100px) {
	.scim-container {
		width: min(calc(100% - 32px), var(--scim-container));
	}

	.scim-menu-toggle {
		display: block;
		margin-left: auto;
	}

	.scim-primary-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		max-height: calc(100vh - var(--scim-header-height));
		overflow-y: auto;
		padding: 10px 20px 20px;
		background: var(--scim-header-bg);
		border-bottom: 1px solid var(--scim-border);
		box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
	}

	.scim-primary-nav.is-open {
		display: block;
	}

	.scim-menu {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.scim-menu > li {
		border-bottom: 1px solid var(--scim-border);
	}

	.scim-menu > li:last-child {
		border-bottom: 0;
	}

	.scim-menu a {
		padding: 13px 4px;
	}

	.scim-menu .sub-menu,
	.scim-menu .sub-menu .sub-menu {
		position: static;
		display: block;
		min-width: 0;
		padding: 0 0 8px 18px;
		background: transparent;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.scim-menu .sub-menu a {
		padding: 8px 4px;
		font-size: .93rem;
		font-weight: 500;
	}

	.admin-bar .scim-site-header.is-sticky {
		top: 46px;
	}
}

@media (max-width: 767px) {
	.scim-container {
		width: calc(100% - 28px);
	}

	.scim-header-inner {
		gap: 14px;
	}

	.scim-brand {
		min-width: 0;
		max-width: calc(100% - 58px);
	}

	.scim-brand .custom-logo {
		max-width: min(190px, 100%);
		max-height: calc(var(--scim-header-height) - 24px);
	}

	.scim-primary-nav {
		padding-inline: 14px;
	}

	/* Les titres Elementor trop grands sont plafonnés sur téléphone. */
	.elementor-widget-heading h1.elementor-heading-title {
		font-size: clamp(2rem, 10vw, 3rem);
		line-height: 1.08;
	}

	.elementor-widget-heading h2.elementor-heading-title {
		font-size: clamp(1.6rem, 7.5vw, 2.25rem);
		line-height: 1.15;
	}

	/* Boutons pleine largeur uniquement quand leur largeur naturelle dépasse l'écran. */
	.elementor-button {
		max-width: 100%;
		white-space: normal;
	}
}

@media (max-width: 600px) {
	.scim-footer-grid {
		grid-template-columns: 1fr;
		gap: 34px;
	}

	.scim-site-footer {
		padding-top: 44px;
	}
}

@media (max-width: 782px) {
	.admin-bar .scim-site-header.is-sticky {
		top: 46px;
	}
}
