/* src/styles/pages/blog_post.css */
.blog-post-page-main {
    padding: 4rem 0;
    background-color: var(--secondary-off-white);
    min-height: 100vh; /* Ensure main content area is tall enough */
}

.blog-post-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 4rem;
}

.blog-post-content h1 { font-size: 3rem; line-height: 1.2; margin-bottom: 1rem; }
.blog-post-meta { color: #6c757d; margin-bottom: 2rem; display: flex; gap: 1.5rem; }
.article-body { font-size: 18px; line-height: 1.7; color: var(--text-main-charcoal); }
.article-body h2 { font-size: 2rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.article-body h3 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; }
.article-body ul, .article-body ol { padding-left: 2rem; }
.article-body blockquote {
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 4px solid var(--accent-matte-gold);
    font-style: italic;
    font-size: 1.2rem;
    color: #555;
}

.article-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.article-body th, .article-body td {
    border: 1px solid #ddd;
    padding: 0.8rem 1rem;
    text-align: left;
}
.article-body th {
    background-color: #f7f7f7;
    font-weight: 700;
}
.article-body tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* ===== NEW: Expandable References Section ===== */
.references-section {
    margin-top: 4rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}
.references-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}
.references-toggle span:first-child {
    font-family: 'Lora', serif;
    font-size: 2rem;
    color: var(--text-headings-blue);
}
.toggle-icon {
    font-size: 1.5rem;
    color: var(--text-headings-blue);
    transition: transform 0.3s ease-in-out;
}
.toggle-icon.expanded {
    transform: rotate(-180deg);
}
.references-content {
    padding-top: 1rem;
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== FIX: Use Flexbox for mobile layout ===== */
@media (max-width: 992px) {
    .blog-post-layout {
        display: flex; /* Use flexbox for mobile */
        flex-direction: column;
        gap: 1.5rem; /* Reduced gap for mobile */
    }
    .blog-post-sidebar {
        order: -1; /* Move sidebar to the top */
        position: sticky;
        top: 68px; /* Height of the main header */
        z-index: 998;
        align-self: center; /* Center the sidebar horizontally within the flex container */
        width: 100%; /* Ensure it takes full width for centering */
        max-width: 400px; /* Limit its max width to prevent it from being too wide on tablets */
        
        /* Add background to ensure it covers content during scroll */
        background-color: var(--secondary-off-white);
        padding-bottom: 1rem; /* Add some space at the bottom */
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        /* Removed negative margins */
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .blog-post-content {
        /* Add padding to the top to create space below the sticky bar */
        padding-top: 1.5rem; /* Reduced padding-top */
    }

    .blog-post-sidebar {
        display: none; /* Hide sidebar on mobile */
    }
}

/* ===== NEW: Footnotes & Task Lists Styling ===== */

/* Footnotes */
.footnote-definition {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #444;
}

.footnote-definition p {
    display: inline; /* Keep the paragraph on the same line as the number */
}

.footnote-reference a {
    text-decoration: none;
    color: var(--accent-matte-gold);
}

/* Task Lists */
ul.task-list {
    list-style-type: none;
    padding-left: 0;
}

.task-list-item {
    display: flex;
    align-items: center;
}

.task-list-item input[type="checkbox"] {
    margin-right: 0.75rem;
    /* Custom checkbox styles */
    -webkit-appearance: none;
    appearance: none;
    width: 1.2em;
    height: 1.2em;
    border: 2px solid var(--text-main-charcoal);
    border-radius: 3px;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    cursor: not-allowed; /* It's disabled, so show not-allowed cursor */
}

.task-list-item input[type="checkbox"]:checked::before {
    content: '✔';
    font-size: 1em;
    color: var(--accent-matte-gold);
    position: absolute;
    right: 0.1em;
    top: -0.1em;
}