/* L44 Gallery — the opened picture. */

.l44g-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	background: rgba( 24, 22, 23, 0.92 );
	opacity: 0;
	transition: opacity 0.22s ease;
	cursor: zoom-out;
}

.l44g-lightbox.is-open { opacity: 1; }

/* Closed means gone.
   
   The hidden attribute means display:none, but it says so in the browser's own
   stylesheet — which a class here outranks. So the overlay stayed exactly where
   it was, invisible at no opacity and still covering the page: every click went
   into it, and the cursor stayed a magnifier over the whole site. */
.l44g-lightbox[hidden] { display: none !important; }

/* At its own proportions, and never larger than the room it has. */
.l44g-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.5 );
}

.l44g-lightbox__shut {
	position: absolute;
	top: 12px;
	right: 16px;
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

/* The page behind it stays where it was. */
.l44g-open,
.l44g-open body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.l44g-lightbox { transition: none; }
}

/* ---- browsing the set ----
 *
 * Either side of the picture, clear of it on a wide screen and over its edges
 * on a narrow one, where there is no room beside it. They sit above the ground
 * so a press turns the page rather than closing it — the ground itself is what
 * closes.
 */
.l44g-lightbox__go {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.12 );
	color: #fff;
	font-family: inherit;
	font-size: 24px;
	line-height: 56px;
	cursor: pointer;
	z-index: 2;
	transition: background-color 0.16s ease;
}

.l44g-lightbox__go:hover { background: #00a95c; }
.l44g-lightbox__go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.l44g-lightbox__go--back { left: 3vmin; }
.l44g-lightbox__go--on { right: 3vmin; }

/* Gone means gone, for the same reason the overlay's own hidden needs saying:
   the browser's rule is outranked by anything here. */
.l44g-lightbox__go[hidden] { display: none !important; }

/* The picture itself is not the ground, so it does not offer to close. */
.l44g-lightbox__img { cursor: default; }

@media (max-width: 700px) {
	.l44g-lightbox__go {
		width: 44px;
		height: 44px;
		font-size: 19px;
		line-height: 44px;
	}

	.l44g-lightbox__go--back { left: 8px; }
	.l44g-lightbox__go--on { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.l44g-lightbox__go { transition: none; }
}
