/*
 * Sylvain Pagnier — compléments à theme.json.
 * Ne contient que ce que theme.json ne sait pas exprimer : cadre « boxed »,
 * en-tête collant, filet double, chronologie du blog, icônes, formulaire CF7.
 */

:root {
	--sp-base: var(--wp--preset--color--base);
	--sp-contrast: var(--wp--preset--color--contrast);
	--sp-primary: var(--wp--preset--color--primary);
	--sp-border: var(--wp--preset--color--border);
	--sp-heading: var(--wp--preset--font-family--heading);
	--sp-accent: var(--wp--preset--font-family--accent);
}

/* ---------- Cadre « boxed » sur motif ---------- */
body:not(.editor-styles-wrapper) {
	background: var(--wp--preset--color--canvas) url(../images/motif.svg);
}
.wp-site-blocks {
	background: var(--sp-base);
}
.wp-site-blocks > *,
.sp-principal > *,
.sp-contenu--sections > * {
	margin-block-start: 0;
	margin-block-end: 0;
}
@media (min-width: 768px) {
	body:not(.editor-styles-wrapper) {
		padding: 20px;
	}
	.wp-site-blocks {
		max-width: 1400px;
		margin-inline: auto;
	}
}

/* ---------- Accessibilité ---------- */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid var(--sp-primary);
	outline-offset: 2px;
}
.sp-contenu a:not(.wp-block-button__link),
.sp-article a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* ---------- En-tête ---------- */
.wp-site-blocks > header {
	background: var(--sp-base);
	z-index: 50;
}
.sp-entete__barre {
	min-height: 90px;
}
.sp-logo {
	line-height: 0;
}
.sp-menu .wp-block-navigation-item__content {
	color: var(--sp-contrast);
	padding-block: 8px;
}
.sp-menu .current-menu-item > .wp-block-navigation-item__content,
.sp-menu .wp-block-navigation-item__content:hover {
	color: var(--sp-primary);
}
.sp-menu.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	background: #383838;
	color: var(--sp-base);
	padding: 60px 30px;
}
.sp-menu .is-menu-open .wp-block-navigation-item__content {
	color: var(--sp-base);
	font-size: 14px;
}

@media (min-width: 992px) {
	.wp-site-blocks > header {
		position: sticky;
		top: var(--wp-admin--admin-bar--height, 0px);
	}
	/* Passage en brun au défilement, en CSS seul (animations liées au défilement). */
	@supports (animation-timeline: scroll()) {
		@media (prefers-reduced-motion: no-preference) {
			.wp-site-blocks > header,
			.sp-entete__barre,
			.sp-logo img,
			.sp-menu .wp-block-navigation-item__content {
				animation: linear both;
				animation-timeline: scroll(root);
				animation-range: 0 160px;
			}
			.wp-site-blocks > header { animation-name: sp-collant-fond; }
			.sp-entete__barre { animation-name: sp-collant-hauteur; }
			.sp-logo img { animation-name: sp-collant-logo; }
			.sp-menu .wp-block-navigation-item__content { animation-name: sp-collant-lien; }
		}
	}
}
@keyframes sp-collant-fond { to { background-color: var(--sp-primary); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); } }
@keyframes sp-collant-hauteur { to { min-height: 66px; } }
@keyframes sp-collant-logo { to { filter: brightness(0) invert(1); width: 230px; } }
@keyframes sp-collant-lien { to { color: var(--sp-base); } }

/* Menu burger jusqu'à 991 px, logo centré (comme l'existant). */
@media (max-width: 991px) {
	.sp-entete__barre {
		justify-content: center !important;
		position: relative;
		min-height: 92px;
	}
	/* Pas de transform ici : il piégerait l'overlay (position: fixed) du menu. */
	.sp-menu {
		position: absolute;
		left: 0;
		top: 0;
		bottom: 0;
		display: flex;
		align-items: center;
	}
	.sp-menu .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.sp-menu .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
	.sp-menu .wp-block-navigation__responsive-container-open svg {
		width: 30px;
		height: 30px;
	}
}
@media (max-width: 599px) {
	.sp-logo img {
		width: 235px !important;
		height: auto;
	}
}

/* ---------- Titres et sous-titres ---------- */
.is-style-sous-titre {
	font-family: var(--sp-accent);
	font-size: var(--wp--preset--font-size--subtitle);
	font-style: italic;
	letter-spacing: .035em;
	line-height: 1.2;
}
.is-style-filet-double {
	position: relative;
	padding-bottom: 40px;
}
.is-style-filet-double > * {
	margin: 0;
}
.is-style-filet-double > :is(h1, h2, h3) {
	margin-bottom: 15px;
}
.is-style-filet-double::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 5px;
	width: 86px;
	height: 2px;
	background: linear-gradient(to right, var(--sp-contrast) 50%, var(--sp-primary) 50%);
}
.is-style-filet-double.sp-centre::after {
	left: 50%;
	transform: translateX(-50%);
}
.sp-titre-section > * {
	margin: 0;
}
.sp-description {
	margin-top: 30px !important;
}
.sp-description > * {
	margin-block: 0;
}

/* ---------- Bandeaux (couvertures) ---------- */
.sp-bandeau .wp-block-cover__inner-container > * {
	margin-block: 0;
}
.sp-bandeau__titre {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1.3;
}
.sp-bandeau__sous-titre,
.sp-bandeau__sous-titre p,
.sp-bandeau__date {
	font-family: var(--sp-accent);
	font-size: var(--wp--preset--font-size--subtitle);
	font-style: italic;
	letter-spacing: .1em;
	line-height: 1.2;
	margin-top: 10px !important;
}
.sp-bandeau__sous-titre p {
	margin: 0;
}

/* Services (remplace le diaporama) */
.sp-services__colonnes {
	margin: 0;
}
.sp-service {
	min-height: 220px !important;
	height: 100%;
}
.sp-service__titre {
	font-family: var(--sp-heading);
	font-size: clamp(28px, 2.6vw, 42px);
	font-weight: 700;
	letter-spacing: .03em;
	line-height: 1.2;
	margin: 0;
}
@media (min-width: 782px) {
	.sp-service {
		min-height: clamp(420px, 48.7vw, 700px) !important;
	}
}

/* ---------- Appel à l'action ---------- */
.sp-appel-action__titre {
	letter-spacing: 1px;
	margin: 0;
}
.wp-block-button.is-style-contour .wp-block-button__link {
	background: transparent;
	border: 1px solid currentColor;
	color: var(--sp-base);
	padding: 16.5px 30px;
}
.wp-block-button.is-style-contour .wp-block-button__link:is(:hover, :focus-visible) {
	background: var(--sp-base);
	color: var(--wp--preset--color--secondary);
}
@media (max-width: 781px) {
	.sp-appel-action .is-layout-flex {
		justify-content: center !important;
		text-align: center;
	}
}

/* ---------- Rangées et séparateurs ---------- */
.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--sp-border);
	background: none !important;
	height: 0;
	opacity: 1;
}
.sp-intitule-texte .wp-block-column > * {
	margin-block-start: 0;
}
.sp-contenu--sections .wp-block-columns {
	margin-block: 0;
}

/* ---------- Pied de page ---------- */
.sp-pied p {
	letter-spacing: 0;
	line-height: 1.8;
	margin: 0 0 30px;
}
.sp-pied p:has(em) {
	line-height: 2.2;
	letter-spacing: .05em;
}
.sp-pied__logo {
	margin: 0 0 25px;
}
.sp-pied__titre {
	font-size: var(--wp--preset--font-size--medium);
	letter-spacing: .05em;
	margin: 0 0 30px;
	padding-top: 15px;
}
.sp-pied ul {
	list-style: none;
	margin: 0;
	padding: 0;
	font-family: var(--sp-heading);
	letter-spacing: .05em;
}
.sp-plan {
	display: grid;
	grid-template-columns: 1fr 1fr;
	text-transform: uppercase;
	font-size: 12px;
	line-height: 33px;
}
.sp-plan li::before {
	content: "›";
	color: var(--sp-primary);
	margin-right: 8px;
}
.sp-pied a:hover {
	color: var(--sp-base) !important;
}
.is-style-coordonnees li {
	font-size: 12px;
	line-height: 36px;
	letter-spacing: 0;
	padding-left: 23px;
	position: relative;
}
.is-style-coordonnees li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 9px;
	width: 16px;
	height: 16px;
	background: var(--sp-primary);
	-webkit-mask: var(--sp-ico) center / contain no-repeat;
	mask: var(--sp-ico) center / contain no-repeat;
}
.sp-ico-adresse { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E"); }
.sp-ico-email { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 11 22 2l-9 20-2.5-8.5z'/%3E%3C/svg%3E"); }
.sp-ico-tel { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M7 1h10a1 1 0 0 1 1 1v20a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm1 3v14h8V4zm4 15.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E"); }
.sp-ico-horaires { --sp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm-1 3v6.6l5 3 1-1.7-4-2.4V7z'/%3E%3C/svg%3E"); }
.sp-copyright p {
	line-height: 36px;
	margin: 0;
}
.sp-copyright a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Blog : chronologie et barre latérale ---------- */
.sp-chronologie .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sp-chrono {
	position: relative;
	padding: 0 0 60px 200px;
}
.sp-chrono > * {
	margin-block: 0 !important;
}
.sp-chrono::before {
	content: "";
	position: absolute;
	left: 128px;
	top: 0;
	bottom: 0;
	width: 4px;
	background: #eee;
}
.sp-chrono__badge {
	position: absolute;
	left: 0;
	top: 30px;
	width: 112px;
	text-align: center;
	background: var(--wp--preset--color--dark);
	color: var(--sp-base);
	font-family: var(--sp-heading);
	font-size: 11px;
	font-style: normal;
	line-height: 28px;
	border-radius: 3px;
}
.sp-chrono__badge::after {
	content: "";
	position: absolute;
	left: 126px;
	top: 10px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sp-contrast);
}
.sp-chrono__titre {
	font-size: 24px !important;
	font-weight: 400;
	letter-spacing: .05em;
	padding-top: 20px;
}
.sp-chrono__titre a,
.sp-resultat a {
	color: var(--sp-contrast);
}
.sp-meta {
	margin: 15px 0 25px !important;
}
.sp-meta > * {
	font-family: var(--sp-accent);
	font-style: italic;
	font-size: 13px;
}
.wp-block-post-excerpt__excerpt {
	line-height: 2.2;
	letter-spacing: .05em;
	margin: 0;
}
.wp-block-post-excerpt__more-text {
	margin-top: 30px;
}
.wp-block-post-excerpt__more-link {
	display: inline-block;
	background: var(--sp-primary);
	border-bottom: 2px solid rgba(0, 0, 0, .2);
	color: var(--sp-base);
	font-family: var(--sp-heading);
	font-size: 13px;
	letter-spacing: .1em;
	line-height: 1.2;
	padding: 16px 24px;
	text-transform: uppercase;
}
.wp-block-post-excerpt__more-link:hover {
	background: var(--sp-contrast);
	color: var(--sp-base);
}
@media (max-width: 781px) {
	.sp-chrono {
		padding-left: 0;
	}
	.sp-chrono::before,
	.sp-chrono__badge::after {
		display: none;
	}
	.sp-chrono__badge {
		position: static;
		display: inline-block;
		padding: 0 12px;
		width: auto;
	}
}
.sp-barre-laterale > * {
	margin-block: 0 0 40px !important;
}
.sp-barre-laterale__titre {
	font-size: 13px;
	letter-spacing: .05em;
	margin-top: 40px !important;
}
.sp-barre-laterale__titre::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--sp-primary);
	margin-right: 10px;
	vertical-align: middle;
}
.wp-block-categories {
	list-style: none;
	padding: 0;
	margin: 0;
	font-family: var(--sp-heading);
	font-size: 11px;
	text-transform: uppercase;
	border-bottom: 1px solid var(--sp-border);
}
.wp-block-categories li {
	padding: 12px 10px;
}
.wp-block-search__inside-wrapper {
	border: 1px solid #ddd;
	padding: 0;
}
.wp-block-search__input {
	border: 0;
	padding: 10px 18px;
	font-family: var(--sp-heading);
	font-size: 13px;
	letter-spacing: .1em;
}
.wp-block-search__button {
	background: transparent;
	color: var(--sp-contrast);
	border: 0;
	margin: 0;
}
.sp-recherche {
	margin-bottom: 50px !important;
}
.sp-recherche .wp-block-search__inside-wrapper {
	border: 0;
	gap: 18px;
}
.sp-recherche .wp-block-search__input {
	border: 1px solid #ddd;
}
.sp-recherche .wp-block-search__button {
	background: var(--sp-primary);
	color: var(--sp-base);
	font-family: var(--sp-heading);
	font-size: 13px;
	letter-spacing: .1em;
	padding: 12px 24px;
	text-transform: uppercase;
}
.sp-resultat {
	border-bottom: 1px solid var(--sp-border);
	padding: 30px 0;
}
.sp-resultat > * {
	margin-block: 0 10px !important;
}

/* Article */
.sp-article p {
	margin: 0 0 25px;
}
.sp-article ul,
.sp-article ol {
	line-height: 2.2;
	margin: 0 0 25px;
}
.sp-navigation-articles {
	margin-top: 30px !important;
	font-family: var(--sp-heading);
	font-size: 13px;
}

/* 404 */
.sp-404__texte {
	font-family: var(--sp-accent);
	font-size: clamp(20px, 2vw, 26px);
	letter-spacing: .04em;
	line-height: 1.4;
	margin-bottom: 40px !important;
}

/* ---------- Formulaire Contact Form 7 ---------- */
.wpcf7 .contact-us {
	display: grid;
	gap: 30px;
}
.wpcf7 .contact-us p {
	margin: 0;
}
.wpcf7 .contact-us br {
	display: none;
}
.wpcf7 :is(input[type="text"], input[type="email"], input[type="tel"], textarea) {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ddd;
	background: var(--sp-base);
	color: #555;
	font-family: var(--sp-heading);
	font-size: 13px;
	letter-spacing: .1em;
	padding: 13px 20px;
}
.wpcf7 textarea {
	height: 147px;
	margin-bottom: 50px;
}
.wpcf7 input[type="submit"] {
	background: var(--sp-primary);
	border: 0;
	border-bottom: 2px solid rgba(0, 0, 0, .2);
	color: var(--sp-base);
	cursor: pointer;
	font-family: var(--sp-heading);
	font-size: 13px;
	letter-spacing: .1em;
	padding: 16px 48px;
	text-transform: uppercase;
}
.wpcf7 input[type="submit"]:hover {
	background: var(--sp-contrast);
}
.wpcf7 .wpcf7-spinner {
	display: block;
}
@media (min-width: 782px) {
	.wpcf7 .contact-us {
		grid-template-columns: 1fr 1fr;
	}
	.wpcf7 .contact-us > .col-md-12 {
		grid-column: 1 / -1;
	}
}
.wpcf7 .contact-us label {
	display: block;
}
.wpcf7 ::placeholder {
	color: #767676;
	opacity: 1;
}
.sp-bandeau.wp-block-cover {
	padding-top: 44px;
	padding-bottom: 14px;
}
.sp-intitule-texte :is(ul, ol) {
	line-height: 1.6;
	margin-top: 0;
}
.sp-colonnes-texte .wp-block-column > * {
	margin-block-start: 0;
}
.sp-lignes {
	line-height: 1.8;
}
.sp-menu .is-menu-open :is(.wp-block-navigation__responsive-container-content, .wp-block-navigation__container) {
	align-items: flex-start !important;
	gap: 18px;
}
.sp-resultat .wp-block-post-title {
	font-weight: 400;
	letter-spacing: .05em;
}
.sp-texte > * {
	margin-block-start: 0;
}
.sp-texte :is(h2, h3) {
	line-height: 1.1;
}
