/* AABA Gallery - cloned from gallery.css */
@import url('../index/index.css'); /* inherit theme variables and some base rules */

/* Page layout */
body { font-family: 'Poppins', sans-serif; background: var(--bg-page); }
.navbar { display:flex; align-items:center; justify-content:space-between; padding:12px 18px; background: linear-gradient(90deg, var(--teal-700), var(--teal-900)); color: #fff; }
.navbar .back-button{ color:#fff; text-decoration:none; font-weight:600; }
.navbar h2{ margin:0; font-size:1.44rem; }
.logo { height:7vh; }

.gallery-page { padding: 6rem 1rem 3rem; }
.section { max-width:1200px; margin: 0 auto; background: var(--card-bg); border-radius:10px; padding:20px; box-shadow:0 6px 18px rgba(0,0,0,0.08); position:relative; }

.gallery-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.gallery-grid figure {
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafb;
    cursor: pointer;
    aspect-ratio: 4 / 3; /* ensures uniform pixel dimensions for all items */
    position: relative; /* enables overlay */
    box-shadow: 0 6px 18px rgba(3,15,20,0.04);
    transition: transform .28s ease, box-shadow .28s ease;
}
.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .28s ease, filter .28s ease;
}
.gallery-grid figure::after{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.18), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity .22s ease;
    pointer-events: none;
}
.gallery-grid figure:hover{ transform: translateY(-4px); box-shadow: 0 16px 40px rgba(3,15,20,0.08); }
.gallery-grid figure:hover::after{ opacity: 1; }
.gallery-grid figure:hover img{ transform: scale(1.03); filter:brightness(.96); }

/* hover overlay label */
.gallery-grid figure .view-label{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.98);
    pointer-events: none;
    color: #fff;
    font-weight: 600;
    background: rgba(0,0,0,0.45);
    padding: 6px 10px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    font-size: 15.6px;
}
.gallery-grid figure:hover .view-label{ opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* keyboard focus */
.gallery-grid figure:focus{ outline: 3px solid rgba(14,165,164,0.24); outline-offset: 4px; }


/* Lightbox */
.lightbox{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,0.8); z-index:9999; padding:20px; }
.lightbox[aria-hidden="false"]{ display:flex; }
.lb-image-wrap{ width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.lb-image-wrap img{ max-width:90vw; max-height:80vh; object-fit:contain; border-radius:8px; box-shadow:0 10px 30px rgba(0,0,0,0.6); }
.lb-caption{ color:#fff; margin-top:8px; font-size:16.8px; }
.lb-close, .lb-prev, .lb-next{ position: absolute; background:transparent; border:0; color:#fff; font-size:31.2px; padding:10px; cursor:pointer; }
.lb-close{ top:18px; right:18px; font-size:26.4px; }
.lb-prev{ left:18px; top:50%; transform:translateY(-50%); }
.lb-next{ right:18px; top:50%; transform:translateY(-50%); }

/* Loading animation for lightbox images */
@keyframes fadeIn {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

#lbImage {
    animation: fadeIn 0.3s ease-in-out;
}

@media (max-width:768px){
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-grid figure { aspect-ratio: 4 / 3; }
    .gallery-page { padding-top:5.5rem; }

    .logo-container {
        height: 10vh;
        /* Adjust based on your navbar height */
        width: auto;
        /* Keep width dynamic */
        display: flex;
        align-items: center;
    }

    .logo {
        max-height: 100%;
        /* Constrain the height */
        max-width: 100%;
        /* Constrain the width */
        object-fit: contain;
        /* Ensures the whole logo fits */
    }
}

@media (min-width:769px){
    .gallery-grid { grid-template-columns: repeat(8, 1fr); }
    .gallery-grid figure { aspect-ratio: 4 / 3; }
}

/* Photo-album style for gallery buttons (page preview cards) */
.gallery-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 1 300px;
    max-width: 300px;
    padding: 12px 14px;
    background: linear-gradient(180deg,#fff,#fbfbfb);
    border-radius: 12px;
    border: 1px solid rgba(6,30,24,0.06);
    box-shadow: 0 10px 28px rgba(3,15,20,0.06);
}

.gallery-button .gallery-preview{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:6px;
    width:100%;
    max-width:220px;
    margin-bottom:10px;
}

.gallery-button .gallery-preview img{
    width:100%;
    height:68px;
    object-fit:cover;
    border-radius:6px;
    box-shadow:0 6px 18px rgba(3,15,20,0.06);
}

.gallery-button:hover{ transform: translateY(-8px); box-shadow: 0 18px 48px rgba(3,15,20,0.12); }

