/* ===== Tutx Gallery Portfolio — Frontend ===== */

.tutx-gallery-grid {
	--tutx-tile-height: 300px;
	--tutx-tile-min: 300px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--tutx-tile-min), 1fr));
	grid-auto-rows: var(--tutx-tile-height);
	gap: 20px;
	width: 100%;
	direction: rtl;
}

.tutx-gallery-item {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	background: #111;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transform: translateZ(0);
}

.tutx-gallery-item img {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.tutx-gallery-item:hover img {
	transform: scale(1.06);
}

/* الستارة عند الهوفر */
.tutx-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, rgba(59, 38, 22, 0.25) 0%, rgba(40, 23, 12, 0.82) 100%);
	opacity: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.35s ease;
}

.tutx-gallery-item:hover .tutx-overlay {
	opacity: 1;
}

.tutx-plus {
	width: 40px;
	height: 40px;
	border: 3px solid #fff;
	border-radius: 50%;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: scale(0.6);
	opacity: 0;
	transition: transform 0.35s ease, opacity 0.35s ease;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.tutx-gallery-item:hover .tutx-plus {
	transform: scale(1);
	opacity: 1;
}

/* الاسم والقسم تحت كل صورة */
.tutx-caption {
	position: absolute;
	z-index: 2;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 16px 18px 14px;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
	text-align: right;
	transform: translateY(8px);
	transition: transform 0.35s ease;
}

.tutx-gallery-item:hover .tutx-caption {
	transform: translateY(0);
}

.tutx-caption h4 {
	margin: 0 0 3px;
	font-size: 16px;
	font-weight: 700;
	color: #ffffff !important;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.tutx-caption span {
	font-size: 12px;
	color: #ffffff !important;
	opacity: 0.9;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

/* ===== Responsive ===== */
/* الشبكة بتتكيف تلقائي (auto-fill) حسب عرض الشاشة والحد الأدنى المحدد من الإعدادات */
@media (max-width: 576px) {
	.tutx-gallery-grid {
		grid-template-columns: 1fr;
	}
	.tutx-plus {
		width: 34px;
		height: 34px;
		font-size: 16px;
		border-width: 2.5px;
	}
}

/* ===== Lightbox ===== */
.tutx-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(15, 10, 6, 0.94);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.tutx-lightbox.active {
	display: flex;
	opacity: 1;
}

.tutx-lb-content {
	max-width: 90vw;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.tutx-lb-image {
	max-width: 90vw;
	max-height: 75vh;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(0.97);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.tutx-lb-image.show {
	opacity: 1;
	transform: scale(1);
}

.tutx-lb-caption {
	color: #fff;
	text-align: center;
	margin-top: 14px;
}

.tutx-lb-title {
	margin: 0 0 4px;
	font-size: 17px;
}

.tutx-lb-cat {
	font-size: 13px;
	opacity: 0.75;
	margin-inline-end: 10px;
}

.tutx-lb-counter {
	font-size: 12px;
	opacity: 0.6;
}

.tutx-lb-close,
.tutx-lb-prev,
.tutx-lb-next {
	position: absolute;
	color: #fff;
	cursor: pointer;
	user-select: none;
	transition: opacity 0.2s ease;
	opacity: 0.75;
}

.tutx-lb-close:hover,
.tutx-lb-prev:hover,
.tutx-lb-next:hover {
	opacity: 1;
}

.tutx-lb-close {
	top: 22px;
	left: 28px;
	font-size: 34px;
	line-height: 1;
}

.tutx-lb-prev,
.tutx-lb-next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 26px;
	padding: 10px 14px;
}

.tutx-lb-prev {
	right: 18px;
}

.tutx-lb-next {
	left: 18px;
}

@media (max-width: 576px) {
	.tutx-lb-prev,
	.tutx-lb-next {
		font-size: 18px;
		padding: 8px 10px;
	}
	.tutx-lb-close {
		top: 14px;
		left: 16px;
		font-size: 28px;
	}
}
