/**
 * Image Detail Carousel Widget — front-end styles.
 *
 * Notes:
 *  - All rules are scoped under .idcw-carousel-wrapper so the widget never
 *    leaks styles into the rest of the page.
 *  - Most visual properties (colours, sizes, radii) are driven by Elementor
 *    controls via inline selectors; this file only provides structural layout
 *    and sensible defaults.
 */

.idcw-carousel-wrapper {
	box-sizing: border-box;
}

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

/* Two-column flex layout. */
.idcw-carousel {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

/* Reverse the visual order when the image should sit on the right. */
.idcw-carousel.idcw-image-right {
	flex-direction: row-reverse;
}

/* Columns */
.idcw-image-col {
	flex: 0 0 50%;
	max-width: 50%;
}

.idcw-text-col {
	flex: 1;
	min-width: 0; /* allow text to shrink inside flex */
}

/* ---------- Main image ---------- */
.idcw-main-image-wrap {
	overflow: hidden;
	line-height: 0;
}

.idcw-main-image {
	display: block;
	width: 100%;
	max-width: 100%;
	transition: opacity 0.25s ease;
}

/* Fade applied by JS when the main image swaps. */
.idcw-main-image.is-swapping {
	opacity: 0;
}

/* ---------- Thumbnails ---------- */
.idcw-thumbs {
	display: flex;
	flex-wrap: wrap;
	margin-top: 16px;
}

.idcw-thumb {
	position: relative;
	flex: 0 0 auto;
	width: 90px;
	height: 90px;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	overflow: hidden;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

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

/* Hover/focus overlay carrying the item title. */
.idcw-thumb-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	text-align: center;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.idcw-thumb:hover .idcw-thumb-overlay,
.idcw-thumb:focus-visible .idcw-thumb-overlay {
	opacity: 1;
}

/* Visible keyboard focus for accessibility. */
.idcw-thumb:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Text panels ---------- */
.idcw-panel {
	/* Hidden panels use the [hidden] attribute; this is a defensive fallback. */
}

.idcw-panel[hidden] {
	display: none;
}

.idcw-heading {
	margin-top: 0;
}

.idcw-description :last-child {
	margin-bottom: 0;
}

/* ---------- Button ---------- */
.idcw-button {
	display: inline-block;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* ---------------------------------------------------------------------
 * Responsive — stack the columns.
 * The prefix class (idcw-stack-tablet / idcw-stack-mobile) is added by the
 * "Stack Columns On" control. Default breakpoints match Elementor's.
 * ------------------------------------------------------------------- */

/* Tablet & mobile (<= 1024px) */
@media (max-width: 1024px) {
	.idcw-stack-tablet .idcw-carousel {
		flex-direction: column;
	}

	.idcw-stack-tablet .idcw-image-col,
	.idcw-stack-tablet .idcw-text-col {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.idcw-stack-tablet .idcw-text-col {
		margin-top: 24px;
	}
}

/* Mobile only (<= 767px) */
@media (max-width: 767px) {
	.idcw-stack-mobile .idcw-carousel {
		flex-direction: column;
	}

	.idcw-stack-mobile .idcw-image-col,
	.idcw-stack-mobile .idcw-text-col {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.idcw-stack-mobile .idcw-text-col {
		margin-top: 24px;
	}

	/* Smaller default thumbnails on very small screens. */
	.idcw-thumbs {
		justify-content: center;
	}
}
