    /* Gallery grid */
    .gallery {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        /* grid-template-columns: repeat(3, 1fr); */
        gap: 10px;
        padding: 10px;
        height: 300px;         /* Set a height limit */
        overflow-y: auto;      /* Adds scrollbar only when content overflows */
    }

    .gallery img {
        width: 100%;
        height: auto;
        border-radius: 5px;
        cursor: pointer;
        transition: transform 0.3s ease;
    }

    .gallery img:hover {
        transform: scale(1.05);
    }

    /* Lightbox overlay */
    .lightbox {
        display: none;
        position: fixed;
        z-index: 1000;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.85);
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }

    .lightbox img {
        max-width: 90%;
        max-height: 80%;
        border-radius: 5px;
        margin-bottom: 20px;
    }

    .lightbox.active {
        display: flex;
    }

    /* Navigation buttons */
    .nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        font-size: 40px;
        color: white;
        background: rgba(0,0,0,0.4);
        border: none;
        padding: 10px 15px;
        cursor: pointer;
        border-radius: 5px;
        user-select: none;
    }

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

    /* Close button */
    .close {
        position: absolute;
        top: 20px;
        right: 30px;
        font-size: 30px;
        color: white;
        text-decoration: none;
        font-weight: bold;
        cursor: pointer;
    }
