/*
 * Story carousel (PG_Carousel), the replacement for Smart Slider slider 1.
 *
 * Measured from the live slider on /what-is-a-people-group/ (2026-10-19):
 *   the full window width;
 *   desktop: a 326px sidebar (#242424) of thumbnails, each with the slide's
 *   short title and "Slide n of 9", inactive at 60%. Condensed from live's
 *   100×60 rows to 72×43 so all nine fit without scrolling (owner,
 *   2026-10-19); a 600px stage
 *   with the photo full-bleed and a text box 20px from the top and 60px
 *   from the left, half the stage wide; 32×115 arrows at both edges.
 *   The box is rgba(34,91,142,.91) (blue) or rgba(0,69,29,.94) (green),
 *   heading white Nunito 700, 30px on the first slide and 24px after; body
 *   16px/1.6 at 69% white; links #1890d7.
 *   phones: no sidebar or arrows, the box across the top, dots below.
 *
 * Before the script runs (or without it) the slides stack, each a photo with
 * its box, so the text is always readable.
 */

/*
 * Full window width, like the slider's "fullwidth" mode: it breaks out of the
 * page column. The script sets --pg-carousel-vw (the window width without the
 * scrollbar, so the page never scrolls sideways) and a left offset.
 */
.pg-carousel {
	position: relative;
	box-sizing: border-box;
	/* !important: Spectra gives every block inside its containers width:100%
	 * with a far more specific selector (body .wp-block-uagb-container >
	 * .uagb-container-inner-blocks-wrap > :not(…)). */
	width: var(--pg-carousel-vw, 100vw) !important;
	max-width: none !important;
	flex-shrink: 0 !important; /* Spectra's inner wrap is a flex box */
	margin-left: 0 !important;
	margin-right: 0 !important;
	background: #242424;
	color: #fff;
}
.pg-carousel .pg-carousel-label { display: none; }

/* A slide: the photo behind, the box on top */
.pg-carousel-slide {
	position: relative;
	min-height: 600px;
	margin: 0 !important;
	overflow: hidden;
}
.pg-carousel .pg-carousel-bg {
	position: absolute;
	inset: 0;
	margin: 0 !important;
	max-width: none !important;
}
.pg-carousel .pg-carousel-bg img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.pg-carousel .pg-carousel-text {
	position: absolute;
	top: 20px;
	left: 60px;
	z-index: 1;
	box-sizing: border-box;
	width: calc(50% - 60px);
	max-width: 560px;
	margin: 0 !important;
	padding: 15px;
	background: rgba(34, 91, 142, 0.906);
	font-family: Nunito, 'Nunito Sans', sans-serif;
}
.pg-carousel .pg-carousel-slide--green .pg-carousel-text { background: rgba(0, 69, 29, 0.937); }
.pg-carousel .pg-carousel-text h2 {
	margin: 0 0 6px;
	color: #fff;
	font: 700 24px/1.2 Nunito, 'Nunito Sans', sans-serif;
}
.pg-carousel .pg-carousel-slide:first-child .pg-carousel-text h2 { font-size: 30px; }
.pg-carousel .pg-carousel-text p {
	margin: 0 0 0.75em;
	color: rgba(255, 255, 255, 0.69);
	font: 400 16px/1.6 Nunito, 'Nunito Sans', sans-serif;
}
.pg-carousel .pg-carousel-text p:last-child { margin-bottom: 0; }
.pg-carousel .pg-carousel-text a { color: #1890d7; }
.pg-carousel .pg-carousel-text a:hover,
.pg-carousel .pg-carousel-text a:focus { color: #5cb2e6; }

/* ---- Once the script has built the carousel ---- */
.pg-carousel.is-ready {
	display: grid;
	grid-template-columns: 326px minmax(0, 1fr);
}
/* The Group block's flow layout spaces its children; the sidebar and the
 * stage sit flush. */
.pg-carousel.is-ready > *,
.pg-carousel-stage > * { margin-block: 0 !important; }
.pg-carousel.is-ready .pg-carousel-stage {
	position: relative;
	height: 600px;
	overflow: hidden;
}
.pg-carousel.is-ready .pg-carousel-slide { display: none; height: 100%; }
.pg-carousel.is-ready .pg-carousel-slide.is-active {
	display: block;
	animation: pg-carousel-fade 0.5s ease;
}
@keyframes pg-carousel-fade { from { opacity: 0; } to { opacity: 1; } }

/* Sidebar */
.pg-carousel-nav {
	height: 600px;
	overflow-y: auto;
	padding: 12px 0;
	box-sizing: border-box;
	scrollbar-width: thin;
	scrollbar-color: #555 #242424;
}
.pg-carousel button.pg-carousel-navitem,
.pg-carousel button.pg-carousel-navitem:hover,
.pg-carousel button.pg-carousel-navitem:focus {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 7px 10px 7px 8px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #fff;
	text-align: left;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}
.pg-carousel button.pg-carousel-navitem:hover { opacity: 0.85; }
.pg-carousel button.pg-carousel-navitem.is-active { opacity: 1; }
.pg-carousel button.pg-carousel-navitem:focus-visible { opacity: 1; outline: 2px solid #1890d7; outline-offset: -2px; }
.pg-carousel-navitem img {
	flex: 0 0 72px;
	width: 72px;
	height: 43px;
	object-fit: cover;
}
.pg-carousel-navtext { display: block; min-width: 0; }
.pg-carousel-navtitle {
	display: block;
	overflow: hidden;
	color: #fff;
	font: 400 14px/1.3 'Nunito Sans', sans-serif;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.pg-carousel-navcount {
	display: block;
	margin-top: 2px;
	color: #9a9a9a;
	font: 400 12px/1.3 'Nunito Sans', sans-serif;
}

/* Arrows */
.pg-carousel button.pg-carousel-arrow,
.pg-carousel button.pg-carousel-arrow:hover,
.pg-carousel button.pg-carousel-arrow:focus {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 115px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(0, 0, 0, 0.5);
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
}
.pg-carousel button.pg-carousel-arrow:hover { background: rgba(0, 0, 0, 0.7); }
.pg-carousel button.pg-carousel-arrow:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.pg-carousel .pg-carousel-arrow--prev { left: 0; }
.pg-carousel .pg-carousel-arrow--next { right: 0; }
.pg-carousel-arrow svg { width: 32px; height: 32px; opacity: 0.8; }

/* Dots: phones only, as on live */
.pg-carousel-dots { display: none; }

@media (max-width: 640px) {
	.pg-carousel.is-ready { display: block; }
	.pg-carousel-nav,
	.pg-carousel .pg-carousel-arrow { display: none !important; }
	.pg-carousel.is-ready .pg-carousel-stage { height: auto; }
	.pg-carousel-slide { min-height: 385px; }
	.pg-carousel .pg-carousel-text {
		position: relative;
		top: auto;
		left: auto;
		width: auto;
		max-width: none;
		margin: 40px 10px 46px !important;
		padding: 10px;
	}
	.pg-carousel .pg-carousel-text h2,
	.pg-carousel .pg-carousel-slide:first-child .pg-carousel-text h2 { font-size: 20px; }
	.pg-carousel .pg-carousel-text p { font-size: 14px; }
	.pg-carousel-dots {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 12px;
		z-index: 2;
		display: flex;
		justify-content: center;
		gap: 8px;
	}
	.pg-carousel button.pg-carousel-dot,
	.pg-carousel button.pg-carousel-dot:hover,
	.pg-carousel button.pg-carousel-dot:focus {
		width: 12px;
		height: 12px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(0, 0, 0, 0.67);
		box-shadow: none;
		cursor: pointer;
	}
	.pg-carousel button.pg-carousel-dot.is-active { background: #1890d7; }
}

@media (prefers-reduced-motion: reduce) {
	.pg-carousel.is-ready .pg-carousel-slide.is-active { animation: none; }
}
