/* ===== base (matches article/home) ===== */
*,
*::before,
*::after {
    box-sizing: border-box
}

body {
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility
}

img {
    max-width: 100%;
    display: block;
    height: auto
}

a {
    color: inherit;
    text-decoration: none
}

button {
    font: inherit
}

:root {
    --bg: #0e0f12;
    --surface: #14161b;
    --text: #e9ecf1;
    --muted: #b6bdc7;
    --brand: #4ea1ff;
    --accent: #ffbf69;
    --border: #242936;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);
    --content-w: 1100px;
    --sidebar-w: 320px;
    --gutter: 28px;
    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font)
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(20, 22, 27, .8);
    backdrop-filter: saturate(1.2) blur(12px);
    border-bottom: 1px solid var(--border)
}

.wrap {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 700
}

.brand .dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--brand);
    display: inline-block
}

.nav a {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted)
}

.nav a:hover {
    background: #1b1e25;
    color: var(--text)
}

/* ===== layout ===== */
.page {
    display: grid;
    grid-template-columns: 1fr minmax(260px, var(--sidebar-w));
    gap: var(--gutter);
    align-items: start;
    padding: 28px 0
}

@media (max-width: 980px) {
    .page {
        grid-template-columns: 1fr
    }
}

/* ===== header band ===== */
.cat-hero {
    background: linear-gradient(180deg, #151922 0%, #0e1016 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px
}

.breadcrumbs {
    font-size: .9rem;
    color: var(--muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 4px 0 10px
}

.breadcrumbs a {
    color: var(--muted)
}

.breadcrumbs a:hover {
    color: var(--text)
}

.cat-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap
}

.cat-head h1 {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    margin: .1em 0
}

.muted {
    color: var(--muted)
}

/* ===== filters / sort ===== */
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0
}

.field {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #0f131b;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px
}

.field select,
.field input {
    background: transparent;
    border: 0;
    color: var(--text)
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #10131a;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px
}

/* ===== list/grid of articles ===== */
.ad {
    border: 1px dashed #334;
    border-radius: 14px;
    background: #0f1218;
    color: #9bb0d1;
    text-align: center;
    padding: 14px;
    font-size: .95rem
}

.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px
}

@media (min-width:780px) {
    .cards {
        grid-template-columns: 1fr
    }
}

.card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden
}

.thumb {
    background: #0f131b;
    aspect-ratio: 16/12
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.card-body {
    padding: 12px 14px 14px
}

.card-title {
    font-weight: 700;
    line-height: 1.25
}

.meta {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 4px
}

.excerpt {
    margin: .5em 0 0;
    font-size: 0.92rem;
}

.card:hover {
    transform: translateY(-1px)
}

/* ===== pagination ===== */
.pager {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 18px 0
}

.pager a,
.pager span {
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px
}

.pager .active {
    background: #121827;
    color: #cfe1ff;
    border-color: #283146
}

/* ===== sidebar ===== */
.sidebar {
    position: sticky;
    top: 86px
}

.side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden
}

.side-card h3 {
    font-size: 1.05rem;
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: #dbe6f7
}

.side-card .inner {
    padding: 12px 16px
}

.list {
    list-style: none;
    margin: 0;
    padding: 0
}

.list li+li {
    margin-top: 10px
}

.list a {
    display: block;
    padding: 8px 6px;
    border-radius: 10px;
    color: #cfe1ff;
    border: 1px solid transparent
}

.list a:hover {
    background: #121827;
    border-color: #283146
}