/* =============================================================
   NestNooks — single.css
   Blog post single template styles. Mobile-first.
   v1.0.0
============================================================= */


/* ── POST HERO ──────────────────────────────────────────── */

.post-hero {
    background: var(--cream);
    padding: calc(var(--nav-h) + 32px) 0 0;
    border-bottom: 1px solid var(--border);
}

.post-hero-content {
    padding-bottom: clamp(28px, 4vw, 44px);
    max-width: 780px;
}

.post-hero-title {
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.12;
    color: var(--text);
    margin: 14px 0 16px;
}

.post-hero-excerpt {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    color: var(--muted);
    line-height: 1.7;
    max-width: 60ch;
    margin-bottom: 24px;
}

/* Post meta row */
.post-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-2);
    font-weight: 600;
    transition: color var(--dur-fast);
}
.meta-author:hover { color: var(--terra); }

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.meta-sep { color: var(--border-2); }

/* Share button */
.post-share { margin-left: auto; }

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--cream-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-pill);
    padding: 6px 14px;
    cursor: pointer;
    transition: color var(--dur-fast), background var(--dur-fast);
}
.share-btn:hover { color: var(--terra); background: var(--terra-soft); border-color: var(--terra-border); }

/* Hero image */
.post-hero-img-wrap {
    margin-top: clamp(24px, 4vw, 40px);
}

.post-hero-img {
    aspect-ratio: 21/9;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    overflow: hidden;
    background: var(--cream-2);
    max-height: 480px;
}

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


/* ── POST BODY LAYOUT ───────────────────────────────────── */

.post-body {
    padding: clamp(36px, 5vw, 64px) 0 var(--section-pad);
}

.post-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

@media (min-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (min-width: 1200px) {
    .post-layout {
        grid-template-columns: 1fr 360px;
    }
}


/* ── READING PROGRESS ───────────────────────────────────── */

.reading-progress-wrap {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    z-index: 999;
}

.reading-progress {
    height: 100%;
    background: var(--terra);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}


/* ── TABLE OF CONTENTS ──────────────────────────────────── */

.toc-mobile {
    background: var(--cream);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    margin-bottom: 28px;
    display: none;
}

.toc-mobile.has-headings { display: block; }

@media (min-width: 1024px) {
    .toc-mobile { display: none !important; }
}

.toc-desktop-wrap {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    max-height: calc(100vh - var(--nav-h) - 40px);
    overflow-y: auto;
}

.toc-desktop { display: none; }
.toc-desktop.has-headings { display: block; }

.toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 12px;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {}
.toc-item--h3 { padding-left: 14px; }

.toc-link {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 5px 8px;
    border-left: 2px solid transparent;
    border-radius: 0 var(--r-xs) var(--r-xs) 0;
    transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
    line-height: 1.4;
}
.toc-link:hover { color: var(--terra); background: var(--terra-soft); border-color: var(--terra-border); }
.toc-link.is-active { color: var(--terra); border-color: var(--terra); font-weight: 600; }


/* ── POST CONTENT TYPOGRAPHY ────────────────────────────── */

.post-content {
    font-size: clamp(0.95rem, 1.7vw, 1.05rem);
    line-height: 1.8;
    color: var(--text-2);
    max-width: 72ch;
}

.post-content h2 {
    font-size: clamp(1.3rem, 2.8vw, 1.9rem);
    font-weight: 500;
    color: var(--text);
    margin: clamp(32px, 5vw, 48px) 0 16px;
    letter-spacing: -0.015em;
    scroll-margin-top: calc(var(--nav-h) + 24px);
}

.post-content h3 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 600;
    color: var(--text);
    margin: clamp(24px, 3vw, 36px) 0 12px;
    scroll-margin-top: calc(var(--nav-h) + 24px);
}

.post-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 10px;
}

.post-content p { margin-bottom: 20px; }

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

.post-content a {
    color: var(--terra);
    text-decoration: underline;
    text-decoration-color: var(--terra-border);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--dur-fast);
}
.post-content a:hover { text-decoration-color: var(--terra); }

.post-content ul,
.post-content ol {
    padding-left: clamp(20px, 3vw, 28px);
    margin-bottom: 20px;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li {
    margin-bottom: 8px;
    line-height: 1.75;
}

.post-content blockquote {
    border-left: 3px solid var(--terra);
    background: var(--terra-soft);
    border-radius: 0 var(--r) var(--r) 0;
    padding: 16px 20px;
    margin: 28px 0;
    font-style: italic;
    color: var(--text);
    font-size: 1.05em;
}

.post-content img {
    width: 100%;
    height: auto;
    border-radius: var(--r-lg);
    margin: 24px 0;
    display: block;
}

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

.post-content figcaption {
    font-size: 0.82rem;
    color: var(--muted-2);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border-2);
    margin: 36px 0;
}

.post-content code {
    background: var(--cream-2);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    font-family: monospace;
    font-size: 0.88em;
    color: var(--terra);
}

.post-content pre {
    background: var(--ink);
    color: var(--on-dark);
    padding: 20px;
    border-radius: var(--r-lg);
    overflow-x: auto;
    margin-bottom: 20px;
    font-size: 0.88em;
    line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; color: inherit; }

/* Pull quote / callout box */
.post-content .callout,
.post-content .wp-block-pullquote {
    background: var(--sage-soft);
    border: 1.5px solid var(--sage-border);
    border-radius: var(--r-lg);
    padding: 20px 24px;
    margin: 28px 0;
}

/* Pro tip box */
.post-content .pro-tip {
    background: var(--amber-soft);
    border: 1.5px solid var(--amber);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    margin: 24px 0;
    font-size: 0.9rem;
}

/* Post tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    margin-top: 36px;
}

.post-tags-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Author card */
.author-card {
    display: flex;
    gap: 20px;
    background: var(--cream);
    border: 1.5px solid var(--border);
    border-radius: var(--r-xl);
    padding: clamp(20px, 3vw, 28px);
    margin-top: 36px;
    align-items: flex-start;
}

.author-avatar-lg img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.author-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-2);
    margin-bottom: 4px;
}

.author-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    transition: color var(--dur-fast);
}
.author-name:hover { color: var(--terra); }

.author-bio {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.65;
}

/* Sidebar tool links */
.sidebar-tool-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.sidebar-tool-link:hover {
    color: var(--terra);
    background: var(--terra-soft);
    border-color: var(--terra-border);
}

/* Related posts */
.related-posts {
    padding: var(--section-pad) 0;
    background: var(--cream);
    border-top: 1px solid var(--border);
}
