/* Gallery row styles */
.custom-gallery-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5%;
	width: 100%;
	box-sizing: border-box;
	padding: 1rem 0;
}

.custom-gallery-row .gallery-item {
	flex: 1 1 calc(33.333% - 1.5%);
	box-sizing: border-box;
	text-align: center;
	margin: 0;
	overflow: hidden;
	height: 200px;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

/* Image styles within gallery items */
.custom-gallery-row .gallery-item img {
	width: 100%;
	height: 150px;
/* fixed height for uniformity */
	object-fit: cover;
	border-radius: 8px;
	display: block;
	margin-bottom: .5rem;
}

/* Caption styles within gallery items */
.custom-gallery-row .gallery-item figcaption {
	font-size: 18px;
	color: gold !important;
	text-align: center;
	flex-grow: 1;
}

.custom-gallery-row .gallery-item figcaption a {
	color: gold !important;
	text-decoration: none;
	font-weight: bold;
}

.custom-gallery-row .gallery-item figcaption a:hover {
	text-decoration: underline;
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
	.custom-gallery-row .gallery-item {
		flex: 1 1 calc(50% - 1.5%);
		height: 180px;
	}
	
	.custom-gallery-row .gallery-item img {
		height: 130px;
	}
}

@media (max-width: 480px) {
	.custom-gallery-row .gallery-item {
		flex: 1 1 100%;
		height: 160px;
	}
	
	.custom-gallery-row .gallery-item img {
		height: 110px;
	}
}

/* Carousel gallery styles */
.custom-carousel-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5%;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	padding: 1rem 0;
}

.custom-carousel-gallery .gallery-item {
	flex: 1 1 calc(33.333% - 1.5%);
	box-sizing: border-box;
	text-align: center;
	overflow: hidden;
	height: 230px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	margin: 0;
}

.custom-carousel-gallery .gallery-item img {
	width: 100%;
	height: 170px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
	margin-bottom: .5rem;
}

.custom-carousel-gallery .gallery-item figcaption {
	font-size: 16px;
	color: gold !important;
	text-align: center;
	flex-grow: 1;
}

.custom-carousel-gallery .gallery-item figcaption a {
	color: gold !important;
	text-decoration: none;
	font-weight: bold;
}

.custom-carousel-gallery .gallery-item figcaption a:hover {
	text-decoration: underline;
}

/* Responsive styles for carousel */
@media (max-width: 768px) {
	.custom-carousel-gallery .gallery-item {
		flex: 1 1 calc(50% - 1.5%);
		height: 200px;
	}
	
	.custom-carousel-gallery .gallery-item img {
		height: 140px;
	}
}

@media (max-width: 480px) {
	.custom-carousel-gallery .gallery-item {
		flex: 1 1 100%;
		height: 180px;
	}
	
	.custom-carousel-gallery .gallery-item img {
		height: 120px;
	}
}

/* Grid container styles */
#custom-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(3, 1fr);
	gap: 20px;
	width: 100%;
}

/* Individual grid item styles */
#custom-gallery-grid .gallery-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px;
	background-color: #fff;
	height: 100%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
}

#custom-gallery-grid .gallery-item img {
	width: 100%;
	height: 150px;
	object-fit: contain;
	border-radius: 4px;
}

/* Caption styling in grid */
#custom-gallery-grid .caption {
	margin-top: 10px;
	font-size: 1.1em;
	text-align: center;
}

#custom-gallery-grid .caption a {
	text-decoration: none;
	color: #333;
}