/* ==========================================================================
   Single blog post: hero + framed cover, sticky contents rail, readable column
   ========================================================================== */
body.blog-detail-page { background: #05030f; }
.post { position: relative; font-family: 'Inter', 'Poppins', system-ui, sans-serif; color: #f4f2ff; overflow-x: clip; }
.post *, .post *::before, .post *::after { box-sizing: border-box; }
.post a { text-decoration: none; }
.post-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.post-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 1100; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #7c5cff, #e86cf0); }

/* ---------- hero ---------- */
.post-hero {
    padding: 140px 0 40px; text-align: center;
    background:
        radial-gradient(60% 70% at 50% 0%, rgba(124, 92, 255, .30), transparent 70%),
        radial-gradient(40% 50% at 85% 20%, rgba(232, 108, 240, .14), transparent 70%);
}
.post-crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; font-size: .8rem; color: #8f8bb0; }
.post-crumbs li + li::before { content: '/'; margin-right: 8px; color: #55516f; }
.post-crumbs a { color: #b5b1d3; }
.post-crumbs a:hover { color: #fff; }
.post-tag {
    display: inline-block; padding: 6px 15px; border-radius: 999px;
    font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #e4d9ff;
    background: rgba(155, 92, 246, .16); border: 1px solid rgba(190, 160, 255, .32);
}
.post-title {
    max-width: 900px; margin: 20px auto 22px; font-family: 'Poppins', sans-serif; font-weight: 700;
    font-size: clamp(1.85rem, 4.2vw, 3.1rem); line-height: 1.18; letter-spacing: -.015em; color: #fff;
}
.post-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; color: #a9a6c4; }
.post-meta span { display: inline-flex; align-items: center; gap: 8px; }
.post-meta i { color: #a98aff; font-size: .82rem; }

.post-cover { position: relative; max-width: 1040px; margin: 8px auto 0; }
.post-cover::before { content: ''; position: absolute; inset: 12% 4% -8% 4%; background: radial-gradient(closest-side, rgba(124, 92, 255, .5), rgba(232, 108, 240, .14) 60%, transparent); filter: blur(34px); }
.post-cover figure {
    position: relative; margin: 0; padding: 8px; border-radius: 24px; border: 1px solid transparent;
    background: linear-gradient(#0b0820, #0b0820) padding-box, linear-gradient(140deg, rgba(190, 160, 255, .65), rgba(255, 255, 255, .07) 40%, rgba(232, 108, 240, .5)) border-box;
    box-shadow: 0 40px 90px -36px rgba(0, 0, 0, .95);
}
.post-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 8.2; object-fit: cover; border-radius: 17px; }

/* ---------- layout ---------- */
.post-grid { display: grid; grid-template-columns: 250px minmax(0, 740px); justify-content: center; gap: 64px; padding-top: 64px; padding-bottom: 40px; align-items: start; }
.post-rail { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
.post-rail h2 { margin: 0 0 14px; font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #8f8bb0; }
.post-toc { margin: 0; padding: 0; list-style: none; border-left: 1px solid rgba(190, 160, 255, .18); }
.post-toc a { display: block; margin-left: -1px; padding: 7px 0 7px 16px; border-left: 2px solid transparent; font-size: .86rem; line-height: 1.45; color: #9d99bd; transition: color .25s ease, border-color .25s ease; }
.post-toc a:hover { color: #fff; }
.post-toc a.is-active { color: #fff; border-left-color: #c28af0; }

.post-share { margin-top: 28px; }
.post-share-row { display: flex; gap: 10px; }
.post-share a, .post-share button {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer;
    color: #e4d9ff; font-size: .95rem; background: rgba(255, 255, 255, .05); border: 1px solid rgba(190, 160, 255, .22); transition: transform .2s ease, background .2s ease;
}
.post-share a:hover, .post-share button:hover { transform: translateY(-3px); background: rgba(155, 92, 246, .28); color: #fff; }
.post-copied { display: block; min-height: 1.2em; margin-top: 8px; font-size: .78rem; color: #8fe3b0; }

.post-toc-mobile { display: none; }

/* ---------- article typography ---------- */
.post .post-content { font-size: 1.08rem; line-height: 1.85; color: #cdc9e6; }
.post .post-content > :first-child { margin-top: 0; }
.post .post-content h2 { position: relative; margin: 2.3em 0 .75em; padding-left: 18px; font-family: 'Poppins', sans-serif; font-size: clamp(1.35rem, 2.4vw, 1.7rem); font-weight: 600; line-height: 1.3; color: #fff; text-align: left; scroll-margin-top: 110px; }
.post .post-content h2::before { content: ''; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 4px; background: linear-gradient(180deg, #8f6bff, #f08bff); }
.post .post-content h3 { margin: 1.8em 0 .5em; font-family: 'Poppins', sans-serif; font-size: 1.18rem; font-weight: 600; color: #efeaff; text-align: left; }
.post .post-content p { margin: 0 0 1.2em; color: inherit; text-align: left; }
.post .post-content > p:first-of-type { font-size: 1.16rem; color: #e6e2fa; }
.post .post-content ul, .post .post-content ol { margin: 0 0 1.5em; padding: 18px 22px; list-style: none; border-radius: 16px; background: rgba(124, 92, 255, .07); border: 1px solid rgba(190, 160, 255, .16); }
.post .post-content li { position: relative; margin: 0; padding: 6px 0 6px 28px; list-style: none; color: #d8d4ef; }
.post .post-content ul li::before { content: ''; position: absolute; left: 4px; top: .98em; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #8f6bff, #f08bff); box-shadow: 0 0 10px rgba(155, 92, 246, .8); }
.post .post-content ol { counter-reset: item; }
.post .post-content ol li { counter-increment: item; }
.post .post-content ol li::before { content: counter(item); position: absolute; left: 0; top: 8px; font-size: .78rem; font-weight: 700; color: #c9b8ff; }
.post .post-content strong { color: #fff; }
.post .post-content a { color: #c9a8ff; text-decoration: underline; text-underline-offset: 3px; }
.post .post-content img { max-width: 100%; height: auto; border-radius: 16px; }
.post .post-content blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid #a98aff; font-size: 1.18rem; color: #efeaff; }
.post-table { overflow-x: auto; margin: 0 0 1.6em; border-radius: 16px; border: 1px solid rgba(190, 160, 255, .2); }
.post .post-content table { width: 100%; min-width: 480px; margin: 0; border-collapse: collapse; font-size: .94rem; }
.post .post-content th, .post .post-content td { padding: 12px 16px; text-align: left; border: 0; border-bottom: 1px solid rgba(190, 160, 255, .14); color: #d8d4ef; }
.post .post-content th { background: rgba(124, 92, 255, .18); color: #fff; font-weight: 600; }
.post .post-content tr:last-child td { border-bottom: 0; }

/* ---------- CTA + related ---------- */
.post-cta {
    margin-top: 52px; padding: 34px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 22px;
    border-radius: 24px; border: 1px solid transparent;
    background: linear-gradient(150deg, #1b1244, #0d0a24) padding-box, linear-gradient(135deg, rgba(155, 92, 246, .85), rgba(232, 108, 240, .6)) border-box;
}
.post-cta h2 { margin: 0 0 6px; font-family: 'Poppins', sans-serif; font-size: 1.35rem; color: #fff; }
.post-cta p { margin: 0; max-width: 380px; font-size: .96rem; line-height: 1.65; color: #b9b5d8; }
.post .post-btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px; font-size: .94rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #7c5cff, #e86cf0); box-shadow: 0 12px 30px -10px rgba(155, 92, 246, .9); transition: transform .2s ease; }
.post .post-btn:hover { transform: translateY(-2px); }

.post-related { padding-top: 40px; padding-bottom: 100px; }
.post-related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.post-related-head h2 { margin: 0; font-family: 'Poppins', sans-serif; font-size: 1.6rem; color: #fff; }
.post-related-head a { font-size: .9rem; font-weight: 600; color: #c9a8ff; white-space: nowrap; }
.post-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post .post-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: linear-gradient(165deg, rgba(26, 20, 60, .9), rgba(10, 8, 28, .94)); border: 1px solid rgba(190, 160, 255, .16); transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.post .post-card:hover { transform: translateY(-6px); border-color: rgba(190, 160, 255, .5); box-shadow: 0 28px 60px -30px rgba(124, 92, 255, .8); }
.post-card-img { overflow: hidden; aspect-ratio: 16 / 9; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.post-card:hover .post-card-img img { transform: scale(1.06); }
.post-card-body { padding: 18px 20px 22px; }
.post-card-body small { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #b9a6ff; }
.post-card-body h3 { margin: 8px 0 10px; font-family: 'Poppins', sans-serif; font-size: 1.02rem; font-weight: 600; line-height: 1.45; color: #fff; }
.post-card-body span { font-size: .8rem; color: #8f8bb0; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: minmax(0, 740px); padding-top: 40px; }
    .post-rail { position: static; max-height: none; order: 2; }
    .post-rail .post-toc-box { display: none; }
    .post-rail .post-share { margin-top: 0; }
    .post-toc-mobile { display: block; margin-bottom: 30px; border-radius: 16px; background: rgba(124, 92, 255, .08); border: 1px solid rgba(190, 160, 255, .22); }
    .post-toc-mobile summary { padding: 15px 18px; cursor: pointer; font-weight: 600; font-size: .95rem; color: #fff; }
    .post-toc-mobile .post-toc { margin: 0 18px 16px; }
    .post-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .post-wrap { padding: 0 18px; }
    .post-hero { padding: 110px 0 24px; }
    .post-cover figure { padding: 5px; border-radius: 18px; }
    .post-cover img { aspect-ratio: 16 / 11; border-radius: 13px; }
    .post .post-content { font-size: 1.02rem; line-height: 1.8; }
    .post .post-content ul, .post .post-content ol { padding: 14px 16px; }
    .post-cta { padding: 24px 20px; }
    .post-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .post .post-card, .post-card-img img, .post .post-btn, .post-share a, .post-share button { transition: none; }
}
