/**
 * TEC Gallery Lightbox – Styles
 * Lightweight, responsive lightbox for WordPress galleries.
 */

/* ── Overlay ─────────────────────────────────────────────── */
.tec-glb-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.92);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.tec-glb-overlay.tec-glb-active {
	opacity: 1;
	visibility: visible;
}

/* ── Image container ─────────────────────────────────────── */
.tec-glb-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.tec-glb-image {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 4px;
	opacity: 0;
	transform: scale(0.95);
	transition: opacity 0.35s ease, transform 0.35s ease;
	user-select: none;
	-webkit-user-drag: none;
}

.tec-glb-overlay.tec-glb-active .tec-glb-image {
	opacity: 1;
	transform: scale(1);
}

/* ── Caption ─────────────────────────────────────────────── */
.tec-glb-caption {
	margin-top: 12px;
	padding: 6px 16px;
	color: #e0e0e0;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
	max-width: 80vw;
	word-wrap: break-word;
}

.tec-glb-caption:empty {
	display: none;
}

/* ── Navigation arrows ───────────────────────────────────── */
.tec-glb-prev,
.tec-glb-next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1000000;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	font-size: 28px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
	line-height: 1;
	padding: 0;
}

.tec-glb-prev:hover,
.tec-glb-next:hover {
	background: rgba(255, 255, 255, 0.25);
}

.tec-glb-prev:active,
.tec-glb-next:active {
	transform: translateY(-50%) scale(0.92);
}

.tec-glb-prev {
	left: 16px;
}

.tec-glb-next {
	right: 16px;
}

/* ── Close button ────────────────────────────────────────── */
.tec-glb-close {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 1000000;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	font-size: 24px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
	line-height: 1;
	padding: 0;
}

.tec-glb-close:hover {
	background: rgba(255, 255, 255, 0.25);
}

.tec-glb-close:active {
	transform: scale(0.92);
}

/* ── Download button ─────────────────────────────────────── */
.tec-glb-download {
	position: fixed;
	top: 16px;
	right: 72px;
	z-index: 1000000;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	font-size: 20px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
	text-decoration: none;
	line-height: 1;
	padding: 0;
}

.tec-glb-download:hover {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}

.tec-glb-download:active {
	transform: scale(0.92);
}

/* ── Counter ─────────────────────────────────────────────── */
.tec-glb-counter {
	position: fixed;
	top: 20px;
	left: 20px;
	z-index: 1000000;
	color: rgba(255, 255, 255, 0.6);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

/* ── Loading spinner ─────────────────────────────────────── */
.tec-glb-loading {
	position: absolute;
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255, 255, 255, 0.15);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tec-glb-spin 0.8s linear infinite;
}

@keyframes tec-glb-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
	.tec-glb-prev,
	.tec-glb-next {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}

	.tec-glb-prev {
		left: 8px;
	}

	.tec-glb-next {
		right: 8px;
	}

	.tec-glb-close,
	.tec-glb-download {
		width: 38px;
		height: 38px;
		font-size: 18px;
	}

	.tec-glb-download {
		right: 60px;
	}

	.tec-glb-caption {
		font-size: 13px;
		padding: 4px 12px;
	}

	.tec-glb-image {
		max-width: 96vw;
		max-height: 75vh;
	}
}

/* ── Body scroll lock ────────────────────────────────────── */
body.tec-glb-no-scroll {
	overflow: hidden;
}
