/* Static photo/video gallery grid + lightbox.
   Replaces the old iWeb MediaGrid/DetailView/HeaderControls/FooterControls
   widgets, which depended on an absolute local file:// feed path that
   cannot work once published (see conversion notes). */

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 0 auto;
	padding: 0;
	width: 100%;
	box-sizing: border-box;
}

.gallery-item {
	position: relative;
	display: block;
	background: #111;
	border: 1px solid #333;
	overflow: hidden;
	cursor: pointer;
	text-decoration: none;
}

.gallery-item img {
	display: block;
	width: 100%;
	height: 172px;
	object-fit: cover;
}

.gallery-item .gallery-caption {
	display: block;
	padding: 4px 6px;
	font-family: Arial, sans-serif;
	font-size: 11px;
	line-height: 1.3em;
	color: #ccc;
	background: #000;
}

.gallery-item .video-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-family: Arial, sans-serif;
	font-size: 10px;
	padding: 2px 5px;
	border-radius: 3px;
}

/* Lightbox overlay */
.lightbox-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 1000;
	text-align: center;
}

.lightbox-overlay.open {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.lightbox-overlay img,
.lightbox-overlay video {
	max-width: 90vw;
	max-height: 80vh;
}

.lightbox-caption {
	color: #eee;
	font-family: Arial, sans-serif;
	font-size: 13px;
	margin-top: 12px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: none;
	font-family: Arial, sans-serif;
	font-size: 28px;
	line-height: 1;
	padding: 10px 16px;
	cursor: pointer;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-close {
	top: 18px;
	right: 18px;
	left: auto;
	transform: none;
	font-size: 22px;
	padding: 6px 12px;
}

@media (max-width: 640px) {
	.gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
