/* --- Global Styles & Typography --- */
:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2a2a2a;
    --text-color: #e0e0e0;
    --accent-color: #3498db;
    --border-color: #444;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    /* Ensure footer is at the bottom */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem;
    flex-grow: 1; /* Pushes footers down */
}

/* --- Header --- */
.site-header {
    background-color: var(--secondary-bg);
    text-align: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.site-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
}

/* --- Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.gallery-item {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    gap: 0.5rem; /* Reduced gap for number links */
    flex-wrap: wrap; /* Allows wrapping on small screens */
}

.nav-button {
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--secondary-bg);
    padding: 0.75rem;
    border-radius: 5px;
    transition: background-color 0.2s;
    min-width: 25px; /* Give number buttons a consistent width */
    text-align: center;
    line-height: 1;
}

.nav-button:hover {
    background-color: var(--accent-color);
}

.pagination .active {
    font-weight: bold;
    background-color: var(--accent-color);
    color: #fff;
    cursor: default;
}

/* --- Lightbox --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: calc(90vh - 80px); /* Leave space for controls */
    display: block;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #bbb;
}

.lightbox-controls {
    display: flex;
    gap: 1rem;
}

.control-button {
    text-decoration: none;
    color: #fff;
    background-color: #333;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.control-button:hover {
    background-color: var(--accent-color);
}

/* --- Site Credit Footer --- */
.site-credit {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid var(--border-color);
}

.site-credit p {
    margin: 0;
}

.site-credit a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.site-credit a:hover {
    color: var(--accent-color);
}


/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
    .site-header h1 {
        font-size: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    .gallery-item {
        border-radius: 4px;
    }

    .pagination {
        gap: 0.5rem;
    }

    .nav-button {
        padding: 0.6rem;
    }
}