html,
body {
    height: 100%;
    margin: 0;
    scroll-behavior: smooth;
}

main {
    flex: 1;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    padding-top: 55px;
    /* Topbar height */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header{
    --page-header-image: url("images/gallery-banner.jpg");
}

.categories {

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 30px;

    max-width: 1300px;

    margin: auto;

    padding: 30px;
}

.folder {

    background: white;

    border-radius: 18px;

    overflow: hidden;

    text-decoration: none;

    color: #222;

    box-shadow: 0 6px 20px rgba(0, 0, 0, .15);

    transition: .35s;

}

.folder:hover {

    transform: translateY(-8px);

    box-shadow: 0 12px 28px rgba(0, 0, 0, .25);

}

.folder img {

    width: 100%;

    height: 220px;

    object-fit: cover;

    display: block;

}

.folder-info {

    padding: 16px;

}

.folder-info h3 {

    margin: 0;

    font-size: 20px;

    color: #004d99;

}

.folder-info p {

    margin-top: 8px;

    color: #777;

    font-size: 14px;

}

@media(max-width:992px) {

    .categories {

        grid-template-columns: repeat(2, 1fr);

    }

}

@media(max-width:600px) {

    .categories {

        grid-template-columns: 1fr;

    }

}

/* Prevent Layout Shift */
.main-content {
    margin-top: 55px;
}

/* Page section animation */
.page-section {
    display: none;
}

.page-section.active-section {
    display: block;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

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

.gallery{

display:grid;

grid-template-columns:repeat(auto-fill,minmax(260px,1fr));

gap:20px;

max-width:1300px;

margin:auto;

padding:30px;

}
.gallery-title {
    margin-left: 30px;   /* Adjust to 40px or 50px if needed */
    margin-top: 10px;
    color: #004d99;
    font-size: 28px;
    font-weight: 600;
}


.gallery-item{

overflow:hidden;

border-radius:15px;

background:white;

box-shadow:0 5px 18px rgba(0,0,0,.15);

transition:.3s;

}

.gallery-item:hover{

transform:translateY(-5px);

}

.gallery-item img,

.gallery-item video{

width:100%;

height:220px;

object-fit:cover;

display:block;

cursor:pointer;

}
.back-btn{
    display:inline-block;
    align-self:flex-start;
    margin:30px;
    padding:12px 22px;
    background:#004d99;
    color:white;
    border-radius:8px;
    text-decoration:none;
    font-weight:bold;
    transition:.3s;
}

.back-btn:hover{

background:#0066cc;

}

.alert-box {
    background-color: #e6ffe6;
    color: #2d7a2d;
    border: 1px solid #77cc77;
    padding: 10px;
    margin: 10px auto;
    width: 60%;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
    animation: fadeOut 4s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        display: none;
    }
}

/* Lightbox Background */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Lightbox Image */
.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

.footer {
    background: #004d99;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

.footer p {
    margin: 0;
}
/* =====================================================
   MOBILE RESPONSIVE OVERRIDES
   Desktop rules above are untouched.
   ===================================================== */
@media (max-width: 600px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gallery {
        padding: 15px;
    }

    .gallery-title {
        margin-left: 15px;
        font-size: 22px;
    }

    .categories {
        padding: 15px;
        gap: 15px;
    }

    .back-btn {
        margin: 15px;
    }
}