/* Reset spacing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main gallery layout */
.gallery {
    display: flex;
    gap: 30px; /* Increased spacing between columns */
    width: 100%;
}

.gallery-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px; /* Fixed 30px spacing between all items */
    width: calc((100% - 60px) / 3); /* Three equal columns */
}

/* All gallery items */
.gallery-item {
    width: 100%;
    margin-bottom: 0;
}

.image-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* All images (square and rectangular) */
.gallery-item .image-container {
    padding-bottom: 100%; /* Default 1:1 aspect ratio */
    position: relative;
}

.gallery-item .image-container .image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover !important; /* Cover for square images */
    background-position: center;
    background-repeat: no-repeat !important;
}

/* For specific adjustments to rectangular images (38-45) */
.gallery-item.rectangular {
    width: 100% !important;
    margin: 0 !important;
}

.gallery-item.rectangular .image-container {
    padding-bottom: 0 !important;
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-top: 75% !important; /* Set a fixed aspect ratio that's similar to other images */
    overflow: hidden !important;
}

/* Maintain original aspect ratio without cropping */
.gallery-item.rectangular .image-placeholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: contain !important; /* Allow full image to show without cropping */
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: white !important; /* Add white background to maintain spacing */
}

/* Video items */
.gallery-item.video-item .image-container {
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    position: relative;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Covers entire container without distorting */
}

/* Play button on videos */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 30px;
    border-color: transparent transparent transparent #ffffff;
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.5));
    z-index: 5;
}