:root{
	--uml-radius:18px;
	--uml-border:rgba(255,255,255,0.12);
	--uml-accent:rgba(120,170,255,0.60);
	--uml-bg:rgba(255,255,255,0.03);
	--uml-text:rgba(255,255,255,0.92);
	--uml-muted:rgba(255,255,255,0.70);
}

.uml-gallery{
	position:relative;
	display:block;
	padding:16px;
	border-radius:var(--uml-radius);
	border:1px solid var(--uml-border);
	background:linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
	box-shadow:0 20px 60px rgba(0,0,0,0.35);
	color:var(--uml-text);
}

.uml-gallery *{ box-sizing:border-box; }

.uml-gallery__stage{
	position:relative;
}

.uml-gallery__frame{
	position:relative;
	overflow:hidden;
	border-radius:calc(var(--uml-radius) - 4px);
	border:1px solid rgba(255,255,255,0.10);
	background:rgba(0,0,0,0.35);
	aspect-ratio:16 / 9;
}

.uml-gallery[data-ratio="auto"] .uml-gallery__frame{ aspect-ratio:auto; }
.uml-gallery[data-ratio="4:3"] .uml-gallery__frame{ aspect-ratio:4 / 3; }
.uml-gallery[data-ratio="1:1"] .uml-gallery__frame{ aspect-ratio:1 / 1; }
.uml-gallery[data-ratio="21:9"] .uml-gallery__frame{ aspect-ratio:21 / 9; }

.uml-gallery__img{
	position:absolute;
	inset:0;
	width:100%;
	height:100%;
	object-fit:cover;
	opacity:0;
	transform:scale(1.02);
	transition:opacity .32s ease, transform .45s ease;
}
.uml-gallery.is-contain .uml-gallery__img{ object-fit:contain; background:rgba(0,0,0,0.55); }
.uml-gallery__img.is-active{
	opacity:1;
	transform:scale(1);
}

.uml-gallery__nav{
	position:absolute;
	top:50%;
	transform:translateY(-50%);
	width:44px;
	height:44px;
	border-radius:999px;
	border:1px solid rgba(255,255,255,0.18);
	background:rgba(0,0,0,0.35);
	backdrop-filter: blur(6px);
	color:var(--uml-text);
	font-size:28px;
	line-height:40px;
	padding:0;
	cursor:pointer;
	display:flex;
	align-items:center;
	justify-content:center;
	transition:transform .15s ease, background .15s ease, border-color .15s ease;
	user-select:none;
}
.uml-gallery__nav:hover{
	background:rgba(0,0,0,0.55);
	border-color:rgba(255,255,255,0.26);
	transform:translateY(-50%) scale(1.04);
}
.uml-gallery__nav:active{ transform:translateY(-50%) scale(0.98); }
.uml-gallery__nav--prev{ left:12px; }
.uml-gallery__nav--next{ right:12px; }

.uml-gallery__dots{
	display:flex;
	gap:8px;
	padding:12px 2px 0;
	justify-content:center;
}
.uml-gallery__dot{
	width:10px;
	height:10px;
	border-radius:999px;
	border:1px solid rgba(255,255,255,0.22);
	background:rgba(255,255,255,0.10);
	cursor:pointer;
	padding:0;
	transition:transform .15s ease, background .15s ease, border-color .15s ease;
}
.uml-gallery__dot:hover{ transform:scale(1.15); }
.uml-gallery__dot.is-active{
	background:var(--uml-accent);
	border-color:rgba(255,255,255,0.35);
}

.uml-gallery__thumbs{
	padding-top:14px;
}
.uml-gallery__thumbs-inner{
	display:grid;
	grid-template-columns:repeat(var(--uml-thumbs, 6), 1fr);
	gap:10px;
}
.uml-gallery__thumb{
	border-radius:14px;
	border:1px solid rgba(255,255,255,0.14);
	background:rgba(255,255,255,0.04);
	padding:0;
	overflow:hidden;
	cursor:pointer;
	transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.uml-gallery__thumb img{
	display:block;
	width:100%;
	height:68px;
	object-fit:cover;
	opacity:0.9;
}
.uml-gallery.is-contain .uml-gallery__thumb img{ object-fit:contain; background:rgba(0,0,0,0.55); }
.uml-gallery__thumb:hover{
	transform:translateY(-1px);
	border-color:rgba(255,255,255,0.25);
	box-shadow:0 10px 25px rgba(0,0,0,0.25);
}
.uml-gallery__thumb.is-active{
	border-color:rgba(255,255,255,0.35);
	box-shadow:0 0 0 2px var(--uml-accent) inset;
}

.uml-gallery__content{
	margin-top:16px;
	padding-top:16px;
	border-top:1px solid rgba(255,255,255,0.10);
	color:var(--uml-text);
}
.uml-gallery.is-content-only .uml-gallery__content{
	margin-top:0;
	padding-top:0;
	border-top:0;
}

/* Typography inside the content section */
.uml-gallery__content :where(h1,h2,h3,h4,h5,h6){
	color:var(--uml-text);
	margin:0.6em 0 0.25em;
}
.uml-gallery__content :where(p, ul, ol){
	color:var(--uml-muted);
	line-height:1.7;
	margin:0.6em 0;
}
.uml-gallery__content :where(a){
	color:rgba(170,205,255,0.95);
	text-decoration:none;
	border-bottom:1px solid rgba(170,205,255,0.35);
}
.uml-gallery__content :where(a:hover){
	border-bottom-color:rgba(170,205,255,0.75);
}
.uml-gallery__content :where(code){
	background:rgba(0,0,0,0.35);
	border:1px solid rgba(255,255,255,0.12);
	padding:0.12em 0.35em;
	border-radius:10px;
	color:rgba(255,255,255,0.92);
}

/* Editor-only helpers */
.uml-gallery--editor{
	outline:1px dashed rgba(255,255,255,0.16);
}
.uml-gallery__empty{
	display:flex;
	align-items:center;
	justify-content:center;
	min-height:200px;
	border-radius:calc(var(--uml-radius) - 4px);
	border:1px dashed rgba(255,255,255,0.18);
	color:rgba(255,255,255,0.70);
	background:rgba(0,0,0,0.18);
}
.uml-gallery__editor-badge{
	position:absolute;
	left:12px;
	top:12px;
	padding:6px 10px;
	border-radius:999px;
	font-size:12px;
	letter-spacing:0.04em;
	text-transform:uppercase;
	border:1px solid rgba(255,255,255,0.14);
	background:rgba(0,0,0,0.35);
	backdrop-filter: blur(6px);
	color:rgba(255,255,255,0.88);
}
.uml-gallery__content--editor{
	border-top:1px solid rgba(255,255,255,0.10);
}

/* Inspector small helpers */
.uml-gallery__inspector-color{ margin:10px 0 14px; }
.uml-gallery__inspector-label{ font-size:12px; opacity:0.8; margin-bottom:6px; }
