/* Photo galleries (galleries.php) and the photo viewer (gallery.js) */

#gallery-title {
	max-width: 670px;
	margin: 0 auto 12px;
	padding: 2px 8px;
	border: 1px solid #606060;
	background: #B9DEF9;
	color: #393939;
	font: bold 1.1em "Helvetica Neue", Arial, Helvetica, sans-serif;
	text-align: center;
}

#gallery-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 8px;
	list-style: none;
}
#gallery-list a.photo { display: block; }
#gallery-list img {
	display: block;
	height: 125px;
	width: auto;
	border: 4px solid #8E8E8E;
	background: #ddd;
}
#gallery-list a.photo:hover img,
#gallery-list a.photo:focus-visible img { border-color: #393939; }

#gallery-more {
	min-height: 40px;
	padding: 12px;
	text-align: center;
	font: 13px Arial, sans-serif;
	color: #606060;
}

/* ---- the viewer ---- */

.lb {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	grid-template-rows: auto 1fr auto;
	background: rgba(12, 12, 12, 0.97);
	color: #eee;
	font: 14px "Helvetica Neue", Arial, Helvetica, sans-serif;
	-webkit-user-select: none;
	user-select: none;
}
.lb[hidden] { display: none; }

.lb-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
}
.lb-count { color: #bbb; }

.lb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0 56px;
}
.lb-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
	cursor: pointer;
	transition: opacity 0.15s;
}
.lb.loading .lb-img { opacity: 0.25; }
.lb-spinner {
	position: absolute;
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: lb-spin 0.8s linear infinite;
	display: none;
}
.lb.loading .lb-spinner { display: block; }
@keyframes lb-spin { to { transform: rotate(360deg); } }

.lb-caption {
	min-height: 1.4em;
	padding: 10px 16px 14px;
	text-align: center;
	line-height: 1.4;
}

.lb button {
	border: 0;
	background: none;
	color: #fff;
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
}
.lb button:focus-visible { outline: 2px solid #B9DEF9; outline-offset: 2px; }
.lb-close { font-size: 30px; line-height: 1; padding: 2px 8px; }

/* Previous / next: tall strips down each side, easy to hit */
.lb-prev, .lb-next {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 56px;
	font-size: 44px;
	opacity: 0.75;
}
.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-prev:hover, .lb-next:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }
.lb-prev[disabled], .lb-next[disabled] { opacity: 0.15; cursor: default; background: none; }

@media (max-width: 600px) {
	.lb-stage { padding: 0; }
	.lb-prev, .lb-next { width: 40px; font-size: 32px; background: rgba(0, 0, 0, 0.25); }
}

@media (prefers-reduced-motion: reduce) {
	.lb-img { transition: none; }
	.lb-spinner { animation-duration: 2s; }
}
