/**
 * Instagram görselleri — tam genişlik (viewport) kayan şerit
 */
.instagram-gallery-wrapper {
    --ig-fade: #ffffff;
    --ig-track: rgba(99, 102, 241, 0.35);
    --ig-slide: clamp(132px, 14vw, 188px);
    --ig-pad-x: clamp(1rem, 4vw, 2.5rem);
    --ig-aspect: 3 / 4;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.instagram-gallery-inner {
    position: relative;
    background: #fff;
    border: 0;
    border-radius: 0;
    padding: 1.15rem 0 1rem;
    box-shadow: none;
    overflow: hidden;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.instagram-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 auto 1rem;
    padding: 0 var(--ig-pad-x) 0.75rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    flex-wrap: wrap;
    max-width: var(--container-max-width, 1200px);
    box-sizing: border-box;
}

.instagram-gallery-title {
    margin: 0;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    font-weight: 700;
    color: var(--gray-800, #1f2937);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.instagram-gallery-follow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
}

.instagram-gallery-follow:hover {
    text-decoration: none;
    color: var(--primary-600, #4f46e5);
    border-color: rgba(99, 102, 241, 0.35);
}

.instagram-gallery-follow:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.35);
    outline-offset: 1px;
}

.instagram-gallery-follow__icon {
    display: inline-flex;
    opacity: 0.75;
}

.instagram-gallery-carousel-box {
    position: relative;
    margin: 0;
    padding: 0.15rem 0 0.4rem;
    min-width: 0;
    width: 100%;
}

.instagram-gallery-carousel-box::before,
.instagram-gallery-carousel-box::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0.4rem;
    width: clamp(24px, 4vw, 56px);
    z-index: 6;
    pointer-events: none;
}

.instagram-gallery-carousel-box::before {
    left: 0;
    background: linear-gradient(90deg, var(--ig-fade) 0%, transparent 100%);
}

.instagram-gallery-carousel-box::after {
    right: 0;
    background: linear-gradient(270deg, var(--ig-fade) 0%, transparent 100%);
}

@keyframes ig-ribbon-flow {
    0%, 100% { background-position: 120% 0; }
    50% { background-position: -20% 0; }
}

.instagram-gallery-scroll-ribbon {
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--ig-track),
        var(--primary-400, #818cf8),
        var(--ig-track),
        transparent
    );
    background-size: 180% 100%;
    opacity: 0.35;
    z-index: 5;
    pointer-events: none;
    animation: ig-ribbon-flow 3.2s ease-in-out infinite;
}

.instagram-gallery-swiper.swiper {
    position: relative;
    overflow: hidden;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    min-width: 0;
    padding: 0 var(--ig-pad-x);
    box-sizing: border-box;
}

.instagram-gallery-swiper .swiper-wrapper {
    align-items: stretch;
    transition-timing-function: linear !important;
}

.instagram-gallery-swiper .instagram-gallery-slide {
    width: var(--ig-slide) !important;
    height: auto;
    flex-shrink: 0;
}

.instagram-gallery-wrapper--density-few {
    --ig-slide: clamp(148px, 16vw, 200px);
}

.instagram-gallery-wrapper--density-medium {
    --ig-slide: clamp(136px, 14vw, 188px);
}

.instagram-gallery-wrapper--density-many {
    --ig-slide: clamp(120px, 12vw, 168px);
}

.instagram-gallery-card {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    outline: none;
}

.instagram-gallery-card--static {
    cursor: default;
}

.instagram-gallery-card:focus-visible {
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35);
}

.instagram-gallery-figure {
    position: relative;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: var(--ig-aspect, 3 / 4);
    width: 100%;
    background: transparent;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.instagram-gallery-card:hover .instagram-gallery-figure,
.instagram-gallery-card:focus-visible .instagram-gallery-figure {
    box-shadow: none;
    transform: translateY(-2px);
}

.instagram-gallery-figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: transparent;
    transition: transform 0.45s ease;
}

.instagram-gallery-card:hover .instagram-gallery-figure img,
.instagram-gallery-card:focus-visible .instagram-gallery-figure img {
    transform: none;
}

.instagram-gallery-card__cap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.instagram-gallery-card:hover .instagram-gallery-card__cap,
.instagram-gallery-card:focus-visible .instagram-gallery-card__cap {
    opacity: 1;
}

.instagram-gallery-card__cap-icon {
    display: inline-flex;
    opacity: 0.95;
}

.instagram-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 50%;
    background: #fff;
    color: var(--gray-700, #374151);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.instagram-gallery__nav:hover {
    color: var(--primary-600, #4f46e5);
    transform: translateY(-50%) scale(1.06);
}

.instagram-gallery__nav:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.35);
    outline-offset: 1px;
}

.instagram-gallery__nav--prev { left: max(0.5rem, calc(var(--ig-pad-x) - 0.25rem)); }
.instagram-gallery__nav--next { right: max(0.5rem, calc(var(--ig-pad-x) - 0.25rem)); }

.instagram-gallery__nav.swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}

@media (max-width: 640px) {
    .instagram-gallery-wrapper {
        --ig-slide: clamp(120px, 38vw, 156px);
        --ig-pad-x: 0.85rem;
    }

    .instagram-gallery-inner {
        padding: 0.9rem 0 0.85rem;
    }

    .instagram-gallery__nav {
        width: 38px;
        height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .instagram-gallery-figure img,
    .instagram-gallery-card,
    .instagram-gallery-follow,
    .instagram-gallery-card__cap,
    .instagram-gallery__nav,
    .instagram-gallery-figure {
        transition: none;
    }

    .instagram-gallery-scroll-ribbon {
        animation: none;
        opacity: 0.2;
    }

    .instagram-gallery-card:hover .instagram-gallery-figure img,
    .instagram-gallery-card:focus-visible .instagram-gallery-figure img,
    .instagram-gallery-card:hover .instagram-gallery-figure,
    .instagram-gallery-card:focus-visible .instagram-gallery-figure {
        transform: none;
    }

    .instagram-gallery__nav:hover {
        transform: translateY(-50%);
    }

    .instagram-gallery-swiper .swiper-wrapper {
        transition-timing-function: ease !important;
    }
}

/* —— Şablonlar —— */

.instagram-gallery-wrapper--tpl-strip {
    --ig-fade: #f9fafb;
    --ig-track: rgba(99, 102, 241, 0.28);
}

.instagram-gallery-wrapper--tpl-cards {
    --ig-fade: #ffffff;
    --ig-track: rgba(79, 70, 229, 0.4);
}

.instagram-gallery-wrapper--tpl-band {
    --ig-fade: #0f172a;
    --ig-track: rgba(165, 180, 252, 0.55);
}

.instagram-gallery-wrapper--tpl-strip .instagram-gallery-inner {
    background: var(--gray-50, #f9fafb);
    border-top: 3px solid var(--primary-500, #6366f1);
    border-bottom: 0;
}

.instagram-gallery-wrapper--tpl-cards .instagram-gallery-inner {
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.instagram-gallery-wrapper--tpl-cards .instagram-gallery-figure {
    border-radius: 14px;
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-inner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 55%, #1e1b4b 100%);
    border: 0;
    padding: 1.4rem 0 1.2rem;
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-header {
    border-bottom-color: rgba(248, 250, 252, 0.12);
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-title {
    color: #f8fafc;
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-follow {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-follow:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery__nav {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    color: #f1f5f9;
    box-shadow: none;
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery__nav:hover {
    background: rgba(255, 255, 255, 0.26);
    color: #fff;
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-card__cap {
    background: rgba(0, 0, 0, 0.5);
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-figure {
    box-shadow: none;
}

.instagram-gallery-wrapper--tpl-band .instagram-gallery-figure img {
    background: transparent;
}
