/**
 * The styles of the lightbox, for pages that have one. The styles of the
 * slider are in style.css.
 */

/* The lightbox. --gs-open runs from 0 to 1 while it opens. */

.gs-zooms .gs-slide {
	cursor: zoom-in;
}

.gs-lightbox {
	--gs-open: 0;

	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: hidden;
	background: rgb(0 0 0 / calc(var(--gs-open) * 0.92));
	color: #fff;
}

.gs-lightbox::backdrop {
	background: none;
}

html:has(.gs-lightbox[open]) {
	overflow: hidden;
}

/* Whatever the page says about its sliders: this one fills the screen,
   one slide at a time. */
.gs-lightbox > .gs-box {
	--gs-per-view: 1;
	--gs-gap: 0px;

	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	cursor: grab;
}

/* The ring of the focus of the keys, inside the screen. */
.gs-lightbox > .gs-box:focus-visible {
	outline-offset: -4px;
}

.gs-box > .gs-track,
.gs-box > .gs-track > .gs-slide {
	height: 100%;
	max-height: none;
	aspect-ratio: auto;
	margin: 0;
	padding: 0;
	border-radius: 0;
}

.gs-box > .gs-track > .gs-slide > .gs-media {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: 50% 50%;
	border-radius: 0;
}

/* The images of the lightbox are drawn by the canvas of the slider; where
   there is none, they fade in. */
.gs-box .gs-media:not(.gs-drawn) {
	opacity: var(--gs-shown, var(--gs-open));
}

.gs-button {
	opacity: var(--gs-open);
	/* Where an arrow of the slider is, as it opens: see lightbox.js. */
	transform-origin: 0 0;
}

.gs-button {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	corner-shape: squircle;
	background: rgb(0 0 0 / 0.4);
	box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
	backdrop-filter: blur(12px) saturate(1.5);
	color: inherit;
	cursor: pointer;
}

.gs-button:hover {
	background: rgb(0 0 0 / 0.65);
}

.gs-button:focus-visible {
	outline: 2px solid Highlight;
	outline-offset: 2px;
}

/* Colours that the system forces: the buttons keep an edge. */
@media (forced-colors: active) {
	.gs-button {
		border: 1px solid;
	}
}

.gs-button:disabled {
	visibility: hidden;
}

.gs-button::before,
.gs-button::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 10px;
	height: 10px;
	margin: auto;
	border-top: 2px solid;
	border-inline-start: 2px solid;
}

.gs-button::after {
	display: none;
}

.gs-prev {
	inset-inline-start: 16px;
}

.gs-prev::before {
	rotate: -45deg;
	translate: 2px;
}

.gs-next {
	inset-inline-end: 16px;
}

.gs-next::before {
	rotate: 135deg;
	translate: -2px;
}

:dir(rtl) > .gs-prev::before,
:dir(rtl) > .gs-next::before {
	scale: -1;
}

.gs-close {
	top: 16px;
	inset-inline-end: 16px;
	margin: 0;
}

.gs-close::before,
.gs-close::after {
	display: block;
	width: 18px;
	height: 0;
	border-inline-start: 0;
	rotate: 45deg;
}

.gs-close::after {
	rotate: -45deg;
}
