.layout-gallery {
	margin: 60px 0;
}
.gallery-main {
	width: 100%;
	margin-bottom: 20px;
	position: relative;
	min-height: 400px;
}

.gallery-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

.gallery-slide.active {
	opacity: 1;
	pointer-events: auto;
	position: relative;
}

.gallery-slide img {
	width: 100%;
	height: auto;
	display: block;
	max-height: 400px;
	object-fit: contain;
}

.gallery-thumbs-container {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 0 60px;
	position: relative;
	margin-top: 20px;
}

.gallery-thumbs {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	flex: 1;
	padding: 10px 0;
}

.gallery-thumbs::-webkit-scrollbar {
	display: none;
}

.gallery-thumb {
	flex: 0 0 auto;
	height: 110px;
	transition: all 0.3s ease;
	opacity: 0.8;
	cursor: pointer;
	border: 10px solid transparent;
}

.gallery-thumb.active {
	opacity: 1;
	border: 10px solid var(--global-palette1);
	border-radius: 4px;
}

.gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-nav-button {
	width: 58px;
	height: 58px;
	background: var(--bg-strong);
	border: none;
	border-radius: 4px;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
@media screen and (max-width: 767px) {
	.fullscreen-content button.gallery-nav-button {
		bottom: 20px;
		transform: unset;
		top: unset;
		z-index: 99;
	}
	.fullscreen-content .gallery-thumbs {
		bottom: 100px;
		position: fixed;
		left: 25px;
	}
	.fullscreen-content .gallery-thumbs img {
		opacity: 1 !important;
		max-width: 100%;
	}
}
@media screen and (min-width: 1026px) {
	.gallery-nav-button:hover {
		background: var(--global-palette-btn-bg-hover) !important;
	}
	.gallery-nav-button:hover svg path {
		fill: white !important;
	}
}
.gallery-nav-button:focus {
	background: var(--bg-strong);
}

.gallery-nav-button svg {
	width: 21px;
	height: 37px;
}

.gallery-prev svg,
.fullscreen-prev svg {
	transform: rotate(180deg);
}

.gallery-prev,
.gallery-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.gallery-prev {
	left: -20px;
}

.gallery-next {
	right: -20px;
}

.gallery-prev svg,
.gallery-next svg {
	width: 21px;
	height: 37px;
}

.gallery-caption {
position: static;
    opacity: 0;
    transition: opacity 0.15s ease;
    left: 50%;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
	font-size:100%;
	padding-top:10px;
}

.gallery-slide.active .gallery-caption {
	opacity: 1;
}

.gallery-fullscreen {
	display: flex;
	justify-content: center;
	margin-top: 30px;
}

.gallery-fullscreen .btn--primary {
	display: flex;
	align-items: center;
	padding-left: 0;
	padding-top: 16px;
	padding-bottom: 16px;
	font-size:22px;
}

.gallery-fullscreen .btn--primary svg {
	height: 22px;
	padding-left: 32px;
	padding-right: 8px;
}

/* Fullscreen styles */
.gallery-fullscreen-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	flex-direction: column;
	z-index: 9999;
}

.fullscreen-content {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-bottom: 200px; /* Make space for thumbnails and buttons */
	pointer-events: none; /* Allow clicks to pass through to container */
}

.fullscreen-content img,
.fullscreen-content button,
.fullscreen-content .fullscreen-thumbs {
	pointer-events: auto; /* Re-enable clicks for interactive elements */
}

.fullscreen-content img {
	max-height: calc(100vh - 250px); /* Account for thumbnails and buttons */
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.fullscreen-content img.active {
	opacity: 1;
}

.close-fullscreen {
	position: absolute;
	top: 30px;
	right: 30px;
	background: none;
	border: none;
	color: white;
	font-size: 40px;
	cursor: pointer;
	padding: 10px;
	line-height: 1;
	scale: 1.5;
	background: transparent !important;
	aspect-ratio: 1;
	height: 50px;
	border-radius: 50vmax;
	width: 50px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-family: "gill-sans-nova";
	font-weight: 100;
	transition: 0.2s ease-out;
	outline: 1px solid transparent;
}
@media screen and (min-width: 1026px) {
	.close-fullscreen:hover {
		outline: 1px solid white;
	}
}

/* Fullscreen navigation */
.fullscreen-prev,
.fullscreen-next {
	composes: gallery-nav-button;
	background: var(--bg-strong);
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.fullscreen-prev {
	left: 20px;
}

.fullscreen-next {
	right: 20px;
}

.fullscreen-prev svg,
.fullscreen-next svg {
	fill: white;
}

.fullscreen-thumbs {
	position: fixed;
	bottom: 20px;
	left: 0;
	right: 0;
	display: flex;
	gap: 20px;
	padding: 25px;
	background: rgba(0, 0, 0, 0.5);
	justify-content: center;
	height: 130px;
	align-items: center;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE and Edge */
	z-index: 1;
}
.fullscreen-thumbs img {
	opacity: 1 !important;
}
.fullscreen-thumbs::-webkit-scrollbar {
	display: none; /* Chrome, Safari, Opera */
}

.fullscreen-thumb {
	cursor: pointer;
	opacity: 0.8;
	transition: all 0.3s ease;
	flex: 0 0 auto;
}

.fullscreen-thumb {
	border: 10px solid transparent;
}

.fullscreen-thumb.active {
	opacity: 1;
	border: 10px solid white;
	border-radius: 4px;
}

.fullscreen-thumb img {
	width: 100%;
	max-height: 120px;
	object-fit: cover;
}

.gallery-counter {
	text-align: center;
	padding-top: 14px;
}

.fullscreen-content .gallery-thumbs-container {
	position: fixed;
	bottom: 20px;
	left: 0;
	right: 0;
	padding: 0 60px;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1;
}

.fullscreen-content .gallery-thumbs {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 25px 0;
	height: 130px;
	align-items: center;
	opacity: 1 !important;
}

.fullscreen-content .gallery-thumbs::-webkit-scrollbar {
	display: none;
}

.fullscreen-content .gallery-thumb {
	flex: 0 0 auto;
	height: 110px;
	transition: all 0.3s ease;
	opacity: 1 !important;
	cursor: pointer;
	border: 10px solid transparent;
}

.fullscreen-content .gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 1 !important;
}

.fullscreen-content .gallery-thumb.active {
	opacity: 1 !important;
	border: 10px solid white;
	border-radius: 4px;
}

@media screen and (max-width: 767px) {
	.fullscreen-content .gallery-thumbs-container {
		padding: 0 25px;
	}

	.fullscreen-content .gallery-thumbs {
		bottom: 100px;
	}
}
