/* =====================================================
   MAKHASWA HOLDINGS — GALLERY PAGE STYLESHEET
   Specific to gallery.html
   ===================================================== */

/* ── Page Container ── */
.gallery-page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 20px 96px;
}

/* ── Header ── */
.gallery-header {
    text-align: center;
    margin-bottom: 48px;
}

.gallery-header h1 {
    font-size: clamp(26px, 3.5vw, 40px);
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.gallery-header p {
    color: var(--text-light);
    font-size: 15px;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Category Filter Tabs ── */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .gallery-filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 12px;
        /* Allow space for scrollbar */
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
        scrollbar-width: none;
        /* Hide scrollbar for Firefox */
        padding-left: 20px;
        padding-right: 20px;
        margin-left: -20px;
        margin-right: -20px;
    }

    .gallery-filters::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar for Chrome, Safari and Opera */
    }
}

.filter-btn {
    padding: 9px 22px;
    border-radius: 50px;
    border: 2px solid transparent;
    font-family: var(--font, 'Montserrat', sans-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.22s ease;
    background: #f4f4f4;
    color: #555;
    outline: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* ── Gallery Grid ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

@media (min-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* ── Grid Item ── */
.grid-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #e8e8e8;
    cursor: pointer;
    border-radius: 6px;
    animation: fadeInUp 0.35s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ── Hover overlay (desktop) ── */
@media (min-width: 600px) {
    .grid-item:hover img {
        transform: scale(1.06);
    }

    .grid-item::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.42);
        opacity: 0;
        transition: opacity 0.28s ease;
        pointer-events: none;
        z-index: 1;
    }

    .grid-item:hover::after {
        opacity: 1;
    }

    .grid-item-caption {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 14px;
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        opacity: 0;
        z-index: 2;
        transition: opacity 0.28s ease;
        pointer-events: none;
        line-height: 1.45;
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }

    .grid-item:hover .grid-item-caption {
        opacity: 1;
    }

    .grid-item-caption .caption-icon {
        font-size: 20px;
        margin-bottom: 7px;
        opacity: 0.85;
    }
}

@media (max-width: 599px) {
    .grid-item-caption {
        display: none;
    }
}

/* ── Category badge on each item ── */
.grid-item-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 8px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 3;
    display: none;
}

/* ── Pagination ── */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #444;
    font-family: var(--font, 'Montserrat', sans-serif);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.page-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* ── Gallery count label ── */
.gallery-count {
    text-align: center;
    font-size: 13px;
    color: var(--text-light, #888);
    margin-bottom: 20px;
    font-weight: 500;
}

/* ── Empty state ── */
.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
    display: none;
}

/* ── Premium Lightbox Modal ── */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: all;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.94);
    transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-content img {
    transform: scale(1);
}

.lightbox-caption {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    max-width: 560px;
    line-height: 1.55;
    letter-spacing: 0.4px;
    padding: 0 12px;
    font-family: var(--font, 'Montserrat', sans-serif);
}

.lightbox-counter {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--font, 'Montserrat', sans-serif);
    letter-spacing: 0.5px;
}

.lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.22s, transform 0.18s;
    user-select: none;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.08);
}

.lightbox-btn:active {
    transform: scale(0.94);
}

.lightbox-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

.lightbox-close {
    top: -64px;
    right: 0;
}

.lightbox-prev {
    left: -72px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.08);
}

.lightbox-next {
    right: -72px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.08);
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.55);
    }

    .lightbox-prev:hover {
        transform: translateY(-50%) scale(1.06);
    }

    .lightbox-next {
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.55);
    }

    .lightbox-next:hover {
        transform: translateY(-50%) scale(1.06);
    }

    .lightbox-close {
        top: 14px;
        right: 14px;
        background: rgba(0, 0, 0, 0.55);
        position: fixed;
    }
}
