.spa-gallery-wrap {
	--spa-columns: 4;
	margin: 1.5em 0;
}

/* Timeline layout */
.spa-layout-timeline .spa-gallery-body {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.spa-timeline-day {
	margin: 0;
	padding: 0;
	border: 0;
}

.spa-timeline-date {
	margin: 0 0 14px;
	padding: 0 0 8px;
	font-size: 1.15em;
	font-weight: 600;
	line-height: 1.4;
	border-bottom: 2px solid currentColor;
	opacity: 0.85;
}

.spa-layout-timeline .spa-timeline-day + .spa-timeline-day {
	padding-top: 4px;
}

.spa-gallery-grid {
	display: grid;
	grid-template-columns: repeat(var(--spa-columns), 1fr);
	gap: 12px;
}

@media (max-width: 992px) {
	.spa-gallery-wrap.spa-cols-4 .spa-gallery-grid,
	.spa-gallery-wrap.spa-cols-5 .spa-gallery-grid,
	.spa-gallery-wrap.spa-cols-6 .spa-gallery-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 600px) {
	.spa-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.spa-item-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.spa-item-thumb {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: #f0f0f0;
	border-radius: 4px;
}

.spa-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.spa-item-link:hover .spa-item-thumb img {
	transform: scale(1.03);
}

.spa-play-icon::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 50%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 55% center;
	background-size: 24px;
	pointer-events: none;
}

.spa-watermark {
	position: absolute;
	pointer-events: none;
	font-size: 12px;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
	opacity: var(--spa-wm-opacity, 0.5);
	padding: 4px 8px;
	white-space: nowrap;
}

.spa-wm-pos-bottom-right .spa-watermark {
	right: 6px;
	bottom: 6px;
}

.spa-wm-pos-bottom-left .spa-watermark {
	left: 6px;
	bottom: 6px;
}

.spa-wm-pos-top-right .spa-watermark {
	right: 6px;
	top: 6px;
}

.spa-wm-pos-top-left .spa-watermark {
	left: 6px;
	top: 6px;
}

.spa-wm-pos-center .spa-watermark {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.spa-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 20px;
	justify-content: center;
}

.spa-pagination a {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #ddd;
	border-radius: 3px;
	text-decoration: none;
	color: #333;
}

.spa-pagination a.is-active,
.spa-pagination a:hover {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.spa-gallery-wrap.spa-ajax-loading {
	opacity: 0.6;
	pointer-events: none;
}

.spa-empty,
.spa-error {
	text-align: center;
	color: #666;
}

/* Lightbox */
.spa-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.spa-lightbox[hidden] {
	display: none !important;
}

.spa-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
}

.spa-lightbox-content {
	position: relative;
	z-index: 1;
	max-width: 92vw;
	max-height: 90vh;
}

.spa-lightbox-content img,
.spa-lightbox-content video {
	max-width: 92vw;
	max-height: 90vh;
	display: block;
	margin: 0 auto;
}

.spa-lightbox-close {
	position: absolute;
	top: 16px;
	right: 20px;
	z-index: 2;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.spa-lightbox-title {
	color: #fff;
	text-align: center;
	margin-top: 12px;
	font-size: 14px;
}

body.spa-lightbox-open {
	overflow: hidden;
}
