/* ============================================================
   Static-site additions: gallery grid, page nav, lightbox.
   Layered on top of the original main/colorscheme/style CSS.
   ============================================================ */

/* --- Gallery grid --- */
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px 8px;
	margin: 12px 0;
}
.tile {
	display: block;
	text-align: center;
	text-decoration: none !important;
}
.tile img {
	display: block;
	width: 100px;
	height: 100px;
	margin: 0 auto;
	object-fit: cover;
	border: 1px solid #bb854a;
	background: #fff;
}
.tile.folder img {
	object-fit: contain;
	border: 0;
	background: transparent;
}
.tile-label {
	display: block;
	margin-top: 4px;
	font-family: verdana, tahoma, arial, sans-serif;
	font-size: 10px;
	line-height: 1.3;
	color: #880a0a;
	word-break: break-word;
}
.tile.photo:hover img {
	outline: 2px solid #880a0a;
	outline-offset: 1px;
}

/* --- Toolbar / page navigation --- */
.gallery-tools {
	margin: 8px 0;
	font-size: 11px;
}
.slideshow-btn {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: #880a0a;
	text-decoration: underline;
	cursor: pointer;
}
.slideshow-btn:hover {
	color: #93775a;
}
.pagenav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	justify-content: center;
	margin: 12px 0;
	font-family: verdana, tahoma, arial, sans-serif;
	font-size: 11px;
}
.pagenav a {
	color: #880a0a;
	text-decoration: underline;
}
.pagenav .current {
	font-weight: bold;
	color: #000;
}
.pagenav .sep {
	color: #bb854a;
}

/* --- Lightbox --- */
.lb {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
}
.lb.open {
	display: block;
}
.lb-backdrop {
	position: absolute;
	inset: 0;
	background: #520000;
	opacity: 0.97;
}
.lb-stage {
	position: absolute;
	inset: 0 0 64px 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.lb-img {
	position: absolute;
	max-width: 92vw;
	max-height: 100%;
	opacity: 0;
	transition: opacity 0.6s ease;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}
.lb-img.show {
	opacity: 1;
}
.lb-btn {
	position: absolute;
	background: rgba(0, 0, 0, 0.35);
	border: 0;
	color: #f3e4c6;
	font-family: arial, sans-serif;
	cursor: pointer;
	line-height: 1;
	transition: background 0.2s ease, color 0.2s ease;
}
.lb-btn:hover {
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
}
.lb-close {
	top: 12px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 30px;
	border-radius: 50%;
}
.lb-prev,
.lb-next {
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 84px;
	font-size: 44px;
}
.lb-prev {
	left: 12px;
}
.lb-next {
	right: 12px;
}
.lb-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 64px;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 0 20px;
	background: rgba(0, 0, 0, 0.4);
	color: #f3e4c6;
	font-family: verdana, tahoma, arial, sans-serif;
	font-size: 12px;
}
.lb-caption {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.lb-count {
	flex: 0 0 auto;
	opacity: 0.85;
}
.lb-play {
	position: static;
	flex: 0 0 auto;
	padding: 7px 14px;
	border-radius: 4px;
	font: inherit;
}
.lb-full {
	flex: 0 0 auto;
	color: #f3e4c6;
	text-decoration: underline;
}
.lb-full:hover {
	color: #fff;
}

@media (max-width: 600px) {
	.lb-prev,
	.lb-next {
		width: 40px;
		font-size: 32px;
	}
	.lb-bar {
		gap: 10px;
		padding: 0 10px;
		font-size: 11px;
	}
	.lb-full {
		display: none;
	}
}
