/* ================================================================
   Image Slider Block — frontend + editor styles
   ================================================================ */

/* ---- Figure wrapper ---- */
.imo-image-slider-figure {
	margin: 1.5rem 0;
}

/* ---- Slider container ---- */
.imo-image-slider {
	width: 100%;
	outline: none;
}

/* ---- Main image area ---- */
.imo-image-slider__main {
	position: relative;
	width: 100%;
	background: var(--color-surface-alt, #f5f5f5);
	border-radius: 6px 6px 0 0;
	overflow: hidden;
	/* CSS fallback; JS overwrites with the actual image's ratio */
	aspect-ratio: 4 / 3;
}

.imo-image-slider__slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center top;
	opacity: 0;
	transition: opacity 0.35s ease;
	display: block;
	pointer-events: none;
}

.imo-image-slider__slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* ---- Active slide title ---- */
.imo-image-slider__slide-title {
	margin: 0.5rem 0 0;
	padding: 0 2px;
	font-family: var(--font-body, sans-serif);
	font-size: 1rem;
	line-height: 1.4;
	color: var(--color-text, #222);
	text-align: center;
}

/* ---- Thumbnail grid — columns set inline via render.php ---- */
.imo-image-slider__thumbs {
	display: grid;
	gap: 4px;
	padding: 6px 0 4px;
	border-top: 1px solid var(--color-border, #e0e0e0);
	background: var(--color-surface, #fff);
	border-radius: 0 0 6px 6px;
}

/* ---- Individual thumbnail ---- */
.imo-image-slider__thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 3px 3px 5px;
	border: 2px solid transparent;
	border-radius: 4px;
	background: none;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	min-width: 0;
}

.imo-image-slider__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 3px;
	pointer-events: none;
}

.imo-image-slider__thumb-title {
	font-family: var(--font-body, sans-serif);
	font-size: 0.625rem;
	line-height: 1.3;
	color: var(--color-text-muted, #777);
	text-align: center;
	word-break: break-word;
	hyphens: auto;
	width: 100%;
}

.imo-image-slider__thumb:hover {
	border-color: var(--color-border, #c8c8c8);
	background: var(--color-surface-alt, #f5f5f5);
}

.imo-image-slider__thumb.is-active {
	border-color: var(--color-heading-blue, #5396FB);
	background: rgba(83, 150, 251, 0.06);
}

.imo-image-slider__thumb.is-active .imo-image-slider__thumb-title {
	color: var(--color-heading-blue, #5396FB);
}

/* ---- Caption (handled by theme's figcaption styles) ---- */
.imo-image-slider-figure > figcaption {
	margin-top: 0.5rem;
}

/* ================================================================
   Dark theme
   ================================================================ */
html[data-theme="dark"] .imo-image-slider__slide-title {
	color: #c8d0da;
}

html[data-theme="dark"] .imo-image-slider__main {
	background: #1a1f28;
}
html[data-theme="dark"] .imo-image-slider__thumbs {
	background: #1e2530;
	border-top-color: #3a3f4a;
}
html[data-theme="dark"] .imo-image-slider__thumb:hover {
	background: #252c38;
	border-color: #4a5060;
}
html[data-theme="dark"] .imo-image-slider__thumb.is-active {
	background: rgba(83, 150, 251, 0.12);
	border-color: #5396FB;
}
html[data-theme="dark"] .imo-image-slider__thumb-title {
	color: #8898aa;
}

/* ================================================================
   Dim theme
   ================================================================ */
html[data-theme="dim"] .imo-image-slider__slide-title {
	color: #3a3228;
}

html[data-theme="dim"] .imo-image-slider__main {
	background: #e8e0d0;
}
html[data-theme="dim"] .imo-image-slider__thumbs {
	background: #f0e8d8;
	border-top-color: #c8c0b0;
}
html[data-theme="dim"] .imo-image-slider__thumb.is-active {
	border-color: #4a7fc7;
	background: rgba(74, 127, 199, 0.08);
}

/* ================================================================
   Block editor preview
   ================================================================ */
.imo-image-slider-editor {
	border: 1px dashed #ccc;
	border-radius: 8px;
	padding: 12px;
	background: #fafafa;
}

.imo-image-slider-editor__placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 140px;
	background: #f0f0f0;
	border-radius: 8px;
	color: #888;
	cursor: pointer;
	transition: background 0.15s;
	border: 2px dashed #ccc;
}

.imo-image-slider-editor__placeholder:hover {
	background: #e8e8e8;
	border-color: #999;
}

.imo-image-slider-editor__placeholder .dashicons {
	font-size: 36px;
	width: 36px;
	height: 36px;
	margin-bottom: 8px;
}

.imo-image-slider-editor__placeholder p {
	margin: 0;
	font-size: 13px;
}

.imo-image-slider-editor__main {
	width: 100%;
	background: #f0f0f0;
	border-radius: 4px 4px 0 0;
	overflow: hidden;
}

.imo-image-slider-editor__active-img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 480px;
	object-fit: contain;
	object-position: center top;
}

.imo-image-slider-editor__thumbs {
	display: grid;
	gap: 4px;
	padding: 6px 0 4px;
	border-top: 1px solid #ddd;
	background: #fff;
	border-radius: 0 0 4px 4px;
	margin-bottom: 8px;
}

.imo-image-slider-editor__thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 3px 3px 5px;
	border: 2px solid transparent;
	border-radius: 4px;
	background: none;
	cursor: pointer;
	transition: border-color 0.12s;
	min-width: 0;
}

.imo-image-slider-editor__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 3px;
	pointer-events: none;
}

.imo-image-slider-editor__thumb-title {
	font-size: 0.625rem;
	color: #777;
	text-align: center;
	word-break: break-word;
	width: 100%;
	line-height: 1.3;
}

.imo-image-slider-editor__thumb.is-active {
	border-color: #5396FB;
}

.imo-image-slider-editor__caption {
	font-size: 0.875rem;
	color: #555;
	font-style: italic;
	text-align: center;
	margin-top: 4px;
}
