/**
 * Bandeau Promo – bannière publique.
 * Les couleurs viennent de variables CSS propres à chaque bannière ; les polices et tailles
 * des Réglages. Les styles sont préfixés par .rbp pour résister aux styles des thèmes.
 * La mise en page mobile utilise une requête de conteneur : elle fonctionne aussi
 * dans l'aperçu de l'administration.
 */

.rbp {
	container: rbp / inline-size;
	position: relative;
	z-index: var(--rbp-z, 9990);
	display: block;
	width: 100%;
	margin: 0;
	font-family: var(--rbp-font-text, inherit);
	line-height: 1.2;
	text-align: left;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.rbp[hidden] {
	display: none !important;
}

.rbp *,
.rbp *::before,
.rbp *::after {
	box-sizing: border-box;
}

.rbp p {
	margin: 0;
	padding: 0;
	color: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.rbp p[hidden],
.rbp a[hidden] {
	display: none !important;
}

.rbp .rbp__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Bannière ouverte (ordinateur) ---------- */

.rbp .rbp__full {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
}

.rbp .rbp__left {
	display: flex;
	flex: 0 0 31.25%;
	align-items: center;
	padding: 20px 32px 20px 2.75%;
	color: var(--rbp-left-color, #fff);
	background-color: var(--rbp-left-bg, #e93323);
	background-image: var(--rbp-left-img, none);
	background-position: var(--rbp-left-pos, center);
	background-size: cover;
	background-repeat: no-repeat;
}

.rbp .rbp__title {
	font-family: var(--rbp-font-title, inherit);
	font-size: clamp(16px, calc(var(--rbp-title-size-n, 32) * 0.078125cqi), var(--rbp-title-size, 32px));
	font-weight: 400;
	line-height: 1.15;
}

.rbp .rbp__right {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 32px;
	min-width: 0;
	padding: 18px 124px 18px 5.25%;
	color: var(--rbp-right-color, #fff);
	background: var(--rbp-right-bg, #a3b2c6);
}

.rbp .rbp__content {
	min-width: 0;
	margin: 0 auto;
}

.rbp .rbp__text {
	font-size: clamp(14px, calc(var(--rbp-text-size-n, 22) * 0.078125cqi), var(--rbp-text-size, 22px));
	line-height: 1.02;
}

.rbp .rbp__text--m {
	display: none;
}

.rbp .rbp__terms {
	margin-top: 0.4em;
	font-size: max(11px, calc(clamp(14px, calc(var(--rbp-text-size-n, 22) * 0.078125cqi), var(--rbp-text-size, 22px)) * 0.58));
	line-height: 1.25;
}

.rbp .rbp__text + .rbp__terms {
	margin-top: 0.35em;
}

/* Bouton */
.rbp .rbp__cta {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 0;
	padding: 0.6em 2.6em;
	font-family: var(--rbp-font-text, inherit);
	font-size: var(--rbp-button-size, 16px);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.01em;
	white-space: nowrap;
	text-decoration: none;
	color: var(--rbp-btn-color, #fff);
	background: var(--rbp-btn-bg, transparent);
	border: 1px solid var(--rbp-btn-border, #fff);
	border-radius: 999px;
	box-shadow: none;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.rbp .rbp__cta:hover,
.rbp .rbp__cta:focus-visible {
	color: var(--rbp-btn-color-h, var(--rbp-btn-color, #fff));
	background: var(--rbp-btn-bg-h, var(--rbp-btn-bg, transparent));
	border-color: var(--rbp-btn-border-h, var(--rbp-btn-border, #fff));
	text-decoration: none;
}

.rbp .rbp__arrow {
	display: none;
	flex: 0 0 auto;
	width: 32px;
	height: 12px;
}

/* Fermer */
.rbp .rbp__close {
	position: absolute;
	top: 50%;
	right: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: -22px 0 0;
	padding: 0;
	color: var(--rbp-right-color, #fff);
	background: transparent;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	line-height: 1;
}

.rbp .rbp__close svg {
	width: 26px;
	height: 26px;
}

.rbp .rbp__close:hover {
	opacity: 0.75;
	background: transparent;
}

/* ---------- Bandeau réduit ---------- */

.rbp .rbp__bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 10px 2.75%;
	font-family: var(--rbp-font-title, inherit);
	font-size: var(--rbp-bar-size, 20px);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: normal;
	text-align: center;
	text-transform: none;
	color: var(--rbp-bar-color, #fff);
	background-color: var(--rbp-bar-bg, #e93323);
	background-image: var(--rbp-bar-img, none);
	background-position: var(--rbp-bar-pos, center);
	background-size: cover;
	background-repeat: no-repeat;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.rbp .rbp__bar:hover {
	color: var(--rbp-bar-color, #fff);
	background-color: var(--rbp-bar-bg, #e93323);
}

.rbp .rbp__bar-title {
	min-width: 0;
}

.rbp .rbp__plus {
	flex: 0 0 auto;
	width: 0.95em;
	height: 0.95em;
	transition: transform 0.2s ease;
}

.rbp .rbp__bar:hover .rbp__plus {
	transform: rotate(90deg);
}

/* ---------- Ouverture / fermeture animées ---------- */

.rbp .rbp__panel {
	display: grid;
	grid-template-rows: 1fr;
	overflow: hidden;
	opacity: 1;
	transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.rbp .rbp__panel > * {
	min-height: 0;
	overflow: hidden;
}

.rbp .rbp__panel--bar,
.rbp.is-collapsed .rbp__panel--full {
	grid-template-rows: 0fr;
	opacity: 0;
}

.rbp.is-collapsed .rbp__panel--bar {
	grid-template-rows: 1fr;
	opacity: 1;
}

/* Focus visible pour la navigation au clavier. */
.rbp .rbp__cta:focus-visible,
.rbp .rbp__close:focus-visible,
.rbp .rbp__bar:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.rbp .rbp__bar:focus-visible {
	outline-offset: -4px;
}

/* ---------- Tablette ---------- */

@container rbp (max-width: 1100px) {
	.rbp .rbp__right {
		gap: 20px;
		padding-right: 76px;
	}

	.rbp .rbp__cta {
		padding: 0.6em 1.6em;
	}

	.rbp .rbp__close {
		right: 14px;
	}
}

/* ---------- Mobile (largeur de la bannière sous 768 px) ---------- */

@container rbp (max-width: 767px) {
	.rbp .rbp__full {
		flex-direction: column;
	}

	.rbp .rbp__left {
		flex: 0 0 auto;
		min-height: 52px;
		padding: 12px 64px 12px 20px;
	}

	.rbp .rbp__title {
		font-size: var(--rbp-title-size-m, 20px) !important;
	}

	.rbp .rbp__right {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding: 18px 20px 20px;
	}

	.rbp .rbp__content {
		margin: 0;
	}

	.rbp .rbp__text {
		font-size: var(--rbp-text-size-m, 17px) !important;
		line-height: 1.25;
	}

	.rbp .rbp__text--d {
		display: none;
	}

	.rbp .rbp__text--m {
		display: block;
	}

	.rbp .rbp__terms {
		margin-top: 0.75em;
		font-size: max(11px, calc(var(--rbp-text-size-m, 17px) * 0.72)) !important;
	}

	/* Sur mobile, le bouton devient un lien souligné suivi d'une flèche. */
	.rbp .rbp__cta,
	.rbp .rbp__cta:hover,
	.rbp .rbp__cta:focus-visible {
		gap: 14px;
		padding: 0;
		font-size: var(--rbp-button-size-m, 19px) !important;
		white-space: normal;
		text-align: left;
		text-decoration: underline solid;
		text-decoration-line: underline;
		text-decoration-style: solid;
		text-decoration-thickness: 1px;
		text-underline-offset: 0.18em;
		color: var(--rbp-right-color, #fff);
		background: transparent;
		border: 0;
		border-radius: 0;
	}

	.rbp .rbp__arrow {
		display: block;
		transition: transform 0.2s ease;
	}

	.rbp .rbp__cta:hover .rbp__arrow {
		transform: translateX(4px);
	}

	.rbp .rbp__close {
		top: 4px;
		right: 8px;
		margin: 0;
		color: var(--rbp-left-color, #fff);
	}

	.rbp .rbp__bar {
		padding: 12px 20px;
		font-size: var(--rbp-title-size-m, 20px) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rbp *,
	.rbp *::before,
	.rbp *::after {
		transition: none !important;
	}
}

@media print {
	.rbp {
		display: none !important;
	}
}
