/* ===================================================================
 * Minimal blog post layout — canonical blog post styling.
 * Loaded AFTER blog-post.css and abstract-blogstyles to win specificity.
 * Activated by `.blog-post--minimal` on <article>.
 * ------------------------------------------------------------------- */

/* Mobile TOC drawer — hidden on desktop, button toggles on mobile. */
.mobile-toc-toggle { display: none; }
.mobile-toc-content { display: none; }

@media screen and (max-width: 768px) {
    .mobile-toc-toggle {
        display: flex;
        position: fixed;
        bottom: 1.25rem;
        right: 1.25rem;
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        background: var(--accent-primary, #22423d);
        color: #fff;
        border: none;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
        z-index: 1200;
        cursor: pointer;
        font-size: 1rem;
    }

    .mobile-toc-content {
        position: fixed;
        bottom: 5.25rem;
        right: 1.25rem;
        left: 1.25rem;
        max-height: 60vh;
        overflow-y: auto;
        background: #fff;
        border: 1px solid var(--border-color, #e3e3e3);
        border-radius: 10px;
        padding: 1rem 1.25rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
        z-index: 1199;
    }
    .mobile-toc-content.show { display: block; }

    .mobile-toc-content h3 {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #6b7280;
        margin: 0 0 0.75rem;
    }
    .mobile-toc-content ul { list-style: none; padding: 0; margin: 0; }
    .mobile-toc-content a {
        display: block;
        padding: 0.35rem 0;
        color: var(--text-color);
        text-decoration: none;
    }
}

.blog-post--minimal {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 3rem;
    max-width: 1360px;
    margin: 2rem auto 4rem;
    padding: 0 1.5rem;
    box-shadow: none;
    background: transparent;
}

/* Left rail: sticky, plain list, subtle hairline. */
.post-toc-rail {
    position: sticky;
    top: 2rem;
    align-self: start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    font-size: 0.8rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
    line-height: 1.4;
}

.post-toc-rail h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
    margin: 0 0 1rem;
}

.post-toc-rail ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-toc-rail li {
    margin: 0;
    padding: 0;
    border: none;
}

.post-toc-rail a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.3rem 0.6rem;
    border-left: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.post-toc-rail a:hover {
    color: var(--primary-color);
    border-left-color: var(--accent-primary);
}

.post-toc-rail ul ul {
    padding-left: 0.75rem;
    font-size: 0.75rem;
}

/* Flatten the content card. */
.blog-post--minimal .blog-post-content {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
    max-width: 100%;
}

/* Left-aligned header, hairline divider — tally-style. */
.blog-post--minimal .post-header {
    text-align: left;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-post--minimal .post-title {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    text-align: left;
}

.blog-post--minimal .post-meta {
    justify-content: flex-start;
    font-size: 0.75rem;
    color: #6b7280;
    gap: 1.25rem;
}

.blog-post--minimal .post-meta i {
    color: #9ca3af;
}

/* Prose. */
.blog-post--minimal .post-content {
    font-size: 1rem;
    line-height: 1.7;
    margin-left: 0;
    margin-right: 0;
    hyphens: none;
}

.blog-post--minimal .post-content p {
    margin-bottom: 1.35rem;
}

.blog-post--minimal .post-content a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.blog-post--minimal .post-content h1 {
    font-size: 2rem;
    margin: 2.5rem 0 1rem;
}

/* Nuke the light-blue H2 fill — the loudest element of the old design. */
.blog-post--minimal .post-content h2 {
    background-color: transparent !important;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 3rem 0 1rem;
    padding: 0 0 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

.blog-post--minimal .post-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--primary-color);
}

.blog-post--minimal .post-content h4 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.5rem;
}

.blog-post--minimal .post-content img {
    border-radius: 0;
    margin: 2rem 0;
    display: block;
}

.blog-post--minimal .post-content blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--accent-primary);
    color: #4b5563;
    font-style: italic;
}

.blog-post--minimal .post-content ul,
.blog-post--minimal .post-content ol {
    margin: 1rem 0 1.35rem;
}

/* Author bio and read-next: flat, low-key. */
.blog-post--minimal .author-bio {
    background: transparent;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    padding: 2rem 0 0;
    margin: 3rem 0 0;
}

.blog-post--minimal .read-next-container {
    margin-top: 3rem !important;
    text-align: left !important;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Tablet: narrower rail. */
@media screen and (max-width: 1024px) {
    .blog-post--minimal {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 2rem;
        max-width: 100%;
        padding: 0 1.25rem;
    }
}

/* Mobile: single column, rely on existing mobile TOC drawer. */
@media screen and (max-width: 768px) {
    .blog-post--minimal {
        display: block;
        padding: 0 1rem;
        margin: 1rem 0 2rem;
    }

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

    .blog-post--minimal .post-title {
        font-size: 1.75rem;
    }

    .blog-post--minimal .post-content {
        font-size: 0.95rem;
    }

    .blog-post--minimal .post-content h2 {
        font-size: 1.3rem;
        margin: 2.25rem 0 0.75rem;
    }
}
