:root {
    --ink: #333333;
    --paper: #f7edce;
    --accent: #333333;
    --link: #0072c9;
}

html { font-size: 112.5%; }

body {
    font-family: "Sitka Text", Sitka, Charter, Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    max-width: 55rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}
a { color: var(--link); }
img { max-width: 100%; height: auto; }

p { text-align: justify; hyphens: auto; }
footer p { text-align: center; }

h1, h2, h3 {
    font-family: "Sitka Heading", "Sitka Text", Sitka, Charter, Georgia, serif;
    line-height: 1.25;
    text-align: center;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--accent);
}

nav a {text-decoration: none; }
nav a[aria-current="page"] { font-weight: bold}

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--accent);
    font-size: 0.875rem;
    color: var(--ink);
    text-align: center;
}

.panel {
    position: sticky;
    top: 0;
    min-height: 100svh;
    background: var(--paper);
    box-shadow: 0 -0.5rem 1.5rem rgba(0, 0, 0, 0.08);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery figure {
    margin: 0;
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--ink);
}

@media (max-width: 40rem) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

.carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    align-items: start;
    container-type: inline-size;
}

.carousel figure {
    flex: 0 0 auto;
    margin: 0;
    scroll-snap-align: center;
}

.carousel img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100cqw;
    max-height: min(70vh, 32rem);
}

.carousel figcaption {
    width: 0;
    min-width: 100%;
    font-family: "Sitka Heading", "Sitka Text", Sitka, Charter, Georgia, serif;
    font-style: italic;
    font-size: 0.875rem;
    text-align: center;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.with-toc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 12rem;
    gap: 3rem;
}
.toc {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.toc a[aria-current="true"] { font-weight: bold; }
html { scroll-behavior: smooth; }
@media (max-width: 50rem) {
    .with-toc { grid-template-columns: 1fr; }
    .with-toc aside { display: none; }
}