.instagram-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.instagram-wrapper .instagram-post {
    max-height: 100% !important;
    /* width: calc(100% / 2); */
    position: relative;
}

.instagram-wrapper .instagram-post::before {
    content: "";
    padding-top: 100%;
    display: block;
}

.instagram-wrapper .instagram-post .instagram-link {
    display: block;
    height: 100%;
}

.instagram-wrapper .instagram-post img, .instagram-wrapper .instagram-post a {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instagram-wrapper .instagram-post-video {
    background: #000;
    display: flex;
    position: static;
}

.instagram-wrapper .instagram-post-video video {
    max-width: 100%;
    height: 100%;
}

@media (min-width: 1024px) {
    .instagram-wrapper .instagram-post {
        width: calc(100% / 6);
        max-height: 250px;
    }
}

@media (min-width: 768px) {
    .instagram-wrapper .instagram-post {
        width: calc(100% / 6);
    }
}

/* =============================================================
   Dark Mode — Instagram Feed Block
   ============================================================= */

/* Backstop for the wrapper gap between tiles on slow loads */
[data-theme="dark"] .instagram-wrapper {
    background-color: #111;
}

/* Video tiles already have black bg — just ensure text/icon contrast */
[data-theme="dark"] .instagram-wrapper .instagram-post-video {
    background: #000;
}