/* ── Portfolio Carousel ── */
.wbp-carousel {
	position: relative;
	width: 100%;
	direction: rtl;
	box-sizing: border-box;
	padding: 0;
	overflow: visible;
	--wbp-mobile-visible: 1.5;
	--wbp-mobile-gap: 12px;
}

.wbp-carousel-desktop {
	display: block;
	width: 100%;
}

.wbp-carousel-mobile {
	display: none;
	width: 100%;
}

.wbp-carousel-viewport {
	overflow: hidden;
	width: 100%;
	direction: ltr;
}

.wbp-carousel-track {
	display: flex;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.wbp-carousel-slide {
	flex: 0 0 100%;
	width: 100%;
	min-width: 100%;
	box-sizing: border-box;
	direction: rtl;
}

.wbp-carousel-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 70px;
	height: 70px;
	padding: 0;
	border-radius: 50%;
	border: 1.5px solid #c5a059;
	background: #ffffff;
	color: #c5a059;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.wbp-carousel-prev {
	left: auto;
	right: 100%;
	margin-right: 16px;
}

.wbp-carousel-next {
	right: auto;
	left: 100%;
	margin-left: 16px;
}

.wbp-carousel-btn svg {
	display: block;
	width: 28px;
	height: 28px;
	pointer-events: none;
}

.wbp-carousel-btn:hover,
.wbp-carousel-btn:focus-visible {
	background: #c5a059;
	color: #ffffff;
	outline: none;
	box-shadow: 0 4px 14px rgba(197, 160, 89, 0.28);
}

.wbp-carousel-btn:active {
	transform: translateY(-50%) scale(0.94);
}

.wbp-carousel-btn.is-disabled,
.wbp-carousel-btn:disabled {
	opacity: 0.35;
	pointer-events: none;
	box-shadow: none;
}

@media (max-width: 1200px) {
	.wbp-carousel-prev { margin-right: 8px; }
	.wbp-carousel-next { margin-left: 8px; }
}

@media (max-width: 992px) {
	.wbp-carousel-btn {
		width: 56px;
		height: 56px;
	}

	.wbp-carousel-btn svg {
		width: 22px;
		height: 22px;
	}

	.wbp-carousel-prev {
		right: 100%;
		margin-right: 6px;
	}

	.wbp-carousel-next {
		left: 100%;
		margin-left: 6px;
	}
}

/* موبایل: اسکرول افقی روان + تعداد باکس از تنظیمات */
@media (max-width: 768px) {
	.wbp-carousel-desktop {
		display: none !important;
	}

	.wbp-carousel-mobile {
		display: block;
	}

	.wbp-carousel-btn {
		display: none;
	}

	.wbp-mobile-scroller {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		gap: var(--wbp-mobile-gap);
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		-webkit-overflow-scrolling: touch;
		padding: 4px 2px 14px;
		scrollbar-width: none;
		direction: rtl;
	}

	.wbp-mobile-scroller::-webkit-scrollbar {
		display: none;
	}

	.wbp-mobile-scroller .wbp-card {
		flex: 0 0 calc((62% - (var(--wbp-mobile-gap) * (var(--wbp-mobile-visible) - 1))) / var(--wbp-mobile-visible));
		width: calc((100% - (var(--wbp-mobile-gap) * (var(--wbp-mobile-visible) - 1))) / var(--wbp-mobile-visible));
		max-width: none;
		scroll-snap-align: start;
		border-radius: 10px;
	}

	.wbp-mobile-scroller .wbp-card-image {
		aspect-ratio: unset;
	}

	.wbp-mobile-scroller .wbp-card-title {
		padding: 2px 6px;
		min-height: unset;
		height: 32px;
	}

	.wbp-mobile-scroller .wbp-card-title span {
		font-size: 13px;
	}
}

/* ── Portfolio Grid ── */
.wbp-grid {
	display: grid;
	gap: 28px;
	width: 100%;
	direction: rtl;
	box-sizing: border-box;
}

.wbp-cols-1 { grid-template-columns: 1fr; }
.wbp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wbp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wbp-cols-4 { grid-template-columns: repeat(4, 1fr); }
.wbp-cols-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1200px) {
	.wbp-cols-5 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
	.wbp-cols-5,
	.wbp-cols-4,
	.wbp-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
	.wbp-cols-5,
	.wbp-cols-4,
	.wbp-cols-3,
	.wbp-cols-2 { grid-template-columns: 1fr; }
	.wbp-grid { gap: 20px; }
}

/* ── Card ── */
.wbp-card {
	display: flex;
	flex-direction: column;
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	max-width: 100%;
}

.wbp-card:hover,
.wbp-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

/* تصویر مربع ۲۱۵×۲۱۵ — بدون برش نامتناسب */
.wbp-card-image {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f3f4f6;
}

.wbp-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.wbp-card:hover .wbp-card-image img {
	transform: scale(1.03);
}

.wbp-card-title {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 8px;
	background: #fff;
	min-height: 42px;
	box-sizing: border-box;
}

.wbp-card-title span {
	font-family: "IRANSansX", "IRANSans", "Vazirmatn", "Tahoma", sans-serif;
	font-size: 19px;
	font-weight: 700;
	color: #1E498C;
	text-align: center;
	line-height: 1.5;
}

/* ── Archive page wrapper ── */
.wbp-archive-page {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: calc(100vh - 280px);
	box-sizing: border-box;
}

.wbp-archive-page .wbp-pagination {
	margin-top: auto;
	padding-top: 56px;
	padding-bottom: 32px;
}

/* ── Archive cards (dark style) ── */
.wbp-archive {
	width: 100%;
	direction: rtl;
	box-sizing: border-box;
	position: relative;
	margin-top: -3rem;
	z-index: 2;
}

.wbp-archive-card {
	display: flex;
	flex-direction: column;
	background: #31425BD9;
	border-radius: 22px;
	overflow: hidden;
	cursor: pointer;
	padding: 14px 14px 18px;
	box-sizing: border-box;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	height: 351px;
	border: 1px solid #E8E3DB66;
}

.wbp-archive-card:hover,
.wbp-archive-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

.wbp-archive-card-image {
	height: 74%;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 14px;
	overflow: hidden;
	background: #1e2636;
}

.wbp-archive-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.wbp-archive-card:hover .wbp-archive-card-image img {
	transform: scale(1.04);
}

.wbp-archive-card-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 16px 8px 4px;
	gap: 8px;
}

.wbp-archive-card-title {
	margin: 0;
	font-family: "IRANSansX", "IRANSans", "Vazirmatn", "Tahoma", sans-serif;
	font-size: 21px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.5;
}

.wbp-archive-card-link {
	font-family: "IRANSansX", "IRANSans", "Vazirmatn", "Tahoma", sans-serif;
	font-size: 16px;
	font-weight: 500;
	color: #c5a059;
	line-height: 1.4;
}

.wbp-empty {
	text-align: center;
	color: #64748b;
	padding: 40px 20px;
	font-family: "IRANSansX", "IRANSans", "Vazirmatn", "Tahoma", sans-serif;
}

/* ── Pagination ── */
.wbp-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 36px;
	direction: rtl;
	flex-wrap: wrap;
}

.wbp-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	background: #fff;
	color: #1E498C;
	text-decoration: none;
	font-family: "IRANSansX", "IRANSans", "Vazirmatn", "Tahoma", sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
	transition: background 0.2s, color 0.2s;
}

.wbp-pagination .page-numbers:hover,
.wbp-pagination .page-numbers.current {
	background: #1E498C;
	color: #fff;
}

/* ── Modal (clean white lightbox) ── */
.wbp-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483646 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
	isolation: isolate;
}

.wbp-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.wbp-modal-backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.wbp-modal-dialog {
	position: relative;
	z-index: 2;
	width: min(720px, 100%);
	max-height: calc(100vh - 64px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 24px;
	box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
	direction: rtl;
	transform: translateY(18px) scale(0.98);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wbp-modal.is-open .wbp-modal-dialog {
	transform: translateY(0) scale(1);
}

.wbp-modal-close {
	position: absolute;
	top: 14px;
	left: 14px;
	right: auto;
	width: 40px;
	height: 40px;
	border: 1px solid #e5e7eb;
	border-radius: 50%;
	background: #ffffff;
	color: #1E498C;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
	z-index: 5;
	padding: 0;
}

.wbp-modal-close:hover {
	background: #1E498C;
	border-color: #1E498C;
	color: #fff;
}

.wbp-modal-stage {
	position: relative;
	background: #f8fafc;
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px 64px;
	box-sizing: border-box;
	flex: 1 1 auto;
}

.wbp-slider-track {
	width: 100%;
	max-height: min(58vh, 520px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wbp-slider-img {
	display: block;
	max-width: 100%;
	max-height: min(58vh, 520px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	opacity: 1;
	transition: opacity 0.22s ease;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.wbp-slider-img.is-fading {
	opacity: 0;
}

.wbp-modal-stage .wbp-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	border: 1.5px solid #c5a059;
	background: #ffffff;
	color: #c5a059;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
	transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.wbp-modal-stage .wbp-prev {
	left: 14px;
	right: auto;
}

.wbp-modal-stage .wbp-next {
	right: 14px;
	left: auto;
}

.wbp-modal-stage .wbp-nav:hover {
	background: #c5a059;
	color: #fff;
	box-shadow: 0 4px 14px rgba(197, 160, 89, 0.28);
}

.wbp-modal-stage .wbp-nav:active {
	transform: translateY(-50%) scale(0.94);
}

.wbp-modal-stage .wbp-nav.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.wbp-modal-footer {
	padding: 18px 24px 22px;
	background: #fff;
	border-top: 1px solid #f1f5f9;
	text-align: center;
	flex-shrink: 0;
}

.wbp-modal-title {
	margin: 0 0 14px;
	padding: 0 36px;
	font-family: "IRANSansX", "IRANSans", "Vazirmatn", "Tahoma", sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
	color: #1E498C;
	text-align: center;
	line-height: 1.5;
}

.wbp-thumbs {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.wbp-thumbs:empty {
	display: none;
	margin: 0;
}

.wbp-thumb {
	width: 52px;
	height: 52px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	background: #f1f5f9;
	opacity: 0.65;
	transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}

.wbp-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wbp-thumb:hover {
	opacity: 1;
}

.wbp-thumb.is-active {
	opacity: 1;
	border-color: #c5a059;
	transform: translateY(-1px);
}

.wbp-counter {
	font-family: "IRANSansX", "IRANSans", "Vazirmatn", "Tahoma", sans-serif;
	font-size: 0.8rem;
	color: #94a3b8;
	font-weight: 500;
}

/* مودال موبایل — ساده، سفید، وسط صفحه */
@media (max-width: 768px) {
	.wbp-modal {
		padding: 24px 16px;
		align-items: center;
		justify-content: center;
	}

	.wbp-modal-backdrop {
		background: rgba(255, 255, 255, 0.92);
		backdrop-filter: blur(4px);
		-webkit-backdrop-filter: blur(4px);
	}

	.wbp-modal-dialog {
		width: 100%;
		max-width: 420px;
		max-height: calc(100vh - 48px);
		border-radius: 16px;
		transform: scale(0.96);
		box-shadow: 0 12px 48px rgba(15, 23, 42, 0.1);
		border: 1px solid #f1f5f9;
	}

	.wbp-modal.is-open .wbp-modal-dialog {
		transform: scale(1);
	}

	.wbp-modal-close {
		top: 12px;
		left: 12px;
		width: 34px;
		height: 34px;
		background: #fff;
		border-color: #e5e7eb;
		box-shadow: none;
	}

	.wbp-modal-stage {
		background: #ffffff;
		padding: 44px 40px 12px;
		min-height: 0;
	}

	.wbp-slider-track {
		max-height: 50vh;
	}

	.wbp-slider-img {
		max-height: 50vh;
		border-radius: 8px;
		box-shadow: none;
	}

	.wbp-modal-stage .wbp-nav {
		width: 34px;
		height: 34px;
		border-color: #e5e7eb;
		color: #64748b;
		background: #fff;
	}

	.wbp-modal-stage .wbp-nav:hover {
		background: #f8fafc;
		color: #1E498C;
		box-shadow: none;
	}

	.wbp-modal-stage .wbp-prev { left: 10px; }
	.wbp-modal-stage .wbp-next { right: 10px; }

	.wbp-modal-footer {
		padding: 14px 16px 18px;
		border-top: 1px solid #f1f5f9;
	}

	.wbp-modal-title {
		font-size: 0.9rem;
		margin-bottom: 8px;
		padding: 0 28px;
		color: #334155;
	}

	.wbp-thumbs {
		gap: 6px;
		margin-bottom: 6px;
		max-height: 48px;
		overflow-x: auto;
		flex-wrap: nowrap;
		justify-content: center;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 0;
	}

	.wbp-thumbs::-webkit-scrollbar {
		display: none;
	}

	.wbp-thumb {
		width: 36px;
		height: 36px;
		flex: 0 0 36px;
		border-radius: 6px;
		border-color: #e5e7eb;
	}

	.wbp-thumb.is-active {
		border-color: #c5a059;
	}

	.wbp-counter {
		font-size: 0.72rem;
		color: #cbd5e1;
	}
}

@media (max-width: 768px) {
	.wbp-archive {
		position: relative;
		top: auto;
		margin-top: 0;
	}

	.wbp-archive .wbp-grid,
	.wbp-archive .wbp-cols-5,
	.wbp-archive .wbp-cols-4,
	.wbp-archive .wbp-cols-3,
	.wbp-archive .wbp-cols-2 {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 10px;
		overflow: visible;
		flex-wrap: unset;
		padding: 0;
	}

	.wbp-archive .wbp-archive-card {
		flex: none;
		max-width: none;
		width: 100%;
		height: 169px;
		min-height: 169px;
		padding: 8px 8px 10px;
		border-radius: 14px;
	}

	.wbp-archive-card-image {
		flex: 1;
		height: auto;
		min-height: 0;
		aspect-ratio: unset;
		border-radius: 10px;
	}

	.wbp-archive-card-body {
		padding: 6px 2px 0;
		gap: 2px;
		flex-shrink: 0;
	}

	.wbp-archive-card-title {
		font-size: 11px;
		line-height: 1.35;
	}

	.wbp-archive-card-link {
		display: block;
		font-size: 9px;
		line-height: 1.2;
	}
}

@media (max-width: 576px) {
	.wbp-archive-page {
		min-height: calc(100vh - 220px);
	}

	.wbp-archive-page .wbp-pagination {
		padding-top: 40px;
		padding-bottom: 24px;
	}

	.wbp-card-title span {
		font-size: 14px;
	}

	.wbp-card-title {
		padding: 12px 10px;
		min-height: 48px;
	}

	.wbp-card {
		border-radius: 22px;
	}

	.wbp-archive .wbp-grid {
		gap: 8px;
	}

	.wbp-archive .wbp-archive-card {
		height: 169px;
		min-height: 169px;
		padding: 6px 6px 8px;
		border-radius: 12px;
	}

	.wbp-archive-card-title {
		font-size: 12px;
	}

	.wbp-archive-card-link {
		font-size: 9px;
	}
}

body.wbp-modal-open {
	overflow: hidden !important;
	touch-action: none;
}
