/* Popup de page — mobile first, lisible, fermeture explicite. */

.rp-popup {
	width: calc(100vw - 1.5rem);
	max-width: 46rem;
	max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--radius, 0.75rem);
	background: var(--color-cream-light, #fcf8f1);
	color: var(--color-text, #1d2b2b);
	box-shadow: 0 0.75rem 2rem rgba(0, 47, 51, 0.28);
}

.rp-popup:not([open]) {
	display: none;
}

.rp-popup[open] {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.rp-popup::backdrop {
	background: rgba(0, 31, 34, 0.72);
}

.rp-popup__header {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	flex: none;
	min-height: 0;
	padding: 1rem 1rem 1rem 1.25rem;
	background: var(--color-primary, #004048);
	color: #fff;
}

.rp-popup__title {
	flex: 1;
	margin: 0.35rem 0 0;
	color: #fff;
	font-family: var(--font-heading, Georgia, "Times New Roman", serif);
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.rp-popup__close {
	flex: none;
	min-height: var(--tap, 3rem);
	margin: 0;
	padding: 0.65rem 1.25rem;
	border: 2px solid transparent;
	border-radius: 999px;
	background: var(--color-gold-button, #d4a24c);
	color: var(--color-primary-dark, #002f33);
	font-family: var(--font-body, "Segoe UI", Arial, sans-serif);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.rp-popup__close:hover {
	background: #e2b866;
}

.rp-popup__header :focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
	box-shadow: 0 0 0 6px var(--color-focus, #005fcc);
}

.rp-popup__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 1.25rem 1.25rem 1.5rem;
	-webkit-overflow-scrolling: touch;
}

.rp-popup .alignwide,
.rp-popup .alignfull {
	width: auto;
	max-width: 100%;
	margin-inline: 0;
	transform: none;
}

.rp-popup .entry-content img,
.rp-popup .entry-content video,
.rp-popup .entry-content iframe {
	max-width: 100%;
	height: auto;
}

@media (min-width: 48em) {
	.rp-popup {
		width: calc(100vw - 3rem);
	}

	.rp-popup__header {
		padding: 1.25rem 1.25rem 1.25rem 1.75rem;
	}

	.rp-popup__title {
		font-size: 1.75rem;
	}

	.rp-popup__body {
		padding: 1.5rem 1.75rem 2rem;
	}
}

@media (max-height: 30rem) {
	.rp-popup {
		max-height: calc(100dvh - 0.75rem);
	}
}

@media print {
	.rp-popup {
		display: none !important;
	}
}
