:root {
    --parchment: #ffffff;
    --parchment-dark: #ebe2d2;
    --ink: #2b2017;
    --muted: #5a4a38;
    --terracotta: #8b3a2b;
    --terracotta-dark: #6b2c20;
    --stone: #d4c4a8;
    --gold: #b8893a;
}

* {
    box-sizing: border-box;
}

/* Scale every rem-based font-size on the page by 20%. */
html {
    font-size: 120%;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.65;
}

header.site-header {
    background: var(--terracotta-dark);
    color: var(--parchment);
    border-bottom: 4px solid var(--gold);
}

.site-header .inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
}

.site-header h1 {
    margin: 0 0 0.4rem 0;
    font-size: 1.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-header .subtitle {
    margin: 0;
    font-style: italic;
    color: var(--stone);
    font-size: 0.95rem;
}

nav.site-nav {
    background: var(--terracotta);
    border-bottom: 1px solid var(--terracotta-dark);
}

nav.site-nav ul {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

nav.site-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--parchment);
    text-decoration: none;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    border-bottom: 3px solid transparent;
}

nav.site-nav a:hover {
    background: var(--terracotta-dark);
}

nav.site-nav a.current {
    border-bottom-color: var(--gold);
    background: var(--terracotta-dark);
}

main {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem 1.5rem;
}

main h2 {
    font-size: 2rem;
    margin-top: 0;
    color: var(--terracotta-dark);
    border-bottom: 2px solid var(--stone);
    padding-bottom: 0.4rem;
}

main h3 {
    color: var(--terracotta-dark);
    font-size: 1.35rem;
    margin-top: 2rem;
}

main p {
    margin: 1rem 0;
}

.hero {
    margin: 0 0 1.5rem 0;
}

.hero img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--stone);
}

.hero .caption {
    background: var(--parchment-dark);
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--muted);
    border: 1px solid var(--stone);
    border-top: none;
}

figure.inline {
    margin: 1.2rem 0;
    border: 1px solid var(--stone);
    background: var(--parchment-dark);
}

figure.inline img {
    width: 100%;
    height: auto;
    display: block;
}

figure.inline figcaption {
    padding: 0.5rem 0.8rem;
    font-size: 0.88rem;
    font-style: italic;
    color: var(--muted);
}

figure.inline.right {
    float: right;
    width: 45%;
    margin: 0.4rem 0 1rem 1.5rem;
}

figure.inline.left {
    float: left;
    width: 45%;
    margin: 0.4rem 1.5rem 1rem 0;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    border-left: 3px solid var(--terracotta);
}

.timeline li {
    padding: 0.5rem 0 0.5rem 1.2rem;
    position: relative;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 1rem;
    width: 13px;
    height: 13px;
    background: var(--gold);
    border: 2px solid var(--terracotta-dark);
    border-radius: 50%;
}

.timeline .date {
    font-weight: bold;
    color: var(--terracotta-dark);
    display: inline-block;
    min-width: 7rem;
}

blockquote.pullquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--gold);
    background: var(--parchment-dark);
    font-style: italic;
    color: var(--muted);
}

.clear {
    clear: both;
}

footer.site-footer {
    background: var(--ink);
    color: var(--stone);
    border-top: 4px solid var(--gold);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

footer.site-footer a {
    color: var(--gold);
}

@media (max-width: 640px) {
    figure.inline.right,
    figure.inline.left {
        float: none;
        width: 100%;
        margin: 1rem 0;
    }

    nav.site-nav ul {
        padding: 0;
    }

    nav.site-nav a {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .site-header h1 {
        font-size: 1.3rem;
    }
}

#overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: transparent;
    /* Sits above any positioned page elements (e.g. timeline items
       with position:relative) so they don't poke through the popup. */
    z-index: 9999;
}

#popup {
    position: fixed;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #888;
    box-sizing: border-box;
    padding: 8px;
}

#editor {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    resize: none;
    font-family: monospace;
    /* 0.875rem rather than 14px so the editor scales with the global +20% bump. */
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.7);
}
