/* ═══════════════════════════════════════════════════════════
   ClassoNix — Blog Styles
   Matches the ClassoNix design system: Plus Jakarta Sans,
   --primary #533AFD, same radii/spacing/button language.
   Prefix: cn-blog-*
═══════════════════════════════════════════════════════════ */

.cn-blog-hero {
    padding: 140px 0 56px;
    text-align: center;
}
.cn-blog-hero .section-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #533AFD;
    background: rgba(83, 58, 253, 0.08);
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.cn-blog-hero h1 {
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 800;
    color: #1A1A2E;
    line-height: 1.15;
    margin-bottom: 16px;
}
.cn-blog-hero h1 .text-grad {
    background: linear-gradient(120deg, #533AFD, #8B5CF6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.cn-blog-hero p {
    font-size: 17px;
    color: #475569;
    max-width: 620px;
    margin: 0 auto;
}

/* ── Search + category filter ─────────────────────────── */
.cn-blog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.cn-blog-search {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 420px;
}
.cn-blog-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 14px;
}
.cn-blog-search input {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 13px 16px 13px 42px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #fff;
    color: #1A1A2E;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cn-blog-search input:focus {
    outline: none;
    border-color: #533AFD;
    box-shadow: 0 0 0 4px rgba(83, 58, 253, 0.08);
}
.cn-blog-cats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cn-blog-cats a {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #E2E8F0;
    background: #fff;
    transition: all 0.18s;
}
.cn-blog-cats a:hover { border-color: #533AFD; color: #533AFD; }
.cn-blog-cats a.active {
    background: #533AFD;
    border-color: #533AFD;
    color: #fff;
}

/* ── Post grid ────────────────────────────────────────── */
.cn-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 48px;
}
@media (max-width: 991px) { .cn-blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cn-blog-grid { grid-template-columns: 1fr; } }

.cn-post-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}
.cn-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 44px rgba(26, 26, 46, 0.10);
    border-color: #C7D2FE;
}
.cn-post-card-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #EEF0FF, #F5F3FF);
    position: relative;
}
.cn-post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.cn-post-card:hover .cn-post-card-img img { transform: scale(1.05); }
.cn-post-card-img .no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A5B4FC;
    font-size: 34px;
}
.cn-post-card-body {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cn-post-card-cat {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #533AFD;
    background: #EEF0FF;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.cn-post-card-title {
    font-size: 18px;
    font-weight: 800;
    color: #1A1A2E;
    line-height: 1.35;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cn-post-card:hover .cn-post-card-title { color: #533AFD; }
.cn-post-card-excerpt {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.cn-post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #F1F5F9;
}
.cn-post-card-meta .meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #64748B;
    min-width: 0;
}
.cn-post-card-meta .meta-left .author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #533AFD, #8B5CF6);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cn-post-card-meta .read-more {
    font-size: 13px;
    font-weight: 700;
    color: #533AFD;
    white-space: nowrap;
}
.cn-post-card:hover .read-more i { transform: translateX(3px); }
.cn-post-card-meta .read-more i { transition: transform 0.2s; margin-left: 4px; }

/* ── Empty state ──────────────────────────────────────── */
.cn-blog-empty {
    text-align: center;
    padding: 80px 24px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    margin-bottom: 48px;
}
.cn-blog-empty i { font-size: 46px; color: #C7D2FE; margin-bottom: 18px; }
.cn-blog-empty h3 { font-size: 22px; font-weight: 800; margin-bottom: 10px; color: #1A1A2E; }
.cn-blog-empty p { color: #64748B; font-size: 15px; margin-bottom: 24px; }
.cn-blog-empty .clear-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #533AFD;
    text-decoration: none;
}

/* ── Pagination ───────────────────────────────────────── */
.cn-blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}
.cn-blog-pagination a,
.cn-blog-pagination span {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #fff;
    color: #475569;
    text-decoration: none;
    padding: 0 14px;
    transition: all 0.18s;
}
.cn-blog-pagination a:hover { border-color: #533AFD; color: #533AFD; }
.cn-blog-pagination .current {
    background: #533AFD;
    border-color: #533AFD;
    color: #fff;
}
.cn-blog-pagination .dots { border: none; background: none; color: #94A3B8; }

/* ═══════════════════════════════════════════════════════════
   SINGLE POST PAGE
═══════════════════════════════════════════════════════════ */
.cn-post-wrap { padding: 130px 0 60px; }

.cn-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748B;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.cn-breadcrumb a { color: #64748B; text-decoration: none; transition: color 0.15s; }
.cn-breadcrumb a:hover { color: #533AFD; }
.cn-breadcrumb i { font-size: 9px; color: #CBD5E1; }
.cn-breadcrumb .current { color: #1A1A2E; font-weight: 600; }

.cn-post-head { max-width: 800px; margin: 0 auto 36px; text-align: center; }
.cn-post-head .cat-chip {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #533AFD;
    background: #EEF0FF;
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.cn-post-head h1 {
    font-size: clamp(28px, 4.4vw, 44px);
    font-weight: 800;
    color: #1A1A2E;
    line-height: 1.2;
    margin-bottom: 20px;
}
.cn-post-head .post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #64748B;
}
.cn-post-head .post-meta .author {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    color: #1A1A2E;
}
.cn-post-head .author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #533AFD, #8B5CF6);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cn-post-head .meta-sep { color: #CBD5E1; }
.cn-post-head .updated { font-size: 12.5px; color: #94A3B8; }

.cn-post-hero-img {
    max-width: 960px;
    margin: 0 auto 48px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(26, 26, 46, 0.12);
}
.cn-post-hero-img img { width: 100%; display: block; }

/* Article body — comfortable reading width & typography */
.cn-post-body {
    max-width: 760px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.8;
    color: #334155;
}
.cn-post-body p { margin-bottom: 1.4em; }
.cn-post-body h2 {
    font-size: 30px;
    font-weight: 800;
    color: #1A1A2E;
    line-height: 1.3;
    margin: 1.8em 0 0.7em;
}
.cn-post-body h3 {
    font-size: 24px;
    font-weight: 800;
    color: #1A1A2E;
    line-height: 1.35;
    margin: 1.6em 0 0.6em;
}
.cn-post-body h4 {
    font-size: 19px;
    font-weight: 700;
    color: #1A1A2E;
    margin: 1.4em 0 0.5em;
}
.cn-post-body ul, .cn-post-body ol { margin: 0 0 1.4em 1.4em; }
.cn-post-body li { margin-bottom: 0.5em; }
.cn-post-body a { color: #533AFD; text-decoration: underline; text-underline-offset: 3px; }
.cn-post-body a:hover { color: #4530D9; }
.cn-post-body blockquote {
    border-left: 4px solid #533AFD;
    background: #F8F7FF;
    padding: 18px 24px;
    margin: 0 0 1.4em;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #475569;
}
.cn-post-body img { max-width: 100%; height: auto; border-radius: 14px; margin: 0.6em 0; }
.cn-post-body figure { margin: 0 0 1.4em; }
.cn-post-body figcaption { font-size: 13px; color: #94A3B8; text-align: center; margin-top: 8px; }
.cn-post-body pre {
    background: #1A1A2E;
    color: #E2E8F0;
    padding: 18px 22px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 1.4em;
}
.cn-post-body code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}
.cn-post-body p code, .cn-post-body li code {
    background: #F1F5F9;
    color: #533AFD;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.88em;
}
.cn-post-body hr {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 2.4em 0;
}
.cn-post-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.4em;
    font-size: 15px;
}
.cn-post-body th, .cn-post-body td {
    border: 1px solid #E2E8F0;
    padding: 10px 14px;
    text-align: left;
}
.cn-post-body th { background: #F8FAFC; font-weight: 700; color: #1A1A2E; }

/* Tags row */
.cn-post-tags {
    max-width: 760px;
    margin: 36px auto 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cn-post-tags .tag {
    font-size: 12.5px;
    font-weight: 600;
    color: #64748B;
    background: #F1F5F9;
    padding: 6px 14px;
    border-radius: 999px;
}

/* Share buttons */
.cn-post-share {
    max-width: 760px;
    margin: 40px auto 0;
    padding: 24px 0;
    border-top: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cn-post-share .share-label { font-size: 14px; font-weight: 700; color: #1A1A2E; margin-right: 6px; }
.cn-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
}
.cn-share-btn:hover { transform: translateY(-2px); opacity: 0.9; }
.cn-share-facebook { background: #1877F2; }
.cn-share-twitter { background: #000; }
.cn-share-linkedin { background: #0A66C2; }
.cn-share-whatsapp { background: #25D366; }
.cn-share-copy { background: #64748B; cursor: pointer; border: none; }
.cn-share-copy.copied { background: #047857; }

/* Related posts */
.cn-related {
    max-width: 1100px;
    margin: 64px auto 0;
    padding-top: 48px;
    border-top: 1px solid #E2E8F0;
}
.cn-related h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1A1A2E;
    margin-bottom: 28px;
    text-align: center;
}

/* Preview banner (admin preview mode) */
.cn-preview-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #1A1A2E;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    text-align: center;
    padding: 10px 16px;
    z-index: 9999;
}
.cn-preview-banner a { color: #A5B4FC; margin-left: 10px; }
body.has-preview-banner .cn-post-wrap { padding-top: 160px; }
body.has-preview-banner .xb-header { top: 40px; }

@media (max-width: 768px) {
    .cn-blog-hero { padding: 120px 0 40px; }
    .cn-post-wrap { padding-top: 110px; }
    .cn-post-head { margin-bottom: 26px; }
    .cn-post-hero-img { margin-bottom: 32px; border-radius: 14px; }
    .cn-post-body { font-size: 16px; }
    .cn-post-body h2 { font-size: 25px; }
    .cn-post-body h3 { font-size: 21px; }
}
