/* ==========================================================================
   RDL Carousel — styles
   ========================================================================== */

/* Wrapper principal
   ========================================================================== */
.rdl-carousel {
	position: relative;
	width: 100%;
	user-select: none;
}

/* Viewport — clip les débordements gauche/droite
   ========================================================================== */
.rdl-carousel__track-wrapper {
	overflow: hidden;
	width: 100%;
}

/* Track — ligne flex de slides
   ========================================================================== */
.rdl-carousel__track {
	display: flex;
	align-items: flex-end; /* aligne les images sur la même ligne de base basse */
	column-gap: var(--rdl-carousel-gap, 0px);
	transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
}

.rdl-carousel__track.rdl-no-transition {
	transition: none;
}

/* Slide individuel
   ========================================================================== */
.rdl-carousel__slide {
	flex: 0 0 auto;
	/*
	 * Mode proportionnel (défaut) : ni hauteur ni largeur explicites.
	 * Le slide se redimensionne sur son contenu (l'image).
	 * Mode fixe (data-visible) : hauteur + largeur posées ci-dessous.
	 */
}

/* Image — mode proportionnel (défaut)
   ========================================================================== */
.rdl-carousel__img {
	display: block;
	/*
	 * La hauteur est appliquée DIRECTEMENT sur l'image en px (pas en %)
	 * pour que le navigateur calcule correctement width:auto.
	 * Si height était 100% d'un parent sans hauteur explicite,
	 * le navigateur ne pourrait pas résoudre la largeur proportionnelle.
	 */
	height: var(--rdl-carousel-height, 400px);
	width: auto; /* largeur proportionnelle au format d'origine */
	cursor: pointer;
	vertical-align: top; /* supprime le gap inline sous l'image */
}

/* Mode visible (data-visible > 0) : même comportement que le mode proportionnel
   — hauteur fixe, largeur auto, image entière non recadrée
   ========================================================================== */
.rdl-carousel[data-visible] .rdl-carousel__slide {
	height: var(--rdl-carousel-height, 400px);
	/* pas de largeur explicite : le slide épouse la largeur naturelle de l'image */
	overflow: hidden;
}

.rdl-carousel[data-visible] .rdl-carousel__img {
	height: 100%;
	width: auto; /* largeur proportionnelle au format d'origine */
	object-fit: contain; /* image entière, non recadrée */
}

.rdl-carousel__img:focus-visible {
	outline: 3px solid #86192D;
	outline-offset: 2px;
}

/* Message éditeur (galerie vide)
   ========================================================================== */
.rdl-carousel__empty {
	padding: 24px;
	text-align: center;
	color: #888;
	background: #f5f5f5;
	border: 2px dashed #ccc;
	border-radius: 8px;
	margin: 0;
}

/* Flèches de navigation
   ========================================================================== */
.rdl-carousel__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;

	/* Dimensions par défaut (Elementor les override via selectors si modifiées) */
	width: 44px;
	height: 44px;
	border-radius: 50%;

	display: flex;
	align-items: center;
	justify-content: center;

	background: #86192D;
	color: #ffffff;
	border: none;
	cursor: pointer;
	transition: background 0.2s;

	/* Pas de font-size : on utilise des SVG, taille via le contrôle Elementor */
	padding: 0;
	line-height: 0;
}

.rdl-carousel__btn svg {
	display: block;
	flex-shrink: 0;
	pointer-events: none;
	/* Taille par défaut (overridée par Elementor via selectors si modifiée) */
	width: 10px;
	height: auto;
}

.rdl-carousel__btn:hover {
	background: #21401D;
}

.rdl-carousel__btn:focus-visible {
	outline: 3px solid #86192D;
	outline-offset: 3px;
}

.rdl-carousel__btn--prev { left: 12px; }
.rdl-carousel__btn--next { right: 12px; }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.rdl-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
}

.rdl-lightbox[hidden] {
	display: none;
}

/* Figure centrale
   ========================================================================== */
.rdl-lightbox__figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 90vw;
	max-height: 90vh;
}

.rdl-lightbox__img {
	display: block;
	max-width: 90vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
}

.rdl-lightbox__caption {
	color: #ffffff;
	font-size: 0.875rem;
	margin-top: 10px;
	text-align: center;
	min-height: 1em;
}

/* Bouton fermeture
   ========================================================================== */
.rdl-lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: transparent;
	border: 1.5px solid rgba(255, 255, 255, 0.6);
	color: #ffffff;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 0;
	transition: border-color 0.2s, background 0.2s;
}

.rdl-lightbox__close svg {
	display: block;
	pointer-events: none;
}

.rdl-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: #ffffff;
}

.rdl-lightbox__close:focus-visible {
	outline: 3px solid #A9D2A0;
	outline-offset: 3px;
}

/* Flèches lightbox — reprennent les mêmes styles que .rdl-carousel__btn
   Les valeurs par défaut sont identiques ; Elementor les override via selectors.
   ========================================================================== */
.rdl-lightbox__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);

	/* Même apparence que les boutons de navigation */
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #86192D;
	color: #ffffff;
	border: none;
	cursor: pointer;
	padding: 0;
	line-height: 0;

	display: flex;
	align-items: center;
	justify-content: center;

	transition: background 0.2s;
}

.rdl-lightbox__btn svg {
	display: block;
	flex-shrink: 0;
	pointer-events: none;
	width: 10px;
	height: auto;
}

.rdl-lightbox__btn:hover {
	background: #21401D;
}

.rdl-lightbox__btn:focus-visible {
	outline: 3px solid #A9D2A0;
	outline-offset: 3px;
}

.rdl-lightbox__btn--prev { left: 20px; }
.rdl-lightbox__btn--next { right: 20px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
	.rdl-carousel__btn {
		width: 36px;
		height: 36px;
	}

	.rdl-carousel__btn--prev { left: 6px; }
	.rdl-carousel__btn--next { right: 6px; }

	.rdl-lightbox__btn {
		padding: 10px;
	}
}
