/* Album Instagram grid — 18 photos, 6 columns x 3 rows on desktop.
   Overrides / extends the original theme styles so every tile (including
   video posts) gets a square crop via object-fit: cover. */

#AlbumInstagram {
    flex: 1 1 auto;
    min-width: 0;
}

.instagram_gallery--cols-6 {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
}

.instagram_gallery--cols-6 .instagram-image,
.instagram_gallery--cols-6 .instagram-sidecar,
.instagram_gallery--cols-6 .instagram-video {
    position: relative;
    display: block;
    overflow: hidden;
    width: 33.3333333333%;
    opacity: 1;
    cursor: pointer;
    transition: z-index 0s;
    z-index: 1;
}

.instagram_gallery--cols-6 .instagram-image:hover,
.instagram_gallery--cols-6 .instagram-sidecar:hover,
.instagram_gallery--cols-6 .instagram-video:hover {
    opacity: 1;
    z-index: 4;
    overflow: visible;
}

@media (min-width: 992px) {
    .instagram_gallery--cols-6 .instagram-image,
    .instagram_gallery--cols-6 .instagram-sidecar,
    .instagram_gallery--cols-6 .instagram-video {
        width: calc(16.6666666667% - 10px);
        margin: 0 5px 10px;
        border-radius: 2px;
    }
}

.instagram_gallery--cols-6 .instagram-image::before,
.instagram_gallery--cols-6 .instagram-sidecar::before,
.instagram_gallery--cols-6 .instagram-video::before {
    display: block;
    content: '';
    width: 100%;
    padding-top: 100%;
}

.instagram_gallery--cols-6 .instagram-sidecar::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

.instagram_gallery--cols-6 .instagram-image img,
.instagram_gallery--cols-6 .instagram-sidecar img,
.instagram_gallery--cols-6 .instagram-video img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    margin: 0;
    min-width: 0;
    min-height: 0;
    max-width: none;
    transform-origin: center center;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.38s ease;
    will-change: transform;
}

.instagram_gallery--cols-6 .instagram-image:hover img,
.instagram_gallery--cols-6 .instagram-sidecar:hover img,
.instagram_gallery--cols-6 .instagram-video:hover img {
    transform: scale(1.06) rotate(-1.25deg);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

@media (min-width: 992px) {
    .instagram_gallery--cols-6 .instagram-image:hover img,
    .instagram_gallery--cols-6 .instagram-sidecar:hover img,
    .instagram_gallery--cols-6 .instagram-video:hover img {
        transform: perspective(900px) scale(1.06) rotateY(-2deg) rotateX(1.5deg) rotateZ(-1deg);
    }
}
