/**
 * GM Theme – fullscreen photo viewer for blog posts (assets/js/lightbox.js).
 *
 * Dark, minimal stage; previous / next, counter, caption. Loaded on single
 * posts only.
 */

.gm-lb-zoomable {
	cursor: zoom-in;
}

.gm-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	background: rgba(12, 12, 13, 0.97);
	color: #f5f5f7;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.gm-lb[hidden] {
	display: none;
}

.gm-lb.is-open {
	opacity: 1;
}

.gm-lb__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem clamp(0.75rem, 2vw, 1.25rem);
	font-size: 0.8125rem;
	color: rgba(245, 245, 247, 0.7);
	font-variant-numeric: tabular-nums;
}

.gm-lb__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0 clamp(0.5rem, 5vw, 5rem);
	touch-action: pan-y;
}

.gm-lb__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	transition: opacity 0.25s ease;
}

.gm-lb__img.is-loading {
	opacity: 0;
}

.gm-lb__caption {
	min-height: 1.5rem;
	max-width: 46rem;
	margin: 0 auto;
	padding: 0.9rem 1.25rem 1.25rem;
	font-size: 0.875rem;
	line-height: 1.5;
	text-align: center;
	color: rgba(245, 245, 247, 0.78);
}

.gm-lb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #f5f5f7;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.gm-lb__btn:hover {
	background: rgba(255, 255, 255, 0.1);
}

.gm-lb__btn:focus-visible {
	outline: 2px solid #f5f5f7;
	outline-offset: 2px;
}

.gm-lb__btn svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.gm-lb__prev,
.gm-lb__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.gm-lb__prev {
	left: clamp(0.25rem, 1.5vw, 1.25rem);
}

.gm-lb__next {
	right: clamp(0.25rem, 1.5vw, 1.25rem);
}

.gm-lb--single .gm-lb__prev,
.gm-lb--single .gm-lb__next,
.gm-lb--single .gm-lb__count {
	visibility: hidden;
}

html.gm-lb-open {
	overflow: hidden;
}

@media (max-width: 767.5px) {

	.gm-lb__stage {
		padding: 0;
	}

	/* Swipe instead of buttons on small screens. */
	.gm-lb__prev,
	.gm-lb__next {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	.gm-lb,
	.gm-lb__img {
		transition: none !important;
	}
}
