@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap');

html, body {
    height: 100%;
}

body {
    max-width: 680px;      /* Creates that focused central column */
    margin: 0 auto;        /* Centers the column */
    padding: 2rem 1rem;
    font-family: 'EB Garamond'; /*, 'Merriweather', 'Georgia', serif; /* The classic "writer" look */
    line-height: 1.6;
    color: #333;
    background-color: #fdfdfd;
    display: flex;
    flex-direction: column;
}

nav { margin-bottom: 3rem; }
nav a { margin-right: 15px; text-decoration: none; color: #555; font-weight: bold; }
nav a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: 'EB Garamond'; margin-top: 2rem; }
a { color: #0056b3; }
code { background: #eee; padding: 2px 5px; border-radius: 3px; font-size: 0.9em; }
pre { background: #f4f4f4; padding: 15px; overflow-x: auto; border-radius: 5px; }
.date { color: #888; font-size: 0.9rem; margin-left: 10px; }

main {
    flex: 1;
}

footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

footer a {
    color: #888;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

main img, main video { max-width: 100%; max-height: 80vh; width: auto; height: auto; display: block; margin: 1.5rem auto; }
/* never taller than the screen: on short laptop screens tall figures shrink to fit */
figure video { margin: 0 auto 0.5rem; }
blockquote { border-left: 3px solid #ddd; margin-left: 0; padding-left: 1rem; color: #555; }
figure { margin: 1.5rem 0; }
figure img { margin: 0 auto 0.5rem; }
figcaption { font-size: 0.9rem; color: #777; font-style: italic; text-align: center; }
.figure-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.figure-row img { min-width: 0; width: 100%; max-height: none; margin: 0 0 0.5rem; }
.figure-row.zoom { align-items: center; }
.zoom-arrow { color: #c0392b; font-size: 1.4rem; flex: 0 0 auto; }
.closing { text-align: center; font-size: 1.25rem; margin: 2.5rem 0; }
.post-meta { color: #888; font-size: 0.95rem; margin-top: -0.75rem; margin-bottom: 2rem; }

/* before/after slider */
.compare { position: relative; overflow: hidden; border-radius: 4px; user-select: none; margin: 0 auto 0.5rem; max-width: calc(80vh * 1200 / 1090); }
.compare img { display: block; width: 100%; height: auto; max-height: none; margin: 0; }
.compare-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-top img { height: 100%; object-fit: cover; }
.compare-label { position: absolute; top: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 4px; background: rgba(15, 17, 22, 0.75); color: #fff; font-size: 0.85rem; line-height: 1.3; pointer-events: none; }
.compare-label.left { left: 0.75rem; }
.compare-label.right { right: 0.75rem; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,0.5); pointer-events: none; }
.compare-handle::after { content: "\2194"; position: absolute; top: 50%; left: 50%; width: 2.2rem; height: 2.2rem; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; color: #222; font-size: 1.1rem; line-height: 2.2rem; text-align: center; box-shadow: 0 1px 6px rgba(0,0,0,0.4); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }

/* footnotes */
.footnote-reference { font-size: 0.75em; line-height: 0; margin-left: 1px; }
.footnote-reference a { text-decoration: none; }
.footnotes { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #ddd; font-size: 0.9rem; color: #666; }
.footnotes ol { margin: 0; padding-left: 1.2rem; }
.footnotes li p { margin: 0.3rem 0; }
.footnotes a[href^="#fr-"] { text-decoration: none; margin-left: 0.2rem; }
:target { scroll-margin-top: 2rem; }
