body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

header {
    background-color: #bbb7b7;
    padding: 0.5em 1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo {
    width: 160px;
    height: auto;
    flex-shrink: 0;
}

nav ul {
    list-style-type: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    justify-content: center;
    flex-grow: 1;
    overflow-x: auto;
    /* Add these lines to fix the blotch */
    background: none;
    border: none;
    outline: none;
}

nav ul li {
    display: inline;
    /* Add these lines to ensure clean styling */
    background: none;
    border: none;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: black;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5em;
    white-space: nowrap;
    /* Add these lines for consistency */
    background: none;
    border: none;
    outline: none;
    display: inline-block;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

nav ul li a:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

main {
    padding: 20px;
}

footer {
    background-color: #bbb7b7;
    color: black;
    text-align: center;
    padding: 10px;
}

/* Thumbnail Gallery Styles */
.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.thumbnail {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.modal img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #ccc;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 1001;
}

.modal-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-caption {
    color: white;
    font-size: 16px;
    margin-top: 15px;
    text-align: center;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Increased from 150px */
        gap: 12px; /* Slightly increased gap */
    }
    
    .thumbnail img {
        height: 180px; /* Increased from 150px */
    }
    
    .logo {
        width: 120px;
    }

    nav ul {
        gap: 5px;
        justify-content: center;
    }

    nav ul li a {
        font-size: 0.85rem;
        padding: 0.3em 0.5em;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .close {
        font-size: 30px;
        right: 20px;
        top: 10px;
    }

    .modal-nav {
        font-size: 20px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Increased from 120px */
        gap: 10px;
    }
    
    .thumbnail img {
        height: 160px; /* Increased from 120px */
    }

    .modal-nav {
        font-size: 18px;
        padding: 6px 10px;
    }
}

/* Extra small devices */
@media (max-width: 320px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    
    .thumbnail img {
        height: 140px;
    }
}