/* =========================================================
   gwern-simple — a very simple, text-first Ghost theme
   ========================================================= */

:root {
    --accent: #8b0000;
    --bg: #fffff8;
    --fg: #111111;
    --fg-muted: #666666;
    --fg-faint: #999999;
    --rule: #dddddd;
    --serif: Georgia, "Times New Roman", "Liberation Serif", serif;
    --mono: Menlo, Consolas, "Liberation Mono", monospace;
    --measure: 680px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0 1.25rem;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

.wrap {
    max-width: var(--measure);
    margin: 0 auto;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

/* ---------- header ---------- */

.site-head {
    border-bottom: 1px solid var(--rule);
    padding: 1.75rem 0 1rem;
    margin-bottom: 2rem;
}

.site-title {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.site-desc {
    display: block;
    color: var(--fg-muted);
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 0.15rem;
}

.site-nav {
    margin-top: 0.6rem;
    font-size: 0.9rem;
}

.site-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.site-nav li {
    display: flex;
    align-items: center;
}

.site-nav li:not(:last-child)::after {
    content: "\00b7";
    color: var(--fg-faint);
    margin: 0 0.5em;
}

.site-nav a {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav li.nav-current a {
    border-bottom: 1px solid var(--accent);
}

.sep {
    color: var(--fg-faint);
    margin: 0 0.4em;
}

/* ---------- subscribe box ---------- */

.subscribe-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.9rem;
    max-width: 360px;
}

.subscribe-box-email {
    flex: 1;
    min-width: 0;
    font-family: var(--serif);
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--rule);
    background: var(--bg);
    color: var(--fg);
    border-radius: 2px;
}
.subscribe-box-email:focus {
    outline: none;
    border-color: var(--accent);
}

.subscribe-box-btn {
    font-family: var(--serif);
    font-size: 0.9rem;
    padding: 0.4rem 0.9rem;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    border-radius: 2px;
    cursor: pointer;
}
.subscribe-box-btn:hover { opacity: 0.85; }

.subscribe-box .message-success,
.subscribe-box .message-error {
    display: none;
    font-size: 0.82rem;
    margin-top: 0.4rem;
    flex-basis: 100%;
}
.subscribe-box.success .message-success { display: block; color: var(--fg-muted); }
.subscribe-box.error .message-error { display: block; color: var(--accent); }
.subscribe-box.loading .subscribe-box-btn { opacity: 0.6; cursor: wait; }

/* ---------- index / post list ---------- */

.index-intro .lede {
    color: var(--fg-muted);
    font-style: italic;
    margin-bottom: 2rem;
}

.section-head {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
}

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

.post-row {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
}
.post-row:last-child { border-bottom: none; }

.post-row-title {
    font-size: 1.08rem;
    text-decoration: none;
    font-weight: 700;
}
.post-row-title:hover { text-decoration: underline; }

.post-row-meta {
    display: inline-block;
    margin-left: 0.6rem;
    font-size: 0.82rem;
    color: var(--fg-faint);
}
.post-row-meta a { color: var(--fg-faint); }

.post-row-excerpt {
    margin: 0.3rem 0 0;
    font-size: 0.92rem;
    color: var(--fg-muted);
}

/* ---------- single post ---------- */

.post-head { margin-bottom: 1.75rem; }

.post-title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

.post-meta {
    color: var(--fg-muted);
    font-size: 0.88rem;
    margin: 0;
}
.post-meta a { color: var(--fg-muted); }

.post-excerpt {
    font-style: italic;
    color: var(--fg-muted);
    margin-top: 0.75rem;
}

.post-feature-image {
    width: 100%;
    height: auto;
    margin-bottom: 1.75rem;
}

.post-content {
    text-align: left;
    hyphens: none;
}

.post-content > * + * { margin-top: 1.1em; }

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    text-align: left;
    line-height: 1.3;
    margin: 1.6em 0 0.4em;
}
.post-content h1 { font-size: 1.5rem; }
.post-content h2 { font-size: 1.3rem; }
.post-content h3 { font-size: 1.12rem; }

.post-content ul,
.post-content ol {
    padding-left: 1.4em;
}

.post-content blockquote {
    margin: 1.2em 0;
    padding-left: 1em;
    border-left: 3px solid var(--rule);
    color: var(--fg-muted);
    font-style: italic;
}

.post-content img,
.post-content figure {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-wide {
    width: 1000px;
    max-width: 1000px;
    margin-left: calc(50% - 500px);
    margin-right: calc(50% - 500px);
}

.kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-width-full img { display: block; margin: 0 auto; }

@media (max-width: 1040px) {
    .kg-width-wide {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}
.post-content figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--fg-faint);
    margin-top: 0.4em;
}

.post-content code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: #f2f2ea;
    padding: 0.1em 0.3em;
    border-radius: 2px;
}
.post-content pre {
    background: #f2f2ea;
    padding: 1em;
    overflow-x: auto;
    border-radius: 3px;
}
.post-content pre code {
    background: none;
    padding: 0;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 2em 0;
}

.post-foot {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    font-size: 0.9rem;
}

/* ---------- footer ---------- */

.site-foot {
    margin-top: 3rem;
    padding: 1.25rem 0 2.5rem;
    border-top: 1px solid var(--rule);
    color: var(--fg-faint);
    font-size: 0.82rem;
}
.site-foot a { color: var(--fg-faint); }

/* ---------- small screens ---------- */

@media (max-width: 700px) {
    body { font-size: 17px; }
    .post-title { font-size: 1.6rem; }
    .post-content { text-align: left; }
}
