/* Community design system: home feed, blog, news and forum.
   Theme tokens (--dq-*) win when present; every value falls back to a neutral default.
   Logical properties only, so LTR and RTL share one stylesheet. */

:root {
    --cm-accent: var(--dq-brand, var(--primary, #2563eb));
    --cm-accent-soft: color-mix(in srgb, var(--cm-accent) 9%, #fff);
    --cm-accent-line: color-mix(in srgb, var(--cm-accent) 22%, #fff);
    --cm-ink: var(--dq-ink, #171a21);
    --cm-muted: var(--dq-muted, #6b7280);
    --cm-border: var(--dq-border, #e5e7eb);
    --cm-surface: #fff;
    --cm-soft: #f7f8fa;
    --cm-radius: 22px;
    --cm-radius-sm: 14px;
    --cm-shadow: 0 1px 2px rgb(23 26 33 / .04), 0 10px 30px -12px rgb(23 26 33 / .14);
    --cm-shadow-hover: 0 2px 4px rgb(23 26 33 / .05), 0 22px 44px -14px rgb(23 26 33 / .22);
    --cm-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Atoms ---------- */

.cm-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .9rem;
    border-radius: 999px;
    background: var(--cm-accent-soft);
    color: var(--cm-accent);
    font-size: .75rem;
    font-weight: 700;
}

.cm-chip {
    display: inline-flex;
    align-items: center;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: rgb(255 255 255 / .92);
    color: var(--cm-ink);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
    backdrop-filter: blur(6px);
}

.cm-chip--solid {
    background: var(--cm-accent);
    color: #fff;
    align-self: flex-start;
}

.cm-meta,
.cm-topic-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
    color: var(--cm-muted);
    font-size: .78rem;
}

.cm-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: .5;
}

.cm-ph {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--cm-accent) 24%, #fff) 0%, transparent 60%),
        linear-gradient(135deg, var(--cm-accent-soft), #fff);
}

.cm-ph > span {
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 800;
    color: var(--cm-accent);
    opacity: .28;
}

.cm-pill {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1.1rem;
    border: 1px solid var(--cm-border);
    border-radius: 999px;
    background: var(--cm-surface);
    color: var(--cm-ink);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .2s, color .2s, transform .2s var(--cm-ease);
}

.cm-pill:hover {
    border-color: var(--cm-accent);
    color: var(--cm-accent);
    text-decoration: none;
    transform: translateY(-2px);
}

.cm-hub a:focus-visible,
.cm-filter-btn:focus-visible,
.cm-page a:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 3px;
}

/* ---------- Home feed hub ---------- */

.cm-hub {
    margin-block: 56px;
    scroll-margin-top: 24px;
}

.cm-hub-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 32px;
    margin-block-end: 28px;
}

.cm-hub-title {
    margin: 14px 0 6px;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    font-weight: 800;
    line-height: 1.5;
}

.cm-hub-lead {
    max-width: 52ch;
    margin: 0;
    color: var(--cm-muted);
    font-size: .92rem;
    line-height: 2;
}

.cm-filter {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--cm-border);
    border-radius: 999px;
    background: var(--cm-soft);
}

.cm-filter-btn {
    min-height: 40px;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cm-muted);
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
}

.cm-filter-btn:hover { color: var(--cm-ink); }

.cm-filter-btn[aria-pressed="true"] {
    background: var(--cm-surface);
    color: var(--cm-accent);
    box-shadow: 0 2px 8px rgb(23 26 33 / .1);
}

.cm-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

.cm-bento > [hidden] { display: none !important; }

/* Lead article */
.cm-feature {
    grid-column: span 12;
    min-height: 420px;
    border-radius: var(--cm-radius);
    overflow: hidden;
    box-shadow: var(--cm-shadow);
}

.cm-has-forum .cm-feature { grid-column: span 7; }

.cm-feature-link {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
    min-height: inherit;
    color: #fff;
    text-decoration: none;
    isolation: isolate;
}

.cm-feature-link:hover { color: #fff; text-decoration: none; }

.cm-feature-media {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.cm-feature-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--cm-ease);
}

.cm-feature-link:hover .cm-feature-media img { transform: scale(1.05); }

.cm-feature-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgb(12 14 20 / .88) 0%, rgb(12 14 20 / .45) 45%, rgb(12 14 20 / 0) 75%);
}

.cm-feature--plain .cm-feature-link { color: var(--cm-ink); }
.cm-feature--plain .cm-feature-link:hover { color: var(--cm-ink); }
.cm-feature--plain .cm-feature-link::after { display: none; }
.cm-feature--plain .cm-meta,
.cm-feature--plain .cm-feature-text { color: var(--cm-muted); }

.cm-feature-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 640px;
    padding: clamp(22px, 3vw, 36px);
}

.cm-feature-title {
    font-size: clamp(1.4rem, 2.6vw, 2.15rem);
    font-weight: 800;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cm-feature-text {
    color: rgb(255 255 255 / .85);
    font-size: .92rem;
    line-height: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cm-feature .cm-meta { color: rgb(255 255 255 / .8); }
.cm-feature--plain .cm-meta { color: var(--cm-muted); }

.cm-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
    font-weight: 700;
    color: inherit;
}

.cm-more svg { transition: transform .25s var(--cm-ease); }
html[dir="rtl"] .cm-more svg,
[dir="rtl"] .cm-more svg { transform: scaleX(-1); }
.cm-feature-link:hover .cm-more svg { transform: translateX(4px); }
[dir="rtl"] .cm-feature-link:hover .cm-more svg { transform: scaleX(-1) translateX(4px); }

/* Article cards */
.cm-card {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    background: var(--cm-surface);
    transition: transform .35s var(--cm-ease), box-shadow .35s var(--cm-ease), border-color .35s;
}

.cm-has-articles:not(.cm-has-forum) .cm-card { grid-column: span 3; }

.cm-card:hover {
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: var(--cm-shadow-hover);
}

.cm-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--cm-soft);
}

.cm-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--cm-ease);
}

.cm-card:hover .cm-card-media img { transform: scale(1.06); }

.cm-card-media .cm-chip {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-start: 12px;
}

.cm-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
    padding: 18px 20px 20px;
}

.cm-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.9;
}

.cm-card-title a {
    color: var(--cm-ink);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cm-card-title a:hover { color: var(--cm-accent); }

.cm-card-text {
    margin: 0;
    color: var(--cm-muted);
    font-size: .85rem;
    line-height: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cm-card .cm-meta { margin-block-start: auto; padding-block-start: 6px; }

/* Forum panel */
.cm-forum {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    background: linear-gradient(180deg, var(--cm-accent-soft), var(--cm-surface) 120px);
}

.cm-forum-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-block-end: 8px;
}

.cm-forum-title { margin: 0; font-size: 1.1rem; font-weight: 800; }
.cm-forum-lead { margin: 2px 0 0; color: var(--cm-muted); font-size: .8rem; }

.cm-live {
    position: relative;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #16a34a;
}

.cm-live::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: cm-pulse 2s ease-out infinite;
}

@keyframes cm-pulse {
    to { transform: scale(3.2); opacity: 0; }
}

.cm-topics {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cm-topic + .cm-topic { border-block-start: 1px solid var(--cm-border); }

.cm-topic-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 6px;
    border-radius: var(--cm-radius-sm);
    color: var(--cm-ink);
    text-decoration: none;
    transition: background .2s, padding .25s var(--cm-ease);
}

.cm-topic-link:hover {
    padding-inline: 12px;
    background: var(--cm-surface);
    color: var(--cm-ink);
    text-decoration: none;
}

.cm-avatar {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: .95rem;
    font-weight: 800;
    color: var(--tone-fg, #fff);
    background: var(--tone-bg, var(--cm-accent));
}

.cm-avatar[data-tone="0"] { --tone-bg: #fde8ec; --tone-fg: #b4112a; }
.cm-avatar[data-tone="1"] { --tone-bg: #e3f1ff; --tone-fg: #1561b5; }
.cm-avatar[data-tone="2"] { --tone-bg: #e2f6ea; --tone-fg: #14804a; }
.cm-avatar[data-tone="3"] { --tone-bg: #fff1dc; --tone-fg: #a85d00; }
.cm-avatar[data-tone="4"] { --tone-bg: #efe8ff; --tone-fg: #5b36b8; }

.cm-topic-main { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }

.cm-topic-title {
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-topic-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 48px;
    padding: 6px 8px;
    border-radius: 12px;
    background: var(--cm-soft);
    line-height: 1.3;
}

.cm-topic-stat b { font-size: .95rem; }
.cm-topic-stat small { color: var(--cm-muted); font-size: .68rem; }

.cm-forum-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-block-start: 14px;
    border-radius: var(--cm-radius-sm);
    background: var(--cm-ink);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s;
}

.cm-forum-cta:hover { background: var(--cm-accent); color: #fff; text-decoration: none; }

/* Social strip */
.cm-social {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    padding: 26px 32px;
    border-radius: var(--cm-radius);
    color: #fff;
    background:
        radial-gradient(60% 140% at 0% 0%, color-mix(in srgb, var(--cm-accent) 80%, #fff) 0%, transparent 70%),
        linear-gradient(135deg, #1b1d25, #0f1015);
}

.cm-social-copy h3 { margin: 0 0 4px; color: #fff; font-size: 1.15rem; font-weight: 800; }
.cm-social-copy p { margin: 0; max-width: 56ch; color: rgb(255 255 255 / .75); font-size: .85rem; line-height: 1.9; }

.cm-social-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.cm-social-btn {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgb(255 255 255 / .22);
    border-radius: 14px;
    background: rgb(255 255 255 / .08);
    color: #fff;
    font-size: 1.15rem;
    text-decoration: none;
    transition: background .2s, transform .25s var(--cm-ease), color .2s;
}

.cm-social-btn:hover { background: #fff; color: var(--cm-accent); text-decoration: none; transform: translateY(-3px); }

.cm-social .cm-pill {
    border-color: rgb(255 255 255 / .22);
    background: transparent;
    color: #fff;
}

.cm-social .cm-pill:hover { background: #fff; color: var(--cm-ink); }

/* Filtered state: simple responsive grid */
.cm-hub:not([data-filter="all"]) .cm-bento { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cm-hub:not([data-filter="all"]) .cm-bento > * { grid-column: auto !important; }
.cm-hub:not([data-filter="all"]) .cm-forum,
.cm-hub:not([data-filter="all"]) .cm-social { grid-column: 1 / -1 !important; }
.cm-hub:not([data-filter="all"]) .cm-feature { min-height: 0; }
.cm-hub:not([data-filter="all"]) .cm-feature-link { min-height: 320px; }

/* ---------- Public pages: blog & news ---------- */

.cm-page { padding-block-end: 24px; }

.cm-page-head {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    margin-block-end: 28px;
    padding: clamp(24px, 4vw, 44px);
    border-radius: var(--cm-radius);
    overflow: hidden;
    background:
        radial-gradient(70% 160% at 100% 0%, color-mix(in srgb, var(--cm-accent) 16%, #fff) 0%, transparent 65%),
        linear-gradient(135deg, var(--cm-accent-soft), #fff);
    border: 1px solid var(--cm-accent-line);
}

.cm-page-head h1 {
    margin: 12px 0 4px;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.5;
}

.cm-page-head p { margin: 0; color: var(--cm-muted); line-height: 2; }

.cm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
}

.cm-grid {
    display: grid;
    grid-template-columns: repeat(var(--cm-cols, 2), minmax(0, 1fr));
    gap: 22px;
}

.cm-masonry {
    column-count: var(--cm-cols, 2);
    column-gap: 22px;
}

.cm-masonry > * { break-inside: avoid; margin-block-end: 22px; }

.cm-post {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    background: var(--cm-surface);
    transition: transform .35s var(--cm-ease), box-shadow .35s var(--cm-ease), border-color .35s;
}

.cm-post:hover {
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: var(--cm-shadow-hover);
}

.cm-post-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--cm-soft);
}

.cm-post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--cm-ease);
}

.cm-post:hover .cm-post-media img { transform: scale(1.06); }

.cm-post-media .cm-chip {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-start: 12px;
}

.cm-post-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }

.cm-post-title { margin: 0; font-size: 1.1rem; font-weight: 800; line-height: 1.9; }
.cm-post-title a { color: var(--cm-ink); text-decoration: none; }
.cm-post-title a:hover { color: var(--cm-accent); }

.cm-post-intro {
    margin: 0;
    color: var(--cm-muted);
    font-size: .88rem;
    line-height: 2;
    display: -webkit-box;
    -webkit-line-clamp: var(--cm-lines, 3);
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cm-post-intro.cm-full { display: block; -webkit-line-clamp: unset; }

.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: auto; padding-block-start: 4px; }

.cm-tag {
    display: inline-flex;
    align-items: center;
    padding: .25rem .7rem;
    border-radius: 999px;
    background: var(--cm-soft);
    color: var(--cm-muted);
    font-size: .74rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.cm-tag:hover { background: var(--cm-accent-soft); color: var(--cm-accent); text-decoration: none; }

/* Lead post on first page: wide horizontal card */
.cm-post--lead { grid-column: 1 / -1; flex-direction: row; }
.cm-post--lead .cm-post-media { flex: 1 1 52%; aspect-ratio: auto; min-height: 320px; }
.cm-post--lead .cm-post-body { flex: 1 1 48%; justify-content: center; padding: clamp(22px, 3vw, 40px); }
.cm-post--lead .cm-post-title { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }

/* Sidebar */
.cm-side { position: sticky; inset-block-start: 20px; display: flex; flex-direction: column; gap: 20px; }

.cm-side .block {
    margin: 0 !important;
    padding: 20px 22px;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    background: var(--cm-surface);
}

.cm-side .block-title {
    margin: 0 0 12px;
    font-size: .95rem;
    font-weight: 800;
}

.cm-side .block-title span::before { display: none; }

.cm-side ul { margin: 0; padding: 0; list-style: none; }
.cm-side li { padding: 10px 0 !important; }
.cm-side li + li { border-block-start: 1px dashed var(--cm-border); }
.cm-side li a { color: var(--cm-ink); font-weight: 600; line-height: 1.9; text-decoration: none; }
.cm-side li a:hover { color: var(--cm-accent); }

.cm-side .blog-tag {
    padding: .3rem .75rem;
    border: 0 !important;
    border-radius: 999px;
    background: var(--cm-soft);
    color: var(--cm-ink);
    font-weight: 600;
    text-decoration: none;
    margin-inline: 0 6px !important;
}

.cm-side .blog-tag:hover { background: var(--cm-accent-soft); color: var(--cm-accent); }

.cm-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 56px 20px;
    border: 2px dashed var(--cm-border);
    border-radius: var(--cm-radius);
    background: var(--cm-soft);
    color: var(--cm-muted);
    text-align: center;
}

/* Article detail */
.cm-article-hero { margin-block-end: 28px; }

.cm-article-hero h1 {
    margin: 14px 0 12px;
    font-size: clamp(1.7rem, 3.6vw, 2.7rem);
    font-weight: 800;
    line-height: 1.6;
}

.cm-article-cover {
    margin: 0 0 32px;
    overflow: hidden;
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
}

.cm-article-cover img { display: block; width: 100%; max-height: 520px; object-fit: cover; }

.cm-article-lead {
    margin-block-end: 24px;
    padding-inline-start: 18px;
    border-inline-start: 4px solid var(--cm-accent);
    color: var(--cm-ink);
    font-size: 1.1rem;
    line-height: 2.1;
}

.cm-prose {
    max-width: 74ch;
    font-size: 1rem;
    line-height: 2.2;
    overflow-wrap: anywhere;
}

.cm-prose h2, .cm-prose h3, .cm-prose h4 { margin-block: 1.8em .6em; font-weight: 800; line-height: 1.7; }
.cm-prose img { max-width: 100%; height: auto; border-radius: var(--cm-radius-sm); }
.cm-prose a { color: var(--cm-accent); text-decoration: underline; text-underline-offset: 4px; }
.cm-prose blockquote {
    margin: 1.6em 0;
    padding: 14px 22px;
    border-inline-start: 4px solid var(--cm-accent);
    border-radius: var(--cm-radius-sm);
    background: var(--cm-accent-soft);
}

.cm-article-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-start: 32px; padding-block-start: 20px; border-block-start: 1px solid var(--cm-border); }

.cm-comments {
    margin-block-start: 48px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    background: var(--cm-soft);
}

.cm-comments .form-control { border-radius: var(--cm-radius-sm); border-color: var(--cm-border); }

/* ---------- Forum ---------- */

.cm-forum-page .page-title { display: none; }

.cm-board-group {
    margin-block-end: 28px;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    background: var(--cm-surface);
    overflow: hidden;
}

.cm-board-group > header {
    padding: 18px 24px;
    border-block-end: 1px solid var(--cm-border);
    background: linear-gradient(90deg, var(--cm-accent-soft), var(--cm-surface));
}

.cm-board-group h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.cm-board-group header p { margin: 2px 0 0; color: var(--cm-muted); font-size: .82rem; }

.cm-board {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    transition: background .2s;
}

.cm-board + .cm-board { border-block-start: 1px solid var(--cm-border); }
.cm-board:hover { background: var(--cm-soft); }

.cm-board-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--cm-accent-soft);
    color: var(--cm-accent);
    font-size: 1.3rem;
    font-weight: 800;
}

.cm-board-name { display: block; color: var(--cm-ink); font-size: 1rem; font-weight: 800; text-decoration: none; }
.cm-board-name:hover { color: var(--cm-accent); text-decoration: none; }
.cm-board-desc { display: block; margin-block-start: 2px; color: var(--cm-muted); font-size: .82rem; line-height: 1.9; }

.cm-board-stats { display: flex; gap: 8px; }

.cm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 62px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--cm-soft);
    line-height: 1.35;
}

.cm-stat b { font-size: 1rem; }
.cm-stat small { color: var(--cm-muted); font-size: .7rem; }

.cm-lastpost { max-width: 240px; min-width: 0; }

.cm-topic-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    transition: background .2s;
}

.cm-topic-row + .cm-topic-row { border-block-start: 1px solid var(--cm-border); }
.cm-topic-row:hover { background: var(--cm-soft); }
.cm-topic-row .cm-topic-name { color: var(--cm-ink); font-weight: 800; line-height: 1.8; text-decoration: none; }
.cm-topic-row .cm-topic-name:hover { color: var(--cm-accent); }

.cm-badge {
    display: inline-flex;
    align-items: center;
    margin-inline-end: 6px;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    color: #fff;
    background: #6b7280;
    vertical-align: middle;
}

.cm-badge--announce { background: #c62828; }
.cm-badge--sticky { background: #d97706; }

.cm-post-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    margin-block-end: 18px;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    background: var(--cm-surface);
    overflow: hidden;
}

.cm-post-card:target { border-color: var(--cm-accent); box-shadow: 0 0 0 4px var(--cm-accent-soft); }

.cm-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border-inline-end: 1px solid var(--cm-border);
    background: var(--cm-soft);
    text-align: center;
}

.cm-author .cm-avatar { width: 64px; height: 64px; border-radius: 20px; font-size: 1.5rem; }
.cm-author b { font-size: .92rem; word-break: break-word; }
.cm-author small { color: var(--cm-muted); }

.cm-post-main { display: flex; flex-direction: column; min-width: 0; }

.cm-post-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 22px;
    border-block-end: 1px solid var(--cm-border);
    color: var(--cm-muted);
    font-size: .8rem;
}

.cm-post-bar a { color: var(--cm-muted); }

.cm-post-text { flex: 1; padding: 20px 22px; line-height: 2.1; overflow-wrap: anywhere; }

.cm-post-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px; border-block-start: 1px solid var(--cm-border); background: var(--cm-soft); }

.cm-forum-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Responsive ---------- */

@media (max-width: 1199.98px) {
    .cm-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
    .cm-has-forum .cm-feature { grid-column: span 12; }
    .cm-forum { grid-column: span 12; }
    .cm-card, .cm-has-articles:not(.cm-has-forum) .cm-card { grid-column: span 4; }
}

@media (max-width: 991.98px) {
    .cm-layout { grid-template-columns: minmax(0, 1fr); }
    .cm-side { position: static; }
    .cm-card, .cm-has-articles:not(.cm-has-forum) .cm-card { grid-column: span 6; }
    .cm-post--lead { flex-direction: column; }
    .cm-post--lead .cm-post-media { min-height: 220px; aspect-ratio: 16 / 9; }
    .cm-board { grid-template-columns: 52px minmax(0, 1fr) auto; }
    .cm-board .cm-lastpost { display: none; }
    .cm-topic-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
    .cm-topic-row .cm-lastpost { display: none; }
}

@media (max-width: 767.98px) {
    .cm-hub { margin-block: 40px; }
    .cm-feature { min-height: 360px; }
    .cm-card, .cm-has-articles:not(.cm-has-forum) .cm-card { grid-column: span 12; }
    .cm-grid { grid-template-columns: minmax(0, 1fr); }
    .cm-masonry { column-count: 1; }
    .cm-social { padding: 22px 20px; }
    .cm-board { grid-template-columns: 44px minmax(0, 1fr); padding: 16px; }
    .cm-board-icon { width: 44px; height: 44px; }
    .cm-board-stats { grid-column: 1 / -1; }
    .cm-topic-row { grid-template-columns: 40px minmax(0, 1fr); padding: 14px 16px; }
    .cm-topic-row .cm-board-stats { grid-column: 1 / -1; }
    .cm-post-card { grid-template-columns: minmax(0, 1fr); }
    .cm-author { flex-direction: row; justify-content: flex-start; padding: 14px 18px; border-inline-end: 0; border-block-end: 1px solid var(--cm-border); text-align: start; }
    .cm-author .cm-avatar { width: 44px; height: 44px; border-radius: 14px; font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .cm-hub *, .cm-page *, .cm-hub *::after {
        animation: none !important;
        transition: none !important;
    }
}
