/**
 * Casas Choice — homepage hero slider (Penpot board "Homepage" → Desktop/
 * Mobile, "Slider" row). See inc/hero-slider.php for the exact Penpot
 * measurements this was built from.
 *
 * The shortcode sits inside a normal (boxed) Greenshift row, but Penpot has
 * it running the full board width edge to edge — same full-bleed "breakout"
 * used by .cc-persp-pills (assets/css/perspetivas.css) and
 * .cc-article__photo (assets/css/artigo.css) on mobile, applied here at
 * every width since Penpot's Mobile board is full-bleed too.
 *
 * Nav buttons reuse the exact visual spec already proven out for the
 * gallery-card slider's own prev/next buttons (.cc-gcard__nav,
 * assets/css/comprar.css: 46px circle, white 90%, 1px ink-35% border,
 * 20px icon) — just always visible instead of hover-revealed, since this is
 * the page's own hero rather than a card overlay.
 */

.cc-hero-slider {
	--cc-ink: var( --theme-palette-color-5, #333538 );
	--cc-accent: var( --theme-palette-color-1, #00A6CE );

	position: relative;
	width: 100vw;
	left: 50%;
	margin-left: -50vw;
	overflow: hidden;
}

.cc-hero-slider__swiper,
.cc-hero-slider .swiper-wrapper,
.cc-hero-slider .swiper-slide {
	width: 100%;
}

.cc-hero-slider__swiper {
	aspect-ratio: 1920 / 563;
}

.cc-hero-slider .swiper-slide {
	height: 100%;
}

.cc-hero-slider .swiper-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Fallback for the moment before Swiper initializes (or if its script
 * fails to load): show only the first photo, plain, full-bleed — same
 * "un-initialized" convention as .cc-gcard-grid__swiper (comprar.css). */
.cc-hero-slider__swiper:not( .swiper-initialized ) .swiper-wrapper {
	display: block;
}

.cc-hero-slider__swiper:not( .swiper-initialized ) .swiper-slide {
	display: none;
}

.cc-hero-slider__swiper:not( .swiper-initialized ) .swiper-slide:first-child {
	display: block;
}

/* ----------------------------------------------------------------------
 * Nav arrows — 46px circle, vertically centered, 64px inset (Penpot: ~67.5px
 * either side of a 1920 board — 64px matches the site's own gutter unit
 * used sitewide, e.g. the homepage's row `gutterGap`/`rowGap` values).
 * -------------------------------------------------------------------- */

.cc-hero-slider__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-top: -23px;
	background: rgba( 255, 255, 255, 0.9 );
	border: 1px solid rgba( 51, 53, 56, 0.35 );
	border-radius: 999px;
	color: var( --cc-ink );
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.cc-hero-slider__nav:hover {
	background: #FFFFFF;
}

.cc-hero-slider__nav svg {
	width: 20px;
	height: 20px;
	display: block;
}

.cc-hero-slider__nav--prev {
	left: 64px;
}

.cc-hero-slider__nav--next {
	right: 64px;
}

.cc-hero-slider__nav.swiper-button-disabled {
	opacity: 0.4;
	pointer-events: none;
}

/* ----------------------------------------------------------------------
 * Pagination — bottom gradient scrim (Penpot: black 80%→0, 96px tall) +
 * centered dots (8px, active = 32px accent pill), 4px gap.
 * -------------------------------------------------------------------- */

.cc-hero-slider__dots {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 2;
	height: 96px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.8 ), rgba( 0, 0, 0, 0 ) );
	pointer-events: none;
}

.cc-hero-slider__pagination {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	pointer-events: auto;
}

.cc-hero-slider__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0 !important;
	background: #FFFFFF;
	opacity: 1;
	border-radius: 999px;
	cursor: pointer;
	transition: width 0.2s ease, background-color 0.15s ease;
}

.cc-hero-slider__pagination .swiper-pagination-bullet-active {
	width: 32px;
	background: var( --cc-accent );
}

/* ----------------------------------------------------------------------
 * Mobile — plain full-bleed image, near-square crop, no nav/pagination at
 * all (Penpot's Mobile "Slider" board has no children besides the photo
 * itself — swipe-only, matching the rest of the touch-first Mobile board).
 * -------------------------------------------------------------------- */

@media ( max-width: 999px ) {
	.cc-hero-slider__swiper {
		aspect-ratio: 390 / 380;
	}

	.cc-hero-slider__nav,
	.cc-hero-slider__dots {
		display: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.cc-hero-slider__nav,
	.cc-hero-slider__pagination .swiper-pagination-bullet {
		transition: none;
	}
}
