/* ===========================
   Lightbox Gallery - Frontend
   =========================== */

.lbg-gallery {
	--lbg-columns: 3;
	display: grid;
	grid-template-columns: repeat(var(--lbg-columns), minmax(0, var(--lbg-thumb-width, 1fr)));
	gap: 12px;
	margin: 1.5em 0;
}

@media (max-width: 782px) {
	.lbg-gallery {
		grid-template-columns: repeat(2, minmax(0, var(--lbg-thumb-width, 1fr)));
	}
}

@media (max-width: 480px) {
	.lbg-gallery {
		grid-template-columns: repeat(1, minmax(0, var(--lbg-thumb-width, 1fr)));
	}
}

.lbg-item {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 8px;
	background: #f0f0f0;
	aspect-ratio: 1 / 1;
	height: var(--lbg-thumb-height, auto);
	cursor: zoom-in;
	text-decoration: none;
}

.lbg-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

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

.lbg-item .lbg-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 8px 10px;
	font-size: 13px;
	line-height: 1.3;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.lbg-item:hover .lbg-caption {
	opacity: 1;
	transform: translateY(0);
}

.lbg-empty {
	color: #888;
	font-style: italic;
}

/* rows parametresi ile sınırlandığında görünmeyen kutucuklar (yine de DOM'da kalır,
   böylece lightbox içinde gezinme tüm görseller arasında çalışmaya devam eder). */
.lbg-item-hidden {
	display: none;
}

/* Son görünür kutucuktaki "+N daha" rozeti. */
.lbg-more-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 22px;
	font-weight: 600;
	letter-spacing: 0.02em;
	transition: background 0.2s ease;
}

.lbg-item:hover .lbg-more-overlay {
	background: rgba(0, 0, 0, 0.7);
}

/* ===========================
   Lightbox Overlay
   =========================== */

.lbg-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(10, 10, 10, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.lbg-overlay.lbg-open {
	display: flex;
	opacity: 1;
}

.lbg-content {
	position: relative;
	max-width: 90vw;
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.lbg-content img {
	max-width: 90vw;
	max-height: 78vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(0.97);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.lbg-content img.lbg-visible {
	opacity: 1;
	transform: scale(1);
}

.lbg-caption-text {
	color: #eee;
	font-size: 14px;
	margin-top: 12px;
	max-width: 70vw;
}

.lbg-counter {
	color: #999;
	font-size: 12px;
	margin-top: 6px;
	letter-spacing: 0.03em;
}

.lbg-close,
.lbg-nav {
	position: absolute;
	background: rgba(255, 255, 255, 0.08);
	border: none;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 20px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.lbg-close:hover,
.lbg-nav:hover {
	background: rgba(255, 255, 255, 0.2);
}

.lbg-close {
	top: 20px;
	right: 20px;
	font-size: 28px;
}

.lbg-prev {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.lbg-next {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}

@media (max-width: 600px) {
	.lbg-close {
		top: 10px;
		right: 10px;
		width: 38px;
		height: 38px;
	}
	.lbg-prev {
		left: 6px;
	}
	.lbg-next {
		right: 6px;
	}
	.lbg-nav {
		width: 38px;
		height: 38px;
	}
}

body.lbg-noscroll {
	overflow: hidden;
}
