/**
 * IO Widget – Posts Spotlight 1.2.5
 * RTL: list on the right, image on the left
 */

.io-ps {
	--io-ps-img-w: 48%;
	--io-ps-gap: 28px;
	--io-ps-img-h: 420px;
	display: flex;
	flex-direction: row; /* image left, list right in LTR box; with direction:rtl list is first visually on right */
	direction: rtl;
	align-items: stretch;
	gap: var(--io-ps-gap);
	width: 100%;
	box-sizing: border-box;
}

.io-ps *,
.io-ps *::before,
.io-ps *::after {
	box-sizing: border-box;
}

/* In RTL flex, first DOM child (image) appears on the RIGHT unless we reorder.
   User wants: RIGHT = list, LEFT = image.
   DOM order: image-col first, list-col second.
   With direction:rtl → first item goes to the right. So swap DOM visual with order. */
.io-ps__image-col {
	flex: 0 0 var(--io-ps-img-w);
	width: var(--io-ps-img-w);
	max-width: var(--io-ps-img-w);
	order: 2; /* left side visually in RTL */
}

.io-ps__list-col {
	flex: 1 1 auto;
	min-width: 0;
	order: 1; /* right side visually in RTL */
}

.io-ps__media {
	position: relative;
	width: 100%;
	height: var(--io-ps-img-h);
	overflow: hidden;
	border-radius: 16px;
	background: #E5E7EB;
}

.io-ps__slide {
	position: absolute;
	inset: 0;
	display: block;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	text-decoration: none;
	transition: opacity 0.55s ease, transform 0.55s ease, visibility 0.55s;
}

.io-ps__slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 1;
}

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

.io-ps__noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #9CA3AF;
	font-size: 14px;
	background: #F3F4F6;
}

/* effects */
.io-ps--effect-fade-scale .io-ps__slide {
	transform: scale(1.06);
}
.io-ps--effect-fade-scale .io-ps__slide.is-active {
	transform: scale(1);
}

.io-ps--effect-slide .io-ps__slide {
	transform: translateX(-24px);
}
.io-ps--effect-slide .io-ps__slide.is-active {
	transform: translateX(0);
}

.io-ps__list {
	list-style: none;
	margin: 0;
	padding: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.io-ps__item {
	padding: 18px 12px 18px 8px;
	border-bottom: 1px solid #E5E7EB;
	border-right: 3px solid transparent;
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease;
}

.io-ps__item:last-child {
	border-bottom: none;
}

.io-ps__item.is-active,
.io-ps__item:hover {
	background-color: rgba(59, 130, 246, 0.06);
}

.io-ps__item.is-active {
	border-right-color: #3B82F6;
}

.io-ps__title {
	display: block;
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.45;
	color: #1A1A2E;
	text-decoration: none;
	transition: color 0.2s ease;
}

.io-ps__item:hover .io-ps__title,
.io-ps__item.is-active .io-ps__title {
	color: #3B82F6;
}

.io-ps__excerpt {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.7;
	color: #6B7280;
}

/* meta: date RIGHT, more LEFT (RTL: flex with space-between keeps date at start=right) */
.io-ps__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	direction: rtl;
}

.io-ps__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #9CA3AF;
	line-height: 1;
}

.io-ps__date-icon,
.io-ps__more-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	line-height: 1;
	flex: 0 0 auto;
}

.io-ps__date-icon img,
.io-ps__more-icon img,
.io-ps__date-icon svg,
.io-ps__more-icon svg {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.io-ps__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #3B82F6;
	text-decoration: none;
	line-height: 1;
	transition: color 0.2s ease, transform 0.2s ease;
}

.io-ps__more:hover {
	color: #1D4ED8;
}

.io-ps__more:hover .io-ps__more-icon {
	transform: translateX(-3px);
}

.io-ps__more-icon {
	transition: transform 0.2s ease;
}

.io-ps-empty {
	padding: 24px;
	text-align: center;
	color: #9CA3AF;
}

/* Mobile: image on top, list below */
@media (max-width: 991px) {
	.io-ps {
		flex-direction: column;
		direction: rtl;
	}

	.io-ps__image-col,
	.io-ps__list-col {
		order: unset;
		flex: 1 1 auto;
		width: 100%;
		max-width: 100%;
	}

	.io-ps {
		--io-ps-img-h: 260px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.io-ps__slide {
		transition: none;
	}
}

/* Prevent Elementor entrance animation from hiding widget permanently */
.elementor-widget-io-posts-spotlight.elementor-invisible {
	visibility: visible !important;
	opacity: 1 !important;
}
