/* ============================================================
   EXAT Post Tabs Slider — BEM Component
   Scope: .exat-post-tabs-slider
   ============================================================ */

[x-cloak] { display: none !important; }

/* Swiper core CSS (fallback for Elementor editor iframe) */
.exat-post-tabs-slider .swiper {
	display: flex;
	flex-direction: column;
	margin-left: auto;
	margin-right: auto;
	position: relative;
	list-style: none;
	padding: 0;
	z-index: 1;
}

.exat-post-tabs-slider .swiper-wrapper {
	box-sizing: content-box;
	display: flex;
	height: 100%;
	position: relative;
	transition-property: transform;
	width: 100%;
	z-index: 1;
}

.exat-post-tabs-slider .swiper-slide {
	flex-shrink: 0;
	height: 100%;
	position: relative;
	transition-property: transform;
	width: 100%;
}

.exat-post-tabs-slider {
	width: 100%;
}

/* ── Tabs row ───────────────────────────────────────────── */
.exat-post-tabs-slider__tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	margin-bottom: 1.75rem;
	overflow-x: auto;
	scrollbar-width: none;
}

.exat-post-tabs-slider__tabs::-webkit-scrollbar {
	display: none;
}

.exat-post-tabs-slider__tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: 0.75rem 0.25rem;
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	color: #6b7280;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.exat-post-tabs-slider__tab:hover {
	color: var(--primary, #1d4ed8);
}

.exat-post-tabs-slider__tab.is-active {
	color: var(--primary, #1d4ed8);
	border-bottom-color: var(--primary, #1d4ed8);
	font-weight: 600;
}

.exat-post-tabs-slider__tab:focus-visible {
	outline: 2px solid var(--primary, #1d4ed8);
	outline-offset: 4px;
	border-radius: 4px;
}

/* ── Panels ─────────────────────────────────────────────── */
.exat-post-tabs-slider__panels {
	position: relative;
}

.exat-post-tabs-slider__panel {
	width: 100%;
}

/* ── Swiper container ───────────────────────────────────── */
.exat-post-tabs-slider__swiper {
	padding-bottom: 2.5rem; /* room for pagination */
}

/* Ensure slides display in a row before Swiper JS initializes */
.exat-post-tabs-slider__swiper .swiper-wrapper {
	/* Swiper.js will handle display and spacing internally */
}

.exat-post-tabs-slider__swiper .swiper-slide {
	flex: 0 0 auto;
	width: calc(33.333% - 16px); /* Default 3 columns with gap */
}

@media (max-width: 1023px) {
	.exat-post-tabs-slider__swiper .swiper-slide {
		width: calc(50% - 12px); /* Tablet: 2 columns */
	}
}

@media (max-width: 767px) {
	.exat-post-tabs-slider__swiper .swiper-slide {
		width: 100%; /* Mobile: 1 column */
	}
}

/* ── Card ───────────────────────────────────────────────── */
.exat-post-tabs-slider__slide {
	height: auto;
}

.exat-post-tabs-slider__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none !important;
	transition: transform 0.25s ease;
}

.exat-post-tabs-slider__card:hover {
	transform: translateY(-2px);
}

/* ── Image ──────────────────────────────────────────────── */
.exat-post-tabs-slider__image {
	position: relative;
	width: 100%;
	aspect-ratio: 4/3;
	height: var(--exat-image-height, auto);
	background-color: #f3f4f6;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	border-radius: 16px;
	overflow: hidden;
}

.exat-post-tabs-slider__image-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e5e7eb 0%, #f9fafb 100%);
}

/* ── Body ───────────────────────────────────────────────── */
.exat-post-tabs-slider__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem 0.25rem 0;
}

.exat-post-tabs-slider__date {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: #6b7280;
	font-size: 0.8125rem;
	line-height: 1.2;
}

.exat-post-tabs-slider__date-icon {
	flex-shrink: 0;
}

.exat-post-tabs-slider__title {
	margin: 0 !important;
	color: #111827;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.exat-post-tabs-slider__card:hover .exat-post-tabs-slider__title {
	color: var(--primary, #1d4ed8);
}

/* ── Pagination ─────────────────────────────────────────── */
.exat-post-tabs-slider .swiper-pagination,
.exat-post-tabs-slider__pagination {
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center; /* Overridden by CSS variable */
	gap: var(--exat-pagination-gap, 6px);
	position: relative;
	left: 0;
	right: 0;
	padding-top: var(--exat-pagination-padding-top, 35px);
}

.exat-post-tabs-slider .swiper-pagination-bullet {
	width: var(--exat-pagination-bullet-size, 8px);
	height: var(--exat-pagination-bullet-size, 8px);
	background: var(--exat-pagination-bullet-color, #d1d5db);
	opacity: 1;
	border-radius: 9999px;
	transition: width 0.3s ease, background 0.3s ease;
}

.exat-post-tabs-slider .swiper-pagination-bullet-active {
	background: var(--exat-pagination-bullet-active-color, var(--primary, #1d4ed8));
	width: var(--exat-pagination-bullet-active-width, 28px);
}

/* ── Empty state ────────────────────────────────────────── */
.exat-post-tabs-slider__empty {
	padding: 3rem 1rem;
	text-align: center;
	color: #6b7280;
	font-size: 0.95rem;
}

/* ── Mobile Toggle Button & Bottom Sheet Popup ─────────── */
.exat-post-tabs-slider__mobile-toggle {
	padding-bottom: 1.25rem;
}

.exat-post-tabs-slider__toggle-btn {
	cursor: pointer;
}

.exat-post-tabs-slider__mobile-popup {
	pointer-events: auto;
}

.exat-post-tabs-slider__mobile-tab {
	cursor: pointer;
	transition: all 0.2s ease;
}

.exat-post-tabs-slider__mobile-tab:active {
	transform: scale(0.98);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 767px) {
	.exat-post-tabs-slider__tabs {
		display: none;
	}

	.exat-post-tabs-slider__tab {
		font-size: 0.9375rem;
	}

	.exat-post-tabs-slider__image {
		height: 200px;
	}

	.exat-post-tabs-slider__title {
		font-size: 1rem;
	}

	.exat-post-tabs-slider .swiper-pagination,
	.exat-post-tabs-slider__pagination {
		padding-top: var(--exat-pagination-padding-top, 70px);
	}
}
