/* Larre-Gain lightbox (see assets/js/lg-lightbox.js). */

a[data-lg-lightbox] {
	display: block;
	cursor: zoom-in;
	border-radius: var(--lg-radius, 10px);
}

a[data-lg-lightbox]:focus-visible {
	outline: 3px solid var(--lg-amber, #e4a23a);
	outline-offset: 3px;
}

html.lg-lightbox-open {
	overflow: hidden;
}

.lg-lightbox {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 16px 24px 24px;
	border: 0;
	background: var(--lg-forest-dark, #16261c);
	color: var(--lg-on-dark, #e7ede8);
	box-sizing: border-box;
	display: none;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-rows: auto minmax(0, 1fr);
	column-gap: 16px;
	align-items: center;
}

.lg-lightbox[open] {
	display: grid;
	animation: lg-lightbox-in 0.2s ease-out;
}

.lg-lightbox::backdrop {
	background: transparent;
}

@keyframes lg-lightbox-in {
	from {
		opacity: 0;
	}
}

.lg-lightbox__bar {
	grid-column: 1 / -1;
	grid-row: 1;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.lg-lightbox__counter {
	margin: 0;
	font-family: var(--lg-font-body, sans-serif);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.lg-lightbox__figure {
	grid-column: 2;
	grid-row: 2;
	height: 100%;
	min-height: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.lg-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100% - 3.5em);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: var(--lg-radius-sm, 6px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.lg-lightbox__caption {
	max-width: 60ch;
	font-family: var(--lg-font-body, sans-serif);
	font-size: 17px;
	line-height: 1.4;
	text-align: center;
	color: var(--lg-on-dark-muted, #d9e2db);
}

.lg-lightbox__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.75);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.lg-lightbox__btn svg {
	width: 22px;
	height: 22px;
}

.lg-lightbox__btn:is(:hover, :focus-visible) {
	background: #fff;
	border-color: #fff;
	color: var(--lg-forest-dark, #16261c);
}

.lg-lightbox__btn:focus-visible {
	outline: 3px solid var(--lg-amber, #e4a23a);
	outline-offset: 3px;
}

.lg-lightbox__btn:disabled {
	opacity: 0.3;
	cursor: default;
	background: transparent;
	border-color: rgba(255, 255, 255, 0.75);
	color: #fff;
}

.lg-lightbox__prev {
	grid-column: 1;
	grid-row: 2;
}

.lg-lightbox__next {
	grid-column: 3;
	grid-row: 2;
}

/* Phones: the photo takes the full width, arrows sit under it. */
@media (max-width: 767px) {
	.lg-lightbox {
		padding: 12px 16px 20px;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto minmax(0, 1fr) auto;
		row-gap: 16px;
	}

	.lg-lightbox__figure {
		grid-column: 1 / -1;
	}

	.lg-lightbox__prev,
	.lg-lightbox__next {
		grid-row: 3;
		grid-column: auto;
	}

	.lg-lightbox__next {
		justify-self: end;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lg-lightbox[open] {
		animation: none;
	}
}
