/**
 * HEXANA — ProFeedWP (carousel)
 *
 * Ratio forcé : 1080 × 1350 (4:5, portrait Instagram).
 * ProFeedWP n’expose pas ce ratio en shortcode (auto, 1, 4/3, 16/9, 3/2, 2/1).
 * Flèches de navigation + scrollbar plus lisible.
 */

.profeedwp-feed {
	--hexana-profeed-ratio: 1080 / 1350; /* 4 / 5 */
}

/* -------------------------------------------------------------------------
   Cadre 4:5 — minimal + gallery
   ------------------------------------------------------------------------- */

.profeedwp-feed--minimal .profeedwp-feed-post,
.profeedwp-feed--minimal .profeedwp-feed-post-link,
.profeedwp-feed--gallery .profeedwp-feed-post,
.profeedwp-feed--gallery .profeedwp-feed-post-link {
	height: auto !important;
	min-height: 0 !important;
}

.profeedwp-feed--minimal .profeedwp-feed-post-image,
.profeedwp-feed--gallery .profeedwp-feed-post {
	aspect-ratio: var(--hexana-profeed-ratio) !important;
	height: auto !important;
	overflow: hidden;
}

.profeedwp-feed--minimal .profeedwp-feed-post-image img,
.profeedwp-feed--minimal .profeedwp-feed-post-media-item img,
.profeedwp-feed--gallery .profeedwp-feed-post-image img,
.profeedwp-feed--gallery .profeedwp-feed-post-media-item img {
	width: 100% !important;
	height: 100% !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center center;
}

/* Gallery : image en absolute dans le cadre 4:5 */
.profeedwp-feed--gallery .profeedwp-feed-post-image {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: unset !important;
}

.profeedwp-feed--minimal .profeedwp-feed-carousel.swiper > .swiper-wrapper,
.profeedwp-feed--gallery .profeedwp-feed-carousel.swiper > .swiper-wrapper {
	align-items: stretch !important;
}

/* -------------------------------------------------------------------------
   Flèches carousel
   ------------------------------------------------------------------------- */

.profeedwp-feed--minimal .profeedwp-feed-container,
.profeedwp-feed--gallery .profeedwp-feed-container {
	position: relative;
}

.hexana-profeed-nav {
	position: absolute;
	top: 40%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	color: #062338;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.hexana-profeed-nav:hover:not(:disabled) {
	transform: scale(1.05);
}

.hexana-profeed-nav:focus-visible {
	outline: 2px solid #062338;
	outline-offset: 2px;
}

.hexana-profeed-nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.hexana-profeed-nav--prev {
	left: 8px;
}

.hexana-profeed-nav--next {
	right: 8px;
}

.hexana-profeed-nav svg {
	display: block;
	width: 18px;
	height: 18px;
}

@media (max-width: 767px) {
	.hexana-profeed-nav {
		width: 36px;
		height: 36px;
		top: 36%;
	}

	.hexana-profeed-nav--prev {
		left: 4px;
	}

	.hexana-profeed-nav--next {
		right: 4px;
	}
}

/* -------------------------------------------------------------------------
   Scrollbar Swiper (autonome)
   ProFeedWP cache l’ascenseur natif et pose un .swiper-scrollbar. Sur l’accueil
   le CSS Swiper d’Elementor n’est PAS chargé (pas de loop-carousel) → sans
   position/height explicites le curseur reste à height:0 (piste seule = « grisé »).
   Sur /actualites/ le CSS Elementor charge et le rendu bleu fonctionne.
   ------------------------------------------------------------------------- */

.profeedwp-feed--minimal .profeedwp-feed-carousel.swiper,
.profeedwp-feed--gallery .profeedwp-feed-carousel.swiper {
	position: relative !important;
	padding-bottom: 28px !important;
}

.profeedwp-feed--minimal .profeedwp-feed-carousel.swiper .swiper-scrollbar,
.profeedwp-feed--gallery .profeedwp-feed-carousel.swiper .swiper-scrollbar {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: absolute !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 4px !important;
	top: auto !important;
	width: 100% !important;
	height: 8px !important;
	margin: 0 !important;
	background: rgba(6, 35, 56, 0.15) !important;
	border-radius: 999px !important;
	z-index: 4;
}

.profeedwp-feed--minimal .profeedwp-feed-carousel.swiper .swiper-scrollbar-drag,
.profeedwp-feed--gallery .profeedwp-feed-carousel.swiper .swiper-scrollbar-drag {
	display: block !important;
	position: relative !important;
	height: 100% !important;
	min-height: 8px !important;
	background: #062338 !important;
	border-radius: 999px !important;
	opacity: 1 !important;
	min-width: 64px;
	cursor: grab;
}

.profeedwp-feed--minimal .profeedwp-feed-carousel.swiper .swiper-scrollbar-drag:hover,
.profeedwp-feed--gallery .profeedwp-feed-carousel.swiper .swiper-scrollbar-drag:hover,
.profeedwp-feed--minimal .profeedwp-feed-carousel.swiper .swiper-scrollbar-drag:active,
.profeedwp-feed--gallery .profeedwp-feed-carousel.swiper .swiper-scrollbar-drag:active {
	background: #f54500 !important;
}
