/* =======================================
 *  Pages en blocs : conteneur, blocs core et corrections du thème
 *  (front + éditeur ; les blocs sud/* ont leur propre style.css)
 *
 *  Conteneurs :
 *   - front   : .sa-blocks (page-templates/blocks.php), layout « constrained »
 *     (largeur : theme.json, contentSize 1200 px)
 *   - éditeur : .is-root-container
 *
 *  Surcharges du thème rttheme19 neutralisées ici :
 *   - CSS inline : p { text-align: justify }, h3 { border-left… }
 *   - app.min.css : marges et « #container img { height: auto } » sur les images
 * ======================================= */

/* ---------------------------------------
 *  En-tête de page du thème (template « Page en blocs ») : titre masqué
 *  (H1 dans le contenu), il ne reste que le fil d'Ariane → pas de marge.
 *  WordPress génère la classe sans le slash : page-templatesblocks-php.
 * --------------------------------------- */
body.page-template-page-templatesblocks-php .sub_page_header .content_row_wrapper {
	padding-top: 0;
	padding-bottom: 0;
}

html body.page-template-page-templatesblocks-php .sub_page_header .col.col-sm-12 {
	min-height: 0;
	padding: 14px 20px;
}

html body.page-template-page-templatesblocks-php .sub_page_header .col.col-sm-12 .breadcrumb {
	margin-bottom: 0;
}

/* ---------------------------------------
 *  Police : Inter (theme.json, fichiers dans fonts/Inter/) sur tout le
 *  contenu, titres compris : le thème leur impose sa police avec
 *  « h1:not(.clean_heading) »… d'où « html body ». En-tête, bandeau et
 *  pied de page gardent celle du site.
 * --------------------------------------- */
html body .sa-blocks,
html body .sa-blocks * {
	font-family: var(--wp--preset--font-family--inter, Inter, Arial, sans-serif);
}

/* ---------------------------------------
 *  Conteneur
 * --------------------------------------- */
.sa-blocks {
	--sa-gouttiere: 24px;

	padding: 0 var(--sa-gouttiere) 72px;
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--anthracite);
	box-sizing: border-box;
}

/* Pleine largeur malgré la gouttière du conteneur */
.sa-blocks > .alignfull {
	margin-left: calc(-1 * var(--sa-gouttiere));
	margin-right: calc(-1 * var(--sa-gouttiere));
}

/* Section pleine largeur en fin de page : collée au pied de page */
.sa-blocks > .alignfull:last-child {
	margin-bottom: -72px;
}

/* Espacement entre les sections */
.sa-blocks > * + *,
.is-root-container > * + * {
	margin-block-start: 64px;
}

.sa-blocks > .alignfull + *,
.is-root-container > .alignfull + * {
	margin-block-start: 56px;
}

/* Titre suivi de son contenu : rapprochés */
.sa-blocks > .is-style-sa-titre-barre + *,
.is-root-container > .is-style-sa-titre-barre + * {
	margin-block-start: 24px;
}

/* Image qui suit un bloc : rapprochée */
.sa-blocks > * + .wp-block-image,
.is-root-container > * + .wp-block-image {
	margin-block-start: 24px;
}

/* ---------------------------------------
 *  Textes (le thème justifie les paragraphes)
 * --------------------------------------- */
.sa-blocks p,
.is-root-container p {
	font-size: 17px;
	line-height: 1.6;
	text-align: inherit;
}

/* Titre avec barre jaune (style de core/heading) */
.sa-blocks .is-style-sa-titre-barre,
.is-root-container .is-style-sa-titre-barre {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 0;
	padding-left: 0;
	border-left: 0;
	color: var(--wp--preset--color--anthracite);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.2;
}

.sa-blocks h1.is-style-sa-titre-barre,
.is-root-container h1.is-style-sa-titre-barre {
	font-size: 44px;
	font-weight: 900;
	letter-spacing: -0.02em;
}

.sa-blocks .is-style-sa-titre-barre::before,
.is-root-container .is-style-sa-titre-barre::before {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 1em;
	background: var(--wp--preset--color--jaune);
}

/* Surtitre (style de core/heading) : petit, capitales espacées */
.sa-blocks .is-style-sa-surtitre,
.is-root-container .is-style-sa-surtitre {
	padding-left: 0;
	border-left: 0;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.4;
	letter-spacing: .22em;
	text-transform: uppercase;
}

/* Accroche (style de core/paragraph) : grande ligne en gras */
.sa-blocks .is-style-sa-accroche,
.is-root-container .is-style-sa-accroche {
	font-size: 30px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

@media (max-width: 781px) {
	.sa-blocks .is-style-sa-accroche,
	.is-root-container .is-style-sa-accroche {
		font-size: 22px;
	}
}

/* Mentions légales (style de core/paragraph) */
.sa-blocks .is-style-sa-mentions,
.is-root-container .is-style-sa-mentions {
	color: var(--wp--preset--color--gris);
	font-size: 13px;
	line-height: 1.5;
}

.sa-blocks * + .is-style-sa-mentions,
.is-root-container * + .is-style-sa-mentions {
	margin-block-start: 16px;
}

/* ---------------------------------------
 *  Images
 * --------------------------------------- */
.sa-blocks .wp-block-image,
.is-root-container .wp-block-image {
	margin-bottom: 0;
}

.sa-blocks .wp-block-image img {
	margin: 0;            /* le thème ajoute 20 px de marge verticale */
	border-radius: 6px;
}

/* Ratio choisi dans l'éditeur (« Recadrer ») : pleine largeur */
.sa-blocks .wp-block-image img[style*="aspect-ratio"] {
	width: 100%;
}

/* ---------------------------------------
 *  Boutons
 * --------------------------------------- */
.sa-blocks .wp-block-buttons,
.is-root-container .wp-block-buttons {
	gap: 14px;
}

.sa-blocks .wp-block-button__link,
.is-root-container .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 28px;
	border: 2px solid transparent;
	border-radius: 4px;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	transition: opacity .15s ease;
}

.sa-blocks .wp-block-button__link:hover,
.sa-blocks .wp-block-button__link:focus-visible {
	opacity: .88;
	text-decoration: none;
}

.sa-blocks .wp-block-button__link.has-jaune-background-color { border-color: var(--wp--preset--color--jaune); }
.sa-blocks .wp-block-button__link.has-anthracite-background-color { border-color: var(--wp--preset--color--anthracite); }

.sa-blocks .is-style-outline > .wp-block-button__link,
.is-root-container .is-style-outline > .wp-block-button__link {
	background: transparent;
	border-color: currentColor;
}

/* ---------------------------------------
 *  Encart gris (style de core/media-text) : image à gauche, contenu à droite
 *  Largeur de l'image : 200 px par défaut (le réglage « largeur du média »
 *  de l'éditeur, écrit en style inline, reste prioritaire).
 * --------------------------------------- */
.sa-blocks .wp-block-media-text.is-style-sa-encart-gris,
.is-root-container .wp-block-media-text.is-style-sa-encart-gris {
	grid-template-columns: 200px auto;
	padding: 28px;
	border-radius: 6px;
	background: var(--wp--preset--color--gris-clair);
}

.is-style-sa-encart-gris .wp-block-media-text__content {
	padding: 0 0 0 32px;
}

.is-style-sa-encart-gris .wp-block-media-text__content > * + * {
	margin-block-start: 14px;
}

.sa-blocks .is-style-sa-encart-gris .wp-block-media-text__media img,
.is-root-container .is-style-sa-encart-gris .wp-block-media-text__media img {
	height: 140px !important;   /* « #container img { height: auto } » du thème */
	object-fit: cover;
	border-radius: 4px;
}

/* ---------------------------------------
 *  Aucune offre (style de core/group) : bandes jaunes en haut, fond gris
 * --------------------------------------- */
.is-style-sa-aucune-offre {
	padding: calc(16px + 72px) 32px 72px;
	background:
		repeating-linear-gradient(-45deg, var(--wp--preset--color--jaune) 0 16px, var(--wp--preset--color--anthracite) 16px 32px) top left / 100% 16px no-repeat,
		var(--wp--preset--color--gris-clair);
	text-align: center;
}

.sa-blocks .is-style-sa-aucune-offre p,
.is-root-container .is-style-sa-aucune-offre p {
	max-width: 620px;
	margin: 0 auto 24px;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.45;
}

.is-style-sa-aucune-offre .wp-block-buttons {
	justify-content: center;
}

/* ---------------------------------------
 *  Mobile
 * --------------------------------------- */
@media (max-width: 781px) {
	.sa-blocks {
		--sa-gouttiere: 16px;
	}

	.sa-blocks > * + *,
	.is-root-container > * + * {
		margin-block-start: 48px;
	}

	.sa-blocks .is-style-sa-titre-barre,
	.is-root-container .is-style-sa-titre-barre {
		font-size: 24px;
	}

	.sa-blocks h1.is-style-sa-titre-barre,
	.is-root-container h1.is-style-sa-titre-barre {
		font-size: 32px;
	}

	.sa-blocks .wp-block-media-text.is-style-sa-encart-gris,
	.is-root-container .wp-block-media-text.is-style-sa-encart-gris {
		padding: 20px;
	}

	.is-style-sa-aucune-offre {
		padding: calc(16px + 48px) 20px 48px;
	}

	.sa-blocks .is-style-sa-aucune-offre p,
	.is-root-container .is-style-sa-aucune-offre p {
		font-size: 19px;
	}
}

/* media-text s'empile sous 600 px : plus de retrait à gauche du contenu */
@media (max-width: 599px) {
	.is-style-sa-encart-gris.is-stacked-on-mobile .wp-block-media-text__content {
		padding: 20px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sa-blocks .wp-block-button__link {
		transition: none;
	}
}
