/* Instagram: --post-ratio:4 / 5 für Hochformat, 1 / 1 für quadratische Posts.
   object-fit:contain zeigt jedes Bild vollständig, auch bei gemischten Formaten. */
.ig-grid {
    --post-ratio: 4 / 5;
    --grid-angle: -15deg;
    --grid-gap: 12px;
    --grid-brightness: .72;
    --grid-drift: 2.5%;
    --grid-duration: 38s;
}

.ig-grid, .ig-grid * {
    box-sizing: border-box;
}

.ig-grid {
    position: relative;
    width: 100%;
    height: 70vh;
    height: 70dvh;
    background: black;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    isolation: isolate;
}

.ig-grid__grid {
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(200%, 180vh);
    width: max(200%, 180dvh);
    display: grid;
    grid-template-rows:repeat(5, auto);
    gap: var(--grid-gap);
    transform: translate(-50%, -50%) rotate(var(--grid-angle));
    filter: brightness(var(--grid-brightness));
}

.ig-grid__row {
    display: grid;
    grid-template-columns:repeat(10, minmax(0, 1fr));
    gap: var(--grid-gap);
    animation: ig-grid-drift var(--grid-duration) ease-in-out infinite alternate;
    will-change: transform;
}

.ig-grid__row:nth-child(2) {
    animation-duration: 44s;
    animation-delay: -19s;
    animation-direction: alternate-reverse;
}

.ig-grid__row:nth-child(3) {
    animation-duration: 40s;
    animation-delay: -27s;
}

.ig-grid__row:nth-child(4) {
    animation-duration: 48s;
    animation-delay: -11s;
    animation-direction: alternate-reverse;
}

.ig-grid__row:nth-child(5) {
    animation-duration: 42s;
    animation-delay: -23s;
}

.ig-grid__tile {
    position: relative;
    aspect-ratio: var(--post-ratio);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: black;
}

.ig-grid__tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #1c2390 0%, #952260 100%);
    z-index: 2;
    mix-blend-mode: color;
}

.ig-grid__tile img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.ig-grid__grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: rgba(0, 0, 0, .4);
    z-index: 1;
}

/*.ig-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #66666633, #00000000 100%);
    pointer-events: none;
}*/

@keyframes ig-grid-drift {
    from {
        transform: translate3d(calc(-1 * var(--grid-drift)), 0, 0);
    }
    to {
        transform: translate3d(var(--grid-drift), 0, 0);
    }
}

@media (max-width: 600px) {
    .ig-grid {
        --grid-gap: 8px;
    }

    .ig-grid__grid {
        width: max(340%, 180vh);
        width: max(340%, 180dvh);
    }

    .ig-grid__tile {
        border-radius: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ig-grid__row {
        animation: none;
        will-change: auto;
    }
}

.ig-grid--square {
    --post-ratio: 1 / 1;
}

.ig-grid--paused .ig-grid__row {
    animation-play-state: paused;
}

section:has(.ig-grid) p {
    color: white;
}

section:has(.ig-grid) .primary-button,
section:has(.ig-grid) .primary-button i{
    color: white;
}

section:has(.ig-grid) .primary-button .logographic {
    position: relative;
    float: left;
    border: 1px solid white;
    border-radius: 100%;
    height: 40px;
    width: 40px;
    margin-right: 1rem;
}

section:has(.ig-grid) .primary-button .logographic svg {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%,-50%);
    -ms-transform: translate(-50%,-50%);
    -o-transform: translate(-50%,-50%);
    transform: translate(-50%, -50%);
    height: 15px;
}

section:has(.ig-grid) .primary-button .logographic svg path {
    fill: white;
}
@media (min-width: 1400px) {
    section:has(.ig-grid) .primary-button + .primary-button {
        margin-left: 1rem;
    }
}
@media (min-width:768px) and (max-width: 991.98px) {
    section:has(.ig-grid) .col-md-6 {
        width: 75%;
    }
}
@media (max-width: 767.98px) {
    section:has(.ig-grid) .container {
        padding-right: var(--bs-gutter-x);
        padding-left: var(--bs-gutter-x);
    }

}
