/**
 * com_uhadvent – Adventskalender im Stil von uwehermann.com
 * Farben kommen aus den Komponenten-Optionen (CSS-Variablen am .uha-Element).
 */

.uha {
	--uha-bg: #0a0a0a;
	--uha-door: #111522;
	--uha-accent: #60a5fa;
	--uha-accent2: #a855f7;
	--uha-text: #e4e4e7;
	--uha-muted: #a1a1aa;
	--uha-serif: 'Playfair Display', Georgia, serif;
	--uha-dim: .25;
	--uha-radius: 16px;
	--uha-gap: clamp(.5rem, 1.6vw, 1rem);
	--uha-gradient: linear-gradient(90deg, var(--uha-accent), var(--uha-accent2));

	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin-block: 1.5rem;
	padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 3rem);
	border: 1px solid rgb(255 255 255 / .07);
	border-radius: calc(var(--uha-radius) * 1.5);
	color: var(--uha-text);
	font-family: inherit;
	background:
		radial-gradient(60% 45% at 15% 0%, color-mix(in srgb, var(--uha-accent) 16%, transparent), transparent 70%),
		radial-gradient(55% 45% at 90% 100%, color-mix(in srgb, var(--uha-accent2) 16%, transparent), transparent 70%),
		var(--uha-bg);
}

.uha--bgimage {
	background:
		linear-gradient(color-mix(in srgb, var(--uha-bg) 78%, transparent), color-mix(in srgb, var(--uha-bg) 92%, transparent)),
		var(--uha-bgimage) center / cover no-repeat,
		var(--uha-bg);
}

/* Sternenhimmel */
.uha--stars::before,
.uha--stars::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-repeat: repeat;
}

.uha--stars::before {
	background-image:
		radial-gradient(1px 1px at 7% 12%, #fff, transparent 70%),
		radial-gradient(1px 1px at 23% 38%, #fff, transparent 70%),
		radial-gradient(1.5px 1.5px at 41% 8%, #fff, transparent 70%),
		radial-gradient(1px 1px at 58% 27%, #fff, transparent 70%),
		radial-gradient(1px 1px at 76% 14%, #fff, transparent 70%),
		radial-gradient(1.5px 1.5px at 89% 41%, #fff, transparent 70%),
		radial-gradient(1px 1px at 13% 67%, #fff, transparent 70%),
		radial-gradient(1px 1px at 34% 83%, #fff, transparent 70%),
		radial-gradient(1px 1px at 52% 61%, #fff, transparent 70%),
		radial-gradient(1.5px 1.5px at 69% 92%, #fff, transparent 70%),
		radial-gradient(1px 1px at 94% 76%, #fff, transparent 70%);
	background-size: 420px 420px;
	opacity: .35;
}

.uha--stars::after {
	background-image:
		radial-gradient(1.5px 1.5px at 18% 24%, var(--uha-accent), transparent 70%),
		radial-gradient(1.5px 1.5px at 63% 48%, var(--uha-accent2), transparent 70%),
		radial-gradient(1px 1px at 83% 18%, #fff, transparent 70%),
		radial-gradient(1px 1px at 37% 71%, #fff, transparent 70%);
	background-size: 560px 560px;
	animation: uha-twinkle 5s ease-in-out infinite alternate;
}

/* Kopfbereich – angelehnt an die Startseite */
.uha-head {
	text-align: center;
	margin: 0 auto clamp(1.75rem, 4vw, 2.75rem);
	max-width: 46rem;
}

.uha-eyebrow {
	display: inline-block;
	margin: 0 0 1.25rem;
	padding: .45rem 1.3rem;
	border: 1px solid color-mix(in srgb, var(--uha-accent) 45%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--uha-accent) 10%, var(--uha-bg));
	color: var(--uha-accent);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	line-height: 1.3;
}

.uha-title {
	margin: 0;
	color: var(--uha-text);
	font-size: clamp(2.2rem, 7.5vw, 4.25rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -.02em;
	text-transform: uppercase;
}

.uha-gradient {
	background: var(--uha-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.uha-tagline {
	margin: 1rem 0 0;
	color: var(--uha-text);
	font-family: var(--uha-serif);
	font-size: clamp(1.25rem, 3.4vw, 1.8rem);
	font-style: italic;
	opacity: .92;
}

.uha-intro {
	margin-top: 1.25rem;
	color: var(--uha-muted);
	font-size: clamp(1rem, 2.4vw, 1.15rem);
	line-height: 1.65;
}

.uha-intro > :last-child {
	margin-bottom: 0;
}

.uha-preview {
	margin: 0 auto 1.5rem;
	max-width: 40rem;
	padding: .6rem 1rem;
	border: 1px dashed color-mix(in srgb, var(--uha-accent2) 60%, transparent);
	border-radius: 10px;
	color: var(--uha-muted);
	font-size: .9rem;
	text-align: center;
}

/* Raster: 5 Spalten, Türchen 24 doppelt breit = perfektes 5×5 */
.uha-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	grid-auto-flow: dense;
	gap: var(--uha-gap);
	max-width: 56rem;
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.uha-cell {
	margin: 0;
	aspect-ratio: 1;
	perspective: 900px;
}

.uha-cell--big {
	grid-column: span 2;
	aspect-ratio: auto;
}

/* Türchen */
.uha-door {
	all: unset;
	box-sizing: border-box;
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: var(--uha-radius);
	cursor: pointer;
	transform-style: preserve-3d;
	-webkit-tap-highlight-color: transparent;
}

.uha-door:focus-visible {
	outline: 2px solid var(--uha-accent);
	outline-offset: 3px;
}

.uha-door__inside {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	overflow: hidden;
	border-radius: inherit;
	background: color-mix(in srgb, var(--uha-bg) 85%, black);
	box-shadow: inset 0 2px 14px rgb(0 0 0 / .7);
}

.uha-door__inside img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: .9;
}

.uha-door__glyph {
	background: var(--uha-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-size: clamp(1.4rem, 4vw, 2.2rem);
}

.uha-door__leaf {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	border: 1px solid transparent;
	border-radius: inherit;
	background:
		linear-gradient(155deg, color-mix(in srgb, var(--uha-door) 86%, white), var(--uha-door) 55%) padding-box,
		linear-gradient(135deg,
			color-mix(in srgb, var(--uha-accent) 55%, transparent),
			rgb(255 255 255 / .06) 45%,
			color-mix(in srgb, var(--uha-accent2) 55%, transparent)) border-box;
	box-shadow: 0 8px 22px rgb(0 0 0 / .45), inset 0 1px 0 rgb(255 255 255 / .06);
	transform-origin: left center;
	transition: transform .75s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, filter .3s ease;
	backface-visibility: hidden;
}

.uha-door__num {
	background: var(--uha-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-size: clamp(1.35rem, 4.2vw, 2.6rem);
	font-weight: 800;
	letter-spacing: -.02em;
	font-variant-numeric: lining-nums;
	line-height: 1;
}

.uha-cell--big .uha-door__num {
	font-size: clamp(2rem, 7vw, 4rem);
}

/*
 * Gesamtmotiv über alle Türchen: Jede Tür zeigt ihren Ausschnitt des Bildes.
 * Größe und Position setzt advent.js pro Tür (--uha-img-size / --uha-img-pos).
 */
.uha--doorimage .uha-grid {
	gap: max(4px, calc(var(--uha-gap) * .5));
}

.uha--doorimage .uha-door__leaf {
	border-color: rgb(255 255 255 / .22);
	background:
		linear-gradient(rgb(0 0 0 / var(--uha-dim)), rgb(0 0 0 / var(--uha-dim))),
		var(--uha-bgimage) var(--uha-img-pos, center) / var(--uha-img-size, cover) no-repeat,
		var(--uha-door);
	background-origin: border-box;
	background-clip: border-box;
	box-shadow: 0 6px 16px rgb(0 0 0 / .4), inset 0 0 0 1px rgb(0 0 0 / .25);
}

.uha--doorimage .uha-door__num {
	min-width: 2.1em;
	padding: .28em .5em;
	border: 1px solid color-mix(in srgb, var(--uha-accent) 55%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--uha-bg) 72%, transparent);
	-webkit-background-clip: border-box;
	background-clip: border-box;
	color: var(--uha-text);
	font-size: clamp(.95rem, 2.6vw, 1.45rem);
	text-align: center;
	box-shadow: 0 0 14px color-mix(in srgb, var(--uha-accent2) 35%, transparent);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.uha--doorimage .uha-cell--big .uha-door__num {
	font-size: clamp(1.2rem, 3.6vw, 2rem);
}

.uha--doorimage .uha-door[data-state="locked"] .uha-door__num {
	opacity: .8;
}

/* Zustände */
.uha-door[data-state="open"]:hover .uha-door__leaf,
.uha-door[data-state="open"]:focus-visible .uha-door__leaf {
	transform: rotateY(-14deg);
	box-shadow: 0 10px 30px rgb(0 0 0 / .5), 0 0 24px color-mix(in srgb, var(--uha-accent) 30%, transparent);
}

.uha-door.is-opened .uha-door__leaf,
.uha-door.is-opened:hover .uha-door__leaf {
	transform: rotateY(-76deg);
	filter: brightness(.75);
}

.uha-door[data-state="locked"] {
	cursor: default;
}

.uha-door[data-state="locked"] .uha-door__num {
	opacity: .5;
}

.uha-door.is-today:not(.is-opened) .uha-door__leaf {
	animation: uha-glow 2.6s ease-in-out infinite;
}

.uha-door.is-shaking {
	animation: uha-shake .45s ease;
}

.uha-hint {
	min-height: 1.6em;
	margin: 1.25rem 0 0;
	color: var(--uha-accent);
	font-family: var(--uha-serif);
	font-size: 1.05rem;
	font-style: italic;
	text-align: center;
}

/* Dialog mit dem Türchen-Inhalt */
.uha-dialog {
	width: min(42rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	/* Gescrollt wird im inneren .uha-dialog__scroll – so bleibt der Rahmen samt runden Ecken rundum sichtbar. */
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: calc(var(--uha-radius) * 1.4);
	background:
		linear-gradient(var(--uha-bg), var(--uha-bg)) padding-box,
		linear-gradient(135deg, color-mix(in srgb, var(--uha-accent) 60%, transparent), color-mix(in srgb, var(--uha-accent2) 60%, transparent)) border-box;
	color: var(--uha-text);
	font-family: inherit;
	box-shadow: 0 30px 80px rgb(0 0 0 / .8);
}

.uha-dialog[open] {
	display: flex;
	flex-direction: column;
}

.uha-dialog__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: rgb(255 255 255 / .25) transparent;
}

.uha-dialog__scroll::-webkit-scrollbar {
	width: 8px;
}

.uha-dialog__scroll::-webkit-scrollbar-track {
	margin-block: calc(var(--uha-radius) * 1.4);
	background: transparent;
}

.uha-dialog__scroll::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: rgb(255 255 255 / .25);
}

.uha-dialog::backdrop {
	background: rgb(3 4 10 / .78);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
}

.uha-dialog[open] {
	animation: uha-pop .35s cubic-bezier(.2, .8, .2, 1);
}

.uha-dialog__close {
	position: sticky;
	top: .75rem;
	z-index: 2;
	float: right;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: .75rem .75rem -3.25rem 0;
	padding: 0;
	border: 1px solid rgb(255 255 255 / .2);
	border-radius: 50%;
	background: rgb(10 10 10 / .7);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.uha-dialog__close:focus-visible {
	outline: 2px solid var(--uha-accent);
	outline-offset: 2px;
}

.uha-content__media {
	margin: 0;
}

.uha-content__media img {
	display: block;
	width: 100%;
	max-height: 24rem;
	object-fit: cover;
}

.uha-content__body {
	padding: clamp(1.4rem, 4vw, 2.4rem);
}

.uha-content__day {
	margin: 0 0 .4rem;
	color: var(--uha-accent);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.uha-content__title {
	margin: 0 0 1rem;
	padding-right: 2.5rem;
	color: var(--uha-text);
	font-size: clamp(1.4rem, 3.6vw, 2rem);
	font-weight: 800;
	line-height: 1.15;
}

.uha-content__text {
	color: var(--uha-muted);
	font-size: 1.05rem;
	line-height: 1.7;
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
}

/* Blocksatz bekommt Silbentrennung, sonst entstehen große Lücken. */
.uha-content__text [style*="justify"] {
	-webkit-hyphens: auto;
	hyphens: auto;
}

.uha-content__text a {
	color: var(--uha-accent);
}

.uha-content__text img,
.uha-content__text iframe {
	max-width: 100%;
	height: auto;
}

.uha-content__text > :last-child {
	margin-bottom: 0;
}

.uha-content__action {
	margin: 1.5rem 0 0;
}

.uha-button {
	display: inline-block;
	padding: .75rem 1.5rem;
	border-radius: 999px;
	background: var(--uha-gradient);
	color: #fff !important;
	font-weight: 700;
	text-decoration: none !important;
	box-shadow: 0 8px 24px color-mix(in srgb, var(--uha-accent2) 35%, transparent);
	transition: transform .2s ease, box-shadow .2s ease;
}

.uha-button:hover,
.uha-button:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 12px 30px color-mix(in srgb, var(--uha-accent2) 50%, transparent);
}

/* Animationen */
@keyframes uha-twinkle {
	from { opacity: .25; }
	to { opacity: .8; }
}

@keyframes uha-glow {
	0%, 100% { box-shadow: 0 8px 22px rgb(0 0 0 / .45), 0 0 0 0 color-mix(in srgb, var(--uha-accent) 0%, transparent); }
	50% { box-shadow: 0 8px 22px rgb(0 0 0 / .45), 0 0 28px 2px color-mix(in srgb, var(--uha-accent2) 55%, transparent); }
}

@keyframes uha-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-5px); }
	40% { transform: translateX(5px); }
	60% { transform: translateX(-3px); }
	80% { transform: translateX(3px); }
}

@keyframes uha-pop {
	from { opacity: 0; transform: translateY(14px) scale(.97); }
	to { opacity: 1; transform: none; }
}

/* Tablet und Handy */
@media (max-width: 640px) {
	.uha-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.uha-cell--big {
		grid-column: auto;
		aspect-ratio: 1;
	}

	.uha-cell--big .uha-door__num {
		font-size: clamp(1.35rem, 6vw, 2rem);
	}

	.uha-door__num {
		font-size: clamp(1.25rem, 6vw, 1.9rem);
	}

	.uha {
		--uha-radius: 12px;
	}

	/* Türchen-Fenster auf dem Handy: fast bildschirmfüllend, etwas kleinere Schrift. */
	.uha-dialog {
		width: calc(100vw - 1rem);
		max-height: calc(100vh - 1rem);
		max-height: calc(100dvh - 1rem);
	}

	.uha-content__text {
		font-size: 1rem;
		line-height: 1.65;
	}

	/* Blocksatz reißt in schmalen Spalten Löcher – auf dem Handy linksbündig. */
	.uha-content__text [style*="justify"] {
		text-align: left !important;
	}

	/* Bilder, die im Text links/rechts umflossen werden, stehen auf dem Handy allein. */
	.uha-content__text img[style*="float"],
	.uha-content__text img[align],
	.uha-content__text .pull-left,
	.uha-content__text .pull-right,
	.uha-content__text .float-start,
	.uha-content__text .float-end {
		float: none !important;
		display: block;
		max-width: min(100%, 16rem);
		margin: 0 auto 1.25rem !important;
	}

	/* Kästen mit festem Innenabstand (z. B. style="padding: 32px 40px") nicht zu eng werden lassen. */
	.uha-content__text div[style*="padding"] {
		padding: 1rem !important;
	}
}

@media (max-width: 360px) {
	.uha-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.uha *,
	.uha::after,
	.uha-dialog[open] {
		animation: none !important;
		transition: none !important;
	}
}

/* 1.3: Statuszeile, leere Türchen, Teilen, Badge */
.uha-status {
	margin: -.75rem auto 1.5rem;
	color: var(--uha-muted);
	font-family: var(--uha-serif);
	font-size: clamp(1rem, 2.6vw, 1.2rem);
	font-style: italic;
	text-align: center;
}

.uha-status--today {
	color: var(--uha-accent);
}

.uha-content--empty .uha-content__body {
	padding-block: clamp(2rem, 6vw, 3rem);
	text-align: center;
}

.uha-content__glyph {
	margin: .25rem 0 .5rem;
	background: var(--uha-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-size: 2.5rem;
	line-height: 1;
}

.uha-content--empty .uha-content__title {
	padding-right: 0;
}

.uha-badge {
	display: inline-block;
	margin-left: .5rem;
	padding: .1rem .55rem;
	border: 1px dashed currentColor;
	border-radius: 999px;
	color: var(--uha-accent2);
	font-size: .7rem;
	letter-spacing: .08em;
	vertical-align: middle;
}

.uha-dialog__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem;
	padding: 0 clamp(1.4rem, 4vw, 2.4rem) clamp(1.2rem, 3vw, 1.8rem);
}

.uha-share {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .5rem 1rem;
	border: 1px solid color-mix(in srgb, var(--uha-accent) 45%, transparent);
	border-radius: 999px;
	background: transparent;
	color: var(--uha-text);
	font: inherit;
	font-size: .9rem;
	cursor: pointer;
}

.uha-share:hover,
.uha-share:focus-visible {
	border-color: var(--uha-accent);
	outline: none;
	background: color-mix(in srgb, var(--uha-accent) 12%, transparent);
}

.uha-share[hidden] {
	display: none;
}

.uha-share__done {
	color: var(--uha-accent);
	font-size: .9rem;
}

.uha-share__field {
	width: min(22rem, 70vw);
	padding: .35rem .6rem;
	border: 1px solid rgb(255 255 255 / .2);
	border-radius: 8px;
	background: transparent;
	color: var(--uha-text);
	font: inherit;
	font-size: .85rem;
}

.uha-door[data-state="empty"]:hover .uha-door__leaf,
.uha-door[data-state="empty"]:focus-visible .uha-door__leaf {
	transform: rotateY(-10deg);
}

/* 1.4: Schneefall */
.uha-snow {
	position: absolute;
	inset: 0;
	z-index: 3;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.uha-snow--page {
	position: fixed;
	z-index: 9990;
}

/* 1.4: Gewinnspiel */
.uha-giveaway {
	margin-top: 1.75rem;
	padding: clamp(1rem, 3vw, 1.5rem);
	border: 1px solid color-mix(in srgb, var(--uha-accent2) 45%, transparent);
	border-radius: var(--uha-radius);
	background: color-mix(in srgb, var(--uha-accent2) 8%, var(--uha-bg));
}

.uha-giveaway__title {
	margin: 0 0 .5rem;
	color: var(--uha-accent2);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.uha-giveaway__prize {
	margin: 0 0 .35rem;
	color: var(--uha-text);
	font-size: 1.05rem;
}

.uha-giveaway__deadline,
.uha-giveaway__closed {
	margin: 0 0 1rem;
	color: var(--uha-muted);
	font-size: .9rem;
}

.uha-giveaway__form {
	display: grid;
	gap: .85rem;
}

.uha-field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
	gap: .85rem;
}

.uha-field {
	display: grid;
	gap: .3rem;
	min-width: 0;
}

.uha-field label {
	color: var(--uha-text);
	font-size: .9rem;
	font-weight: 600;
}

.uha-field input,
.uha-field textarea {
	box-sizing: border-box;
	width: 100%;
	padding: .6rem .75rem;
	border: 1px solid rgb(255 255 255 / .18);
	border-radius: 10px;
	background: rgb(255 255 255 / .04);
	color: var(--uha-text);
	font: inherit;
	font-size: 1rem;
}

.uha-field input:focus-visible,
.uha-field textarea:focus-visible,
.uha-check input:focus-visible {
	outline: 2px solid var(--uha-accent);
	outline-offset: 2px;
	border-color: transparent;
}

.uha-check {
	display: flex;
	align-items: flex-start;
	gap: .6rem;
	color: var(--uha-muted);
	font-size: .9rem;
	line-height: 1.5;
}

.uha-check input {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	margin-top: .15rem;
	accent-color: var(--uha-accent2);
}

.uha-check a,
.uha-giveaway__conditions a {
	color: var(--uha-accent);
}

.uha-giveaway__conditions {
	color: var(--uha-muted);
	font-size: .9rem;
}

.uha-giveaway__conditions summary {
	color: var(--uha-text);
	cursor: pointer;
}

.uha-giveaway__conditions > div {
	max-height: 14rem;
	margin-top: .5rem;
	overflow: auto;
}

.uha-giveaway .uha-button {
	justify-self: start;
	border: 0;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.uha-giveaway .uha-button:disabled {
	opacity: .6;
	cursor: wait;
}

.uha-giveaway__msg {
	min-height: 1.2em;
	margin: 0;
	font-size: .95rem;
}

.uha-giveaway__msg.is-error {
	color: #fca5a5;
}

.uha-giveaway__msg.is-success {
	color: var(--uha-text);
	font-family: var(--uha-serif);
	font-size: 1.15rem;
	font-style: italic;
}

/* Honeypot: für Menschen unsichtbar, für Bots ein normales Feld */
.uha-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* 1.5.1: Bildvergrößerung */
.uha-content__text a:has(> img),
.uha-intro a:has(> img) {
	position: relative;
	display: inline-block;
	max-width: 100%;
	cursor: zoom-in;
}

.uha-content__text a:has(> img)::after,
.uha-intro a:has(> img)::after {
	content: "⤢";
	position: absolute;
	right: .5rem;
	bottom: .5rem;
	display: grid;
	place-items: center;
	width: 2.1rem;
	height: 2.1rem;
	border-radius: 50%;
	background: rgb(10 10 10 / .7);
	color: #fff;
	font-size: 1.1rem;
	line-height: 1;
	pointer-events: none;
}

.uha-lightbox {
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgb(3 4 10 / .94);
	color: #fff;
	font-family: inherit;
}

.uha-lightbox[open] {
	display: flex;
	flex-direction: column;
	animation: uha-fade .2s ease;
}

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

.uha-lightbox__stage {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 3.75rem 1rem .5rem;
	scrollbar-width: thin;
	scrollbar-color: rgb(255 255 255 / .3) transparent;
}

.uha-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	margin: auto;
	object-fit: contain;
	border-radius: 6px;
	cursor: zoom-in;
}

.uha-lightbox.is-zoomed .uha-lightbox__img {
	max-width: none;
	max-height: none;
	cursor: zoom-out;
}

.uha-lightbox__close {
	position: absolute;
	top: .75rem;
	right: .75rem;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid rgb(255 255 255 / .3);
	border-radius: 50%;
	background: rgb(10 10 10 / .75);
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.uha-lightbox__close:focus-visible {
	outline: 2px solid var(--uha-accent, #60a5fa);
	outline-offset: 2px;
}

.uha-lightbox__hint {
	margin: 0;
	padding: .5rem 1rem .9rem;
	color: rgb(255 255 255 / .6);
	font-size: .85rem;
	text-align: center;
}

@keyframes uha-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}
