/* Hide the default footer and action bar */
.site-info, #actionbar {
    display: none !important;
}

/* Target the wrapper around the posts to ensure exactly 12 show */
.home .post-area li:nth-child(n+13),
.home .posts-grid .post-item:nth-child(n+13),
.home .archive-item:nth-child(n+13) {
    display: none !important;
}

/* Optimise text rendering for a sharper editorial look */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
#infinite-handle span {
    display: block !important;
    background: #000; /* Black for editorial look */
    color: #fff;
    padding: 15px 30px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    margin: 20px auto;
    width: 200px;
}

/* --- THE GLOBAL RESET (Prevents Overlap) --- */
.nav-links, .pagination {
    display: flex !important;
    flex-wrap: wrap !important; /* Forces numbers to drop to next line instead of overlapping */
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important; /* The 'Safety Zone' between numbers */
    margin: 50px 0 !important;
    padding: 20px 10px !important;
    border-top: 1px solid #000 !important;
    width: 100% !important;
    position: static !important; /* Kills any bad 'Absolute' positioning */
}

/* --- THE NUMBERS --- */
.page-numbers {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important; /* Apple's touch standard */
    height: 44px !important;
    padding: 0 10px !important;
    margin: 0 !important; /* We use gap instead for better control */
    font-family: "Didot", serif !important;
    font-size: 14px !important;
    color: #000 !important;
    background: #fff !important;
    border: 1px solid #000 !important; /* Makes them look like premium buttons */
    text-decoration: none !important;
    box-sizing: border-box !important;
}

/* --- THE ACTIVE PAGE --- */
.page-numbers.current {
    background: #000 !important;
    color: #fff !important;
}

/* --- MOBILE SPECIFIC FIX --- */
@media screen and (max-width: 480px) {
    .nav-links, .pagination {
        gap: 10px !important;
    }

    /* Keep only the Essential Numbers on very small screens */
    .page-numbers.dots {
        display: none !important;
    }
    
    /* Ensure no text can force the button to grow too wide */
    .page-numbers {
        flex: 0 0 auto !important;
        font-size: 12px !important;
    }
}