.modInstagram2 {
    width: 100%;
}

.instagram-feed {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0 0 20px;
}

.instagram-feed__item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #111;
    cursor: pointer;
}

.instagram-feed__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.instagram-feed__item:hover img {
    transform: scale(1.06);
}

.instagram-feed__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.instagram-feed__badge--video {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 18px no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.instagram-feed__badge--carousel {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M7 7h12v12H7z'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M5 5h12v12'/%3E%3C/svg%3E") center / 18px no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.instagram-feed__profile {
    margin: 0 0 20px;
    text-align: center;
}

.instagram-feed__profile a {
    color: #434343;
    font-family: 'Montserrat-Medium', sans-serif;
    font-size: 16px;
}

.instagram-feed__profile a:hover {
    color: #e42926;
}

.instagram-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
}

.instagram-modal.is-open {
    display: flex;
}

.instagram-modal__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(960px, calc(100vw - 120px));
    height: min(90vh, 960px);
    max-width: 100%;
}

.instagram-modal__image,
.instagram-modal__video {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #000;
}

.instagram-modal__video {
    width: 100%;
    height: auto;
    max-height: 90vh;
}

.instagram-modal__close,
.instagram-modal__nav {
    position: absolute;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.instagram-modal__close:hover,
.instagram-modal__nav:hover {
    background: rgba(255, 255, 255, 0.28);
}

.instagram-modal__close:disabled,
.instagram-modal__nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.instagram-modal__close {
    top: 16px;
    right: 16px;
    font-size: 32px;
}

.instagram-modal__nav--prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.instagram-modal__nav--next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.instagram-modal__meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 72px;
    color: #fff;
    text-align: center;
    pointer-events: none;
}

.instagram-modal__counter,
.instagram-modal__caption {
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.instagram-modal__caption {
    max-width: 720px;
    font-size: 14px;
}

.instagram-modal__link {
    pointer-events: auto;
    color: #fff;
    font-size: 14px;
    text-decoration: underline;
}

.instagram-modal-open {
    overflow: hidden;
}

@media (max-width: 575px) {
    .instagram-feed {
        gap: 4px;
    }

    .instagram-modal__stage {
        width: calc(100vw - 24px);
        height: 80vh;
    }

    .instagram-modal__nav--prev {
        left: 8px;
    }

    .instagram-modal__nav--next {
        right: 8px;
    }

    .instagram-modal__meta {
        padding: 0 16px;
        bottom: 12px;
    }
}
