/* Root variables for consistent theming */
:root {
    --text-color: #2d2d2d;
    --background-color: #faf9f6;
    --accent-color: #5a6c7d;
    --link-color: #3b4f61;
    --heading-color: #1a1a1a;
}

/* Base body styling for optimal reading */
body {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Content container width control */
.md-main__inner {
    max-width: none;
}

.md-content {
    max-width: 750px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Typography refinements for body text */
.md-typeset {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-color);
}

/* Heading hierarchy */
.md-typeset h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--heading-color);
    font-weight: 600;
}

.md-typeset h2 {
    font-size: 1.6rem;
    line-height: 1.4;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--heading-color);
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.md-typeset h3 {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--heading-color);
    font-weight: 600;
}

/* Paragraph spacing for comfortable reading rhythm */
.md-typeset p {
    margin-bottom: 1.5rem;
}

/* Link styling that's visible but not distracting */
.md-typeset a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.md-typeset a:hover {
    border-bottom-color: var(--link-color);
}

/* Blockquote styling for quotations in your essays */
.md-typeset blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4a4a4a;
}

/* Image handling for full-width within content column */
.md-typeset img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 4px;
}

/* Figure captions */
.md-typeset figure {
    margin: 2rem 0;
}

.md-typeset figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Table of contents styling */
.md-sidebar--secondary {
    padding-left: 1rem;
}

.md-nav--secondary .md-nav__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--heading-color);
}

/* Footer refinements */
.md-footer {
    background-color: #252525;
    color: var(--text-color);
}

/* Responsive adjustments for mobile reading */
@media screen and (max-width: 768px) {
    .md-typeset {
        font-size: 17px;
    }

    .md-content {
        padding: 1.5rem 1rem;
    }

    .md-typeset h1 {
        font-size: 1.8rem;
    }

    .md-typeset h2 {
        font-size: 1.4rem;
    }
}

/* Essay metadata styling (you'll add this to your templates) */
.essay-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.essay-meta span {
    margin-right: 1.5rem;
}

/* Related essays section at bottom of each essay */
.related-essays {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.related-essays h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.related-essays ul {
    list-style: none;
    padding: 0;
}

.related-essays li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.related-essays li:last-child {
    border-bottom: none;
}