/* ==========================================================================
   LN Social Feed — Instagram Grid + Lightbox
   Uses theme --ln-* design tokens for consistency.
   ========================================================================== */

.ln-social-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* Hidden gallery data blocks */
.ln-social-feed__gallery-data {
    display: none !important;
}

/* ---------- Card ---------- */

.ln-social-feed__card {
    display: block;
    background: var(--ln-bg-card, #16161f);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--ln-radius-md, 12px);
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ln-social-feed__card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 229, 255, 0.15);
}

/* ---------- Image ---------- */

.ln-social-feed__image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--ln-bg-elevated, #1c1c28);
}

.ln-social-feed__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ln-social-feed__card:hover .ln-social-feed__image {
    transform: scale(1.05);
}

/* ---------- Carousel dots (grid card) ---------- */

.ln-social-feed__carousel-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 3;
    pointer-events: none;
}

.ln-social-feed__dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.3s ease;
}

.ln-social-feed__dot--active {
    background: #ffffff;
}

/* ---------- Hover overlay ---------- */

.ln-social-feed__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.7);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
}

.ln-social-feed__card:hover .ln-social-feed__overlay {
    opacity: 1;
}

.ln-social-feed__caption {
    color: var(--ln-text-primary, #f0f0f5);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Empty state ---------- */

.ln-social-feed__empty {
    text-align: center;
    color: var(--ln-text-muted, #6b6b7b);
    padding: 2rem 1rem;
    font-size: 0.95rem;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.ln-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ln-lightbox[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ln-lightbox[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

/* Backdrop */
.ln-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

/* Content wrapper */
.ln-lightbox__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

/* Close button */
.ln-lightbox__close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: none !important;
    border: none !important;
    color: var(--ln-text-secondary, #a0a0b0) !important;
    font-size: 2rem;
    cursor: pointer;
    padding: 4px 12px !important;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 3;
}

.ln-lightbox__close:hover {
    color: #ffffff !important;
    transform: none;
    box-shadow: none;
}

/* Image */
.ln-lightbox__image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 75vh;
}

.ln-lightbox__image {
    display: block;
    max-width: 80vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--ln-radius-md, 12px);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

/* Prev / Next buttons */
.ln-lightbox__prev,
.ln-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
    z-index: 2;
}

.ln-lightbox__prev:hover,
.ln-lightbox__next:hover {
    background: rgba(0, 229, 255, 0.15) !important;
    border-color: var(--ln-accent-cyan, #00e5ff) !important;
    transform: translateY(-50%);
    box-shadow: none;
}

.ln-lightbox__prev {
    left: -60px;
}

.ln-lightbox__next {
    right: -60px;
}

/* Footer: dots + caption + IG link */
.ln-lightbox__footer {
    text-align: center;
    margin-top: 1rem;
    max-width: 600px;
}

.ln-lightbox__dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.ln-lightbox__dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ln-lightbox__dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.ln-lightbox__dot--active {
    background: var(--ln-accent-cyan, #00e5ff);
    transform: scale(1.2);
}

.ln-lightbox__caption {
    color: var(--ln-text-secondary, #a0a0b0);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ln-lightbox__ig-link {
    color: var(--ln-accent-cyan, #00e5ff) !important;
    font-size: 0.8rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ln-lightbox__ig-link:hover {
    opacity: 1;
    color: var(--ln-accent-cyan, #00e5ff) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .ln-social-feed {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .ln-lightbox__prev {
        left: 8px;
    }

    .ln-lightbox__next {
        right: 8px;
    }

    .ln-lightbox__prev,
    .ln-lightbox__next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .ln-lightbox__image {
        max-width: 95vw;
    }

    .ln-lightbox__close {
        top: -36px;
        right: 0;
    }
}

@media (max-width: 480px) {
    .ln-social-feed {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .ln-social-feed__caption,
    .ln-lightbox__caption {
        font-size: 0.75rem;
    }
}
