/* =============================================
   TVP - Instagram Grid Plugin – v3.0.1
   ============================================= */

/* --- Grid --- */
.igg-wrap { width: 100%; }

.igg-grid {
    display: grid;
    grid-template-columns: repeat(var(--igg-columns, 3), 1fr);
    gap: 6px;
    width: 100%;
}

/* --- Hidden items (load more) --- */
.igg-item.igg-hidden { display: none; }

/* --- Item --- */
.igg-item {
    position: relative;
    overflow: hidden;
    background: #efefef;
    aspect-ratio: 1 / 1;
    border-radius: 2px;
}

.igg-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.igg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* --- Badges --- */
.igg-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(3px);
}

/* --- Hover overlay --- */
.igg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.igg-overlay-inner {
    width: 100%;
    padding: 14px 12px 12px;
    transform: translateY(6px);
    transition: transform 0.3s ease;
}

.igg-item:hover .igg-overlay,
.igg-item:focus-within .igg-overlay { opacity: 1; }

.igg-item:hover .igg-image,
.igg-item:focus-within .igg-image { transform: scale(1.05); }

.igg-item:hover .igg-overlay-inner,
.igg-item:focus-within .igg-overlay-inner { transform: translateY(0); }

.igg-caption {
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 9px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.igg-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.igg-likes {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.igg-likes svg { color: #ff4d6d; flex-shrink: 0; }

.igg-view-link {
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.35);
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
    margin-left: auto;
}

.igg-link:hover .igg-view-link {
    color: #fff;
    border-bottom-color: #fff;
}

/* --- Load More Button --- */
.igg-loadmore-wrap {
    text-align: center;
    margin-top: 20px;
}

.igg-loadmore-btn {
    display: inline-block;
    padding: 10px 32px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.igg-loadmore-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.igg-loadmore-btn:active { transform: translateY(0); }

.igg-loadmore-btn.igg-hidden { display: none; }

/* --- Follow Button --- */
.igg-follow-wrap {
    text-align: center;
    margin-top: 20px;
}

.igg-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.igg-follow-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

/* =============================================
   LIGHTBOX
   ============================================= */

.igg-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.igg-lb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99998;
    cursor: pointer;
    display: none;
}

.igg-lb-inner {
    position: relative;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    background: #111;
    border-radius: 4px;
    overflow: hidden;
    animation: igg-lb-in 0.25s ease;
}

@keyframes igg-lb-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.igg-lb-img-wrap {
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 65vh;
    overflow: hidden;
}

.igg-lb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 65vh;
    display: block;
}

.igg-lb-info {
    padding: 16px 20px;
    background: #111;
    flex-shrink: 0;
}

.igg-lb-caption {
    color: #ddd;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 12px;
    max-height: 80px;
    overflow-y: auto;
}

.igg-lb-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.igg-lb-likes {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.igg-lb-likes svg { color: #ff4d6d; }

.igg-lb-ig-link {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 1px;
    transition: color 0.15s;
}

.igg-lb-ig-link:hover { color: #fff; border-bottom-color: #fff; }

/* Close button */
.igg-lb-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 100000;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}

.igg-lb-close:hover { background: rgba(255,255,255,0.15); }

/* Prev / Next */
.igg-lb-prev,
.igg-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100000;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
    padding-bottom: 2px;
}

.igg-lb-prev { left: 16px; }
.igg-lb-next { right: 16px; }

.igg-lb-prev:hover,
.igg-lb-next:hover { background: rgba(255,255,255,0.15); }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .igg-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px;
    }
    .igg-lb-prev { left: 6px; }
    .igg-lb-next { right: 6px; }
}

@media (max-width: 480px) {
    .igg-grid { gap: 3px; }
    .igg-caption { display: none; }
    .igg-overlay-inner { padding: 8px 10px; }
    .igg-lb-inner { max-height: 95vh; }
}
