/**
 * Image carousel — filmstrip-style slider (adapted from an existing
 * Medallion Cabinetry component). See inc/image-carousel.php's file
 * comment for exactly what changed from the donor code and why — this is
 * the CSS half of that same adaptation: only the rules actually relevant
 * to the .pg-carousel-* component were kept (the donor's page pasted a
 * whole other site's design-system stylesheet along with it — headings,
 * buttons, breadcrumbs, a completely different <hero-carousel> component,
 * etc. — none of that belongs here).
 *
 * --pg-carousel-w / --pg-carousel-h aren't in the donor code either
 * (presumably set inline on that page) — defaults below are a reasonable
 * guess sized to match this theme's existing ~1320px content width and the
 * "Riverton" mockup's proportions. Tune them if the real thing should look
 * different.
 *
 * Colors: the donor code hardcoded its own brand color (#9f6a4c) on the
 * arrows/counter — swapped for var(--goldHex) instead, confirmed against
 * the mockup (the counter/arrows there sample to this theme's exact gold).
 */

:root {
	--pg-carousel-w: min(94vw, 1320px);
	--pg-carousel-h: 260px;
}

@media (min-width: 900px) {
	:root {
		--pg-carousel-h: 560px;
	}
}

/* ---- Reset for the injected buttons ---- */

.pg-carousel .prevbtn,
.pg-carousel .nextbtn {
	border-width: 0;
	font: inherit;
	color: var(--goldHex);
	background-color: transparent;
	cursor: pointer;
	touch-action: manipulation;
}

/* ---- Clip layer: prevents a horizontal scrollbar while still letting the
   track visually bleed past the centered wrapper below ---- */

.pg-carousel-clip {
	overflow: hidden;
	width: 100%;
}

/* ---- Inner wrapper: the actual sized/centered carousel; overflow stays
   visible so the next slide can peek in from the clip layer's edge ---- */

.pg-carousel-wrapper {
	width: var(--pg-carousel-w);
	margin: 0 auto;
	position: relative;
	overflow: visible;
}

/* ---- Filmstrip track ---- */

.pg-carousel-track {
	display: flex;
	gap: 30px;
	align-items: flex-start;
	transition: transform 0.55s cubic-bezier(0.77, 0, 0.18, 1);
	will-change: transform;
}

.pg-carousel-track .pg-slide {
	flex: 0 0 auto;
	height: var(--pg-carousel-h);
	position: relative;
	overflow: hidden;
}

.pg-carousel-track .pg-slide img {
	height: var(--pg-carousel-h);
	width: auto;
	display: block;
}

/* ---- Slide Image Modal trigger — each slide's image is wrapped in a
   <button class="cards-simple-modal-trigger pg-slide-trigger"> (see
   inc/image-carousel.php / inc/image-modal.php) when a full-size URL is
   available. Reset it back down to plain button styling so it doesn't
   change the slide's existing layout at all — the .pg-carousel-track
   .pg-slide img rule above still matches straight through it. ---- */

.pg-slide-trigger {
	display: block;
	height: 100%;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	cursor: pointer;
	position: relative; /* Anchors .pg-slide-zoom-icon below to the actual
		photo — this button has no explicit width, so as a flex item's
		content it already shrink-wraps to the image's own rendered size
		(fixed height, auto width), no separate letterbox fix needed here. */
}

/* "Zoom" cue in each slide's lower-right corner — same decorative
   treatment already used for the single Storage Solution/Finishing Touch
   photo (.sg-zoom-icon, assets/css/solution-gallery.css) and the Door/
   Finish Gallery cards (.product-gallery-zoom-icon,
   assets/css/product-gallery.css): 50% opaque at rest with a light
   shadow, full opacity + a heavier shadow on hover. Only present on
   slides that are actually the lightbox trigger (inc/image-carousel.php). */
.pg-slide-zoom-icon {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	width: 2rem;
	height: 2rem;
	pointer-events: none;
	opacity: 0.5;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.pg-slide-trigger:hover .pg-slide-zoom-icon,
.pg-slide-trigger:focus-visible .pg-slide-zoom-icon {
	opacity: 1;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75));
}

.pg-slide-zoom-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* ---- Nav (buttons injected by assets/js/image-carousel.js) ---- */

.pg-carousel-nav {
	width: var(--pg-carousel-w);
	margin: 20px auto 0;
	display: flex;
	gap: 12px;
	padding: 0 4px;
	align-items: center;
	justify-content: center;
}

.pg-carousel-nav .prevbtn,
.pg-carousel-nav .nextbtn {
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s, transform 0.2s;
	border-radius: 50%;
}

.pg-carousel-nav .prevbtn:hover:not([aria-disabled="true"]),
.pg-carousel-nav .nextbtn:hover:not([aria-disabled="true"]) {
	transform: scale(1.08);
}

.pg-carousel-nav .prevbtn[aria-disabled="true"],
.pg-carousel-nav .nextbtn[aria-disabled="true"] {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

.pg-carousel-nav .prevbtn:focus-visible,
.pg-carousel-nav .nextbtn:focus-visible {
	outline: 2px solid var(--goldHex);
	outline-offset: 4px;
}

/* ---- Visible slide counter ("1 / 4") ---- */

.pg-carousel-counter {
	font-family: var(--font-primary);
	font-weight: var(--font-weight-regular);
	font-style: normal;
	font-size: 0.95rem;
	letter-spacing: 0.05em;
	color: var(--goldHex);
	min-width: 3em;
	text-align: center;
}

/* ---- Screen-reader-only utility (announcer live region, button labels) ---- */

.pg-carousel .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}