/* ===== Image Carousel – Frontend Styles ===== */

/* ---------- Container ---------- */
.ic-carousel {
	position: relative;
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	overflow: visible;
	padding: 0;
	box-sizing: border-box;
	user-select: none;
	-webkit-user-select: none;
	outline: none;
}

.ic-carousel:focus-visible {
	outline: 2px solid var(--ic-arrow-bg, #000);
	outline-offset: 2px;
}

/* ---------- Track ---------- */
.ic-track-wrapper {
	overflow: hidden;
	width: 100%;
}

.ic-track {
	display: flex;
	gap: var(--ic-gap, 16px);
	transition: transform var(--ic-transition, 500ms) ease;
	cursor: grab;
}

.ic-track:active {
	cursor: grabbing;
}

/* ---------- Slides ---------- */
.ic-slide {
	flex: 0 0 calc( ( 100% - ( var(--ic-visible, 3) - 1 ) * var(--ic-gap, 16px) ) / var(--ic-visible, 3) );
	min-width: 0;
}

.ic-slide-inner {
	position: relative;
	overflow: hidden;
	border-radius: var(--ic-radius, 8px);
}

.ic-slide-inner img {
	width: 100%;
	height: var(--ic-height, 400px);
	display: block;
	object-fit: cover;
}

/* ---------- Caption below ---------- */
.ic-caption {
	padding: 10px 4px 4px;
	font-size: 14px;
	line-height: 1.4;
	color: inherit;
	text-align: center;
}

/* ---------- Overlay text ---------- */
.ic-overlay-text {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient( transparent, rgba(0,0,0,0.7) );
	color: #fff;
	padding: 20px 16px 14px;
	font-size: 15px;
	line-height: 1.4;
}

/* ---------- Arrows ---------- */
.ic-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	width: 40px;
	height: 40px;
	color: #fff;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 50%;
	font-size: 24px;
	line-height: 1;
	transition: background 0.3s ease, transform 0.2s ease;
	padding: 0;
}

.ic-arrow:hover {
	background: rgba(0, 0, 0, 0.8);
}

.ic-arrow:disabled {
	opacity: 0.5;
	cursor: default;
	transform: translateY(-50%);
}

.ic-arrow:active {
	background: rgba(0, 0, 0, 0.9);
	transform: translateY(-50%) scale(0.95);
}

.ic-arrow:focus {
	outline: none;
}

.ic-arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.ic-arrow-prev {
	left: -52px;
}

.ic-arrow-next {
	right: -52px;
}

/* Keep arrows inside carousel earlier to avoid horizontal page scroll */
@media ( max-width: 1600px ) {
	.ic-arrow-prev {
		left: 8px;
	}

	.ic-arrow-next {
		right: 8px;
	}
}

/* -- Arrow style variants -- */
/* circle (default) */
.ic-carousel[data-arrow-style="circle"] .ic-arrow {
	border-radius: 50%;
}

/* square */
.ic-carousel[data-arrow-style="square"] .ic-arrow {
	border-radius: 0;
}

/* rounded */
.ic-carousel[data-arrow-style="rounded"] .ic-arrow {
	border-radius: 8px;
}

/* minimal */
.ic-carousel[data-arrow-style="minimal"] .ic-arrow {
	border-radius: 50%;
	background: rgba(0,0,0,0.25);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

/* none (no background) */
.ic-carousel[data-arrow-style="none"] .ic-arrow {
	background: transparent !important;
	box-shadow: none;
}

/* ---------- Dots ---------- */
.ic-dots {
	display: flex;
	justify-content: center;
	gap: 10px;
	padding: 14px 0 4px;
}

.ic-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 0;
	background: #bcbcbc;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.25s ease;
}

.ic-dot.active {
	background: #1f1f1f;
}

/* ---------- Caption position "none" ---------- */
.ic-caption-none .ic-caption,
.ic-caption-none .ic-overlay-text {
	display: none;
}

/* ---------- Responsive ---------- */

/* Tablet: max 2 slides */
@media ( max-width: 900px ) {
	.ic-slide {
		flex: 0 0 calc( ( 100% - var(--ic-gap, 16px) ) / 2 );
	}
}

/* Mobile: always 1 slide */
@media ( max-width: 600px ) {
	.ic-slide {
		flex: 0 0 100%;
	}
	.ic-track {
		gap: 0;
	}
	.ic-arrow {
		--ic-arrow-size: 34px;
	}
	.ic-arrow-prev { left: -6px; }
	.ic-arrow-next { right: -6px; }

	.ic-slide-inner img {
		height: clamp(200px, 60vw, var(--ic-height, 400px));
	}

	.ic-dots {
		gap: 8px;
	}
	.ic-dot {
		width: 8px;
		height: 8px;
		border: 0;
	}
}

/* ---------- Accessibility: prefers-reduced-motion ---------- */
@media ( prefers-reduced-motion: reduce ) {
	.ic-track {
		transition: none !important;
	}
}

