/* =====================================================================
   BLOG POST PAGE STYLES
   ===================================================================== */

/* ── Nav overrides (dark hero) ── */
.post-page nav .nav-logo-text { color: var(--white); }
.post-page nav.scrolled .nav-logo-text { color: var(--dark); }
.post-page nav.nav-dark.scrolled .nav-logo-text { color: var(--white); }

/* ─────────────────────────────────────────────────────────────────────
   POST HERO
   ───────────────────────────────────────────────────────────────────── */
.post-hero {
    background: var(--dark);
    position: relative;
    overflow: hidden;
    padding: 116px 40px 64px;
    text-align: center;
}

.post-hero-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 800px; height: 420px;
    background: radial-gradient(ellipse, rgba(102,0,204,0.22) 0%, rgba(0,0,204,0.09) 50%, transparent 72%);
    pointer-events: none;
}

.post-hero-orb {
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.post-hero-orb--l { background: #6600cc; opacity: 0.15; top: -60px; left: -60px; }
.post-hero-orb--r { background: #0000cc; opacity: 0.12; bottom: -60px; right: -60px; }

.post-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Back link */
.post-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.38);
    text-decoration: none;
    align-self: flex-start;
    transition: color 0.18s;
    margin-bottom: 4px;
}

.post-back-link:hover { color: rgba(255,255,255,0.75); }

.post-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: -1.5px;
    color: var(--white);
    line-height: 1.1;
    margin: 0;
    -webkit-text-stroke: 0.5px white;
}

.post-hero-excerpt {
    font-size: 15px;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    max-width: 620px;
    margin: 0;
}

.post-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.post-author-av {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6600cc, #0000cc);
}

.post-author-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.post-author-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.post-hero-date {
    font-size: 12px;
    color: rgba(255,255,255,0.38);
}

.post-read-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: rgba(255,255,255,0.38);
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,0.12);
    margin-left: 4px;
}

.post-read-time::before {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.38)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.7;
}

/* ─────────────────────────────────────────────────────────────────────
   HERO IMAGE
   ───────────────────────────────────────────────────────────────────── */
.post-hero-image-wrap {
    background: var(--dark);
    padding: 0 40px 40px; /* bottom matches the translateY so dark bg covers the shifted image */
}

.post-hero-image {
    max-width: 1100px;
    margin: 0 auto;
    height: 420px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transform: translateY(40px);
    box-shadow: 0 32px 80px rgba(0,0,0,0.45), 0 2px 0 rgba(255,255,255,0.06) inset;
}

.post-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* CSS art placeholder when no image URL provided */
.post-hero-image-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0a0d24 0%, #1a0a38 40%, #0d0060 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-hero-image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.06) 0px,
        rgba(255,255,255,0.06) 1px,
        transparent 1px,
        transparent 32px
    );
}

.post-hero-image-placeholder::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102,0,204,0.35) 0%, transparent 70%);
    top: 20%; left: 20%;
}

/* Image caption */
.post-img-caption {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    margin-top: 10px;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────────
   TWO-COLUMN LAYOUT
   ───────────────────────────────────────────────────────────────────── */
.post-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 40px 64px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 60px;
    align-items: start;
    position: relative;
    z-index: 1;
    background: var(--white);
}

/* ─────────────────────────────────────────────────────────────────────
   STICKY TOC SIDEBAR
   ───────────────────────────────────────────────────────────────────── */
.post-toc-aside {
    /* plain grid cell — fills the full row height, bounding the sticky */
    min-width: 0;
}

.post-toc-sticky {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.post-toc {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 20px;
}

.post-toc-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.post-toc-nav {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    justify-content: flex-start !important;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-toc-link {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 450;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.18s, color 0.18s;
    border-left: 2px solid transparent;
}

.post-toc-link::before {
    content: '';
    flex-shrink: 0;
    margin-top: 6px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.18s;
}

.post-toc-link:hover { background: var(--light-grey); color: var(--text); }

.post-toc-link.active {
    color: var(--accent);
    font-weight: 600;
    background: rgba(0,0,204,0.06);
    border-left-color: var(--accent);
}

.post-toc-link.active::before { background: var(--accent); }

.post-toc-link.h3 { padding-left: 24px; font-size: 12.5px; }
.post-toc-link.h4 { padding-left: 34px; font-size: 12px; }

/* Share */
.post-share {
    padding: 0 4px;
}

.post-share-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.post-share-btns {
    display: flex;
    gap: 8px;
}

.post-share-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
    font-size: 0;
}

.post-share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0,0,204,0.04);
}

.post-share-btn.copied {
    border-color: #059669;
    color: #059669;
    background: rgba(5,150,105,0.06);
}

/* ─────────────────────────────────────────────────────────────────────
   ARTICLE BODY
   ───────────────────────────────────────────────────────────────────── */
.post-article {
    min-width: 0; /* prevent grid blowout */
    color: var(--text);
    min-height: 420px;
}

/* Rich text typography */
.post-body { line-height: 1.8; }

.post-body h1 {
    font-family: var(--font-heading);
    font-size: clamp(30px, 4.2vw, 44px);
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text);
    line-height: 1.18;
    margin: 12px 0 20px;
    text-wrap: balance;
}

.post-body p {
    font-size: 16px;
    font-weight: 400;
    font-family: var(--font-body);
    line-height: 1.82;
    color: #2a3050;
    margin-bottom: 24px;
}

.post-body h2 {
    font-family: var(--font-heading);
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    margin: 48px 0 16px;
    line-height: 1.2;
    padding-top: 8px;
    scroll-margin-top: 100px;
}

.post-body h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
    margin: 36px 0 12px;
    scroll-margin-top: 100px;
}

.post-body h4 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text);
    margin: 28px 0 10px;
    line-height: 1.3;
    scroll-margin-top: 100px;
}

.post-body h5,
.post-body h6 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.1px;
    color: #2a3050;
    margin: 20px 0 8px;
    line-height: 1.35;
    scroll-margin-top: 100px;
}

.post-body h2:first-child { margin-top: 0; }
.post-body h1:first-child { margin-top: 0; }

/* Inline links */
.post-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(0,0,204,0.25);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.18s;
}

.post-body a:hover { text-decoration-color: var(--accent); }

/* Ordered / unordered lists */
.post-body ul,
.post-body ol {
    margin: 0 0 24px 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-body li {
    font-size: 16px;
    font-weight: 400;
    font-family: var(--font-body);
    line-height: 1.75;
    color: #2a3050;
}

.post-body ol { list-style: decimal; }
.post-body ul { list-style: disc; }
.post-body ul li::marker { color: var(--accent); }

/* Pull quote */
.post-pullquote {
    margin: 40px 0;
    padding: 32px 36px;
    border-left: 3px solid var(--accent);
    background: linear-gradient(135deg, rgba(0,0,204,0.04), rgba(102,0,204,0.04));
    border-radius: 0 14px 14px 0;
}

.post-pullquote p {
    font-family: var(--font-heading);
    font-size: clamp(17px, 2vw, 21px) !important;
    font-weight: 600 !important;
    font-style: italic;
    letter-spacing: -0.3px;
    color: var(--text) !important;
    line-height: 1.55 !important;
    margin: 0 0 10px !important;
}

.post-pullquote cite {
    font-size: 12.5px;
    color: var(--muted);
    font-style: normal;
    display: block;
}

/* Inline image inside article */
.post-body figure {
    margin: 36px 0;
}

.post-body figure img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.post-body figure figcaption {
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
    margin-top: 10px;
    line-height: 1.5;
}

/* Inline code */
.post-body code {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13.5px;
    background: rgba(0,0,204,0.06);
    color: #3344dd;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid rgba(0,0,204,0.1);
}

/* Divider */
.post-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* Key takeaway box */
.post-callout {
    display: flex;
    gap: 14px;
    background: rgba(0,0,204,0.05);
    border: 1px solid rgba(0,0,204,0.14);
    border-radius: 12px;
    padding: 20px 22px;
    margin: 32px 0;
}

.post-callout-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--accent), var(--accent-mid));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.post-callout-icon svg { color: #fff; }

.post-callout p {
    font-size: 14.5px !important;
    line-height: 1.7 !important;
    margin: 0 !important;
    color: var(--text) !important;
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────────
   SKELETON / LOADING
   ───────────────────────────────────────────────────────────────────── */
.post-loading {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-loading-bar {
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--light-grey) 25%, #e0e7f0 50%, var(--light-grey) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.post-loading-bar.short { width: 55%; }
.post-loading-bar.medium { width: 78%; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────────────────────────────
   TAG LIST (end of article)
   ───────────────────────────────────────────────────────────────────── */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.post-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 5px 14px;
    text-decoration: none;
    transition: border-color 0.18s, color 0.18s;
}

.post-tag:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────
   AUTHOR CARD
   ───────────────────────────────────────────────────────────────────── */
.post-author-card-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px 64px;
}

.post-author-card {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 40px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.post-author-card-av {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.post-author-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.post-author-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--muted);
}

.post-author-card-name {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.post-author-card-bio {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 560px;
}

/* ─────────────────────────────────────────────────────────────────────
   RELATED POSTS
   ───────────────────────────────────────────────────────────────────── */
.post-related {
    background: var(--off-white);
    border-top: 1px solid var(--border);
    padding: 80px 40px;
}

.post-related-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.post-related-header {
    margin-bottom: 40px;
}

.post-related-title {
    font-family: var(--font-heading);
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--text);
    margin: 6px 0 0;
}

.post-related-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* ─────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 56px 28px 48px;
    }

    .post-hero-image-wrap { padding: 0 28px 40px; }
    .post-hero-image { height: 300px; }

    .post-toc-aside {
        margin-bottom: 40px;
        padding-bottom: 32px;
        border-bottom: 1px solid var(--border);
    }

    .post-toc-sticky {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
        width: 100%;
    }

    .post-toc { flex: 1; min-width: 240px; }
    .post-share { flex-shrink: 0; }

    .post-author-card-wrap { padding: 0 28px 48px; }
    .post-related { padding: 64px 28px; }
    .post-related-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 700px) {
    .post-hero { padding: 96px 20px 48px; }
    .post-hero-title { font-size: clamp(22px, 7vw, 32px); letter-spacing: -0.8px; }
    .post-hero-meta { flex-direction: column; gap: 8px; }
    .post-read-time { padding-left: 0; border-left: none; margin-left: 0; }

    .post-hero-image-wrap { padding: 0 16px 40px; }
    .post-hero-image { height: 220px; border-radius: 14px; }

    .post-layout { padding: 48px 18px 40px; }
    .post-body h1 { font-size: clamp(22px, 9vw, 34px); letter-spacing: -0.5px; line-height: 1.2; margin: 8px 0 16px; }
    .post-body p, .post-body li { font-size: 15px; }
    .post-body h2 { font-size: 20px; }
    .post-body h3 { font-size: 17px; }
    .post-body h4 { font-size: 16px; }

    .post-author-card { flex-direction: column; gap: 16px; padding: 24px 22px; }
    .post-author-card-wrap { padding: 0 16px 40px; }
    .post-related { padding: 52px 16px; }
    .post-related-grid { grid-template-columns: 1fr !important; }
    .post-toc-sticky { flex-direction: column; }
}

/* ─────────────────────────────────────────────────────────────────────
   CTA SECTION (blog post variant — centre-align content)
   ───────────────────────────────────────────────────────────────────── */
.post-page .cta-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.post-page .cta-section .section-title {
    max-width: 600px;
}

.post-page .cta-section .cta-desc {
    max-width: 460px;
}
