/* Webinitium Popup Annonce — styles génériques, à adapter aux couleurs du site
 * client si besoin (variables ci-dessous). Le popup est volontairement grand :
 * au moins la moitié de l'écran, pour un message important. */

:root {
	--wipop-bg: #ffffff;
	--wipop-text: #1a1a1a;
	--wipop-accent: #c0282d;
	--wipop-overlay: rgba(10, 10, 10, 0.72);
}

.wipop-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--wipop-overlay);
	opacity: 0;
	visibility: hidden;
}
@media not all and (prefers-reduced-motion) {
	.wipop-overlay {
		transition: opacity 0.25s, visibility 0.25s;
	}
}
.wipop-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}

.wipop-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(94vw, 1200px);
	min-height: 50vh;
	max-height: 92vh;
	background: var(--wipop-bg);
	color: var(--wipop-text);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
}

/* Zone qui défile seule, sans emporter le bouton fermer avec elle. */
.wipop-dialog-scroll {
	flex: auto;
	min-height: 0;
	overflow-y: auto;
}

.wipop-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.wipop-close:hover,
.wipop-close:focus-visible {
	background: rgba(0, 0, 0, 0.8);
}

/* ---------- Contenu ---------- */

.wipop-content-wrap {
	flex: none;
	padding: clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px) 0;
	text-align: center;
}

.wipop-content {
	font-size: clamp(16px, 1.6vw, 19px);
	line-height: 1.5;
}
.wipop-content > :first-child { margin-top: 0; }
.wipop-content > :last-child { margin-bottom: 0; }
.wipop-content :where(h1, h2, h3, h4) { margin: 0 0 12px; }
.wipop-content p { margin: 0 0 12px; }

.wipop-cta {
	margin-top: 20px;
	margin-bottom: 0;
}
.wipop-cta-btn {
	display: inline-flex;
	align-items: center;
	padding: 12px 28px;
	border-radius: 999px;
	background: var(--wipop-accent);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}
.wipop-cta-btn:hover {
	opacity: 0.88;
}

/* ---------- Galerie masonry ---------- */

.wipop-gallery {
	column-count: 3;
	column-gap: 14px;
	padding: 20px clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px);
}

.wipop-gallery-item {
	display: block;
	width: 100%;
	margin: 0 0 14px;
	break-inside: avoid;
	border: none;
	background: none;
	padding: 0;
	border-radius: 10px;
	overflow: hidden;
	cursor: zoom-in;
}
.wipop-gallery-item img {
	width: 100%;
	display: block;
	transition: transform 0.3s;
}
@media (hover: hover) {
	.wipop-gallery-item:hover img {
		transform: scale(1.04);
	}
}
.wipop-gallery-item:focus-visible {
	outline: 2px solid var(--wipop-accent);
	outline-offset: 2px;
}

/* ---------- Visionneuse (lightbox) ---------- */

.wipop-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100010;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.92);
	opacity: 0;
	visibility: hidden;
}
@media not all and (prefers-reduced-motion) {
	.wipop-lightbox {
		transition: opacity 0.2s, visibility 0.2s;
	}
}
.wipop-lightbox.is-visible {
	opacity: 1;
	visibility: visible;
}

.wipop-lightbox-img {
	max-width: 92vw;
	max-height: 88vh;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

.wipop-lightbox-close,
.wipop-lightbox-prev,
.wipop-lightbox-next {
	position: fixed;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	line-height: 1;
}
.wipop-lightbox-close:hover,
.wipop-lightbox-prev:hover,
.wipop-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.24);
}

.wipop-lightbox-close {
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	font-size: 26px;
}

.wipop-lightbox-prev,
.wipop-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
	font-size: 30px;
}
.wipop-lightbox-prev { left: 20px; }
.wipop-lightbox-next { right: 20px; }

@media (max-width: 640px) {
	.wipop-dialog {
		min-height: 60vh;
	}
	.wipop-gallery {
		column-count: 2;
	}
	.wipop-lightbox-prev,
	.wipop-lightbox-next {
		width: 44px;
		height: 44px;
		font-size: 24px;
	}
}

@media (max-width: 420px) {
	.wipop-gallery {
		column-count: 1;
	}
}
