/* EP Gallery — Frontend Styles */

/* Gallery title */
.ep-gallery-title {
	margin: 0 0 16px;
	font-size: 1.4em;
	font-weight: 600;
	line-height: 1.3;
}

/* Grid */
.ep-gallery {
	display: grid;
	margin: 24px 0;
}

/* Gap modifiers — default is --gap-8 */
.ep-gallery--gap-0  { gap: 0; }
.ep-gallery--gap-4  { gap: 4px; }
.ep-gallery--gap-8  { gap: 8px; }
.ep-gallery--gap-16 { gap: 16px; }
.ep-gallery--gap-24 { gap: 24px; }

.ep-gallery--cols-2 { grid-template-columns: repeat(2, 1fr); }
.ep-gallery--cols-3 { grid-template-columns: repeat(2, 1fr); }
.ep-gallery--cols-4 { grid-template-columns: repeat(2, 1fr); }
.ep-gallery--cols-5 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 640px) {
	.ep-gallery--cols-3 { grid-template-columns: repeat(3, 1fr); }
	.ep-gallery--cols-4 { grid-template-columns: repeat(3, 1fr); }
	.ep-gallery--cols-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
	.ep-gallery--cols-4 { grid-template-columns: repeat(4, 1fr); }
	.ep-gallery--cols-5 { grid-template-columns: repeat(5, 1fr); }
}

.ep-gallery-item {
	margin: 0;
	overflow: hidden;
	border-radius: 4px;
}
.ep-gallery-link {
	display: block;
	line-height: 0;
}
.ep-gallery-link img {
	width: 100%;
	height: auto;
	display: block;
	margin: 0;
	transition: transform 0.2s ease;
}
.ep-gallery-link:hover img {
	transform: scale(1.03);
}
.ep-gallery-caption {
	font-size: 13px;
	color: #6b7280;
	padding: 6px 0;
	line-height: 1.4;
}

/* Lightbox */
.ep-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ep-lightbox-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.9);
}
.ep-lightbox-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.ep-lightbox-image-wrap {
	position: relative;
	display: inline-block;
	line-height: 0;
}
.ep-lightbox-img {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 2px;
}
.ep-lightbox-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: none;
	border: none;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
	padding: 4px 12px;
	line-height: 1;
	z-index: 1;
}
.ep-lightbox-close:hover {
	color: #d1d5db;
}

/* Slideshow play/pause button */
.ep-lightbox-play {
	position: absolute;
	top: -40px;
	right: 44px;
	background: none;
	border: none;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	padding: 4px 10px;
	line-height: 1;
	z-index: 1;
	opacity: 0.8;
}
.ep-lightbox-play:hover {
	opacity: 1;
}

.ep-lightbox-prev,
.ep-lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	border: none;
	color: #fff;
	font-size: 36px;
	cursor: pointer;
	padding: 12px 16px;
	line-height: 1;
	border-radius: 4px;
}
.ep-lightbox-prev { left: -60px; }
.ep-lightbox-next { right: -60px; }
.ep-lightbox-prev:hover,
.ep-lightbox-next:hover {
	background: rgba(0, 0, 0, 0.8);
}
.ep-lightbox-caption {
	color: #d1d5db;
	font-size: 14px;
	margin-top: 12px;
	text-align: center;
	max-width: 600px;
}

/* EXIF panel — default "below" layout */
.ep-lightbox-exif {
	display: none;
	margin-top: 10px;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 4px;
	padding: 8px 12px;
	max-width: 400px;
	width: 100%;
}
/* Below layout: two-column grid, label | value */
.ep-lightbox-exif-table {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 12px;
	row-gap: 2px;
	width: 100%;
}
.ep-lightbox-exif-row {
	display: contents;
}

/* EXIF panel — "overlay" layout: semi-transparent strip on the image */
.ep-lightbox-content--exif-overlay .ep-lightbox-exif {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: auto;
	margin: 0;
	max-width: none;
	background: rgba(0, 0, 0, 0.65);
	border-radius: 0 0 2px 2px;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	padding: 8px 14px;
	box-sizing: border-box;
	line-height: 1.4;  /* override line-height:0 inherited from .ep-lightbox-image-wrap */
	transition: opacity 0.15s ease, transform 0.15s ease;
}
/* Overlay mode: click image to toggle the EXIF panel */
.ep-lightbox-content--exif-overlay .ep-lightbox-image-wrap {
	cursor: pointer;
}
.ep-lightbox-content--exif-overlay.ep-lightbox-exif-collapsed .ep-lightbox-exif {
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
}
.ep-lightbox-content--exif-overlay .ep-lightbox-exif-table {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	column-gap: 16px;
	row-gap: 2px;
	width: auto;
	margin: 0 auto;
}
.ep-lightbox-content--exif-overlay .ep-lightbox-exif-row {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
}
.ep-lightbox-content--exif-overlay .ep-exif-label,
.ep-lightbox-content--exif-overlay .ep-exif-value {
	padding: 0;
	white-space: nowrap;
}

/* Overlay — mobile: stack rows vertically on narrow screens */
@media (max-width: 640px) {
	.ep-lightbox-content--exif-overlay .ep-lightbox-exif {
		padding: 6px 12px;
	}
	.ep-lightbox-content--exif-overlay .ep-lightbox-exif-table {
		flex-direction: column;
		align-items: stretch;
		row-gap: 2px;
	}
	.ep-lightbox-content--exif-overlay .ep-lightbox-exif-row {
		display: flex;
		width: 100%;
	}
	.ep-lightbox-content--exif-overlay .ep-exif-label {
		min-width: 72px;
		flex-shrink: 0;
	}
	.ep-lightbox-content--exif-overlay .ep-exif-value {
		white-space: normal;
		word-break: break-word;
		flex: 1;
		min-width: 0;
	}
}

/* EXIF panel — "side" layout: panel to the right of the image on wide screens */
@media (min-width: 960px) {
	.ep-lightbox-content--exif-side {
		flex-direction: row;
		align-items: flex-start;
		gap: 20px;
	}
	.ep-lightbox-content--exif-side .ep-lightbox-exif {
		margin-top: 0;
		align-self: stretch;
		min-width: 260px;
		max-width: 320px;
		background: rgba(0, 0, 0, 0.7);
	}
	.ep-lightbox-content--exif-side .ep-lightbox-caption {
		width: 100%;
		order: 3;
		flex-basis: 100%;
	}
}
.ep-exif-label {
	color: #9ca3af;
	font-size: 11px;
	font-family: monospace;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.ep-exif-value {
	color: #e5e7eb;
	font-size: 12px;
	font-family: monospace;
}

/* Responsive lightbox nav */
@media (max-width: 768px) {
	.ep-lightbox-prev { left: 4px; font-size: 28px; padding: 8px 12px; }
	.ep-lightbox-next { right: 4px; font-size: 28px; padding: 8px 12px; }
	.ep-lightbox-close { top: -36px; font-size: 28px; }
	.ep-lightbox-play  { top: -36px; right: 40px; font-size: 16px; }
}
