/* ============================================================
   Image Gallery with Lightbox — Frontend Styles
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --igl-primary:    #6C63FF;
    --igl-primary-dk: #4B44CC;
    --igl-surface:    #ffffff;
    --igl-bg:         #f4f6fb;
    --igl-text:       #1a1a2e;
    --igl-muted:      #6b7280;
    --igl-radius:     14px;
    --igl-shadow:     0 4px 20px rgba(108, 99, 255, 0.10);
    --igl-shadow-hov: 0 12px 36px rgba(108, 99, 255, 0.22);
    --igl-transition: 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Grid ── */
.igl-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 8px 0 32px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .igl-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .igl-gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ── Card ── */
.igl-card {
    background: var(--igl-surface);
    border-radius: var(--igl-radius);
    box-shadow: var(--igl-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--igl-transition), box-shadow var(--igl-transition);
    outline: none;
    border: 1px solid rgba(108, 99, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.igl-card:hover,
.igl-card:focus-visible {
    transform: translateY(-6px) scale(1.015);
    box-shadow: var(--igl-shadow-hov);
}

/* ── Card Image ── */
.igl-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--igl-bg);
}

.igl-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--igl-transition);
}

.igl-card:hover .igl-card-img-wrap img,
.igl-card:focus-visible .igl-card-img-wrap img {
    transform: scale(1.07);
}

/* ── Overlay ── */
.igl-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(108, 99, 255, 0.55) 0%,
        rgba(75, 68, 204, 0.72) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--igl-transition);
}

.igl-card:hover .igl-card-overlay,
.igl-card:focus-visible .igl-card-overlay {
    opacity: 1;
}

.igl-zoom-icon {
    font-size: 32px;
    color: #fff;
    transform: scale(0.7);
    transition: transform var(--igl-transition);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.igl-card:hover .igl-zoom-icon,
.igl-card:focus-visible .igl-zoom-icon {
    transform: scale(1);
}

/* ── Card Body ── */
.igl-card-body {
    padding: 14px 16px 16px;
    background: var(--igl-surface);
    flex: 1;
    display: flex;
    align-items: center;
}

.igl-card-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--igl-text);
    margin: 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── No Images Message ── */
.igl-no-images {
    text-align: center;
    color: var(--igl-muted);
    padding: 40px;
    font-size: 16px;
    background: var(--igl-bg);
    border-radius: var(--igl-radius);
}

/* ═══════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════ */
.igl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: igl-fade-in 0.25s ease;
}

@keyframes igl-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.igl-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 30, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.igl-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: igl-pop-in 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes igl-pop-in {
    from { transform: scale(0.88) translateY(20px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.igl-lightbox-img-wrap {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 72px rgba(0,0,0,0.55);
    max-width: 88vw;
    max-height: 76vh;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

#igl-lightbox-img {
    display: block;
    max-width: 88vw;
    max-height: 76vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.igl-lightbox-caption {
    margin-top: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 50px;
    padding: 8px 24px;
    backdrop-filter: blur(8px);
}

#igl-lightbox-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    display: block;
}

/* ── Close Button ── */
.igl-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--igl-primary);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
}

.igl-lightbox-close:hover {
    background: var(--igl-primary-dk);
    transform: scale(1.1) rotate(90deg);
}

/* ── Scrollbar hide on body when lightbox open ── */
body.igl-lightbox-open {
    overflow: hidden;
}
