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

:root {
    --bg: #fafaf8;
    --background-color: #fafaf8;
    --fg: #59C3D7;
    --paragraph: #5A5A5A;
    --muted: #666;
    --accent: #D75B70;
    --border: #e0e0d8;
    --max-width: 680px;
    --sidebar-width: 280px;
    --font-body: Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Inconsolata', monospace;
    --spacing-xlarge: 24px;
}

html { font-size: 18px; }

body {
    background: var(--bg);
    color: var(--paragraph);
    font-family: var(--font-body);
    line-height: 1.7;
    margin: 0;
}

/* Page structure */
.page-container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.header {
    flex-wrap: wrap;
    padding: 15px 15px 0px;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--background-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#header-button-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    max-width: 768px;
    margin: 0 auto;
}

#logo {
    line-height: 0;
    padding-top: 5px;
}

.header-logo img {
    height: 51px;
}

/* Layout */
.layout {
    max-width: calc(var(--max-width) + var(--sidebar-width) + 3rem);
    margin: 0 auto;
    padding: 2.5rem 2rem;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

main {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

@media (max-width: 800px) {
    body { padding-bottom: 108px; }
    .layout { flex-direction: column; }
    main { width: 100%; }
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--bg);
        border-top: 1px solid var(--border);
        padding: 8px;
        z-index: 100;
    }
}

@media (min-width: 768px) {
    .header-logo img {
        height: 84px;
    }

    #logo {
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .layout { padding: 1.5rem 1rem; }
    blockquote { padding: 1rem 1rem 1rem 2.5rem; }
    blockquote::before { font-size: 3rem; left: 0.4rem; }
}

/* Post list */
.post-list h1 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 2rem;
}

.post-summary {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.post-summary:last-child { border-bottom: none; }

.post-summary h2 {
    font-size: 1.3rem;
    margin: 0 0 0.3rem;
}

.post-summary-link {
    display: block;
    color: var(--fg);
    text-decoration: none;
}

.post-summary-link:hover h2 { color: var(--accent); }

.post-summary time {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.5rem;
}

.post-summary p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.pagination-btn {
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: none;
}

.pagination-btn:hover { text-decoration: underline; }

.pagination-btn--disabled {
    color: var(--border);
    cursor: default;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Post / Page */
.post-header, .page-header { margin-bottom: 2rem; }

.post-header h1, .page-header h1 {
    font-size: 2rem;
    line-height: 1.25;
    margin: 0 0 0.5rem;
}

.post-header time {
    font-size: 0.85rem;
    color: var(--muted);
}

.post-content, .page-content { }

.post-content h2, .page-content h2 { font-size: 1.4rem; margin-top: 2rem; }
.post-content h3, .page-content h3 { font-size: 1.15rem; margin-top: 1.5rem; }

.post-content a, .page-content a { color: var(--accent); }

.post-content img, .page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: #f0f0ea;
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

pre {
    background: #f0f0ea;
    padding: 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
    max-width: 100%;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

pre code.hljs {
    background: none;
    padding: 0;
}

blockquote {
    position: relative;
    border-left: 4px solid var(--accent);
    margin: 2rem 0;
    padding: 1rem 1.25rem 1rem 4rem;
    color: var(--muted);
    font-style: italic;
    background: rgba(215, 91, 112, 0.05);
    border-radius: 0 6px 6px 0;
}

blockquote::before {
    content: '\201C';
    font-size: 5rem;
    line-height: 0.75;
    color: var(--accent);
    opacity: 0.35;
    position: absolute;
    left: 0.55rem;
    top: 0.8rem;
    font-family: Georgia, 'Times New Roman', serif;
    pointer-events: none;
    user-select: none;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-footer a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.post-footer a:hover { color: var(--fg); }

.post-tags {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tags li {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: white;
    background: var(--accent);
    border-radius: 999px;
    padding: 0.2em 0.75em;
}

.error { color: #c0392b; }

/* Footer */
footer {
    text-align: center;
    padding: 16px 0 8px;
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 8px;
}

.footer-nav a {
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--fg);
}

.copyright-container {
    font-size: 0.85rem;
    color: var(--muted);
}
