/*
 * The gallery lightbox.
 *
 * Ships with assets/js/lightbox.js and is enqueued from the same place, so the
 * rules and the markup cannot come apart -- the failure that put the tip jar on
 * the page completely unstyled.
 *
 * No radius anywhere: house rule.
 */

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

.mpr-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px;
	background: rgba( 0, 0, 0, .94 );
	border-radius: 0;
}

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

.mpr-lb-stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	flex: 1 1 auto;
}

.mpr-lb-img {
	display: block;
	max-width: 100%;
	/* Room for the caption and the counter beneath it. */
	max-height: calc( 100vh - 140px );
	width: auto;
	height: auto;
	border-radius: 0;
}

.mpr-lb-caption {
	margin: 0;
	max-width: 68ch;
	color: var( --mpr-text-muted, #C4C4C4 );
	font-family: var( --mpr-font-body, sans-serif );
	font-size: 14px;
	font-weight: var( --mpr-prose-weight, 400 );
	line-height: 1.4;
	text-align: center;
}

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

.mpr-lb-count {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	margin: 0;
	color: var( --mpr-text-muted, #C4C4C4 );
	font-family: var( --mpr-font-body, sans-serif );
	font-size: 12px;
	text-align: center;
}

/*
 * The controls.
 *
 * 44px minimum on every side: these are tapped on a phone in a dark room, and
 * a close button smaller than a thumb is a trap, not a control.
 */
.mpr-lb button {
	appearance: none;
	min-width: 44px;
	min-height: 44px;
	padding: 0 10px;
	background: rgba( 0, 0, 0, .5 );
	color: var( --mpr-text, #F2F2F2 );
	border: 1px solid var( --mpr-line, rgba( 255, 255, 255, .18 ) );
	border-radius: 0;
	font-family: var( --mpr-font-body, sans-serif );
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.mpr-lb button:hover,
.mpr-lb button:focus-visible {
	background: var( --mpr-accent, #ED2124 );
	border-color: var( --mpr-accent, #ED2124 );
	color: #FFFFFF;
}

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

.mpr-lb-close {
	position: absolute;
	top: 12px;
	right: 12px;
	font-size: 32px;
}

.mpr-lb-nav {
	flex: 0 0 auto;
}

/*
 * On a phone the arrows sit over the picture rather than beside it: 44px of
 * chrome on each side of a 390px screen leaves the photograph nothing.
 */
@media ( max-width: 640px ) {
	.mpr-lb {
		padding: 8px;
	}

	.mpr-lb-nav {
		position: absolute;
		top: 50%;
		transform: translateY( -50% );
	}

	.mpr-lb-prev {
		left: 8px;
	}

	.mpr-lb-next {
		right: 8px;
	}

	.mpr-lb-img {
		max-height: calc( 100vh - 120px );
	}
}

/* A gallery shot is a control now, so it should look like one. */
.mpr-exp-shot {
	cursor: zoom-in;
}
