/* Article / Blog Post Styles - "The Paper Scroll" */

main {
    background: transparent;
    margin-top: 0;
    padding: 0;
}

.blog-post {
    max-width: 750px;
    /* Optimal reading width */
    margin: 60px auto;
    padding: 0 20px;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    line-height: 1.9;
    /* Relaxed line height */
    position: relative;
}

/* Typography */
.blog-post h1 {
    font-family: 'Noto Serif JP', serif;
    font-weight: 900;
    font-size: 2.8rem;
    color: #1a1a1a;
    margin-bottom: 2rem;
    text-align: left;
    line-height: 1.25;
    letter-spacing: -0.02em;
    position: relative;
}

/* Article Header Wrapper for Vertical Text */
.article-header-wrapper {
    position: relative;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 2rem;
}

.vertical-decoration {
    position: absolute;
    top: 0;
    right: -60px;
    /* Float outside flow */
    font-family: 'Shippori Mincho', serif;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(26, 35, 126, 0.1);
    /* Very subtle Indigo */
    user-select: none;
    pointer-events: none;
}

.blog-post h2,
.blog-post h3 {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    color: #1a237e;
    /* Indigo headers */
    margin-top: 3rem;
    margin-bottom: 1.2rem;
    position: relative;
    padding-left: 15px;
}

.blog-post h2::before,
.blog-post h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: #b71c1c;
    /* Hanko Red accent */
    border-radius: 2px;
}

.blog-post p {
    margin-bottom: 1.8rem;
    font-size: 1.125rem;
    color: #4a4a4a;
    font-weight: 400;
}

/* Code Blocks ("Washi" Style) */
.blog-post pre {
    margin: 2.5rem -20px;
    /* Bleed slightly */
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background: #f4f1ea;
    /* Washi Paper color */
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px;
    position: relative;
    overflow-x: auto;
}

/* Subtle texture for code block */
.blog-post pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #1a237e;
    /* top accent */
}

.blog-post code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
}

/* Quotes */
.blog-post blockquote {
    border-left: none;
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(26, 35, 126, 0.03);
    font-family: 'Noto Serif JP', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: #1a237e;
    border-radius: 8px;
    position: relative;
    text-align: center;
}

.blog-post blockquote::before {
    content: '"';
    font-size: 4rem;
    position: absolute;
    top: -10px;
    left: 10px;
    color: rgba(26, 35, 126, 0.1);
    font-family: serif;
}

/* Images */
.blog-post img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 3rem 0;
    display: block;
}

/* Table of Contents ("Orikami" Style) */
.toc {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 4px solid #1a237e;
    padding: 2rem;
    border-radius: 0 0 4px 4px;
    margin: 30px 0 50px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.toc h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin: 0 0 1.5rem 0;
    padding: 0;
    border: none;
}

.toc h2::before {
    display: none;
}

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

.toc li {
    margin-bottom: 0.8rem;
}

.toc a {
    text-decoration: none;
    color: #1a237e;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

.toc a:hover {
    border-bottom-color: #b71c1c;
    color: #b71c1c;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #999;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #1a237e;
    transform: translateX(-5px);
}

/* Action Buttons */
.article-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.article-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-btn.primary {
    background-color: #1a237e;
    color: #ffffff;
    border: 1px solid #1a237e;
    box-shadow: 0 4px 10px rgba(26, 35, 126, 0.2);
}

.article-btn.primary:hover {
    background-color: #fff;
    color: #1a237e;
    transform: translateY(-2px);
}

.article-btn.secondary {
    background-color: transparent;
    border: 1px solid #e0e0e0;
    color: #555;
}

.article-btn.secondary:hover {
    border-color: #1a237e;
    color: #1a237e;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 800px) {
    .vertical-decoration {
        display: none;
        /* Hide on mobile */
    }

    .blog-post {
        margin-top: 30px;
        padding: 0 20px;
    }

    .blog-post h1 {
        font-size: 2.2rem;
    }

    .blog-post pre {
        margin: 2rem 0;
        border-radius: 4px;
    }
}

/* Light Mode Overrides (Already default, but explicit for stability) */
body.light-mode .blog-post {
    color: #333;
}