/* Horizontal images */
.subgallery {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.subgallery img,
.subgallery video {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	margin: auto;
}

/* ==================== GALLERY MASONRY ==================== */

.grid {
	margin: 0 auto;
	position: relative;
	padding: var(--spacing);
	max-width: calc(9 * 350px + 6 * 1rem);
}

.grid-sizer,
.grid-item {
	width: 350px; /* column width, adjust for 3 columns */
}

.grid-item {
	margin-bottom: var(--spacing);
	background: white;
	overflow: hidden;
}

.grid-item img,
.grid-item video {
	display: block;
	width: 100%;
	height: auto;
	-webkit-user-select: none;
	user-select: none;
}

.grid-item p {
	margin: 1rem 0 1rem 0;
	text-align: center;
	color: var(--black-color);
	font-weight: var(--font-semibold);
}

/* Loader overlay styles */
.grid-item,
.subgallery {
	position: relative;
}
.video-loader {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 1);
	pointer-events: none;
	color: #000000;
	font-size: 1rem;
	z-index: 10;
}
.video-loader::before {
	content: "";
	width: 1em;
	height: 1em;
	margin-right: 0.5em;
	border: 2px solid rgba(255, 255, 255, 0.528);
	border-top-color: #000000;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Play icon overlay */
/* Ensure the container is positioned for absolute children */
.grid-item {
	position: relative;
}

/* Centered white “play” icon with a white circle */
.play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	box-sizing: border-box;
	width: 2.5em;
	height: 2.5em;
	border: 2px solid white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 1.5em;
	background: rgba(255, 255, 255, 0.1); /* subtle background tint */
	pointer-events: none;
	z-index: 10;
}

.play-overlay p {
	color: white;
	padding-left: 3px;
	padding-top: 2px;
}
