/* ============================================================
   SINGLE POST — Editorial Layout
   Scoped to body.single to avoid bleed onto other pages
   ============================================================ */

body.single .main-content {
    min-height: 100vh;
    width: 100%;
}

body.single .portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Card wrapper — REMOVED overflow:hidden (was causing scroll trap) */
body.single .single-post {
    max-width: 720px;
    margin: 2rem auto 3rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Post Header ─────────────────────────────────────────── */
body.single .post-header {
    padding: 4rem 3rem 3rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
    text-align: center;
}

body.single .post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

body.single .post-meta a {
    color: #495057;
    text-decoration: none;
    transition: color 0.2s;
}

body.single .post-meta a:hover {
    color: #212529;
}

body.single .reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #6c757d;
    font-size: 0.875rem;
}

body.single .reading-time::before {
    content: "•";
    margin-right: 0.25rem;
}

body.single .post-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

body.single .post-summary {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    color: #495057;
    max-width: 600px;
    margin: 0 auto;
}

body.single .post-featured-image {
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

body.single .post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Post Body ───────────────────────────────────────────── */
body.single .post-content {
    padding: 3rem;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #343a40;
}

/* Lead paragraph — only the actual first <p> inside content */
body.single .post-content > p:first-of-type {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 2rem;
}

body.single .post-content h2,
body.single .post-content h3,
body.single .post-content h4 {
    color: #1a1a1a;
    line-height: 1.3;
}

body.single .post-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 3rem 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

body.single .post-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
}

body.single .post-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

body.single .post-content code {
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

body.single .post-content pre {
    background: #f1f3f4;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

body.single .post-content pre code {
    background: none;
    padding: 0;
}

/* ── Takeaway Box ────────────────────────────────────────── */
body.single .takeaway-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

body.single .takeaway-box h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    color: #1a1a1a;
    margin: 0 0 1rem;
}

body.single .takeaway-box h3::before {
    content: "💡";
}

body.single .takeaway-box ul {
    margin: 0;
    padding-left: 1.25rem;
}

body.single .takeaway-box li {
    margin-bottom: 0.5rem;
    color: #495057;
}

/* ── Table of Contents ───────────────────────────────────── */
body.single .toc-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    padding: 1.5rem;
    margin: 2rem 0;
}

body.single .toc-box h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6c757d;
    margin: 0 0 1rem;
}

body.single .toc-box ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.single .toc-box li {
    margin-bottom: 0.5rem;
}

body.single .toc-box a {
    display: block;
    padding: 0.25rem 0;
    font-size: 0.9375rem;
    color: #495057;
    text-decoration: none;
    transition: color 0.2s;
}

body.single .toc-box a:hover {
    color: #667eea;
}

/* ── Tags ────────────────────────────────────────────────── */
body.single .post-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 2rem 3rem;
    border-top: 1px solid #e9ecef;
}

body.single .post-tags h4 {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin: 0;
    white-space: nowrap;
}

body.single .tag {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #495057;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

body.single .tag:hover {
    background: #e9ecef;
    color: #212529;
}

/* ── Post Navigation ─────────────────────────────────────── */
body.single .post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 3rem;
    border-top: 1px solid #e9ecef;
}

body.single .post-navigation a {
    display: block;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #495057;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

body.single .post-navigation a:hover {
    background: #e9ecef;
    color: #212529;
}

body.single .nav-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #adb5bd;
    margin-bottom: 0.5rem;
}

body.single .nav-previous { text-align: left; }
body.single .nav-next     { text-align: right; }

/* ── Related Posts ───────────────────────────────────────── */
body.single .related-posts {
    padding: 3rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

body.single .related-posts h3 {
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1a1a1a;
    margin: 0 0 1.5rem;
}

body.single .related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

body.single .related-post-card {
    display: block;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

body.single .related-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}

body.single .related-post-card h4 {
    font-size: 1rem;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

body.single .related-post-card .post-date {
    font-size: 0.875rem;
    color: #6c757d;
}

/* ── Post CTA ────────────────────────────────────────────── */
body.single .post-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 3rem 2.5rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0 3rem;
}

body.single .post-cta h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
    border: none;
    padding: 0;
}

body.single .post-cta p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

body.single .post-cta .cta-subtext {
    font-size: 0.9375rem;
    opacity: 0.85;
    margin-top: 1rem;
}

body.single .cta-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

body.single .cta-button {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

body.single .cta-button.primary {
    background: #fff;
    color: #667eea;
}

body.single .cta-button.primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

body.single .cta-button.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

body.single .cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    body.single .portfolio-container {
        padding: 1rem;
    }

    body.single .single-post {
        margin: 0 0 2rem;
        border-radius: 8px;
    }

    body.single .post-header,
    body.single .post-content,
    body.single .post-tags,
    body.single .post-navigation,
    body.single .related-posts {
        padding: 1.5rem;
    }

    body.single .post-title {
        font-size: 1.75rem;
    }

    body.single .post-summary {
        font-size: 1.1rem;
    }

    body.single .post-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    body.single .nav-next {
        text-align: left;
    }

    body.single .cta-buttons {
        flex-direction: column;
    }

    body.single .cta-button {
        width: 100%;
        justify-content: center;
    }
}
