/* =========================
   Global Reset
========================= */

*, *::before, *::after {
    box-sizing: border-box;
}

/* =========================
   Base Layout
========================= */

body {
    background-color: #f4f1ea;
    color: #333;

    font-family: 'Georgia', 'Times New Roman', serif;

    font-size: 18px;
    line-height: 1.8;

    max-width: 680px;

    margin: 40px auto;
    padding: 0 20px;

    overflow-wrap: break-word;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}

main {
    flex: 1;
}

/* =========================
   Typography
========================= */

h1, h2, h3 {
    color: #5d4037;
    font-weight: normal;

    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    margin: 1.2rem 0;
}

/* =========================
   Header
========================= */

header {
    border-bottom: 1px dashed #dcd7c9;

    margin-bottom: 2.5rem;
    padding-bottom: 0.5rem;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

/* =========================
   Links
========================= */

a {
    color: #8b4513;
    text-decoration: none;

    transition: opacity 0.2s ease;
}

a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* =========================
   Post List
========================= */

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

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;

    gap: 1rem;
    margin-bottom: 1.2rem;
}

.post-item a {
    flex: 1;
}

.post-date {
    color: #777;

    font-size: 0.9rem;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;

    white-space: nowrap;
}

/* =========================
   Article Typography
========================= */

article {
    text-align: left;
}

article h1,
article h2,
article h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

article p {
    margin: 1.2rem 0;
}

article ul,
article ol {
    padding-left: 1.5rem;
}

article li {
    margin: 0.5rem 0;
}

article blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;

    border-left: 3px solid #d6c7a8;

    color: #666;
    font-style: italic;
}

article img {
    max-width: 100%;
    height: auto;

    border-radius: 4px;
}

article pre {
    overflow-x: auto;

    padding: 1rem;

    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
}

article code {
    font-size: 0.92em;
}

/* =========================
   Code Block
========================= */

pre, code {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
}

/* =========================
   Horizontal Rule
========================= */

hr {
    border: none;
    border-top: 1px dashed #dcd7c9;

    margin: 2rem 0;
}

/* =========================
   Text Selection
========================= */

::selection {
    background: #d7c4a3;
}

/* =========================
   Article Meta
========================= */

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-link {
    color: #777;
    display: flex;
    align-items: center;
}

.edit-link:hover {
    color: #8b4513;
}

.edit-link svg {
    width: 14px;
    height: 14px;
}

/* =========================
   Footer
========================= */

footer {
    border-top: 1px dashed #dcd7c9;
    margin-top: 1.5rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    display: flex;
    justify-content: space-between;
    color: #777;
    font-size: 0.88rem;
}

.footer-links a {
    margin: 0 0.5rem;
}

/* =========================
   Mobile Responsive
========================= */

@media (max-width: 768px) {

    body {
        margin: 1rem auto;
        padding: 1.2rem;

        font-size: 20px;
        line-height: 1.9;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .post-item {
        flex-direction: column;
        align-items: flex-start;

        gap: 0.35rem;
        margin-bottom: 1.2rem;
    }

    .post-date {
        font-size: 0.9rem;
        opacity: 0.7;
    }

    article {
        font-size: 1.05rem;
    }

    article h1,
    article h2 {
        line-height: 1.25;
    }

    article pre {
        font-size: 0.9rem;
    }
}
