/* =========================================
   1. Excerpt List Pagination (Previous/Next)
   ========================================= */
.ps-excerpt-pagination {
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    flex-direction: row !important;
    box-sizing: border-box;
    padding: 20px 0;
    margin-top: 10px;
}

.ps-excerpt-pagination a {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.ps-excerpt-pagination a:hover {
    text-decoration: underline;
}

/* Force Next button to the far right */
.ps-excerpt-pagination .ps-excerpt-nav-next {
    margin-left: auto !important;
}

/* Ensure Prev button stays on the left */
.ps-excerpt-pagination .ps-excerpt-nav-prev {
    margin-right: auto !important; 
}


/* =========================================
   2. Single Story Navigation (Prev | Back | Next)
   ========================================= */
#ps-story-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    
    /* MOBILE FIX: Ensure nav sits on top of overlapping content */
    position: relative !important;
    z-index: 99 !important; 
}

/* Split into 3 equal columns so 'Back' is perfectly centered */
.ps-nav-item {
    flex: 1 !important; 
    display: flex !important;
    align-items: center !important;
    min-width: 0; /* Prevents flex items from breaking out of container */
    position: relative !important; /* Keeps z-index context local */
}

/* Left Column: Previous */
.ps-nav-prev {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* Center Column: Back to List */
.ps-nav-back {
    justify-content: center !important;
    text-align: center !important;
}

/* Right Column: Next */
.ps-nav-next {
    justify-content: flex-end !important;
    text-align: right !important;
}

/* Link Styling */
.ps-nav-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    padding: 10px 5px; /* Increase tap target size for mobile */
    line-height: 1.2;
}

.ps-nav-link:hover {
    text-decoration: underline;
}

/* Disabled state */
.ps-nav-link-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none; /* Ensures clicks pass through if it somehow overlaps */
}

/* MOBILE FIX: On very small screens, prevent text wrapping from breaking layout */
@media (max-width: 480px) {
    .ps-nav-text {
        font-size: 0.9em;
    }
    .ps-nav-arrow {
        font-size: 1.2em;
        line-height: 0.8;
    }
}