/* ==========================================================================
   Instagram reels – slider z rolkami z Instagrama
   ========================================================================== */
.ig-reels {
    width: 100%;
}

.ig-reels__inner {
    box-sizing: content-box;
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-inline: auto;
}

.ig-reels__heading {
    margin: 0;
    font-family: "Newsreader", serif;
    color: var(--theme-palette-color-3);
}

/* Slider wrapper */
.ig-reels__slider {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* Follow link + counter + arrows */
.ig-reels__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ig-reels__follow {
    font-family: "DM Mono", monospace;
    font-size: 12px;
    color: var(--theme-palette-color-3);
    text-decoration: none;
}

.ig-reels__follow:hover {
    color: var(--theme-palette-color-1);
}

.ig-reels__controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ig-reels__counter {
    margin: 0;
    font-family: "DM Mono", monospace;
    font-size: 12px;
    white-space: nowrap;
    color: var(--theme-palette-color-3);
}

.ig-reels__nav {
    display: flex;
    gap: 8px;
}

.ig-reels__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--theme-palette-color-3);
    border-radius: 0;
    background: var(--theme-palette-color-8);
    color: var(--theme-palette-color-3);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}

.ig-reels__prev svg {
    transform: rotate(180deg);
}

.ig-reels__next {
    border-color: var(--theme-palette-color-1);
    background: var(--theme-palette-color-1);
    color: var(--theme-palette-color-8);
}

.ig-reels__arrow:hover {
    border-color: var(--theme-palette-color-3);
    background: var(--theme-palette-color-3);
    color: var(--theme-palette-color-8);
}

.ig-reels__arrow:focus-visible {
    outline: 2px solid var(--theme-palette-color-3);
    outline-offset: 3px;
}

.ig-reels__arrow.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Swiper */
.ig-reels__swiper {
    width: 100%;
    overflow: visible !important;
}

/* Card – Instagram embed (header + video + footer), height set by the ratio below */
.ig-reel {
    position: relative; /* context for .ig-reel__shield */
    overflow: hidden;
    border: 1px solid var(--theme-palette-color-5);
    border-radius: 4px;
    background: var(--theme-palette-color-7);
}

.ig-reel__embed {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    border: 0;
}

/*
* Touch screens - the iframe takes every touch, so swiping over a reel would not
* move the slider. A transparent layer over the reel takes the swipe instead; a tap
* removes it from that reel (.is-active, instagram-reels.js) so the embed can be
* played, and it comes back when the slide changes. Mouse devices - no layer.
*/
.ig-reel__shield {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1;
}

@media (hover: none) and (pointer: coarse) {
    .ig-reel__shield {
        display: block;
    }

    .ig-reel.is-active .ig-reel__shield {
        display: none;
    }
}

/* Pagination – bars instead of dots */
.ig-reels__pagination {
    position: static;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ig-reels__pagination .swiper-pagination-bullet {
    width: 16px;
    height: 4px;
    margin: 0 !important;
    border-radius: 0;
    background: var(--theme-palette-color-5);
    opacity: 1;
    transition: width 0.3s, background-color 0.3s;
}

.ig-reels__pagination .swiper-pagination-bullet-active {
    width: 40px;
    background: var(--theme-palette-color-1);
}

/* Everything fits – no controls needed (the follow link stays) */
.ig-reels__slider.is-locked .ig-reels__controls,
.ig-reels__slider.is-locked .ig-reels__pagination {
    display: none;
}

/* Mobile - follow link (red) in the first line, counter + arrows in the second */
@media (max-width: 767px) {
    .ig-reels__bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ig-reels__follow {
        color: var(--theme-palette-color-1);
    }

    .ig-reels__controls {
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ig-reels *,
    .ig-reels .swiper-wrapper {
        transition: none !important;
    }
}
