/*!
 * Ptitange Hero Slider — Frontend
 * v1.1.0 — mobile-first strict · aspect-ratio aligné images uploadées
 *          (mobile 800×1000 → 4/5, desktop 2000×600 → 10/3)
 * Palette : aubergine #3B1838 · orange #F79421
 */

/* =========================================================================
 * SCOPE racine (anti-collision CSS globale thème kidz)
 * ====================================================================== */
.pt-hero {
	--pt-aubergine: #3B1838;
	--pt-orange: #F79421;
	--pt-white: #ffffff;
	--pt-shadow: 0 2px 8px rgba(0, 0, 0, .15);
	--pt-focus: 3px solid var(--pt-orange);
	--pt-focus-offset: 2px;

	position: relative;
	width: 100%;
	margin: 0 0 1.5rem 0;
	background: #f3f3f3;
	overflow: hidden;
}

.pt-hero--hide-mobile {
	display: none;
}

/* =========================================================================
 * SLIDE
 * ====================================================================== */
.pt-hero .swiper,
.pt-hero .swiper-wrapper,
.pt-hero .swiper-slide {
	width: 100%;
}

.pt-hero .pt-slide {
	display: block;
	width: 100%;
	/* Mobile : images uploadées 800×1000 (portrait 4:5) — texte pre-baké vertical */
	aspect-ratio: 4 / 5;
	position: relative;
	line-height: 0;
	background: #e8e8e8;
	text-decoration: none;
	outline: none;
}

.pt-hero .pt-slide:focus-visible {
	outline: var(--pt-focus);
	outline-offset: calc(-1 * var(--pt-focus-offset));
}

.pt-hero .pt-slide picture,
.pt-hero .pt-slide-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

/* =========================================================================
 * PAGINATION (dots)
 * [FIX #8] Hit area 44×44 via ::before pour WCAG 2.5.5 Target Size (AA).
 * ====================================================================== */
.pt-hero .swiper-pagination {
	position: absolute;
	bottom: 10px;
	left: 0;
	width: 100%;
	z-index: 10;
	text-align: center;
	line-height: 0;
}

.pt-hero .swiper-pagination-bullet {
	position: relative;
	width: 12px;
	height: 12px;
	margin: 0 10px !important; /* +margin pour éviter overlap hit areas */
	background: var(--pt-white);
	opacity: .55;
	border-radius: 50%;
	display: inline-block;
	cursor: pointer;
	transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

/* Hit area invisible 44×44 autour du dot 12×12 */
.pt-hero .swiper-pagination-bullet::before {
	content: '';
	position: absolute;
	inset: -16px;
	display: block;
}

.pt-hero .swiper-pagination-bullet-active {
	background: var(--pt-aubergine);
	opacity: 1;
	transform: scale(1.1);
}

.pt-hero .swiper-pagination-bullet:focus-visible {
	outline: var(--pt-focus);
	outline-offset: var(--pt-focus-offset);
}

/* =========================================================================
 * FLÈCHES (cachées en mobile, visibles ≥ tablet)
 * ====================================================================== */
.pt-hero .swiper-button-prev,
.pt-hero .swiper-button-next {
	display: none;
}

/* =========================================================================
 * TABLET & DESKTOP
 * ====================================================================== */
@media (min-width: 768px) {
	.pt-hero .pt-slide {
		/* Tablet+ : images uploadées 2000×600 (paysage 10:3) — texte pre-baké horizontal */
		aspect-ratio: 10 / 3;
	}

	.pt-hero--has-arrows .swiper-button-prev,
	.pt-hero--has-arrows .swiper-button-next {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		width: 48px;
		height: 48px;
		border-radius: 50%;
		background: rgba(255, 255, 255, .95);
		color: var(--pt-aubergine);
		box-shadow: var(--pt-shadow);
		border: 0;
		cursor: pointer;
		z-index: 10;
		transition: background-color .2s ease, transform .2s ease;
		padding: 0;
	}

	.pt-hero .swiper-button-prev { left: 16px; }
	.pt-hero .swiper-button-next { right: 16px; }

	.pt-hero .swiper-button-prev:hover,
	.pt-hero .swiper-button-next:hover {
		background: var(--pt-white);
		transform: translateY(-50%) scale(1.06);
	}

	.pt-hero .swiper-button-prev:focus-visible,
	.pt-hero .swiper-button-next:focus-visible {
		outline: var(--pt-focus);
		outline-offset: var(--pt-focus-offset);
	}

	.pt-hero .swiper-button-prev::after,
	.pt-hero .swiper-button-next::after {
		font-size: 18px !important;
		font-weight: 700;
		color: var(--pt-aubergine);
	}

	.pt-hero .swiper-pagination-bullet {
		width: 10px;
		height: 10px;
	}
}

/* v1.1.0 : plus de breakpoint 1200 — aspect-ratio 10/3 déjà posé à partir de 768px,
   identique à 2000/600 = 3.333... */

/* =========================================================================
 * ACCESSIBILITÉ — prefers-reduced-motion
 * ====================================================================== */
@media (prefers-reduced-motion: reduce) {
	.pt-hero .swiper-wrapper {
		transition-duration: 0ms !important;
	}
	.pt-hero .swiper-pagination-bullet {
		transition: none;
	}
}

/* =========================================================================
 * RTL
 * ====================================================================== */
[dir="rtl"] .pt-hero .swiper-button-prev { right: 16px; left: auto; }
[dir="rtl"] .pt-hero .swiper-button-next { left: 16px; right: auto; }