/*
 * Program Slider. Loads on its own (not with blocks.css) so it can sit on WPBakery
 * pages like the homepage. Matches the homepage program cards it replaced:
 * photo with a dark fade, Cinzel need text in white, red Cinzel program name with
 * a red rule, Open Sans description, navy "About This Program" button.
 *
 * Layout: the first card lines up with the page's 1400px content column and the
 * row runs off the right edge of the screen, so the next card always peeks in.
 * The section is a size container, so cqw below means "% of the slider's width".
 */
.ss-ps {
	--ps-navy: #113968;
	--ps-red: #c92e2e;
	--ps-text: #2b2b2b;
	--ps-gap: 32px;
	--ps-per: 3.3;      /* cards in the content column; the rest bleeds off */
	position: relative;
	box-sizing: border-box;
	container-type: inline-size;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 56px 0 64px;
	font-family: "Open Sans", sans-serif;
	color: var(--ps-text);
}
.ss-ps *, .ss-ps *::before, .ss-ps *::after { box-sizing: border-box; }

/* cqw only works inside the container, so the sizes live on its children */
.ss-ps > * {
	--ps-pad: max(24px, calc((100cqw - 1352px) / 2));
	--ps-col: calc((min(100cqw, 1400px) - 48px - (var(--ps-per) - 1) * var(--ps-gap)) / var(--ps-per));
}

.ss-ps .ss-ps-track {
	position: relative;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: var(--ps-col);
	gap: var(--ps-gap);
	margin: 0;
	padding: 0 var(--ps-pad) 12px;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-left: var(--ps-pad);
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}
.ss-ps .ss-ps-track:focus { outline: none; }
.ss-ps.is-ready .ss-ps-track { scrollbar-width: none; padding-bottom: 0; }
.ss-ps.is-ready .ss-ps-track::-webkit-scrollbar { display: none; }

.ss-ps .ss-ps-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
}

/* Photo with the need over it */
.ss-ps-media {
	position: relative;
	display: flex;
	align-items: flex-end;
	aspect-ratio: 10 / 7; /* grows taller when the need text needs room */
	background: var(--ps-navy);
}
.ss-ps-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 50% 20%;
}
.ss-ps-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(10, 14, 22, 0.88) 0%, rgba(10, 14, 22, 0.55) 45%, rgba(10, 14, 22, 0) 80%);
}
.ss-ps-need {
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 24px 28px 26px;
	max-width: 95%;
	font-family: Cinzel, Georgia, serif;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.25;
	text-transform: uppercase;
	color: #fff;
	text-wrap: pretty;
}
.ss-ps-need-stat {
	display: block;
	margin: 4px 0;
	font-weight: 900;
	font-size: 24px;
	line-height: 1.1;
}
.ss-ps-need-stat:first-child { margin-top: 0; }
.ss-ps-need-stat:last-child { margin-bottom: 0; }

/* Program, description, button */
.ss-ps .ss-ps-name {
	margin: 22px 0 0;
	padding: 0 0 6px;
	border-bottom: 2px solid var(--ps-red);
	font-family: Cinzel, Georgia, serif;
	font-weight: 900;
	font-size: 18px;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--ps-red);
}
.ss-ps-desc {
	flex: 1 0 auto; /* keeps the buttons in a line */
	margin: 12px 0 0;
	font-size: 16px;
	line-height: 1.6;
	text-wrap: pretty;
}
.ss-ps-btn {
	align-self: flex-start;
	display: inline-block;
	margin-top: 24px;
	padding: 10px 18px;
	border: 2px solid var(--ps-navy);
	background: var(--ps-navy);
	color: #fff;
	font-family: "Open Sans", sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s, border-color 0.2s;
}
.ss-ps-btn:hover,
.ss-ps-btn:focus-visible {
	background: var(--ps-red);
	border-color: var(--ps-red);
	color: #fff;
}
.ss-ps-btn:focus-visible { outline: 3px solid var(--ps-navy); outline-offset: 3px; }

/* Arrows over the photos: "more" on the right edge, "back" once moved */
.ss-ps .ss-ps-arrow {
	position: absolute;
	z-index: 2;
	top: calc(56px + var(--ps-col) * 0.35 - 28px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--ps-navy);
	box-shadow: 0 6px 20px rgba(10, 14, 22, 0.28);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}
.ss-ps .ss-ps-arrow[hidden] { display: none; }
.ss-ps .ss-ps-next { right: 24px; }
.ss-ps .ss-ps-prev { left: max(12px, calc(var(--ps-pad) - 28px)); }
.ss-ps .ss-ps-arrow svg { width: 24px; height: 24px; }
.ss-ps .ss-ps-arrow:hover,
.ss-ps .ss-ps-arrow:focus-visible { background: var(--ps-navy); color: #fff; }
.ss-ps .ss-ps-arrow:focus-visible { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 6px var(--ps-navy); }

/* Dots and Pause */
.ss-ps-foot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 36px;
	padding: 0 var(--ps-pad);
}
.ss-ps-foot[hidden] { display: none; }
.ss-ps-dots { display: flex; align-items: center; gap: 4px; }
.ss-ps .ss-ps-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.ss-ps .ss-ps-dot::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 5px;
	background: #b9c2cf;
	transition: background-color 0.2s, width 0.2s;
}
.ss-ps .ss-ps-dot:hover::before { background: #7d8ba0; }
.ss-ps .ss-ps-dot[aria-current="true"]::before { width: 26px; background: var(--ps-navy); }
.ss-ps .ss-ps-dot:focus-visible { outline: 3px solid var(--ps-red); outline-offset: 0; border-radius: 4px; }
.ss-ps .ss-ps-pause {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 2px solid var(--ps-navy);
	border-radius: 50%;
	background: #fff;
	color: var(--ps-navy);
	cursor: pointer;
}
.ss-ps .ss-ps-pause[hidden] { display: none; }
.ss-ps .ss-ps-pause svg { width: 16px; height: 16px; }
.ss-ps .ss-ps-pause:hover,
.ss-ps .ss-ps-pause:focus-visible { background: var(--ps-navy); color: #fff; }
.ss-ps .ss-ps-pause:focus-visible { outline: 3px solid var(--ps-red); outline-offset: 3px; }
.ss-ps-pause .i-play { display: none; }
.ss-ps.is-paused .ss-ps-pause .i-play { display: inline; }
.ss-ps.is-paused .ss-ps-pause .i-pause { display: none; }

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

@media (max-width: 1023px) {
	.ss-ps { --ps-per: 2.25; --ps-gap: 24px; }
}
@media (max-width: 639px) {
	/* One card with the next one peeking in; swipe, or use the dots */
	.ss-ps { --ps-gap: 16px; padding: 40px 0 48px; }
	.ss-ps > * {
		--ps-pad: 20px;
		--ps-col: calc((100cqw - 20px) * 0.82);
	}
	.ss-ps .ss-ps-arrow { display: none; }
	.ss-ps-media { aspect-ratio: 4 / 5; }
	.ss-ps-need { padding: 20px 22px 22px; font-size: 14px; }
	.ss-ps-need-stat { font-size: 22px; }
	.ss-ps-foot { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
	.ss-ps .ss-ps-track { scroll-behavior: auto; }
	.ss-ps .ss-ps-dot::before { transition: none; }
}
