/* ==========================================================================
   Waqt Al-Hadhara - projects.css
   Featured Photo Grid (Main Page) + Lightbox
   ========================================================================== */

/* ── Featured Grid (6 photos on main page) ──────────────────────────── */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
    max-width: 100%; /* 6-column image grid can never overflow its container */
}

.featured-img {
    width: 100%;
    max-width: 100%; /* image can never exceed its grid cell */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.4s var(--transition-ease), box-shadow 0.4s var(--transition-ease), opacity 0.2s ease;
}

.featured-img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

html.light-mode .featured-img:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.projects-cta {
    margin-top: 10px;
}

/* ── Lightbox ───────────────────────────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border: none;
    animation: lightboxZoomIn 0.3s var(--transition-ease);
}

@keyframes lightboxZoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text-primary);
    font-size: 0.85rem;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #F5F5F7;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: var(--color-gold);
    color: var(--color-text-dark);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #F5F5F7;
    font-size: 2rem;
    cursor: pointer;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.lightbox-nav:hover {
    background: var(--color-gold);
    color: var(--color-text-dark);
}

.lightbox-prev { right: 20px; }
.lightbox-next { left: 20px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .featured-img {
        aspect-ratio: 1 / 1;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }

    .lightbox-prev { right: 8px; }
    .lightbox-next { left: 8px; }
}

@media (max-width: 480px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}
