/* EPN Category Page — modern tabbed layout
 * Reuses .epn-search-grid / .epn-search-card from search-results.css.
 * Adds: full-width layout, header, segmented tabs, topic/type dropdowns.
 */

/* ── Full-width layout (drops the old right sidebar) ── */
.category .blog-wrap #primary,
.tax-work_type .blog-wrap #primary {
    width: 100%;
    max-width: 1200px;
    float: none;
    margin: 0 auto;
}

/* ── Header ── */
.epn-category-header {
    margin-bottom: 18px;
}

.epn-category-header img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0;
    display: block;
}

.epn-category-title {
    font-size: 38px;
    line-height: 1.15;
    margin: 6px 0 6px;
    padding: 0;
    color: #195b71;
}

.epn-category-description {
    font-size: 18px;
    line-height: 1.5;
    color: #555;
    max-width: 860px;
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
}

.epn-category-description p {
    margin: 0;
}

/* ── Filter bar (tabs + dropdowns) ── */
.epn-cat-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e4e7;
}

/* Segmented tabs — styled to match the dropdowns (EPN blue, green when active) */
.epn-cat-tabs {
    display: inline-flex;
    gap: 8px;
}

/* NOTE: scoped under .epn-cat-tabs to outrank parent theme's
   button[type="button"] rule (border:#282828) in weta/style.css */
.epn-cat-tabs .epn-cat-tab {
    appearance: none;
    background: #4470B333;       /* unselected: 20% EPN blue */
    border: 1px solid #d1d5db;   /* unselected: light grey border (matches dropdowns) */
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: #4470B3;
    height: 42px;
    padding: 0 18px;
    box-sizing: border-box;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.epn-cat-tabs .epn-cat-tab:hover {
    background: #4470B344;
}

/* Single-tab (e.g. Work Type pages): display-only, no click/hover */
.epn-cat-tabs.is-static .epn-cat-tab {
    cursor: default;
    pointer-events: none;
}

.epn-cat-tabs .epn-cat-tab.is-active {
    border-color: #62B22F;       /* selected: EPN green border */
    background: #62B22F33;       /* selected: 20% EPN green */
    color: #4e9120;
}

/* Unselected count chip: EPN green / white */
.epn-cat-count {
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 10px;
    background: #62B22F;
    color: #fff;
}

/* Selected count chip: EPN blue / white */
.epn-cat-tabs .epn-cat-tab.is-active .epn-cat-count {
    background: #4470B3;
    color: #fff;
}

/* Dropdowns */
.epn-cat-dropdowns {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.epn-cat-nav {
    height: 42px;
    padding: 0 34px 0 12px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background-color: #fff;
    color: #1d2327;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    max-width: 240px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.epn-cat-nav:focus {
    border-color: #1e6174;
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 97, 116, 0.12);
}

/* ── Panels (tab content) ── */
.epn-cat-panel {
    display: none;
}

.epn-cat-panel.is-active {
    display: block;
}

.epn-cat-empty {
    padding: 48px 20px;
    text-align: center;
    background: #f7f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    color: #666;
    font-size: 15px;
}

/* Excerpt font — Libre Baskerville Italic, matching the previous design */
.category .epn-search-card .card-excerpt {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
}

/* "via Source" attribution on In The News cards */
.epn-search-card .card-source {
    font-size: 11px;
    color: #888;
    line-height: 1.4;
}

.epn-search-card .card-source a {
    color: #5a8a97;
    text-decoration: none;
}

.epn-search-card .card-source a:hover {
    color: #1e6174;
    text-decoration: underline;
}

/* ── Load More ── */
.epn-cat-loadmore-wrap {
    text-align: center;
    margin: 8px 0 40px;
}

/* Scoped under .epn-cat-loadmore-wrap to outrank parent theme's
   button[type="button"] rule. Matches the tab styles. */
.epn-cat-loadmore-wrap .epn-cat-loadmore {
    appearance: none;
    background: #4470B333;       /* default: 20% EPN blue */
    border: 1px solid #d1d5db;   /* default: light grey border */
    color: #4470B3;              /* default: EPN blue text */
    font-size: 14px;
    font-weight: 400;
    height: 42px;
    padding: 0 28px;
    box-sizing: border-box;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.epn-cat-loadmore-wrap .epn-cat-loadmore:hover,
.epn-cat-loadmore-wrap .epn-cat-loadmore:active {
    background: #62B22F33;       /* hover/active: 20% EPN green */
    border-color: #62B22F;       /* hover/active: EPN green border */
    color: #4e9120;
}

.epn-cat-loadmore.is-loading {
    opacity: 0.6;
    cursor: default;
}

/* ── Responsive ── */
@media screen and (max-width: 960px) {
    .category #primary,
    .tax-work_type #primary {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box;
    }

    .epn-category-title {
        font-size: 30px;
    }
}

@media screen and (max-width: 600px) {
    .category #primary,
    .tax-work_type #primary {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box;
    }

    .epn-cat-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .epn-cat-tabs {
        display: flex;
    }

    .epn-cat-tab {
        flex: 1;
        justify-content: center;
    }

    .epn-cat-dropdowns {
        flex-direction: column;
    }

    .epn-cat-nav {
        max-width: none;
        width: 100%;
    }

    .epn-category-title {
        font-size: 26px;
    }
}
