/* INDEX.CSS - The Thumbnail Grid & Pagination */

/* 1. THE GRID CONTAINER */
#index {
    background-color: #1a1a1a;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    border: 1px solid #333;
    padding: 10px 5px;
    margin: 10px 0;
}

/* 2. THE THUMBNAIL WINDOWS */
.thumbnail {
    width: 25%; /* 4 thumbnails per row */
    height: 145px;
    display: flex;
    align-items: center;    /* Vertical center */
    justify-content: center; /* Horizontal center */
}

.thumb {
    max-width: 95%;   /* Safety margin so they don't touch */
    max-height: 130px;
    width: auto;
    height: auto;
    border: 1px solid #444;
}

/* Hide the numbers if your index uses them */
.itemNumber { display: none; }

/* 3. PAGINATION (Bottom Links) */
/* Centered to match your new _large.css style */
.pagination {
    width: 100%;
    padding: 15px 0;
}

.pagination ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.pagination a {
    color: #fff;
    font-size: 22px; /* Matching your _large navigation size */
    text-decoration: underline;
}

/* 4. MOBILE ADJUSTMENTS */
@media (max-width: 600px) {
    /* 3 per row as you noticed */
    .thumbnail { 
        width: 33.33%; 
        height: 120px; 
    }
    
    .thumb { 
        max-height: 110px; 
    }

    /* Fix for the "Stretched" Footer Navigation */
    .pagination ul, .detailNav ul {
        gap: 10px; /* Reduced from 30px to prevent overflow */
        padding: 0 5px;
        justify-content: right;
    }

    .pagination a, .detailNav a {
        font-size: 16px; /* Slightly smaller to ensure it fits one line */
        white-space: nowrap; /* Keeps "Previous" from breaking into two lines */
    }
}

/* DESKTOP: Right-justify and tighten numbers */
@media (min-width: 601px) {
    .pagination ul {
        display: flex !important;
        justify-content: flex-end !important; /* Pushes the whole group to the right */
        padding-right: 30px; 
        gap: 15px; /* Adjust this number (e.g., 10px or 15px) for "normal" spacing */
    }

    .pagination li {
        width: auto !important; /* Prevents numbers from stretching to fill space */
    }
}
