.category-page {
    padding: 2rem 0 4rem;
}

.category-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    opacity: 0.72;
}

.category-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.category-header {
    max-width: 900px;
    margin-bottom: 2.5rem;
}

.category-header h1 {
    margin: 0.35rem 0 0;
    font-size: clamp(
        2.5rem,
        6vw,
        5rem
    );
    line-height: 1;
    letter-spacing: -0.045em;
}

.category-header p {
    max-width: 700px;
    margin: 1rem 0 0;
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.7;
}

.category-story-grid {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 1.5rem;
}

.category-story-card {
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        0
        12px
        36px
        rgba(3, 14, 27, 0.09);
}

.category-story-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            #071c2c,
            #164da3
        );
    color: #ffffff;
    text-decoration: none;
}

.category-story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-story-image span {
    padding: 1rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.category-story-copy {
    padding: 1.3rem;
}

.category-story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}

.article-category {
    display: inline-flex;
    width: fit-content;
    padding: 0.34rem 0.6rem;
    border-radius: 999px;
    background: #e9f1ff;
    color: #145caa;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.category-story-copy h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
}

.category-story-copy h2 a {
    color: inherit;
    text-decoration: none;
}

.category-story-copy h2 a:hover {
    text-decoration: underline;
}

.category-story-copy p {
    margin: 0.85rem 0 0;
    line-height: 1.55;
    opacity: 0.72;
}

.category-story-meta {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.62;
}

.category-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    background: #ffffff;
}

.category-pagination a {
    font-weight: 750;
    text-decoration: none;
}

.category-pagination .disabled {
    opacity: 0.35;
}

.category-empty {
    padding: 4rem 2rem;
    border-radius: 18px;
    background: #ffffff;
    text-align: center;
}

.article-footer {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.88rem;
    opacity: 0.72;
}

.article-footer p {
    margin: 0.25rem 0;
}

@media (max-width: 950px) {
    .category-story-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }
}

@media (max-width: 650px) {
    .category-story-grid {
        grid-template-columns: 1fr;
    }

    .category-pagination {
        flex-wrap: wrap;
    }
}


/* ==========================================================
   WATERFRONT FINAL DARK MODE
   CATEGORY / SEARCH CARDS
========================================================== */

html[data-theme="dark"] .category-page,
html[data-theme="dark"] .category-content,
html[data-theme="dark"] .category-results {
    background: #07111c !important;
    color: #edf4fa !important;
}


/* Card outer surfaces */

html[data-theme="dark"] .category-card,
html[data-theme="dark"] .story-card,
html[data-theme="dark"] .search-result-card,
html[data-theme="dark"] .home-category-card {
    background: #0e1b28 !important;
    color: #edf4fa !important;

    border-color: #283b4c !important;
}


/* White inner card bodies */

html[data-theme="dark"] .category-card-body,
html[data-theme="dark"] .story-body,
html[data-theme="dark"] .search-result-body,
html[data-theme="dark"] .home-category-copy {
    background: #0e1b28 !important;
    color: #edf4fa !important;
}


/* Titles */

html[data-theme="dark"] .category-card h2,
html[data-theme="dark"] .category-card h3,
html[data-theme="dark"] .story-card h2,
html[data-theme="dark"] .story-card h3,
html[data-theme="dark"] .search-result-card h2,
html[data-theme="dark"] .search-result-card h3,
html[data-theme="dark"] .home-category-card h2,
html[data-theme="dark"] .home-category-card h3 {
    color: #edf4fa !important;
}


html[data-theme="dark"] .category-card h2 a,
html[data-theme="dark"] .category-card h3 a,
html[data-theme="dark"] .story-card h2 a,
html[data-theme="dark"] .story-card h3 a,
html[data-theme="dark"] .search-result-card h2 a,
html[data-theme="dark"] .search-result-card h3 a,
html[data-theme="dark"] .home-category-card h2 a,
html[data-theme="dark"] .home-category-card h3 a {
    color: #edf4fa !important;
}


/* Dates, excerpts and secondary text */

html[data-theme="dark"] .category-card time,
html[data-theme="dark"] .story-card time,
html[data-theme="dark"] .search-result-card time,
html[data-theme="dark"] .home-category-card time,
html[data-theme="dark"] .category-card p,
html[data-theme="dark"] .story-card p,
html[data-theme="dark"] .search-result-card p,
html[data-theme="dark"] .home-category-card p {
    color: #aab8c5 !important;
}


/* Category badges stay crisp */

html[data-theme="dark"] .category-card .category-tag,
html[data-theme="dark"] .story-card .category-tag,
html[data-theme="dark"] .search-result-card .category-tag,
html[data-theme="dark"] .home-category-card .category-tag {
    color: #155cff !important;
}


/* END CATEGORY / SEARCH DARK MODE FIX */


/* ==========================================================
   EXACT CATEGORY PAGE DARK MODE
========================================================== */

html[data-theme="dark"] .category-story-card {
    background: #0e1b28 !important;
    color: #edf4fa !important;

    border:
        1px
        solid
        #283b4c !important;

    box-shadow: none !important;
}


html[data-theme="dark"] .category-story-copy {
    background: #0e1b28 !important;
    color: #edf4fa !important;
}


html[data-theme="dark"] .category-story-copy h2,
html[data-theme="dark"] .category-story-copy h2 a {
    color: #edf4fa !important;
}


html[data-theme="dark"] .category-story-copy p {
    color: #b7c4d1 !important;
    opacity: 1 !important;
}


html[data-theme="dark"] .category-story-meta,
html[data-theme="dark"] .category-story-meta time {
    color: #9eafbf !important;
    opacity: 1 !important;
}


html[data-theme="dark"] .article-category {
    background: #173b62 !important;
    color: #8fc4ff !important;
}


html[data-theme="dark"] .category-pagination,
html[data-theme="dark"] .category-empty {
    background: #0e1b28 !important;
    color: #edf4fa !important;

    border:
        1px
        solid
        #283b4c;
}


/* END EXACT CATEGORY PAGE DARK MODE */
