/* =========================================
   SU IDEA LAB — GALLERY STYLES
========================================= */

/* ===== HOME PAGE GALLERY SECTION ===== */
.home-gallery-section {
    padding: 20px 5% 15px;
    background: #ffffff;
    position: relative;
}

.home-gallery-slider-wrapper {
    position: relative;
    max-width: 1300px;
    margin: 15px auto 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.home-gallery-viewport {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    width: 100%;
}

.home-gallery-viewport::-webkit-scrollbar {
    display: none;
}

/* Desktop Previous & Next Buttons */
.home-gallery-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 5;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-gallery-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    transform: scale(1.12);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
}

.home-gallery-btn:active {
    transform: scale(0.96);
}

.home-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    width: 100%;
    margin: 0;
}

/* Gallery Card (Home & Public) */
.gallery-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f7;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    height: 290px;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.18);
    border-color: #93c5fd;
}

.gallery-card-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-card-img-wrap img {
    transform: scale(1.08);
}

/* Category Pill */
.gallery-card-cat {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover Zoom Button */
.gallery-card-zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.75);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-card:hover .gallery-card-zoom-btn {
    opacity: 1;
    transform: scale(1);
}

/* Bottom Overlay Info */
.gallery-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 40px 18px 18px;
    background: linear-gradient(to top, rgba(10, 20, 35, 0.95) 0%, rgba(10, 20, 35, 0.6) 65%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.gallery-card-title {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.gallery-card-meta {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty State */
.gallery-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 20px;
    border: 2px dashed #cbd5e1;
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 0 auto;
}

.gallery-empty-state h3 {
    font-size: 1.25rem;
    color: #334155;
    margin-bottom: 6px;
}

.gallery-empty-state p {
    color: #64748b;
    margin: 0;
    font-size: 0.95rem;
}

/* ===== DEDICATED GALLERY PAGE ===== */
.gallery-page-wrapper {
    max-width: 1260px;
    margin: 0 auto;
    padding: 50px 20px 100px;
}

/* Filter Toolbar */
.gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 35px;
}

.gallery-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-pill-btn {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.gallery-pill-btn:hover {
    border-color: #93c5fd;
    color: #2563eb;
    background: #eff6ff;
}

.gallery-pill-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.gallery-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 18px;
    width: 280px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.gallery-search-wrap:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.gallery-search-wrap svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.gallery-search-wrap input {
    border: none;
    outline: none;
    font-size: 0.92rem;
    width: 100%;
    color: #1e293b;
    font-family: inherit;
}

.gallery-count-badge {
    font-size: 0.92rem;
    font-weight: 700;
    color: #475569;
    background: #e2e8f0;
    padding: 7px 16px;
    border-radius: 20px;
}

/* Public Gallery Grid */
.public-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 26px;
}

/* ===== LIGHTBOX MODAL ===== */
.gallery-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.gallery-lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 35, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gallery-lightbox-container {
    position: relative;
    z-index: 2;
    max-width: 980px;
    width: 100%;
    background: #0f172a;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    transform: scale(0.93) translateY(20px);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox-overlay.active .gallery-lightbox-container {
    transform: scale(1) translateY(0);
}

/* Lightbox Close */
.gallery-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gallery-lightbox-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg);
}

/* Lightbox Media */
.gallery-lightbox-media {
    position: relative;
    width: 100%;
    max-height: 72vh;
    background: #091322;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-lightbox-media img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    display: block;
    user-select: none;
}

/* Nav Arrows */
.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.gallery-lightbox-nav:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-50%) scale(1.08);
}

.gallery-lightbox-prev {
    left: 16px;
}

.gallery-lightbox-next {
    right: 16px;
}

/* Lightbox Info Bar */
.gallery-lightbox-info {
    padding: 20px 28px;
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-lightbox-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gallery-lightbox-cat-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
}

.gallery-lightbox-title {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.gallery-lightbox-counter {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
}

/* View More Card inside Grid (Hidden on desktop, shown at end of mobile slider) */
.gallery-view-more-card {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .home-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .public-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    /* Hide previous and next buttons on phone view */
    .home-gallery-btn {
        display: none !important;
    }

    .home-gallery-slider-wrapper {
        margin: 0 !important;
        gap: 0 !important;
        display: block !important;
    }

    .home-gallery-section {
        padding: 44px 0 36px 0;
        overflow: hidden;
    }

    .home-gallery-section .section-header {
        padding: 0 20px;
    }

    /* Single-line horizontal sliding row for phone view */
    .home-gallery-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        gap: 14px !important;
        padding: 8px 20px 16px 20px !important;
        margin: 20px 0 0 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
        scrollbar-width: none;
    }

    .home-gallery-grid::-webkit-scrollbar {
        display: none;
    }

    /* Gallery cards in the phone horizontal slider */
    .home-gallery-grid .gallery-card {
        flex: 0 0 260px !important;
        width: 260px !important;
        height: 175px !important;
        scroll-snap-align: start;
        border-radius: 16px;
    }

    /* 5th item: View All Gallery Card at the end of the 4 photos */
    .gallery-view-more-card {
        display: flex !important;
        flex: 0 0 195px !important;
        width: 195px !important;
        height: 175px !important;
        scroll-snap-align: start;
        background: linear-gradient(145deg, #1e293b, #0f172a);
        border: 2px dashed rgba(59, 130, 246, 0.45);
        border-radius: 16px;
        align-items: center;
        justify-content: center;
        text-align: center;
        text-decoration: none;
        color: #ffffff;
        padding: 16px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
        transition: transform 0.2s ease, border-color 0.2s ease;
    }

    .gallery-view-more-card:active {
        transform: scale(0.97);
        border-color: #3b82f6;
    }

    .gallery-more-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .gallery-more-icon {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: rgba(37, 99, 235, 0.25);
        border: 1.5px solid rgba(59, 130, 246, 0.5);
        color: #60a5fa;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s ease;
    }

    .gallery-more-content h4 {
        margin: 0;
        font-size: 0.95rem;
        font-weight: 700;
        color: #ffffff;
    }

    .gallery-more-content span {
        font-size: 0.75rem;
        color: #94a3b8;
        font-weight: 500;
    }

    .home-gallery-grid .gallery-card-cat {
        top: 10px;
        left: 10px;
        font-size: 0.65rem;
        padding: 3px 9px;
    }

    .home-gallery-grid .gallery-card-zoom-btn {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }

    .home-gallery-grid .gallery-card-overlay {
        padding: 24px 14px 12px;
    }

    .home-gallery-grid .gallery-card-title {
        font-size: 0.95rem;
    }

    .home-gallery-grid .gallery-card-meta {
        font-size: 0.72rem;
        margin-top: 2px;
    }

    /* Compact Hero on Mobile */
    .facilities-hero {
        padding: 24px 14px 18px !important;
    }

    .facilities-hero h1 {
        font-size: 1.55rem !important;
        margin-bottom: 4px !important;
    }

    .facilities-hero p {
        font-size: 0.78rem !important;
        line-height: 1.35 !important;
        max-width: 95% !important;
        margin: 0 auto !important;
    }

    .hero-eyebrow {
        font-size: 0.62rem !important;
        padding: 2px 9px !important;
        margin-bottom: 6px !important;
    }

    /* Public gallery page cards on phone view (Sleek 2 cards per row) */
    .gallery-page-wrapper {
        padding: 12px 10px 50px !important;
    }

    .public-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-top: 10px !important;
    }

    .public-gallery-grid .gallery-card {
        height: 120px !important;
        border-radius: 10px !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
    }

    .public-gallery-grid .gallery-card-cat {
        top: 5px !important;
        left: 5px !important;
        font-size: 0.50rem !important;
        padding: 2px 5px !important;
        border-radius: 6px !important;
        letter-spacing: 0.3px !important;
    }

    .public-gallery-grid .gallery-card-zoom-btn {
        display: none !important;
    }

    .public-gallery-grid .gallery-card-overlay {
        padding: 16px 7px 6px !important;
        background: linear-gradient(to top, rgba(10, 20, 35, 0.90) 0%, rgba(10, 20, 35, 0.45) 60%, transparent 100%) !important;
    }

    .public-gallery-grid .gallery-card-title {
        font-size: 0.72rem !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        line-height: 1.18 !important;
        margin: 0 !important;
    }

    .public-gallery-grid .gallery-card-meta {
        font-size: 0.58rem !important;
        margin-top: 2px !important;
        gap: 3px !important;
        color: #cbd5e1 !important;
    }

    .public-gallery-grid .gallery-card-meta svg {
        width: 9px !important;
        height: 9px !important;
    }

    .home-gallery-section .section-cta {
        display: none;
    }

    /* Mobile Toolbar */
    .gallery-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .gallery-filter-pills {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px !important;
        gap: 6px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .gallery-filter-pills::-webkit-scrollbar {
        display: none;
    }

    .gallery-pill-btn {
        flex-shrink: 0;
        font-size: 0.72rem !important;
        padding: 4px 10px !important;
        border-radius: 16px !important;
    }

    .gallery-search-wrap {
        width: 100%;
        box-sizing: border-box;
        padding: 6px 12px !important;
        border-radius: 8px !important;
    }

    .gallery-search-wrap input {
        font-size: 0.82rem !important;
    }

    .gallery-count-badge {
        display: none !important;
    }

    .gallery-lightbox-container {
        border-radius: 18px;
    }

    .gallery-lightbox-media {
        max-height: 60vh;
    }

    .gallery-lightbox-media img {
        max-height: 60vh;
    }

    .gallery-lightbox-info {
        padding: 16px;
    }

    .gallery-lightbox-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .home-gallery-grid .gallery-card {
        flex: 0 0 235px !important;
        width: 235px !important;
        height: 165px !important;
    }

    .gallery-view-more-card {
        flex: 0 0 175px !important;
        width: 175px !important;
        height: 165px !important;
    }

    .public-gallery-grid .gallery-card {
        height: 114px !important;
        border-radius: 9px !important;
    }

    .public-gallery-grid .gallery-card-title {
        font-size: 0.68rem !important;
    }
}

@media (max-width: 360px) {
    .public-gallery-grid {
        gap: 6px !important;
    }

    .public-gallery-grid .gallery-card {
        height: 104px !important;
    }

    .public-gallery-grid .gallery-card-title {
        font-size: 0.64rem !important;
    }
}
