/* ─── Instagram Grid Feed — Frontend Styles ─────────────────────────────── */

.igf-grid {
    display: grid;
    grid-template-columns: repeat(var(--igf-columns, 3), 1fr);
    gap: 25px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Each Item ─────────────────────────────────────────────────────────────── */

.igf-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
    border-radius: 2px;
}

.igf-thumb {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 square */
}

.igf-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.igf-item:hover .igf-thumb img {
    transform: scale(1.07);
}

/* ── Video Badge (top-right corner) ───────────────────────────────────────── */

.igf-video-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.60);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* ── Hover Overlay ────────────────────────────────────────────────────────── */

.igf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 14px;
    box-sizing: border-box;
}

.igf-item:hover .igf-overlay {
    opacity: 1;
}

.igf-view-icon {
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.igf-caption {
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    margin: 0;
    max-height: 80px;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Error Message ────────────────────────────────────────────────────────── */

.igf-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

/* ── Lightbox ──────────────────────────────────────────────────────────────── */

.igf-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index:2147483647 !important;
    align-items: center;
    justify-content: center;
}

.igf-lightbox.igf-active {
    display: flex;
}

.igf-lb-inner {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.igf-lb-inner img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    display: block;
}

/* ── Video in Lightbox ────────────────────────────────────────────────────── */

#igf-lb-video {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    background: #000;
    outline: none;
}

/* Prevent closing lightbox when clicking on the video itself */
#igf-lb-video {
    pointer-events: auto;
}

.igf-lb-close,
.igf-lb-prev,
.igf-lb-next {
    position: fixed;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    backdrop-filter: blur(6px);
    z-index:2147483647  !important;
}

.igf-lb-close:hover,
.igf-lb-prev:hover,
.igf-lb-next:hover {
    background: rgba(255,255,255,0.3);
}

.igf-lb-close {
    top: 16px;
    right: 16px;
    font-size: 18px;
}

.igf-lb-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.igf-lb-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* ── Loading Skeleton ──────────────────────────────────────────────────────── */

.igf-item.igf-loading .igf-thumb {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: igf-shimmer 1.5s infinite;
}

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

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .igf-grid {
        grid-template-columns: repeat(min(var(--igf-columns, 3), 3), 1fr) !important;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .igf-grid {
        grid-template-columns: repeat(min(var(--igf-columns, 3), 2), 1fr) !important;
        gap: 3px;
    }
}

/* ── Video Card (Reel modal) ─────────────────────────────────────────────── */

#igf-lb-video-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
    width: 90vw;
    box-shadow: 0 12px 50px rgba(0,0,0,0.8);
}

.igf-vc-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 55vh;
    overflow: hidden;
    background: #000;
}

.igf-vc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.75;
}

.igf-vc-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.igf-vc-info {
    padding: 20px 24px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    background: #1a1a1a;
}

.igf-vc-label {
    font-size: 13px;
    color: #aaa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.igf-vc-msg {
    font-size: 14px;
    color: #ccc;
    margin: 0 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
}

.igf-vc-btn {
    display: inline-block;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff !important;
    text-decoration: none !important;
    padding: 11px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: opacity 0.2s, transform 0.2s;
}

.igf-vc-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}