/* Masonry Gallery Styles */
.acf-masonry-gallery {
    display: block;
    column-count: 4;
    column-gap: 0;
    row-gap: 0;
    width: 100%;
}

.acf-masonry-gallery .gallery-item {
    break-inside: avoid;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.acf-masonry-gallery .gallery-item:hover {
    transform: scale(1.02);
}

.acf-masonry-gallery .gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}

/* Modal Styles */
.acf-masonry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.acf-masonry-modal.open {
    display: flex;
}

.acf-masonry-modal .modal-content {
    position: relative;
    width: 94%;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.acf-masonry-modal .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.acf-masonry-modal .close-button:hover,
.acf-masonry-modal .close-button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.acf-masonry-modal .modal-body {
    display: flex;
    flex-direction: row;
	width: 94%;
    height: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .acf-masonry-modal .modal-body {
        flex-direction: column;
    }
}

.acf-masonry-modal .modal-image-container {
        flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    padding-bottom: 80px;
    overflow: hidden;
}

.acf-masonry-modal .modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.acf-masonry-modal .modal-info {
    flex: 0 0 40%;
    padding: 20px;
    overflow-y: auto;
    max-height: 80vh;
}
.modal-content .modal-close svg,
.modal-content .modal-info svg {
	fill: currentColor;
}
.modal-content .modal-info button:focus,
.modal-content .modal-info button:hover {
	background-color: transparent;
}
.modal-download a {
	background-color: #fff;
	color: #000 !important;
	padding: 5px 15px;
	border: 1px solid #000;
	border-radius: 24px;
	display: inline-block;
	margin-bottom: 15px;
}

@media (max-width: 768px) {
    .acf-masonry-modal .modal-info {
        flex: 1;
        max-height: 40vh;
    }
}

.acf-masonry-modal .modal-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.acf-masonry-modal .nav-button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.acf-masonry-modal .modal-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #fff;
    font-size: 24px;
}

.acf-masonry-modal .modal-description {
    color: #ddd;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .acf-masonry-gallery {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .acf-masonry-gallery {
        column-count: 2;
    }
	.acf-masonry-modal .modal-image-container {
		padding-bottom: 20px;
	}
}

@media (max-width: 480px) {
    .acf-masonry-gallery {
        column-count: 1;
    }
}

/* Body class when modal is open to prevent scrolling */
body.modal-open {
    overflow: hidden;
}