:root {
	--icb-accent: #287FE3;
	--icb-radius: 15px;
	--icb-dot: #c9c9c9;
}

.icb-carousel {
	/* height/width of the biggest image; set inline by PHP and refined by JS */
	--icb-img-ratio: 0.66;
	--icb-center-width: 0.46;
	/* live drag offset (set by JS while dragging) */
	--icb-drag: 0px;
	/* breathing room inside the stage so box-shadows are not clipped */
	--icb-shadow-pad: 24px;
	max-width: 1080px;
	margin: 0 auto;
}

/* Arrows sit left and right OF the carousel, not on the images */
.icb-viewport {
	display: flex;
	align-items: center;
	gap: 14px;
}

.icb-stage {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	aspect-ratio: calc(1 / (var(--icb-center-width) * var(--icb-img-ratio)));
	max-height: 640px;
	overflow: hidden;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}

.icb-stage:active { cursor: grabbing; }

@supports not (aspect-ratio: 1 / 1) {
	.icb-stage { height: 440px; }
}

/* ---------- Slides ---------- */
.icb-slide {
	position: absolute;
	top: 50%;
	left: 50%;
	width: calc(var(--icb-center-frac, var(--icb-center-width)) * 100%);
	height: calc(100% - var(--icb-shadow-pad) * 2);
	margin: 0;
	transform: translate(calc(-50% + var(--icb-drag)), -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	cursor: pointer;
	/* NOTE: no "transition: all" — z-index must switch instantly,
	   otherwise incoming slides briefly overlap the growing center image */
	transition:
		transform 0.69s cubic-bezier(0.33, 1, 0.68, 1),
		left 0.69s cubic-bezier(0.33, 1, 0.68, 1),
		width 0.69s cubic-bezier(0.33, 1, 0.68, 1),
		height 0.69s cubic-bezier(0.33, 1, 0.68, 1),
		opacity 0.69s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Applied by JS for wrap-around jumps: no animation */
.icb-slide.icb-snap { transition: none !important; }

/* While dragging, slides follow the pointer 1:1 (no easing) */
.icb-dragging .icb-slide { transition: none !important; }

/* Images are never cropped: they keep their own proportions inside the slide */
.icb-slide img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: var(--icb-radius);
	box-shadow: 0px 0px 5px 5px rgba(0, 0, 0, 0.12);
	pointer-events: none;
	-webkit-user-drag: none;
}

/* The centered image fills the stage height minus the shadow padding,
   so its shadow is never cut off by the stage's overflow: hidden.
   Wide (landscape) images get a wider center slot (JS sets
   --icb-center-frac) and push the side images outwards.
   The image fills its slot (object-fit: cover) so while it grows
   there is never an empty/white box behind it — the picture itself
   grows edge to edge. At rest the slot matches the image aspect ratio,
   so nothing is cropped. */
.icb-slide.is-center {
	left: 50%;
	width: calc(var(--icb-center-frac, var(--icb-center-width)) * 100%);
	height: calc(100% - var(--icb-shadow-pad) * 2);
	transform: translate(calc(-50% + var(--icb-drag)), -50%);
	z-index: 5;
	opacity: 1;
	cursor: zoom-in;
}

.icb-slide.is-center img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.icb-slide.is-left,
.icb-slide.is-right {
	width: 24%;
	height: 62%;
	z-index: 3;
	opacity: 1;
}

/* Side slides hug the edges of the center image (pushed out by wide images) */
.icb-slide.is-left {
	left: calc(50% - var(--icb-center-frac, var(--icb-center-width)) * 50% - 2%);
	transform: translate(calc(-100% + var(--icb-drag)), -50%);
}

.icb-slide.is-right {
	left: calc(50% + var(--icb-center-frac, var(--icb-center-width)) * 50% + 2%);
	transform: translate(var(--icb-drag), -50%);
}

/* Off-stage slides: fully outside and clipped, so they slide out (no fading) */
.icb-slide.is-off-left,
.icb-slide.is-off-right {
	width: 24%;
	height: 62%;
	z-index: 1;
	opacity: 1;
	pointer-events: none;
}

.icb-slide.is-off-left  { left: -35%; transform: translate(var(--icb-drag), -50%); }
.icb-slide.is-off-right { left: 135%; transform: translate(var(--icb-drag), -50%); }

/* ---------- Arrows: 25x25, blue circle, white inside, blue icon ---------- */
.icb-arrow {
	flex: 0 0 auto;
	width: 25px;
	height: 25px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 2px solid var(--icb-accent);
	border-radius: 50%;
	background: #ffffff;
	color: var(--icb-accent);
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
}

.icb-arrow:focus-visible {
	outline: 2px solid var(--icb-accent);
	outline-offset: 2px;
}

/* ---------- Dots ---------- */
.icb-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 9px;
	margin-top: 18px;
	/* room for the scaled active dot so it is not clipped at the bottom */
	padding: 4px 0 6px;
}

.icb-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--icb-dot);
	cursor: pointer;
	transition: background 0.3s ease, transform 0.3s ease;
}

.icb-dot.is-active {
	background: var(--icb-accent);
	transform: scale(1.25);
}

/* ---------- Lightbox ---------- */
.icb-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.82);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.38s ease, visibility 0.38s ease;
}

.icb-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

/* Sliding track: images slide in/out, no fade */
.icb-lightbox__track {
	display: flex;
	width: 100%;
	height: 100%;
	transition: transform 0.56s cubic-bezier(0.33, 1, 0.68, 1);
}

.icb-lightbox__slide {
	flex: 0 0 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 32px 90px;
	box-sizing: border-box;
}

.icb-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: var(--icb-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	-webkit-user-drag: none;
}

/* Close button (no hover color change) */
.icb-lightbox__close {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 2;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	font-size: 18px;
	cursor: pointer;
}

/* Lightbox arrows (no hover color change) */
.icb-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #ffffff;
	color: var(--icb-accent);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.icb-lightbox__nav--prev { left: 20px; }
.icb-lightbox__nav--next { right: 20px; }

.icb-lightbox__nav:focus-visible,
.icb-lightbox__close:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

body.icb-no-scroll { overflow: hidden; }

/* ---------- Mobile: one image ---------- */
@media (max-width: 768px) {
	.icb-carousel {
		--icb-center-width: 0.8;
		--icb-shadow-pad: 16px;
	}

	.icb-viewport { gap: 8px; }

	.icb-arrow {
		width: 25px;
		height: 25px;
		font-size: 10px;
	}

	/* Side images: same size as center, parked outside the stage (clipped, no fade) */
	.icb-slide.is-left,
	.icb-slide.is-off-left,
	.icb-slide.is-right,
	.icb-slide.is-off-right {
		width: calc(var(--icb-center-frac, var(--icb-center-width)) * 100%);
		height: calc(100% - var(--icb-shadow-pad) * 2);
		pointer-events: none;
	}

	.icb-slide.is-left,
	.icb-slide.is-off-left  { left: -105%; transform: translate(var(--icb-drag), -50%); }
	.icb-slide.is-right,
	.icb-slide.is-off-right { left: 115%; transform: translate(var(--icb-drag), -50%); }

	.icb-lightbox__slide { padding: 16px 56px; }
	.icb-lightbox__nav { width: 40px; height: 40px; font-size: 14px; }
	.icb-lightbox__nav--prev { left: 10px; }
	.icb-lightbox__nav--next { right: 10px; }
	.icb-lightbox__close { top: 12px; right: 12px; }
}

/* ---------- Editor preview ---------- */
.icb-editor {
	border: 1px dashed #c3c4c7;
	border-radius: 12px;
	padding: 16px;
	background: #fff;
}

.icb-editor__preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.icb-editor__preview img {
	width: 96px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
}

.icb-editor__placeholder { color: #757575; margin: 0 0 12px; }