:root {
	color-scheme: dark;
	--page: #111214;
	--panel: #191b1f;
	--panel-strong: #22252b;
	--text: #f6f1e8;
	--muted: #b9afa2;
	--accent: #d8a85f;
	--accent-strong: #f0c77b;
	--line: rgba(255, 255, 255, 0.12);
	--shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
	box-sizing: border-box;
}

html {
	width: 100%;
	height: 100%;
	background: var(--page);
}

body {
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
	background: #070809;
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea,
select {
	font: inherit;
}

button {
	color: inherit;
}

.gallery-shell {
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto;
	gap: 8px;
	width: 100%;
	height: 100svh;
	padding: 8px;
}

.gallery-stage {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 0;
	overflow: hidden;
	background: #070809;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.media-frame {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
}

.media-frame img,
.media-frame video {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	background: #070809;
}

.nav-button {
	position: absolute;
	top: 50%;
	display: grid;
	place-items: center;
	width: 48px;
	height: 72px;
	padding: 0;
	border: 1px solid var(--line);
	background: rgba(17, 18, 20, 0.72);
	backdrop-filter: blur(14px);
	border-radius: 8px;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-button:hover,
.nav-button:focus-visible {
	background: rgba(216, 168, 95, 0.2);
	border-color: rgba(216, 168, 95, 0.72);
	outline: none;
	transform: translateY(-50%) scale(1.04);
}

.nav-button::before {
	content: "";
	width: 16px;
	height: 16px;
	border-left: 3px solid var(--text);
	border-top: 3px solid var(--text);
}

.nav-button--prev {
	left: 16px;
}

.nav-button--prev::before {
	transform: rotate(-45deg);
}

.nav-button--next {
	right: 16px;
}

.nav-button--next::before {
	transform: rotate(135deg);
}

.thumbnail-section {
	min-width: 0;
	padding: 8px;
	background: rgba(25, 27, 31, 0.82);
	border: 1px solid var(--line);
	border-radius: 8px;
}

.thumbnail-strip {
	display: grid;
	grid-auto-columns: clamp(72px, 9vw, 104px);
	grid-auto-flow: column;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 0 0 8px;
	scrollbar-color: var(--accent) rgba(255, 255, 255, 0.08);
	scrollbar-width: thin;
}

.thumbnail {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	padding: 0;
	background: var(--panel-strong);
	border: 2px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	opacity: 0.72;
	transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.thumbnail img,
.thumbnail video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.thumbnail:hover,
.thumbnail:focus-visible,
.thumbnail.is-active {
	opacity: 1;
	border-color: var(--accent);
	outline: none;
}

.thumbnail:hover,
.thumbnail:focus-visible {
	transform: translateY(-2px);
}

.thumbnail[data-type="video"]::after {
	content: "";
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 26px;
	height: 26px;
	background: rgba(17, 18, 20, 0.78);
	border: 1px solid var(--line);
	border-radius: 999px;
}

.thumbnail[data-type="video"]::before {
	content: "";
	position: absolute;
	right: 16px;
	bottom: 15px;
	z-index: 1;
	width: 0;
	height: 0;
	border-bottom: 6px solid transparent;
	border-left: 9px solid var(--text);
	border-top: 6px solid transparent;
}

@media (max-width: 700px) {
	.gallery-shell {
		gap: 6px;
		padding: 6px;
	}

	.nav-button {
		width: 40px;
		height: 58px;
	}

	.nav-button--prev {
		left: 8px;
	}

	.nav-button--next {
		right: 8px;
	}
}
