/* Access'Hôtel — Carrousel
 * Hauteurs des cartes strictement égales grâce au flexbox (align-items:stretch).
 * La zone image a un ratio fixe : la galerie interne défile sans jamais changer la hauteur.
 */

.ahc {
	--ahc-accent: #1FA1CC;
	--ahc-card-bg: #ffffff;
	--ahc-gap: 24px;
	--ahc-per: 3; /* posée par Elementor (responsive) : nombre de cartes visibles */
	--ahc-per-eff: var(--ahc-per); /* largeur effective, ajustée par le JS s'il y a peu de cartes */
	--ahc-ratio: 1 / 1;
	--ahc-lines: 5;
	--ahc-radius: 12px;
	--ahc-pad: 18px;
	/* Flèches (pilotées par les contrôles Elementor de la section « Flèches »). */
	--ahc-arrow-size: 42px;
	--ahc-arrow-icon-size: 26px;
	--ahc-arrow-radius: 10px;
	--ahc-arrow-offset: 6px;
	--ahc-arrow-gap: 12px;
	position: relative;
	width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

/* Ordre des blocs : le viewport au milieu, la nav et les points selon l'emplacement. */
.ahc__viewport { order: 2; }
.ahc__nav { order: 3; }
.ahc__dots { order: 4; }

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

.ahc__viewport {
	overflow: hidden;
	width: 100%;
	padding: var(--ahc-pad); /* espace pour que les ombres/bords des cartes ne soient pas coupés */
	touch-action: pan-y; /* on capte le glissé horizontal, le scroll vertical reste à la page */
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}

.ahc.is-dragging .ahc__viewport {
	cursor: grabbing;
}

.ahc__img {
	-webkit-user-drag: none;
	user-select: none;
}

.ahc__track {
	display: flex;
	gap: var(--ahc-gap);
	align-items: stretch; /* toutes les cartes prennent la hauteur de la plus haute */
	transition: transform 0.45s ease;
}

/* will-change seulement pendant le glissé : sinon un calque GPU permanent alourdit toute la page */
.ahc.is-dragging .ahc__track {
	will-change: transform;
}

.ahc__slide {
	flex: 0 0 calc((100% - (var(--ahc-per-eff) - 1) * var(--ahc-gap)) / var(--ahc-per-eff));
	max-width: calc((100% - (var(--ahc-per-eff) - 1) * var(--ahc-gap)) / var(--ahc-per-eff));
	display: flex; /* la carte remplit toute la hauteur de la slide */
}

.ahc__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--ahc-card-bg);
	border-radius: var(--ahc-radius);
	overflow: hidden;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* --- Zone image à ratio fixe (garde-fou anti-bug de hauteur) --- */
.ahc__media {
	position: relative;
	width: 100%;
	aspect-ratio: var(--ahc-ratio);
	background: #eceff1;
	flex: 0 0 auto;
}

.ahc__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.5s ease;
}

.ahc__img.is-active {
	opacity: 1;
}

.ahc__gdots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	display: flex;
	justify-content: center;
	gap: 6px;
	z-index: 2;
}

.ahc__gdot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	padding: 0;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.65);
}

.ahc__gdot.is-active {
	background: #ffffff;
}

/* --- Corps de la carte --- */
.ahc__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px;
	text-align: center; /* tout le contenu centré par défaut */
}

.ahc__title {
	margin: 0 0 10px;
	font-size: 1.15rem;
	line-height: 1.3;
}

.ahc__text {
	margin: 0 0 16px;
	font-size: 0.95rem;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: var(--ahc-lines);
	line-clamp: var(--ahc-lines);
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ahc__actions {
	margin-top: auto; /* pousse le bouton en bas => boutons alignés d'une carte à l'autre */
}

.ahc__btn {
	display: inline-block;
	background: var(--ahc-accent);
	color: #ffffff;
	text-decoration: none;
	padding: 10px 22px;
	border-radius: 20px;
	font-weight: 600;
	transition: filter 0.2s ease, background-color 0.2s ease, color 0.2s ease,
		border-color 0.2s ease, box-shadow 0.2s ease;
}

.ahc__btn:hover,
.ahc__btn:focus {
	filter: brightness(1.08);
	color: #ffffff;
}

/* --- Flèches --- */
.ahc__arrow {
	z-index: 3;
	width: var(--ahc-arrow-size);
	height: var(--ahc-arrow-size);
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: var(--ahc-arrow-bg, var(--ahc-accent));
	color: var(--ahc-arrow-color, #ffffff);
	font-size: var(--ahc-arrow-icon-size);
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
		box-shadow 0.2s ease, font-size 0.2s ease, border-radius 0.2s ease;
}

.ahc__arrow:hover {
	background: var(--ahc-arrow-bg-hover, var(--ahc-arrow-bg, var(--ahc-accent)));
	color: var(--ahc-arrow-color-hover, var(--ahc-arrow-color, #ffffff));
	font-size: var(--ahc-arrow-icon-size-hover, var(--ahc-arrow-icon-size));
}

/* Appui (clic) : gagne sur :hover (placé après). Repli sur survol puis normal si non défini,
 * pour ne pas perdre la valeur de survol pendant le clic. */
.ahc__arrow:active {
	background: var(--ahc-arrow-bg-active, var(--ahc-arrow-bg-hover, var(--ahc-arrow-bg, var(--ahc-accent))));
	color: var(--ahc-arrow-color-active, var(--ahc-arrow-color-hover, var(--ahc-arrow-color, #ffffff)));
	font-size: var(--ahc-arrow-icon-size-active, var(--ahc-arrow-icon-size-hover, var(--ahc-arrow-icon-size)));
}

.ahc__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

/* Icône (police Font Awesome ou SVG Elementor) : hérite couleur et taille du bouton. */
.ahc__arrow i {
	font-size: inherit;
	line-height: 1;
}

.ahc__arrow svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* --- Formes --- */
.ahc--arrowshape-round .ahc__arrow { border-radius: 50%; }
.ahc--arrowshape-square .ahc__arrow { border-radius: 0; }
.ahc--arrowshape-rounded .ahc__arrow { border-radius: var(--ahc-arrow-radius); }
.ahc--arrowshape-rounded .ahc__arrow:hover { border-radius: var(--ahc-arrow-radius-hover, var(--ahc-arrow-radius)); }
.ahc--arrowshape-rounded .ahc__arrow:active { border-radius: var(--ahc-arrow-radius-active, var(--ahc-arrow-radius-hover, var(--ahc-arrow-radius))); }

/* Sans fond : icône seule, aucun aplat ni ombre, même au survol. */
.ahc--arrowshape-plain .ahc__arrow,
.ahc--arrowshape-plain .ahc__arrow:hover {
	background: transparent;
	box-shadow: none;
}

/* --- Emplacement : côtés (superposées / à l'extérieur) --- */
.ahc--arrows-over .ahc__nav,
.ahc--arrows-outside .ahc__nav {
	display: contents; /* le conteneur s'efface, les flèches se positionnent sur .ahc */
}

.ahc--arrows-over .ahc__arrow,
.ahc--arrows-outside .ahc__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.ahc--arrows-over .ahc__arrow--prev { left: var(--ahc-arrow-offset); }
.ahc--arrows-over .ahc__arrow--next { right: var(--ahc-arrow-offset); }

/* À l'extérieur : on réserve de la place sur les bords pour ne pas couvrir les cartes. */
.ahc--arrows-outside {
	padding-left: calc(var(--ahc-arrow-size) + var(--ahc-arrow-offset));
	padding-right: calc(var(--ahc-arrow-size) + var(--ahc-arrow-offset));
}

.ahc--arrows-outside .ahc__arrow--prev { left: 0; }
.ahc--arrows-outside .ahc__arrow--next { right: 0; }

/* --- Emplacement : en haut / en bas (flèches en flux, groupées) --- */
.ahc--arrows-top .ahc__nav,
.ahc--arrows-bottom .ahc__nav {
	display: flex;
	align-items: center;
	justify-content: var(--ahc-arrow-justify, center); /* alignement choisi (contrôle) */
	gap: var(--ahc-arrow-gap);
}

.ahc--arrows-top .ahc__arrow,
.ahc--arrows-bottom .ahc__arrow {
	position: static;
	transform: none;
}

.ahc--arrows-bottom .ahc__nav { order: 3; margin-top: 16px; }
.ahc--arrows-top .ahc__nav { order: 1; margin-bottom: 16px; }

/* --- Points --- */
.ahc__dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.ahc__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: none;
	padding: 0;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.2);
}

.ahc__dot.is-active {
	background: var(--ahc-accent);
}

/* Quand tout tient à l'écran : pas de navigation. */
.ahc--static .ahc__nav,
.ahc--static .ahc__arrow,
.ahc--static .ahc__dots {
	display: none;
}

/* Le nombre de cartes visibles (--ahc-per) est piloté par le JavaScript selon
 * le breakpoint (desktop / tablette / mobile). Les media queries CSS seraient
 * écrasées par le style inline, d'où le choix du JS. */

/* --- Mode visionneuse : seule l'image visible reçoit le clic --- */
.ahc--lightbox .ahc__img {
	pointer-events: none;
}

.ahc--lightbox .ahc__img.is-active {
	pointer-events: auto;
	cursor: zoom-in;
}

/* --- Visionneuse maison --- */
.ahc-lb[hidden] {
	display: none;
}

.ahc-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.ahc-lb.is-open {
	opacity: 1;
}

.ahc-lb__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.ahc-lb__img {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	transform: scale(0.96);
	transition: transform 0.25s ease;
}

.ahc-lb.is-open .ahc-lb__img {
	transform: scale(1);
}

.ahc-lb__close,
.ahc-lb__nav {
	position: absolute;
	z-index: 2;
	border: none;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	font-size: 28px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ahc-lb__close:hover,
.ahc-lb__nav:hover {
	background: rgba(255, 255, 255, 0.3);
}

.ahc-lb__close {
	top: 20px;
	right: 20px;
}

.ahc-lb__prev {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.ahc-lb__next {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}

html.ahc-lb-open {
	overflow: hidden;
}
