
.gallery-modal { display: none; }
.gallery-modal[aria-hidden="false"] {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9998;
}

.gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    z-index: 9998;
}

.gallery-content {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 92vw;
    max-height: 86vh;
    width: 1000px;
    display: block;
    z-index: 9999;
    pointer-events: auto;
    background: transparent;
    outline: none;
}

:root {
    --gallery-arrow-offset: 220px;
    --carousel-h-padding: 0;
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 72vh;
    max-height: 720px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0,0,0,0.02);

    padding: 0;
    box-sizing: border-box;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-track img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    opacity: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 220ms cubic-bezier(.22,.9,.34,1), opacity 180ms ease, filter 180ms ease;
    will-change: transform, opacity;
    pointer-events: none;
    transform-origin: center center;
}

.carousel-track img.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    z-index: 3;
    pointer-events: auto;
    filter: none;
}

.carousel-track img.prev {
    transform: translate(calc(-50% - 120%), -50%) scale(0.86);
    opacity: 0.34;
    z-index: 2;
    pointer-events: none;
    filter: brightness(0.9);
    max-width: 70%;
}

.carousel-track img.next {
    transform: translate(calc(-50% + 120%), -50%) scale(0.86);
    opacity: 0.34;
    z-index: 2;
    pointer-events: none;
    filter: brightness(0.9);
    max-width: 70%;
}

.carousel-track img.hidden-left {
    transform: translate(calc(-50% - 300%), -50%) scale(0.86);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 1;
}

.carousel-track img.hidden-right {
    transform: translate(calc(-50% + 300%), -50%) scale(0.86);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 1;
}

.controls-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    pointer-events: auto;
}

.carousel-control {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 26px;
    cursor: pointer;
    padding: 0;
}

@media (min-width: 769px) {
    .carousel-control {
        width: 48px;
        height: 56px;
        font-size: 28px;
    }
}

.carousel-control[disabled] {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 768px) {
    .controls-row { margin-top: 10px; gap: 10px; }
    .carousel-control { width: 40px; height: 40px; font-size: 20px; }
    @media (max-width: 420px) {
        .controls-row { gap: 8px; margin-top: 8px; }
    }
}

/* Close button styles */
.gallery-close {
	position: absolute;
	right: 12px;
	top: 12px;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;

	background: rgba(0,0,0,0.6);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 9999px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 6px 20px rgba(0,0,0,0.45);
	pointer-events: auto;
	z-index: 10030;
}

@media (max-width: 420px) {
	.gallery-close {
		right: 10px;
		top: 10px;
		width: 40px;
		height: 40px;
		font-size: 18px;
	}
}
