/**
 * The full-screen viewer (assets/js/lightbox.js), as measured from the design at 1440, 810 and 390:
 * an 80px bar, the picture between two 48px arrows 16px in from the edges, and a strip of
 * thumbnails with 16px above and 20px below them. The picture keeps 80px clear on either side so it
 * never runs under an arrow.
 */

.as-lightbox-open {
	overflow: hidden;
}

.as-lightbox {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(8, 12, 22, 0.95);
	font-family: var(--as-font);
	color: var(--as-white);
}

.as-lightbox--video {
	background: rgba(8, 12, 22, 0.96);
}

.as-lightbox::backdrop {
	background: transparent;
}

.as-lightbox__bar {
	display: flex;
	flex: 0 0 80px;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
}

.as-lightbox__heading {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.as-lightbox__count {
	font-size: 14px;
	line-height: 1.5;
	letter-spacing: 0.04em;
	opacity: 0.85;
}

.as-lightbox__title {
	overflow: hidden;
	font-size: 16px;
	font-weight: 600;
	line-height: normal;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.as-lightbox__meta {
	font-size: 13px;
	line-height: normal;
	opacity: 0.7;
}

.as-lightbox__button {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.as-lightbox__button:hover {
	background: rgba(255, 255, 255, 0.22);
}

.as-lightbox__button:focus-visible,
.as-lightbox__thumb:focus-visible {
	outline: 2px solid var(--as-white);
	outline-offset: 2px;
}

.as-lightbox__stage {
	display: flex;
	flex: 1 1 auto;
	gap: 16px;
	align-items: center;
	min-height: 0;
	padding: 0 16px;
}

/* One item: no arrows, but the picture keeps the same 80px clear of the edges. */
.as-lightbox.is-single .as-lightbox__stage {
	padding: 0 80px;
}

.as-lightbox__view {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	min-width: 0;
	min-height: 0;
}

.as-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	border-radius: 4px;
	object-fit: contain;
}

/* 16:9, as wide as the space allows but never taller than the window less 230px of bar and strip. */
.as-lightbox__frame {
	position: relative;
	overflow: hidden;
	width: min(100%, calc((100vh - 230px) * 16 / 9));
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	background: #000;
}

.as-lightbox__frame iframe,
.as-lightbox__frame img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.as-lightbox__unavailable {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(8, 12, 22, 0.6);
	text-align: center;
}

.as-lightbox__unavailable-title {
	font-size: 17px;
	font-weight: 500;
	line-height: normal;
}

.as-lightbox__unavailable-text {
	font-size: 13px;
	line-height: normal;
	opacity: 0.75;
}

.as-lightbox__thumbs {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
	justify-content: safe center;
	overflow-x: auto;
	padding: 16px 16px 20px;
	scrollbar-width: none;
}

.as-lightbox__thumbs::-webkit-scrollbar {
	display: none;
}

.as-lightbox__thumb {
	flex: 0 0 84px;
	overflow: hidden;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	cursor: pointer;
	opacity: 0.5;
	transition: opacity 0.2s;
}

.as-lightbox__thumb[aria-current="true"] {
	outline: 2px solid var(--as-red);
	outline-offset: 2px;
	opacity: 1;
}

.as-lightbox__thumb[aria-current="true"]:focus-visible {
	outline-color: var(--as-white);
}

.as-lightbox__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.as-lightbox--video .as-lightbox__thumbs {
	gap: 10px;
}

.as-lightbox--video .as-lightbox__thumb {
	flex-basis: 112px;
	height: 63px;
	background: rgb(26 32 48);
}
