.cm-pub {
    --pub-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    padding-bottom: 4rem;
}

.cm-pub-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 80;
    background: linear-gradient(90deg, #3b82f6, #a855f7);
    pointer-events: none;
}

.cm-pub-mast {
    position: relative;
    padding: 2.75rem 0 2rem;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 80% at 0% 0%, rgba(59, 130, 246, 0.16), transparent 55%),
        radial-gradient(ellipse 50% 70% at 100% 10%, rgba(168, 85, 247, 0.12), transparent 50%),
        linear-gradient(180deg, #080d1a, var(--cm-bg));
    border-bottom: 1px solid var(--cm-border);
}

.cm-pub-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cm-pub-kicker::before {
    content: "";
    width: 1.5rem;
    height: 1px;
    background: #60a5fa;
}

.cm-pub-mast h1 {
    font-family: var(--pub-serif);
    font-size: clamp(2.3rem, 5vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: #fff;
    margin: 0 0 0.75rem;
    background: none;
    -webkit-text-fill-color: #fff;
}

.cm-pub-lead {
    margin: 0;
    max-width: 38rem;
    color: #94a3b8;
    font-size: 1.08rem;
    line-height: 1.65;
}

.cm-pub-mast-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.4rem;
    color: #64748b;
    font-size: 0.82rem;
}

.cm-pub-mast-meta strong { color: #e2e8f0; font-weight: 600; }

.cm-pub-wrap { padding-top: 2rem; }

.cm-pub-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.cm-pub-search {
    display: flex;
    flex: 1 1 280px;
    gap: 0.6rem;
}

.cm-pub-search .cm-input {
    flex: 1;
    height: 2.75rem;
    padding: 0 1rem;
    border-radius: 999px;
}

.cm-pub-search .btn {
    height: 2.75rem;
    padding: 0 1.15rem;
    border-radius: 999px;
}

.cm-pub-topics {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.15rem 0 0.85rem;
    margin-bottom: 1.5rem;
    scrollbar-width: thin;
}

.cm-pub-topic {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    padding: 0.42rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--cm-border);
    background: rgba(15, 23, 42, 0.7);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.cm-pub-topic img { width: 14px; height: 14px; }

.cm-pub-topic:hover,
.cm-pub-topic.is-active {
    color: #fff;
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.45);
}

.cm-pub-spread {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
    gap: 1.15rem;
    margin-bottom: 2.5rem;
}

.cm-pub-feature {
    position: relative;
    display: flex;
    min-height: 420px;
    overflow: hidden;
    border-radius: 1.15rem;
    color: inherit;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.cm-pub-feature:hover { color: inherit; }

.cm-pub-feature-media {
    position: absolute;
    inset: 0;
}

.cm-pub-feature-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cm-pub-feature-body {
    position: relative;
    margin-top: auto;
    padding: 2rem 2rem 1.75rem;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 8, 22, 0.55) 28%, rgba(5, 8, 22, 0.92) 100%);
}

.cm-pub-feature-body h2 {
    font-family: var(--pub-serif);
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0.45rem 0 0.7rem;
    line-height: 1.2;
}

.cm-pub-feature-body p {
    margin: 0 0 1rem;
    max-width: 36rem;
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.55;
}

.cm-pub-feature-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #94a3b8;
    font-size: 0.82rem;
}

.cm-pub-read {
    color: #93c5fd;
    font-weight: 600;
}

.cm-pub-feature:hover .cm-pub-read { color: #bfdbfe; }

.cm-pub-aside {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cm-pub-aside-label {
    margin: 0 0 0.15rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cm-pub-mini {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    padding: 0.7rem;
    background: var(--cm-surface);
    border: 1px solid var(--cm-border);
    border-radius: 0.95rem;
    color: inherit;
    min-height: 6.1rem;
    transition: border-color 0.15s, transform 0.15s;
}

.cm-pub-mini:hover {
    color: inherit;
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.cm-pub-mini-media {
    width: 96px;
    height: 96px;
    border-radius: 0.7rem;
    overflow: hidden;
    flex-shrink: 0;
}

.cm-pub-mini-media img,
.cm-pub-mini-fallback,
.cm-pub-card-fallback {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-pub-mini h3 {
    margin: 0.2rem 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.35;
}

.cm-pub-mini small { color: var(--cm-muted); font-size: 0.75rem; }

.cm-pub-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.15rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--cm-border);
}

.cm-pub-section-head h2 {
    margin: 0;
    font-family: var(--pub-serif);
    font-size: 1.45rem;
    color: #fff;
    font-weight: 600;
}

.cm-pub-section-head span { color: var(--cm-muted); font-size: 0.84rem; }

.cm-pub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.cm-pub-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--cm-surface);
    border: 1px solid var(--cm-border);
    border-radius: 1.05rem;
    color: inherit;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.cm-pub-card:hover {
    color: inherit;
    transform: translateY(-4px);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.cm-pub-card-media {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.cm-pub-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cm-pub-card-media .cm-pub-cat {
    position: absolute;
    left: 0.85rem;
    bottom: 0.85rem;
}

.cm-pub-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.15rem 1.2rem 1.2rem;
}

.cm-pub-card-body h3 {
    font-family: var(--pub-serif);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 0.5rem;
}

.cm-pub-card-body p {
    margin: 0 0 1rem;
    color: var(--cm-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.cm-pub-card-meta {
    margin-top: auto;
    display: flex;
    gap: 0.85rem;
    color: #64748b;
    font-size: 0.78rem;
}

.cm-pub-cat {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cm-pub-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--cm-muted);
    background: var(--cm-surface);
    border: 1px dashed var(--cm-border);
    border-radius: 1rem;
}

/* Article */
.cm-pub-article-hero {
    padding: 1.75rem 0 0;
    background: linear-gradient(180deg, #080d1a, var(--cm-bg));
}

.cm-pub-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.15rem;
    color: #64748b;
    font-size: 0.8rem;
}

.cm-pub-crumbs a { color: #93c5fd; }
.cm-pub-crumbs span { color: #475569; }

.cm-pub-article-hero h1 {
    font-family: var(--pub-serif);
    font-size: clamp(1.9rem, 4.2vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #fff;
    margin: 0.55rem 0 0.85rem;
    background: none;
    -webkit-text-fill-color: #fff;
    max-width: 18ch;
}

.cm-pub-dek {
    margin: 0;
    max-width: 42rem;
    color: #94a3b8;
    font-size: 1.12rem;
    line-height: 1.65;
}

.cm-pub-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.25rem;
    margin-top: 1.5rem;
    padding: 1rem 0 1.5rem;
}

.cm-pub-byline-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cm-pub-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.cm-pub-avatar img { width: 100%; height: 100%; object-fit: cover; }

.cm-pub-byline strong { display: block; color: #fff; font-size: 0.92rem; }
.cm-pub-byline small { color: var(--cm-muted); font-size: 0.78rem; }

.cm-pub-byline-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 1.1rem;
    color: #94a3b8;
    font-size: 0.82rem;
}

.cm-pub-cover {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 1.05rem;
    margin: 0 0 2rem;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.cm-pub-cover-fallback {
    height: 220px;
    border-radius: 1.05rem;
    margin-bottom: 2rem;
}

.cm-pub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2.5rem;
    padding-top: 0.25rem;
}

.cm-pub-prose {
    color: #cbd5e1;
    font-size: 1.08rem;
    line-height: 1.8;
    max-width: 42rem;
}

.cm-pub-prose h2,
.cm-pub-prose h3 {
    font-family: var(--pub-serif);
    color: #fff;
    letter-spacing: -0.02em;
    margin: 2rem 0 0.7rem;
    line-height: 1.3;
}

.cm-pub-prose h2 { font-size: 1.55rem; }
.cm-pub-prose h3 { font-size: 1.22rem; }

.cm-pub-prose p { margin: 0 0 1.15rem; }

.cm-pub-prose ul,
.cm-pub-prose ol {
    margin: 0 0 1.15rem;
    padding-left: 1.3rem;
}

.cm-pub-prose li { margin-bottom: 0.4rem; }

.cm-pub-prose a { color: #93c5fd; text-decoration: underline; text-underline-offset: 3px; }

.cm-pub-prose img {
    width: 100%;
    border-radius: 0.8rem;
    margin: 1.1rem 0;
}

.cm-pub-prose code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.86em;
    background: rgba(2, 6, 23, 0.75);
    border: 1px solid var(--cm-border);
    padding: 0.1rem 0.38rem;
    border-radius: 0.35rem;
    color: #e2e8f0;
}

.cm-pub-prose pre {
    background: #020617;
    border: 1px solid var(--cm-border);
    color: #e2e8f0;
    border-radius: 0.9rem;
    padding: 1.1rem 1.2rem;
    overflow-x: auto;
    margin: 0 0 1.35rem;
    font-size: 0.88rem;
    line-height: 1.55;
}

.cm-pub-prose pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
}

.cm-pub-prose blockquote {
    margin: 0 0 1.35rem;
    padding: 0.2rem 0 0.2rem 1.15rem;
    border-left: 3px solid #3b82f6;
    color: #e2e8f0;
    font-family: var(--pub-serif);
    font-size: 1.15rem;
}

.cm-pub-end {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 2.25rem 0 0;
    padding-top: 1.35rem;
    border-top: 1px solid var(--cm-border);
}

.cm-pub-side { position: sticky; top: 1.25rem; align-self: start; }

.cm-pub-panel {
    padding: 1.2rem;
    margin-bottom: 1.1rem;
    background: var(--cm-surface);
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
}

.cm-pub-panel h3 {
    margin: 0 0 0.9rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
}

.cm-pub-author-card .cm-pub-avatar {
    width: 64px;
    height: 64px;
    margin-bottom: 0.75rem;
}

.cm-pub-author-card strong {
    display: block;
    color: #fff;
    font-size: 1.02rem;
    margin-bottom: 0.2rem;
}

.cm-pub-author-card p {
    margin: 0 0 1rem;
    color: var(--cm-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.cm-pub-related {
    display: flex;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--cm-border);
    color: inherit;
}

.cm-pub-related:last-child { border-bottom: 0; padding-bottom: 0; }
.cm-pub-related:first-of-type { padding-top: 0; }
.cm-pub-related:hover { color: inherit; }

.cm-pub-related-media {
    width: 72px;
    height: 72px;
    border-radius: 0.6rem;
    flex-shrink: 0;
    overflow: hidden;
}

.cm-pub-related-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cm-pub-related h4 {
    margin: 0 0 0.3rem;
    font-size: 0.88rem;
    color: #fff;
    line-height: 1.35;
}

.cm-pub-related small { color: var(--cm-muted); font-size: 0.74rem; }

.cm-pub-discuss {
    margin-top: 2.75rem;
    padding: 1.5rem 1.5rem 1.65rem;
    background: var(--cm-surface);
    border: 1px solid var(--cm-border);
    border-radius: 1.1rem;
}

.cm-pub-discuss h2 {
    font-family: var(--pub-serif);
    font-size: 1.4rem;
    color: #fff;
    margin: 0 0 1.15rem;
}

.cm-pub-comment {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.85rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--cm-border);
}

.cm-pub-comment:last-of-type { border-bottom: 0; }

.cm-pub-comment strong { display: block; color: #fff; font-size: 0.92rem; }
.cm-pub-comment time { color: #64748b; font-size: 0.75rem; }
.cm-pub-comment p {
    margin: 0.35rem 0 0;
    color: #cbd5e1;
    white-space: pre-wrap;
    line-height: 1.55;
}

.cm-pub-discuss-empty,
.cm-pub-thanks {
    color: var(--cm-muted);
    margin-bottom: 1rem;
}

.cm-pub-thanks { color: #86efac; }

.cm-pub-errors {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 0.7rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #fecaca;
}

.cm-pub-errors ul { margin: 0; padding-left: 1.1rem; }

.cm-pub-form { position: relative; margin-top: 0.5rem; }

.cm-pub-form label {
    display: block;
    font-weight: 600;
    margin: 0.85rem 0 0.4rem;
    color: #e2e8f0;
    font-size: 0.86rem;
}

.cm-pub-form label span { font-weight: 400; color: var(--cm-muted); }

.cm-pub-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.cm-hp {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

@media (max-width: 991px) {
    .cm-pub-spread,
    .cm-pub-grid,
    .cm-pub-layout { grid-template-columns: 1fr; }
    .cm-pub-feature { min-height: 340px; }
    .cm-pub-article-hero h1 { max-width: none; }
    .cm-pub-side { position: static; }
}

@media (max-width: 640px) {
    .cm-pub-grid { grid-template-columns: 1fr; }
    .cm-pub-form-row { grid-template-columns: 1fr; }
    .cm-pub-feature-body { padding: 1.35rem; }
    .cm-pub-discuss { padding: 1.15rem; }
}
