/* ==========================================================================
   AS — dark mode, ✶ toggle, protection, viewer
   ========================================================================== */

/* pitch black — not grey */
html.dark {
	color-scheme: dark;
	--site-bg: #000000;
	--color-b0: #000000;
	--color-b5: rgba(255, 255, 255, 0.06);
	--color-b20: rgba(255, 255, 255, 0.16);
	--color-b40: rgba(255, 255, 255, 0.44);
	--color-b60: rgba(255, 255, 255, 0.64);
	--color-b100: #ffffff;
	background-color: #000000;
	color: var(--color-b100);
}
html.dark,
html.dark body,
html.dark body.site-color-defaults,
html.dark .site-bg,
html.dark #scroller-wrapper,
html.dark [data-project-slideshow-target="slide"] {
	background-color: #000000 !important;
}
html.dark .site-bg {
	background-color: #000000;
	opacity: 1;
	filter: none;
}

html.light {
	color-scheme: light;
	--site-bg: #ffffff;
	--color-b0: #ffffff;
	--color-b5: rgba(0, 0, 0, 0.05);
	--color-b20: rgba(0, 0, 0, 0.13);
	--color-b40: rgba(0, 0, 0, 0.4);
	--color-b60: rgba(0, 0, 0, 0.6);
	--color-b100: #000000;
	background-color: var(--site-bg);
	color: var(--color-b100);
}
html.light .site-bg {
	opacity: 0 !important;
}

#theme-toggle {
	pointer-events: auto;
	margin-left: 0.45em;
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
	font-size: 0.95em;
	line-height: 1;
	color: inherit;
	opacity: 0.75;
	transition: opacity 0.2s ease;
	font-family: inherit;
	transform: translateY(-0.05em);
}
#theme-toggle:hover { opacity: 0.35; }

img {
	-webkit-user-drag: none;
	user-select: none;
	-webkit-touch-callout: none;
}

[data-gallery-target="galleryImage"] {
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	max-width: 92vw !important;
	max-height: 88vh !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
}

[data-project-slideshow-target="prevButton"],
[data-project-slideshow-target="nextButton"],
[data-gallery-target="galleryPrevButton"],
[data-gallery-target="galleryNextButton"] {
	display: none !important;
}

.as-gallery-close {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 70;
	width: 2.25rem;
	height: 2.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.92);
	color: #333;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
html.dark .as-gallery-close {
	background: rgba(0, 0, 0, 0.9);
	color: #eee;
	border-color: rgba(255, 255, 255, 0.2);
}
[data-gallery-target="galleryOverlay"][aria-hidden="false"] .as-gallery-close {
	opacity: 1;
	pointer-events: auto;
}
.as-gallery-close:hover { opacity: 0.8; }
