/* ── INSTAGRAM ─────────────────────────────────────────────────
   15 gönderiye optimize edilmiş, tam responsive grid.
   Masaüstü: 5×3, Tablet: 4×4, Mobil: 3×5, Küçük mobil: 2×8
   ───────────────────────────────────────────────────────────── */

.instagram-bolum {
    position: relative;
}

/* Bölüm başlığı altındaki açıklama paragrafı */
.instagram-bolum .bolum-baslik p {
    margin-top: .5rem;
    color: var(--metin-soluk, #888);
}

/* ── PROFİL KARTI (başlık altı: foto + kullanıcı + takipçi) ── */
.ig-profil-kart {
    display: inline-flex;
    align-items: center;
    gap: .9rem;
    margin-top: 1rem;
    padding: .55rem .55rem .55rem .65rem;
    border: 1px solid var(--border, #e6dfd2);
    border-radius: 999px;
    background: var(--bg, #fff);
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease,
                box-shadow .25s ease,
                border-color .25s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
    max-width: 100%;
}

.ig-profil-kart:hover,
.ig-profil-kart:focus-visible {
    transform: translateY(-1px);
    border-color: var(--yesil, #2c8a4d);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Profil fotoğrafı çerçevesi — IG markasına benzer gradient halka */
.ig-profil-foto-cerceve {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg,
        #f09433 0%, #e6683c 25%, #dc2743 50%,
        #cc2366 75%, #bc1888 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-profil-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--bg, #fff);
    background: var(--bg-section, #f5f0e6);
}

.ig-profil-foto-yer {
    color: rgba(255,255,255,.85);
    background: linear-gradient(135deg, #bc1888, #f09433);
}

/* Kullanıcı adı + sayılar bloğu */
.ig-profil-meta {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    line-height: 1.2;
    min-width: 0;
}

.ig-profil-isim {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-weight: 700;
    font-size: .95rem;
    color: var(--metin, #1f1b16);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ig-profil-tik {
    flex-shrink: 0;
}

.ig-profil-sayilar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .65rem;
    font-size: .78rem;
    color: var(--metin-soluk, #6b6258);
}

.ig-profil-sayilar strong {
    color: var(--metin, #1f1b16);
    font-weight: 700;
}

/* Sağdaki "Takip Et" rozeti */
.ig-profil-takip {
    flex: 0 0 auto;
    margin-left: .25rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    background: var(--yesil, #2c8a4d);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    transition: filter .2s ease;
}

.ig-profil-kart:hover .ig-profil-takip {
    filter: brightness(1.08);
}

@media (max-width: 480px) {
    .ig-profil-kart {
        gap: .6rem;
        padding: .45rem .5rem .45rem .5rem;
    }
    .ig-profil-foto-cerceve { width: 40px; height: 40px; }
    .ig-profil-isim   { font-size: .88rem; }
    .ig-profil-sayilar { font-size: .72rem; gap: .45rem; }
    .ig-profil-takip  { padding: .35rem .65rem; font-size: .72rem; }
}

/* ── GRID ───────────────────────────────────────────────────── */
.ig-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);   /* 6 kolon → 6 gönderi = 1 satır */
    gap: 10px;
    margin-top: 2rem;
}

/* ── ITEM (link veya placeholder) ───────────────────────────── */
.ig-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--r-sm, 8px);
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg,
        var(--bg-section, #f4f1ec),
        var(--border, #d9d1c4));
    isolation: isolate;
    transform: translateZ(0);                /* hover scale için subpixel düzgünlüğü */
}

/* Sıralı, çok ince giriş animasyonu (her itemin gecikmesi nth-child ile) */
.ig-item {
    opacity: 0;
    animation: ig-fade-in .55s ease forwards;
}
.ig-grid .ig-item:nth-child(1)  { animation-delay: .04s; }
.ig-grid .ig-item:nth-child(2)  { animation-delay: .08s; }
.ig-grid .ig-item:nth-child(3)  { animation-delay: .12s; }
.ig-grid .ig-item:nth-child(4)  { animation-delay: .16s; }
.ig-grid .ig-item:nth-child(5)  { animation-delay: .20s; }
.ig-grid .ig-item:nth-child(6)  { animation-delay: .24s; }
.ig-grid .ig-item:nth-child(7)  { animation-delay: .28s; }
.ig-grid .ig-item:nth-child(8)  { animation-delay: .32s; }
.ig-grid .ig-item:nth-child(9)  { animation-delay: .36s; }
.ig-grid .ig-item:nth-child(10) { animation-delay: .40s; }
.ig-grid .ig-item:nth-child(11) { animation-delay: .44s; }
.ig-grid .ig-item:nth-child(12) { animation-delay: .48s; }
.ig-grid .ig-item:nth-child(13) { animation-delay: .52s; }
.ig-grid .ig-item:nth-child(14) { animation-delay: .56s; }
.ig-grid .ig-item:nth-child(15) { animation-delay: .60s; }

@keyframes ig-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* Erişilebilirlik: hareket azalt */
@media (prefers-reduced-motion: reduce) {
    .ig-item, .ig-grid .ig-item {
        animation: none;
        opacity: 1;
    }
}

/* ── GERÇEK GÖRSEL ──────────────────────────────────────────── */
.ig-gorsel {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .55s cubic-bezier(.2,.8,.2,1),
                filter    .35s ease;
}

.ig-item:hover .ig-gorsel,
.ig-item:focus-visible .ig-gorsel {
    transform: scale(1.08);
    filter: brightness(.85);
}

/* ── PLACEHOLDER (URL yokken) — şimmer animasyonlu ───────── */
.ig-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    background:
        linear-gradient(110deg,
            rgba(255,255,255,0)    0%,
            rgba(255,255,255,.45) 50%,
            rgba(255,255,255,0)  100%) 0 0 / 200% 100% no-repeat,
        linear-gradient(135deg, var(--bg-section, #efe9df), var(--border, #d9d1c4));
    animation: ig-shimmer 1.8s ease-in-out infinite;
}

@keyframes ig-shimmer {
    0%   { background-position: -100% 0, 0 0; }
    100% { background-position:  200% 0, 0 0; }
}

.ig-gorsel-bos {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── VIDEO / CAROUSEL ROZETI ────────────────────────────────── */
.ig-rozet {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    transition: transform .3s ease;
}

.ig-item:hover .ig-rozet {
    transform: scale(1.08);
}

/* ── HOVER OVERLAY ─────────────────────────────────────────── */
.ig-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top,
            rgba(0,0,0,.78) 0%,
            rgba(0,0,0,.35) 55%,
            rgba(0,0,0,0)   100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
    z-index: 1;
}

.ig-item:hover .ig-overlay,
.ig-item:focus-visible .ig-overlay {
    opacity: 1;
}

/* Instagram glifi — overlay içinde küçük marka göstergesi */
.ig-overlay::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 12px;
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='2' width='20' height='20' rx='5'/><path d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/><line x1='17.5' y1='6.5' x2='17.51' y2='6.5'/></svg>") center / contain no-repeat;
    opacity: .9;
    transform: translateY(-4px);
    transition: transform .35s ease;
}

.ig-item:hover .ig-overlay::before {
    transform: translateY(0);
}

.ig-caption {
    color: #fff;
    font-size: .78rem;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ── ALTLIK: SON GÖNDERİ ETİKETİ + BUTON ───────────────────── */
.ig-son-zaman {
    margin-top: 1.5rem !important;
    text-align: center;
    font-size: .85rem;
    color: var(--metin-soluk, #888);
    letter-spacing: .02em;
}

.ig-son-zaman span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

/* Pulsing yeşil canlı göstergesi */
.ig-canli-nokta {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 .2rem rgba(34,197,94,.18);
    animation: ig-canli-pulse 2s ease-in-out infinite;
}

@keyframes ig-canli-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%      { opacity: .55; transform: scale(.92); }
}

@media (prefers-reduced-motion: reduce) {
    .ig-canli-nokta { animation: none; }
}

.instagram-bolum .bolum-alt {
    margin-top: 1.25rem;
    text-align: center;
}

.instagram-bolum .bolum-alt .btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: transform .2s ease, box-shadow .2s ease;
}

.instagram-bolum .bolum-alt .btn:hover {
    transform: translateY(-1px);
}

/* ── RESPONSIVE ────────────────────────────────────────────────
   Doğru sıralama (büyükten küçüğe), tek ve doğru sınıf adı.
   ───────────────────────────────────────────────────────────── */

/* Tablet — 3 kolon */
@media (max-width: 1100px) {
    .ig-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* Küçük tablet — 2 kolon */
@media (max-width: 768px) {
    .ig-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .ig-rozet {
        width: 26px;
        height: 26px;
        top: 6px;
        right: 6px;
    }
    .ig-overlay {
        padding: 8px;
    }
    .ig-overlay::before {
        width: 18px;
        height: 18px;
        top: 8px;
        left: 8px;
    }
    .ig-caption {
        font-size: .72rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

/* Telefon — 2 kolon (15 gönderi: 7 satır × 2 + 1) */
@media (max-width: 480px) {
    .ig-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    .instagram-bolum .bolum-baslik h2 {
        font-size: 1.5rem;
    }
}

/* Çok küçük telefon — yine 2 kolon ama daha sıkı */
@media (max-width: 360px) {
    .ig-grid { gap: 4px; }
}
