/* Compact, responsive previous/all/next controls. */
.reh-series-navigation {
    margin: 42px 0 18px;
    padding: 24px;
    border: 1px solid rgba(127, 127, 127, .25);
    border-radius: 12px;
}

.reh-series-navigation > hr {
    display: none;
}

.reh-series-navigation > h2 {
    margin: 0 0 16px;
    font-size: clamp(20px, 2.2vw, 27px);
}

.reh-series-navigation .reh-series-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.reh-series-navigation .reh-series-buttons > a {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid #087ff5;
    border-radius: 8px;
    background: #087ff5;
    color: #fff !important;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.reh-series-navigation .reh-series-buttons > a:hover,
.reh-series-navigation .reh-series-buttons > a:focus-visible {
    border-color: #0069d3;
    background: #0069d3;
    transform: translateY(-1px);
}

.reh-series-navigation .reh-series-all {
    border-color: rgba(8, 127, 245, .45) !important;
    background: transparent !important;
    color: #087ff5 !important;
}

html.site-s-light body .main-content .reh-series-navigation .reh-series-buttons > a.reh-series-all {
    border-color: #80bfff !important;
    background: #eaf4ff !important;
    color: #075fae !important;
}

html.site-s-light #off-canvas .close {
    border: 1px solid #d6d9dd !important;
    background: #f4f5f7 !important;
    color: #202327 !important;
}

html.site-s-light #off-canvas .close i {
    color: #202327 !important;
}

/* Category-wide series sorting. */
.reh-archive-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 24px;
}

.reh-archive-sort .reh-sort-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid rgba(127, 127, 127, .45);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none !important;
}

.reh-archive-sort .reh-sort-button:hover,
.reh-archive-sort .reh-sort-button:focus-visible,
.reh-archive-sort .reh-sort-button.is-active {
    border-color: #087ff5;
    background: #087ff5;
    color: #fff !important;
}

html.site-s-light .reh-archive-sort .reh-sort-button:not(.is-active) {
    border-color: #b9c2cc;
    background: #fff;
    color: #26313d !important;
}

/* SmartMag forces these areas dark even when the light switch is selected. */
html.site-s-light .smart-head-row.s-dark,
html.site-s-light .smart-head-row .sub-menu,
html.site-s-light .main-footer.s-dark,
html.site-s-light .main-footer .lower-footer,
html.site-s-light #off-canvas.s-dark,
html.site-s-light #off-canvas .sub-menu {
    border-color: #e3e5e8 !important;
    background: #fff !important;
    color: #23262b !important;
}

html.site-s-light .main-footer .lower-footer {
    background: #f3f4f6 !important;
}

html.site-s-light .smart-head-row.s-dark a,
html.site-s-light .smart-head-row.s-dark .navigation a,
html.site-s-light .smart-head-row .sub-menu a,
html.site-s-light .main-footer.s-dark,
html.site-s-light .main-footer.s-dark a,
html.site-s-light .main-footer.s-dark .heading,
html.site-s-light #off-canvas.s-dark,
html.site-s-light #off-canvas.s-dark a,
html.site-s-light #off-canvas.s-dark .heading {
    color: #23262b !important;
}

html.site-s-light .smart-head-row.s-dark a:hover,
html.site-s-light .smart-head-row .sub-menu a:hover,
html.site-s-light .main-footer.s-dark a:hover,
html.site-s-light #off-canvas.s-dark a:hover {
    color: #087ff5 !important;
}

html.site-s-light #off-canvas.s-dark .mobile-menu li,
html.site-s-light .smart-head-row .sub-menu li,
html.site-s-light .main-footer.s-dark .loop-sep .l-post {
    border-color: #e3e5e8 !important;
}

@media (max-width: 767px) {
    .reh-series-navigation {
        margin-top: 30px;
        padding: 18px;
    }

    .reh-series-navigation .reh-series-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reh-series-navigation .reh-series-prev { order: 1; }
    .reh-series-navigation .reh-series-next { order: 2; }
    .reh-series-navigation .reh-series-all {
        order: 3;
        grid-column: 1 / -1;
    }

    .reh-archive-sort {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reh-archive-sort .reh-sort-button {
        padding-right: 8px;
        padding-left: 8px;
    }

    /* Keep the mobile home page focused on the latest article list. */
    body.home .main-sidebar {
        display: none !important;
    }

    body.home .main-content {
        width: 100% !important;
        max-width: 100% !important;
        padding-right: 0 !important;
        border-right: 0 !important;
    }

    body.home .main-footer .upper-footer .widget:not(.widget-about) {
        display: none !important;
    }

    body.home .main-footer .upper-footer .widget-about {
        width: 100% !important;
        max-width: 100% !important;
    }

    #off-canvas .off-canvas-widgets {
        display: none !important;
    }

    .main-footer .upper-footer,
    .main-footer .lower-footer {
        padding-top: 28px !important;
        padding-bottom: 28px !important;
    }
}

@media (max-width: 420px) {
    .reh-series-navigation {
        padding: 15px;
    }

    .reh-series-navigation .reh-series-buttons > a {
        min-height: 44px;
        padding: 9px 10px;
        font-size: 14px;
    }
}
