/* ITU Carousel 1.0.0 — no external dependencies */

.itu-carousel {
	--itu-blue: #12397f;
	--itu-blue-dark: #0c2554;
	--itu-accent: #1f7a4d;
	--itu-radius: 14px;
	--itu-max-height: 520px;
	--itu-ratio: 4 / 3;
	--itu-surface: #ffffff;
	--itu-text: #1b1f27;
	--itu-muted: #5c6473;
	--itu-border: #e4e7ec;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0 auto 2rem;
	color: var(--itu-text);
	font-family: inherit;
}

.itu-carousel *,
.itu-carousel *::before,
.itu-carousel *::after {
	box-sizing: border-box;
}

.itu-carousel__title {
	margin: 0 0 0.85rem;
	font-size: clamp(1.15rem, 1rem + 1vw, 1.6rem);
	line-height: 1.25;
	font-weight: 700;
	color: var(--itu-blue-dark);
}

/* ---------------------------------------------------------------- viewport */

.itu-carousel__viewport {
	position: relative;
	overflow: hidden;
	width: 100%;
	/* Never taller than --itu-max-height: cap the width at the equivalent ratio. */
	max-width: calc( var(--itu-max-height) * var(--itu-ratio-num, 1.3333) );
	margin: 0 auto;
	border-radius: var(--itu-radius);
	background: var(--itu-blue-dark);
	box-shadow: 0 10px 30px rgba(12, 37, 84, 0.18);
	aspect-ratio: var(--itu-ratio);
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 4 / 3) {
	.itu-carousel__viewport {
		height: var(--itu-max-height);
	}
}

/* fill="yes" — stretch to the full container width and crop instead. */
.itu-carousel--fill .itu-carousel__viewport,
.itu-carousel--fill .itu-carousel__thumbs {
	max-width: 100%;
}

.itu-carousel--fill .itu-carousel__viewport {
	aspect-ratio: auto;
	height: var(--itu-max-height);
}

.itu-carousel__track {
	display: flex;
	height: 100%;
	width: 100%;
	transition: transform 520ms cubic-bezier(0.33, 1, 0.68, 1);
	will-change: transform;
}

.itu-carousel__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

.itu-carousel__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	object-position: center;
}

.itu-carousel.is-zoomable .itu-carousel__image {
	cursor: zoom-in;
}

/* Fade variant */
.itu-carousel--fade .itu-carousel__track {
	display: block;
	position: relative;
	transition: none;
}

.itu-carousel--fade .itu-carousel__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 520ms ease;
	pointer-events: none;
}

.itu-carousel--fade .itu-carousel__slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* ---------------------------------------------------------------- captions */

.itu-carousel__caption {
	position: absolute;
	inset: auto 0 0 0;
	padding: 3.25rem 1.1rem 1rem;
	font-size: clamp(0.82rem, 0.76rem + 0.3vw, 1rem);
	line-height: 1.45;
	color: #fff;
	text-align: left;
	background: linear-gradient(to top, rgba(9, 26, 58, 0.92), rgba(9, 26, 58, 0.55) 45%, rgba(9, 26, 58, 0));
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------------- arrows */

.itu-carousel__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--itu-blue-dark);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(9, 26, 58, 0.28);
	transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
	z-index: 3;
}

.itu-carousel__nav svg {
	width: 22px;
	height: 22px;
}

.itu-carousel__nav:hover,
.itu-carousel__nav:focus-visible {
	background: #fff;
	transform: translateY(-50%) scale(1.06);
	outline: none;
}

.itu-carousel__nav:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 0 6px var(--itu-blue);
}

.itu-carousel__nav--prev {
	left: 12px;
}

.itu-carousel__nav--next {
	right: 12px;
}

@media (min-width: 640px) {
	.itu-carousel__nav {
		width: 48px;
		height: 48px;
	}

	.itu-carousel__nav--prev {
		left: 18px;
	}

	.itu-carousel__nav--next {
		right: 18px;
	}
}

/* --------------------------------------------------- counter / play toggle */

.itu-carousel__counter {
	position: absolute;
	top: 12px;
	right: 12px;
	margin: 0;
	padding: 4px 10px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #fff;
	background: rgba(9, 26, 58, 0.6);
	border-radius: 999px;
	backdrop-filter: blur(4px);
	z-index: 3;
}

.itu-carousel__toggle {
	position: absolute;
	top: 12px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(9, 26, 58, 0.6);
	color: #fff;
	cursor: pointer;
	z-index: 3;
}

.itu-carousel__toggle:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.itu-carousel__icon-pause {
	display: block;
	width: 10px;
	height: 12px;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
}

.itu-carousel__toggle.is-paused .itu-carousel__icon-pause {
	width: 0;
	height: 0;
	border: 0;
	border-left: 11px solid currentColor;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	margin-left: 3px;
}

.itu-carousel__progress {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 3px;
	background: rgba(255, 255, 255, 0.25);
	z-index: 3;
}

.itu-carousel__progress > span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--itu-accent);
}

/* --------------------------------------------------------------------- dots */

.itu-carousel__dots {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 0.9rem;
}

.itu-carousel__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #c3cad6;
	cursor: pointer;
	transition: background 160ms ease, width 160ms ease;
}

.itu-carousel__dot.is-active {
	width: 26px;
	border-radius: 999px;
	background: var(--itu-blue);
}

.itu-carousel__dot:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(18, 57, 127, 0.35);
}

/* ----------------------------------------------------------------- thumbs */

.itu-carousel__thumbs {
	display: flex;
	gap: 8px;
	width: 100%;
	max-width: calc( var(--itu-max-height) * var(--itu-ratio-num, 1.3333) );
	margin: 0.85rem auto 0;
	padding-bottom: 4px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: thin;
}

.itu-carousel__thumbs::-webkit-scrollbar {
	height: 6px;
}

.itu-carousel__thumbs::-webkit-scrollbar-thumb {
	background: #c3cad6;
	border-radius: 999px;
}

.itu-carousel__thumb {
	flex: 0 0 auto;
	width: 84px;
	height: 63px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	background: none;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 160ms ease, border-color 160ms ease;
}

.itu-carousel__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.itu-carousel__thumb:hover {
	opacity: 0.9;
}

.itu-carousel__thumb.is-active {
	opacity: 1;
	border-color: var(--itu-blue);
}

@media (max-width: 480px) {
	.itu-carousel__thumb {
		width: 64px;
		height: 48px;
	}
}

/* -------------------------------------------------------------- lightbox */

.itu-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1rem;
	background: rgba(6, 17, 38, 0.94);
	opacity: 0;
	transition: opacity 200ms ease;
}

.itu-lightbox.is-open {
	opacity: 1;
}

.itu-lightbox__image {
	max-width: min(100%, 1400px);
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.itu-lightbox__caption {
	position: absolute;
	left: 50%;
	bottom: 0.9rem;
	transform: translateX(-50%);
	max-width: 90%;
	margin: 0;
	color: #eef2f8;
	font-size: 0.9rem;
	text-align: center;
}

.itu-lightbox__close,
.itu-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.itu-lightbox__close:hover,
.itu-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.28);
}

.itu-lightbox__close {
	top: 1rem;
	right: 1rem;
}

.itu-lightbox__nav--prev {
	left: 1rem;
	top: 50%;
	transform: translateY(-50%);
}

.itu-lightbox__nav--next {
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
}

body.itu-lightbox-open {
	overflow: hidden;
}

/* ------------------------------------------------------------ a11y helper */

.itu-carousel .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;
}

/* ------------------------------------------------------------- dark theme */

@media (prefers-color-scheme: dark) {
	.itu-carousel {
		--itu-text: #e8ecf3;
		--itu-border: #2a3242;
	}

	.itu-carousel__title {
		color: #dce6f7;
	}

	.itu-carousel__dot {
		background: #4a5568;
	}
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
	.itu-carousel__track,
	.itu-carousel--fade .itu-carousel__slide,
	.itu-carousel__nav,
	.itu-lightbox {
		transition: none !important;
	}

	.itu-carousel__thumbs {
		scroll-behavior: auto;
	}
}
