/* Theme Studio — Instagram galerisi stilleri (home.instagram_gallery) */

.tf-ig {
    --tf-ig-card-w: 220px;
    --tf-ig-card-h: 300px;
    --tf-ig-radius: 22px;
    --tf-ig-gap: 16px;
    --tf-ig-overlay: 42;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.tf-ig__card {
    flex: 0 0 auto;
    width: var(--tf-ig-card-w);
    height: var(--tf-ig-card-h);
    overflow: hidden;
    position: relative;
    border: var(--tf-ig-card-border-width, 1px) solid var(--tf-ig-card-border-color, rgba(255, 255, 255, 0.22));
    border-radius: var(--tf-ig-card-radius, var(--tf-ig-radius));
    box-sizing: border-box;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    background: #1a1a1a;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.tf-ig__link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.tf-ig__img,
.tf-ig__ph {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tf-ig__ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ece7e0;
    color: #8a8178;
    font-size: 13px;
}

.tf-ig__icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 28px;
    color: #fff;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.tf-ig__card:hover .tf-ig__icon {
    opacity: 1;
}

/* gallery_1: yatay flex JS’ten önce gelsin (alt alta flash’i önler; infiniteslide aynı değerleri yazar) */
.infiniteSlide-gallery {
    overflow: hidden;
    max-width: 100%;
}

.infiniteSlide-gallery .infiniteSlide,
.infiniteSlide-gallery .infiniteSlide-wrapper {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

.infiniteSlide-gallery .infiniteSlide > .infiniteSlide-item {
    flex: none;
    display: block;
}

.infiniteSlide-gallery .gallery-v01 {
    border: var(--tf-ig-card-border-width, 0) solid var(--tf-ig-card-border-color, transparent);
    border-radius: var(--tf-ig-card-radius, 8px);
    box-sizing: border-box;
}

/* 1. Marquee */
.tf-ig--marquee {
    padding: 8px 0;
}

.tf-ig__marquee {
    display: flex;
    width: max-content;
    gap: var(--tf-ig-gap);
    animation: tf-ig-marquee 42s linear infinite;
}

.tf-ig--marquee:hover .tf-ig__marquee {
    animation-play-state: paused;
}

@keyframes tf-ig-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* 2. Cinematic backdrop */
.tf-ig--cinematic {
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px 0 56px;
    background-color: var(--tf-ig-backdrop, transparent);
}

.tf-ig--cinematic-photo {
    background: #111;
}

.tf-ig__backdrop {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.tf-ig__backdrop--empty {
    background: #1c1c1c;
}

.tf-ig__veil {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, calc(var(--tf-ig-overlay, 42) / 100));
    pointer-events: none;
}

.tf-ig__cinematic-copy {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    margin-bottom: 28px;
    padding: 0 20px;
}

.tf-ig__eyebrow {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.8;
}

.tf-ig__handle {
    margin: 8px 0 0;
    font-family: var(--font-1, "Instrument Serif", Georgia, serif);
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.1;
}

.tf-ig--cinematic .tf-ig__rail {
    position: relative;
    z-index: 2;
}

.tf-ig__rail {
    display: flex;
    gap: var(--tf-ig-gap);
    overflow-x: auto;
    scrollbar-width: none;
    cursor: grab;
    padding: 8px max(16px, calc(50vw - 640px));
}

.tf-ig__rail::-webkit-scrollbar {
    display: none;
}

.tf-ig__rail.is-dragging,
.tf-ig__stage.is-dragging {
    cursor: grabbing;
}

.tf-ig--cinematic .tf-ig__card {
    --tf-ig-card-w: 200px;
    --tf-ig-card-h: 280px;
}

/* 3. Coverflow */
.tf-ig--coverflow {
    min-height: 480px;
    background: transparent;
    perspective: 1200px;
}

.tf-ig--coverflow:not([data-ig-ready]) .tf-ig__card,
.tf-ig--cylinder:not([data-ig-ready]) .tf-ig__card,
.tf-ig--wheel:not([data-ig-ready]) .tf-ig__card {
    opacity: 0;
}

.tf-ig__stage {
    position: relative;
    height: 480px;
    transform-style: preserve-3d;
    touch-action: pan-y;
}

.tf-ig--coverflow .tf-ig__card {
    position: absolute;
    top: 50%;
    left: 50%;
    --tf-ig-card-w: clamp(260px, 22vw, 340px);
    --tf-ig-card-h: clamp(350px, 30vw, 460px);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, filter 0.45s ease;
}

/* 4. Cylinder */
.tf-ig--cylinder {
    min-height: 380px;
    background: transparent;
    perspective: 1800px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.tf-ig__ring {
    position: relative;
    width: 100%;
    max-width: 1280px;
    height: 280px;
    transform-style: preserve-3d;
    touch-action: pan-y;
    cursor: grab;
}

.tf-ig__ring.is-dragging {
    cursor: grabbing;
}

.tf-ig--cylinder .tf-ig__card {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: calc(var(--tf-ig-card-h) / -2) 0 0 calc(var(--tf-ig-card-w) / -2);
    --tf-ig-card-w: 280px;
    --tf-ig-card-h: 168px;
}

/* 5. Grid */
.tf-ig--grid {
    padding: 8px 16px 24px;
}

.tf-ig__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 0 auto;
}

.tf-ig--grid .tf-ig__card {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    --tf-ig-radius: 14px;
}

.tf-ig--grid .tf-ig__img,
.tf-ig--grid .tf-ig__ph {
    aspect-ratio: 3 / 4;
}

/* 7. Wheel / fan arc */
.tf-ig--wheel {
    --tf-ig-wheel-r: 460px;
    min-height: 460px;
    background: transparent;
    overflow: hidden;
}

.tf-ig__wheel-floor {
    position: absolute;
    left: 50%;
    top: calc(74% + var(--tf-ig-wheel-r));
    width: calc(var(--tf-ig-wheel-r) * 2);
    height: calc(var(--tf-ig-wheel-r) * 2);
    margin: calc(var(--tf-ig-wheel-r) * -1) 0 0 calc(var(--tf-ig-wheel-r) * -1);
    border-radius: 50%;
    background: color-mix(in srgb, var(--tf-background, #f2f2f2) 78%, #888);
    box-shadow: inset 0 20px 48px rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.tf-ig__wheel {
    position: relative;
    z-index: 1;
    height: 460px;
    touch-action: pan-y;
    cursor: grab;
}

.tf-ig__wheel.is-dragging {
    cursor: grabbing;
}

.tf-ig--wheel .tf-ig__card {
    position: absolute;
    left: 50%;
    bottom: 26%;
    margin-left: calc(var(--tf-ig-card-w) / -2);
    --tf-ig-card-w: 148px;
    --tf-ig-card-h: 210px;
    --tf-ig-radius: 18px;
    border: 0;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
    will-change: transform;
}

@media (max-width: 1199px) {
    .tf-ig--coverflow .tf-ig__card {
        --tf-ig-card-w: 260px;
        --tf-ig-card-h: 360px;
    }

    .tf-ig__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .tf-ig {
        --tf-ig-card-w: 168px;
        --tf-ig-card-h: 230px;
    }

    .tf-ig--cinematic {
        min-height: 440px;
        padding: 32px 0 40px;
    }

    .tf-ig--coverflow,
    .tf-ig__stage {
        min-height: 380px;
        height: 380px;
    }

    .tf-ig--coverflow .tf-ig__card {
        --tf-ig-card-w: 200px;
        --tf-ig-card-h: 280px;
    }

    .tf-ig--cylinder,
    .tf-ig__ring {
        min-height: 260px;
        height: 220px;
    }

    .tf-ig--cylinder .tf-ig__card {
        --tf-ig-card-w: 200px;
        --tf-ig-card-h: 120px;
    }

    .tf-ig--wheel,
    .tf-ig__wheel {
        min-height: 380px;
        height: 380px;
        --tf-ig-wheel-r: 320px;
    }

    .tf-ig--wheel .tf-ig__card {
        --tf-ig-card-w: 132px;
        --tf-ig-card-h: 186px;
        bottom: 22%;
    }

    .tf-ig__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tf-ig__marquee,
    .tf-ig--coverflow .tf-ig__card {
        animation: none;
        transition: none;
    }
}
