/* ── Reading progress bar ── */
.read-progress {
    position: fixed;
    top: 72px;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--gradient);
    z-index: 99;
    transition: width 0.1s;
    box-shadow: 0 0 12px rgba(192, 68, 245, 0.6);
}

/* ── Hero ── */
.post-hero {
    position: relative;
    padding: 120px 48px 56px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    background: linear-gradient(180deg, #0d0d1a 0%, var(--bg) 100%);
}

.post-hero::before {
    content: "";
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(33, 117, 155, 0.18), transparent 70%);
    filter: blur(80px);
    top: -300px;
    right: -200px;
    pointer-events: none;
}

.post-hero-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.breadcrumb svg {
    width: 12px;
    height: 12px;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 20px;
    width: fit-content;
}

.tag-wp {
    background: rgba(33, 117, 155, 0.18);
    color: #5db8d0;
}

.post-hero h1 {
    font-size: clamp(34px, 4.5vw, 54px);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.post-hero .lede {
    font-size: 19px;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 720px;
}

/* Author row */
.author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.author-meta .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: white;
    box-shadow: 0 0 20px rgba(192, 68, 245, 0.3);
}

.author-meta .name {
    font-size: 15px;
    font-weight: 700;
}

.author-meta .role {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.post-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Cover image */
.post-cover {
    max-width: 1100px;
    margin: -8px auto 0;
    padding: 0 48px;
    position: relative;
    z-index: 2;
}

.post-cover-inner {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    position: relative;
}

.post-cover-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(33, 117, 155, 0.2), rgba(192, 68, 245, 0.1));
    mix-blend-mode: overlay;
}

/* ── Layout ── */
.post-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 48px 100px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 64px;
    align-items: start;
}

/* ── Article body ── */
.post-content {
    font-size: 17px;
    line-height: 1.8;
    color: rgba(240, 240, 255, 0.85);
    max-width: 720px;
}

.post-content p {
    color: rgba(240, 240, 255, 0.78);
    margin-bottom: 24px;
}

.post-content h2 {
    font-size: 28px;
    margin: 48px 0 18px;
    letter-spacing: -0.02em;
    scroll-margin-top: 100px;
}

.post-content h3 {
    font-size: 22px;
    margin: 36px 0 14px;
    letter-spacing: -0.01em;
    scroll-margin-top: 100px;
}

.post-content a {
    color: var(--cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(34, 211, 238, 0.4);
    transition: text-decoration-color 0.2s;
}

.post-content a:hover {
    text-decoration-color: var(--cyan);
}

.post-content ul,
.post-content ol {
    margin-bottom: 24px;
    padding-left: 4px;
}

.post-content li {
    margin-bottom: 10px;
    list-style: none;
    position: relative;
    padding-left: 28px;
    color: rgba(240, 240, 255, 0.78);
}

.post-content ul li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gradient);
}

.post-content ol {
    counter-reset: item;
}

.post-content ol li {
    counter-increment: item;
}

.post-content ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(192, 68, 245, 0.12);
    border: 1px solid rgba(192, 68, 245, 0.3);
    color: var(--purple);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
}

.post-content strong {
    color: var(--text);
    font-weight: 700;
}

.post-content blockquote {
    margin: 36px 0;
    padding: 24px 28px;
    border-left: 3px solid;
    border-image: var(--gradient) 1 100%;
    background: rgba(192, 68, 245, 0.04);
    border-radius: 0 14px 14px 0;
    font-size: 19px;
    line-height: 1.6;
    color: var(--text);
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content blockquote cite {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    font-style: normal;
    color: var(--text-dim);
}

.post-content pre {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 28px 0;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 14px;
    line-height: 1.7;
}

.post-content code {
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 0.92em;
    padding: 2px 8px;
    background: rgba(192, 68, 245, 0.1);
    border: 1px solid rgba(192, 68, 245, 0.2);
    border-radius: 6px;
    color: var(--purple);
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.c-comment {
    color: #636e7b;
}

.c-keyword {
    color: #c792ea;
}

.c-string {
    color: #c3e88d;
}

.c-func {
    color: #82aaff;
}

.post-content figure {
    margin: 36px 0;
}

.post-content figure img {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.post-content figcaption {
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Callout box */
.callout {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 14px;
    margin: 28px 0;
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.callout-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(34, 211, 238, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.callout-body h5 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--cyan);
    letter-spacing: 0.02em;
}

.callout-body p {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 0;
    color: var(--text-muted);
}

/* Stat row */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin: 32px 0;
    border: 1px solid var(--border);
}

.stat-row .stat-cell {
    padding: 22px 18px;
    text-align: center;
    background: var(--bg2);
}

.stat-row .stat-num {
    font-size: 28px;
    font-weight: 800;
}

.stat-row .stat-lbl {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Tags */
.post-tags {
    margin-top: 56px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-tags-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.post-tags a {
    padding: 6px 14px;
    border-radius: 50px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}

.post-tags a:hover {
    border-color: rgba(192, 68, 245, 0.4);
    color: var(--text);
    background: rgba(192, 68, 245, 0.06);
}

/* Share row */
.share-row {
    margin-top: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.share-label {
    font-size: 14px;
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    border-color: rgba(192, 68, 245, 0.4);
    transform: translateY(-2px);
}

.share-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Author bio big */
.author-bio {
    margin-top: 48px;
    padding: 32px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.author-bio .avatar-big {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
}

.author-bio h4 {
    font-size: 18px;
    margin-bottom: 4px;
}

.author-bio .role {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.author-bio p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.author-bio .ab-actions {
    display: flex;
    gap: 8px;
}

.author-bio .ab-actions a {
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 50px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.author-bio .ab-actions a:hover {
    color: var(--text);
    border-color: rgba(192, 68, 245, 0.3);
}

/* Related */
.related {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px 100px;
}

.related h3 {
    font-size: 24px;
    margin-bottom: 28px;
    letter-spacing: -0.01em;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.related-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.related-card:hover {
    border-color: rgba(192, 68, 245, 0.4);
    transform: translateY(-4px);
}

.related-thumb {
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
}

.related-body {
    padding: 22px;
}

.related-card h4 {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.related-meta {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Comments stub */
.comments-section {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.comments-section h3 {
    font-size: 22px;
    margin-bottom: 24px;
}

.comment-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 14px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: rgba(192, 68, 245, 0.5);
}

.comment-form .cf-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-form small {
    font-size: 12px;
    color: var(--text-dim);
}

.comment-list {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment {
    display: flex;
    gap: 14px;
}

.comment .c-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.comment .c-body {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
}

.comment .c-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment .c-name {
    font-size: 13px;
    font-weight: 700;
}

.comment .c-date {
    font-size: 12px;
    color: var(--text-dim);
}

.comment p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.comment .c-actions {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-dim);
}

.comment .c-actions span {
    cursor: pointer;
    transition: color 0.2s;
}

.comment .c-actions span:hover {
    color: var(--text);
}

/* ── Sidebar widgets ── */
.sidebar {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
}

.widget-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title::before {
    content: "";
    width: 4px;
    height: 14px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Table of contents */
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-list a {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-muted);
    border-left: 2px solid var(--border);
    border-radius: 0 8px 8px 0;
    transition: all 0.2s;
    line-height: 1.5;
}

.toc-list a:hover {
    color: var(--text);
    border-left-color: var(--purple);
    background: rgba(192, 68, 245, 0.04);
}

.toc-list a.active {
    color: var(--text);
    font-weight: 600;
    border-left-color: var(--purple);
    background: rgba(192, 68, 245, 0.08);
}

.toc-list .indent {
    padding-left: 24px;
    font-size: 12.5px;
}

/* Newsletter widget */
.widget-newsletter {
    background: linear-gradient(160deg, rgba(192, 68, 245, 0.12), rgba(34, 211, 238, 0.08));
    border: 1px solid rgba(192, 68, 245, 0.25);
    position: relative;
    overflow: hidden;
}

.widget-newsletter::before {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(192, 68, 245, 0.15);
    filter: blur(40px);
    top: -80px;
    right: -80px;
}

.widget-newsletter h4 {
    font-size: 16px;
    margin-bottom: 6px;
    position: relative;
}

.widget-newsletter p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 14px;
    position: relative;
}

.widget-newsletter input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(7, 7, 15, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    margin-bottom: 10px;
}

.widget-newsletter button {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: var(--gradient);
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
}

/* Recent */
.recent-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: opacity 0.2s;
}

.recent-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-item:hover {
    opacity: 0.85;
}

.recent-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.recent-body h5 {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
}

.recent-body .recent-date {
    font-size: 11px;
    color: var(--text-dim);
}

/* Course promo */
.widget-course {
    background: var(--bg3);
    border: 1px solid rgba(34, 211, 238, 0.2);
    position: relative;
    overflow: hidden;
}

.widget-course::before {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.12);
    filter: blur(40px);
    bottom: -80px;
    left: -80px;
}

.widget-course .ce {
    font-size: 28px;
    margin-bottom: 12px;
    position: relative;
}

.widget-course h4 {
    font-size: 16px;
    margin-bottom: 8px;
    position: relative;
}

.widget-course p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 14px;
    position: relative;
}

.widget-course .price {
    font-size: 13px;
    color: var(--cyan);
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
}

.widget-course .btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 13px;
    position: relative;
}

/* Tags cloud sidebar */
.tag-cloud-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-cloud-list a {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 50px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.2s;
}

.tag-cloud-list a:hover {
    border-color: rgba(192, 68, 245, 0.4);
    color: var(--text);
}

@media (max-width: 960px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 48px 20px;
    }

    .post-hero {
        padding: 100px 20px 40px;
    }

    .post-cover {
        padding: 0 20px;
    }

    .related {
        padding: 0 20px 64px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .author-bio {
        flex-direction: column;
        gap: 16px;
    }

    .stat-row {
        grid-template-columns: 1fr;
    }
}
