body {
	font-family: arial, sans-serif;
	padding: 20px;
	margin: 0;
}
* {
	box-sizing: border-box!important;
}
button {
    all: unset;
    cursor: pointer;
}
[hidden], .d-none {
	display: none;
}
.pos-relative {
	position: relative;
}
.pos-absolute {
	position: absolute;
}
.top-0 {
	top: 0;
}
.right-0 {
	right: 0;
}
.opacity-0 {
	opacity: 0;
	transition: opacity 0.5s;
}
.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0); 
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap; 
  width: 1px;
}

.gallery, .gallery li, h1 {
	list-style-type: none;
	padding: 0;
	margin: 0;
}
.gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

.meta {
	position: absolute;
	top: 0;
	right: 0;
	margin: 8px;
	font-size: 0.7em;
	font-weight: 500;
}
.meta .badge {
	margin-left: 2px;
	display: inline-block;
	border-radius: 4px;
	background-color: #eee;
	padding: 2px;
}

ul.gallery li button.btn-open {
	display: block;
	width: 150px;
	margin-bottom: 15px;
	position: relative;
}
ul.gallery li button.btn-open strong {
	display: block;
	font-size: 0.9em;
	text-align: center;
    white-space: nowrap;
    overflow: hidden;
	text-overflow: ellipsis;
}
ul.gallery button.btn-open:hover .thumb-wrapper,
ul.gallery button.btn-open:focus .thumb-wrapper {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}

.thumb-wrapper {
    width: 100%;
    aspect-ratio: 50/33;
	border: 1px solid #ccc;
	border-radius: 4px;
	overflow: hidden;
}
.thumb {
	width: 100%;
	height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
}

dialog {
	padding: 1em;
	background: white;
	border: 1px solid #ccc;
	border-radius: 8px;
	max-width: 90vw;
	max-height: 90vh;
	overflow: auto;
	box-shadow: 0 0 20px rgba(0,0,0,0.2);
}
dialog::backdrop {
  background-color: rgba(0,0,0,0.8);
}

dialog h2 {
	margin: 0;
	padding: 0 0 10px 0;
	font-size: 1.2em;
    white-space: nowrap;
    overflow: hidden;
	text-overflow: ellipsis;
}
dialog img {
	width: 100%;
	max-width: 90vw;
	height: auto;
	max-height: 75vh;
	display: block;
}
dialog > .pos-relative {
	opacity: 0;	
	transition: opacity 0.1s;
}