/* ====================================================================
   CATEGORY PAGE — page-specific styles
   Reuses everything from shared.css; this file only adds what's unique
   to /category.html: the header, two layout views (editorial + list),
   and a richer right sidebar.
==================================================================== */

/* The category page uses 2 columns instead of 4 like the home grid */
.layout.layout-category {
    grid-template-columns: 200px 1fr 320px;
}

@media (max-width: 1280px) {
    .layout.layout-category { grid-template-columns: 180px 1fr 280px; }
}
@media (max-width: 1024px) {
    .layout.layout-category {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* ============ MAIN AREA ============ */
.main.category-main {
    display: block;          /* override the 4-column grid from .main in shared.css */
    background: var(--bg);
    height: 100%;
    overflow-y: auto;
    padding: 28px 36px 60px;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d4 transparent;
}
.main.category-main::-webkit-scrollbar { width: 6px; }
.main.category-main::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 3px; }

@media (max-width: 1024px) {
    .main.category-main {
        height: auto;
        overflow: visible;
        padding: 22px 22px 50px;
    }
}

/* ============ CATEGORY HEADER ============ */
.cat-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
    border-bottom: 1px solid var(--text-strong);
    padding-bottom: 22px;
    margin-bottom: 16px;
}
.cat-eyebrow {
    font-family: "Inter", sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    font-weight: 600;
}
.cat-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 6px 0 8px;
    letter-spacing: -0.01em;
    line-height: 1;
}
.cat-tagline {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    max-width: 600px;
    line-height: 1.4;
    font-style: italic;
}

/* Admin-only quick-edit link. Visible only when an admin is signed
   in (PHP guards rendering). Subtle pill, doesn't compete with the
   header copy. */
.cat-edit-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.cat-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    padding: 5px 12px;
    border: 1px dashed var(--line);
    border-radius: 999px;
    background: transparent;
    font-family: "Inter", "Helvetica Neue", sans-serif;
    font-size: calc(11px * var(--font-scale, 1));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cat-edit-link:hover,
.cat-edit-link:focus {
    color: var(--link-accent, #1f8fff);
    border-color: var(--link-accent, #1f8fff);
    background: rgba(31, 143, 255, 0.05);
}
.cat-edit-link svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    flex-shrink: 0;
}
.cat-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}
.cat-stats {
    font-family: "Inter", sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cat-stats strong { color: var(--text-strong); font-weight: 600; }
.dot-sep { color: var(--text-faint); margin: 0 2px; }

/* Layout toggle: Editorial / List */
.cat-layout-toggle {
    display: inline-flex;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.layout-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}
.layout-btn:hover { color: var(--text-strong); }
.layout-btn.is-active {
    background: var(--text-strong);
    color: var(--bg);
}
.layout-btn svg {
    width: 14px; height: 14px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
}

@media (max-width: 768px) {
    .cat-header { grid-template-columns: 1fr; gap: 16px; align-items: start; }
    .cat-header-meta { align-items: flex-start; }
    .cat-title { font-size: 40px; }
}

/* ============ SUB-TOPIC CHIPS ============ */
.cat-subtopics {
    display: flex;
    gap: 6px;
    padding: 16px 0 22px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.cat-subtopics::-webkit-scrollbar { display: none; }

.subtopic-chip {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
    flex: 0 0 auto;
}
.subtopic-chip:hover {
    color: var(--text-strong);
    border-color: var(--text-faint);
}
.subtopic-chip.is-active {
    background: var(--text-strong);
    color: var(--bg);
    border-color: var(--text-strong);
}

/* ============ EDITORIAL VIEW ============ */
.cat-view { padding-top: 14px; }

/* Layout toggle — show only the view that matches the parent's
   data-layout attribute. The JS (category.js → applyLayout) writes
   either "editorial" or "list" to `.main-category[data-layout]` and
   syncs the active button. Default (no data-layout yet) shows the
   editorial view so first-paint isn't blank. */
.main-category[data-layout="editorial"] .cat-view[data-view="list"],
.main-category[data-layout="list"] .cat-view[data-view="editorial"] {
    display: none;
}
/* While JS is still loading, hide list and show editorial by default
   so we never get a frame with both visible. */
.main-category:not([data-layout]) .cat-view[data-view="list"] {
    display: none;
}

/* Sub-topic filter — JS toggles `.is-hidden` on .cat-story (the hero,
   each grid card, and trending strip rows) based on a tag match.
   Without a CSS rule the toggle does nothing visually, so wire it
   up here. */
.cat-story.is-hidden,
.cat-card.is-hidden,
.list-row.is-hidden {
    display: none !important;
}

/* ---- HERO card ---- */
.cat-hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 28px;
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--line);
}
.cat-hero-image {
    display: block;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #2a2a2a;
    filter: grayscale(60%);
    transition: filter 0.4s ease;
    text-decoration: none;
}
.cat-hero-image:hover { filter: grayscale(0%); }
.cat-hero-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cat-hero-text { display: flex; flex-direction: column; justify-content: center; }
.cat-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "Inter", sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.badge-cat {
    background: var(--bg-soft);
    color: var(--text-strong);
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid var(--line);
}
.cat-card-meta .time { color: var(--text-muted); }

.cat-hero-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.08;
    margin: 0 0 12px;
    letter-spacing: -0.005em;
}
.cat-hero-title a {
    color: inherit;
    text-decoration: none;
}
.cat-hero-title a:hover { text-decoration: underline; text-underline-offset: 4px; }

.cat-hero-deck {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 16px;
}

.cat-byline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.cat-byline .avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5a4a3a, #2a1a0a);
    flex: 0 0 24px;
}
.cat-byline .by {
    font-family: "Inter", sans-serif;
    font-size: 12px;
    color: var(--text-muted);
}
.cat-byline .by .name {
    color: var(--text-strong);
    font-weight: 600;
}

.cat-hero-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Inter", sans-serif;
    font-size: 11px;
    color: var(--text-faint);
    margin-top: auto;
}

/* ---- GRID 2x3 medium cards ---- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 24px;
    margin-bottom: 40px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--line);
}
.cat-card { display: flex; flex-direction: column; }
.cat-card-img {
    display: block;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 5 / 3;
    margin-bottom: 12px;
    filter: grayscale(50%);
    transition: filter 0.4s ease;
    text-decoration: none;
    background: #2a2a2a;
}
.cat-card-img:hover { filter: grayscale(0%); }
.cat-card-img svg { width: 100%; height: 100%; display: block; }

.cat-card-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.18;
    margin: 0 0 10px;
    color: var(--text-strong);
    letter-spacing: -0.005em;
}
.cat-card-title a { color: inherit; text-decoration: none; }
.cat-card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1280px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .cat-grid { grid-template-columns: 1fr; }
    .cat-hero { grid-template-columns: 1fr; gap: 16px; }
    .cat-hero-title { font-size: 28px; }
}

/* ---- TRENDING strip ---- */
.cat-trending-strip { margin-bottom: 28px; }
.cat-section-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0 0 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--text-strong);
    display: inline-block;
    letter-spacing: -0.005em;
}
.cat-strip-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.cat-strip-card { display: flex; flex-direction: column; }
.cat-strip-thumb {
    aspect-ratio: 4 / 3;
    border-radius: 3px;
    background: #ddd;
    margin-bottom: 8px;
    filter: grayscale(60%);
    transition: filter 0.3s;
}
.cat-strip-card:hover .cat-strip-thumb { filter: grayscale(0%); }
/* Each thumb gets a distinctive abstract pattern */
.cat-strip-thumb-1 { background: linear-gradient(135deg, #5a3f29 0%, #c9a062 50%, #f5e6c8 100%); }
.cat-strip-thumb-2 { background: linear-gradient(135deg, #1a3a5a 0%, #4a6a8a 50%, #b0c4d8 100%); }
.cat-strip-thumb-3 { background: linear-gradient(180deg, #2a4a6a 0%, #c8e0f0 50%, #fff 100%); }
.cat-strip-thumb-4 { background: linear-gradient(135deg, #f5a623 0%, #c9a062 50%, #5a3f29 100%); }

.cat-strip-card .time {
    font-family: "Inter", sans-serif;
    font-size: 10px;
    color: var(--text-faint);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cat-strip-card h4 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
    color: var(--text-strong);
}
.cat-strip-card h4 a { color: inherit; text-decoration: none; }
.cat-strip-card h4 a:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 1024px) {
    .cat-strip-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .cat-strip-list { grid-template-columns: 1fr; }
}

/* Load more button */
.cat-load-more-wrap {
    text-align: center;
    padding: 30px 0 20px;
}
.cat-load-more-wrap .load-more-btn {
    background: transparent;
    border: 1px solid var(--text-strong);
    color: var(--text-strong);
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 14px 32px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s;
}
.cat-load-more-wrap .load-more-btn:hover {
    background: var(--text-strong);
    color: var(--bg);
}

/* ============ LIST VIEW ============ */
.cat-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 16px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
    font-family: "Inter", sans-serif;
}
.cat-list-sort {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.sort-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 4px;
}
.sort-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 2px;
    position: relative;
    transition: color 0.15s;
}
.sort-btn:hover { color: var(--text-strong); }
.sort-btn.is-active {
    color: var(--text-strong);
    font-weight: 600;
}
.sort-btn.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--text-strong);
}

.cat-list-count {
    font-size: 11px;
    color: var(--text-muted);
    font-family: "Inter", sans-serif;
}

.cat-list,
.cat-list-container {
    display: flex;
    flex-direction: column;
}

/* List row */
.list-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
    transition: background 0.15s;
}
.list-row:hover { background: var(--bg-soft); }

.list-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 3px;
    overflow: hidden;
    background: #ddd;
    text-decoration: none;
}
.list-thumb > div {
    width: 100%;
    height: 100%;
    filter: grayscale(60%);
    transition: filter 0.4s ease;
}
.list-thumb:hover > div { filter: grayscale(0%); }
/* Distinctive thumb patterns matching the editorial cards */
.list-thumb-1 { background: linear-gradient(135deg, #1a2a4a 0%, #4a6a8a 50%, #c8d8e8 100%); }
.list-thumb-2 { background: linear-gradient(135deg, #5a3f29 0%, #c9a062 100%); }
.list-thumb-3 { background: linear-gradient(135deg, #1a3a2a 0%, #4a7a4a 100%); }
.list-thumb-4 { background: linear-gradient(135deg, #4a5a7a 0%, #1a2a4a 100%); }
.list-thumb-5 { background: linear-gradient(135deg, #d4d4d4 0%, #888 100%); }
.list-thumb-6 { background: linear-gradient(135deg, #2a4a6a 0%, #c8e0f0 100%); }
.list-thumb-7 { background: linear-gradient(180deg, #3a4a5a 0%, #7a8a9a 100%); }
.list-thumb-8 { background: linear-gradient(135deg, #7a3f23 0%, #d8b890 100%); }

.list-content { display: flex; flex-direction: column; }
.list-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Inter", sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.list-meta .time { color: var(--text-muted); }

.list-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 8px;
    color: var(--text-strong);
    letter-spacing: -0.005em;
}
.list-title a { color: inherit; text-decoration: none; }
.list-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.list-deck {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 10px;
}

.list-byline {
    font-family: "Inter", sans-serif;
    font-size: 12px;
    color: var(--text-strong);
    font-weight: 500;
}

@media (max-width: 768px) {
    .list-row { grid-template-columns: 120px 1fr; gap: 14px; padding: 16px 0; }
    .list-title { font-size: 18px; }
    .list-deck { display: none; }
}

/* ============ RIGHT SIDEBAR (CATEGORY-SPECIFIC) ============
   The category template renders `<aside class="sidebar-right cat-sidebar">`
   so we match both the legacy `.cat-sidebar-right` selector and the
   real markup `.cat-sidebar`. Either should pick up the styling. */
.cat-sidebar-right,
.cat-sidebar {
    background: var(--bg);
    border-left: 1px solid var(--line);
    overflow-y: auto;
    padding: 22px 22px 32px;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d4 transparent;
    font-family: "Inter", sans-serif;
}
.cat-sidebar-right::-webkit-scrollbar,
.cat-sidebar::-webkit-scrollbar { width: 4px; }
.cat-sidebar-right::-webkit-scrollbar-thumb,
.cat-sidebar::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 2px; }

@media (max-width: 1024px) {
    .cat-sidebar-right,
    .cat-sidebar { height: auto; border-left: none; border-top: 1px solid var(--line); }
}

.cat-side-block {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.cat-side-block:last-child { border-bottom: none; }

.cat-side-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid var(--text-strong);
}
.cat-side-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-strong);
    letter-spacing: -0.005em;
}
.cat-side-link {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}
.cat-side-link:hover { color: var(--text-strong); }
.cat-side-pulse {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pulse-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ff3b6b;
    animation: pulse 1.6s ease infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

/* Trending list */
.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: trend;
}
.trending-list li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.trending-list li:last-child { border-bottom: none; }
.trending-list .rank {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-faint);
    line-height: 1;
}
.trending-list a {
    color: inherit;
    text-decoration: none;
    display: block;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;             /* allow wrapping within grid track */
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.trending-list a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.trending-list .t-headline {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.25;
    margin-bottom: 4px;
}
.trending-list a:hover .t-headline { text-decoration: underline; text-underline-offset: 2px; }
.trending-list .t-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    gap: 4px;
}
.trend-up   { color: #00a060; font-weight: 600; }
.trend-down { color: #c43d3d; font-weight: 600; }
.trend-flat { color: var(--text-faint); }

/* Columnist list (legacy pattern: .columnist-list > li > .col-avatar) */
.columnist-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.columnist-list li {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.columnist-list li:last-child { border-bottom: none; }

/* Current pattern (what category.php actually renders):
   .columnists-grid > a.columnist-mini > avatar + .cm-info > .cm-name + .cm-follow.
   Same visual goal as .columnist-list: avatar | name | follow button. */
.cat-sidebar .columnists-grid,
.cat-sidebar-right .columnists-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.columnist-mini {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    transition: background 0.15s;
}
.columnist-mini:last-child { border-bottom: none; }
.columnist-mini:hover { background: rgba(0, 0, 0, 0.02); }
.columnist-mini img,
.columnist-mini .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
    background: linear-gradient(135deg, #c8a060, #5a3f1a);
}
.cm-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cm-name {
    font-family: "Inter", "Helvetica Neue", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cm-follow {
    background: transparent;
    border: 1px solid var(--text-strong);
    color: var(--text-strong);
    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    align-self: start;
    transition: background 0.15s, color 0.15s;
}
.cm-follow:hover { background: var(--text-strong); color: var(--bg); }
.cm-follow.is-following {
    background: var(--text-strong);
    color: var(--bg);
}
.cm-follow.is-following:hover {
    background: #c43d3d;
    border-color: #c43d3d;
}

.col-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c8a060, #5a3f1a);
}
.columnist-list li:nth-child(2n) .col-avatar {
    background: linear-gradient(135deg, #4a6a8a, #1a2a4a);
}
.columnist-list li:nth-child(3n) .col-avatar {
    background: linear-gradient(135deg, #5a4a8a, #2a1a4a);
}
.columnist-list li:nth-child(5n) .col-avatar {
    background: linear-gradient(135deg, #c4a3d8, #6a4a8a);
}
.col-info { min-width: 0; }
.col-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.1;
}
.col-name a {
    color: inherit;
    text-decoration: none;
}
.col-name a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.col-beat {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.col-follow {
    background: transparent;
    border: 1px solid var(--text-strong);
    color: var(--text-strong);
    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
}
.col-follow:hover {
    background: var(--text-strong);
    color: var(--bg);
}
.col-follow[data-following="true"] {
    background: var(--text-strong);
    color: var(--bg);
}
.col-follow[data-following="true"]::before {
    content: "✓ ";
    margin-right: 2px;
}

/* Tag cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    background: var(--bg-soft);
    color: var(--text-strong);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tag:hover {
    border-color: var(--text-strong);
    background: var(--bg);
}
.tag .tag-count {
    color: var(--text-faint);
    font-size: 10px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}
/* Size variants for visual hierarchy */
.tag.tag-l { font-size: 13px; padding: 6px 12px; font-weight: 600; }
.tag.tag-m { font-size: 12px; }
.tag.tag-s { font-size: 11px; padding: 3px 8px; opacity: 0.85; }

/* Newsletter card */
.cat-side-newsletter {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 18px 16px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}
.newsletter-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--text-strong);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}
.newsletter-icon svg {
    width: 18px; height: 18px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
}
.newsletter-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 4px;
}
.newsletter-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 14px;
}
.newsletter-cta {
    background: var(--text-strong);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    padding: 8px 22px;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.newsletter-cta:hover { opacity: 0.85; }

/* ============ MOBILE ADJUSTMENTS ============ */
@media (max-width: 1024px) {
    /* Hide the floating timeline (used in home) on mobile category */
    .timeline-sidebar { z-index: 200; }
}

/* ============ FONT-SCALE OVERRIDES (accessibility) ============
   Mirror the pattern from article.css so the aA popover scales fonts. */
.cat-title       { font-size: calc(56px * var(--font-scale, 1)) !important; }
.cat-tagline     { font-size: calc(16px * var(--font-scale, 1)) !important; }
.cat-hero-title  { font-size: calc(36px * var(--font-scale, 1)) !important; }
.cat-hero-deck   { font-size: calc(17px * var(--font-scale, 1)) !important; }
.cat-card-title  { font-size: calc(18px * var(--font-scale, 1)) !important; }
.cat-section-title { font-size: calc(22px * var(--font-scale, 1)) !important; }
.list-title      { font-size: calc(24px * var(--font-scale, 1)) !important; }
.list-deck       { font-size: calc(14px * var(--font-scale, 1)) !important; }
.cat-side-title  { font-size: calc(16px * var(--font-scale, 1)) !important; }
.trending-list .t-headline { font-size: calc(13px * var(--font-scale, 1)) !important; }
.col-name        { font-size: calc(13px * var(--font-scale, 1)) !important; }
.cat-strip-card h4 { font-size: calc(14px * var(--font-scale, 1)) !important; }

/* Font family (serif/sans) overrides */
body.font-serif .cat-title,        body.font-sans .cat-title,
body.font-serif .cat-tagline,      body.font-sans .cat-tagline,
body.font-serif .cat-hero-title,   body.font-sans .cat-hero-title,
body.font-serif .cat-hero-deck,    body.font-sans .cat-hero-deck,
body.font-serif .cat-card-title,   body.font-sans .cat-card-title,
body.font-serif .cat-section-title,body.font-sans .cat-section-title,
body.font-serif .list-title,       body.font-sans .list-title,
body.font-serif .list-deck,        body.font-sans .list-deck,
body.font-serif .cat-side-title,   body.font-sans .cat-side-title,
body.font-serif .cat-strip-card h4,body.font-sans .cat-strip-card h4,
body.font-serif .trending-list .t-headline, body.font-sans .trending-list .t-headline {
    font-family: var(--font-display) !important;
}


/* ====================================================================
   PAGINATED VIEW (category pages 2+)

   Page 1 renders the editorial view (hero + grid + trending).
   Pages 2+ render this simpler grid because the editorial framing
   ("hero card", "trending strip") only makes sense for newest stories.
==================================================================== */

.cat-paginated {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 40px 40px;
}

.cat-paginated-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.cat-paginated-eyebrow {
    font-family: "Inter", "Helvetica Neue", sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.cat-paginated-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 28px;
}
@media (max-width: 1024px) {
    .cat-paginated-grid { grid-template-columns: 1fr; gap: 24px; }
    .cat-paginated      { padding: 20px 24px 32px; }
}
@media (max-width: 640px) {
    .cat-paginated { padding: 16px 20px 28px; }
}

.cat-pag-card {
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.cat-pag-card:last-child {
    border-bottom: none;
}

.cat-pag-image-link {
    display: block;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 2px;
    line-height: 0;
}
.cat-pag-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.cat-pag-image-link:hover .cat-pag-image {
    transform: scale(1.02);
}

.cat-pag-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}
.cat-pag-eyebrow {
    font-family: "Inter", "Helvetica Neue", sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.cat-pag-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.008em;
    color: var(--text-strong);
    margin: 0 0 10px;
}
.cat-pag-card--with-image .cat-pag-title {
    font-size: 20px;
}
.cat-pag-title a {
    color: inherit;
    text-decoration: none;
}
.cat-pag-title a:hover {
    opacity: 0.7;
}
.cat-pag-excerpt {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-strong);
    margin: 0 0 14px;
    /* Cap at 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cat-pag-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: "Inter", "Helvetica Neue", sans-serif;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}
.cat-pag-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex: 0 0 22px;
}
.cat-pag-author {
    font-weight: 600;
    color: var(--text-strong);
}
.cat-pag-sep {
    color: var(--text-faint);
}


/* ====================================================================
   PAGINATION (.cat-pagination) → moved to shared.css so the tag
   template can reuse it without enqueuing the full category.css.
==================================================================== */


/* ---- DARK / NEGATIVE ---- */
[data-theme="dark"] .cat-pag-image,
[data-theme="negative"] .cat-pag-image {
    filter: saturate(0.85) brightness(0.95);
}
