:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665e;
  --rule: #e6e2da;
  --accent: #a2461f;
  --measure: 40rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --surface: #201e1b;
    --text: #e9e5dd;
    --muted: #a29b90;
    --rule: #34312c;
    --accent: #e48a5f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.125rem/1.65 var(--serif);
}
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1rem; }

.site-header { border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: 0.9rem; }
.site-header .wrap { max-width: 64rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; padding-top: 1rem; padding-bottom: 1rem; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }

main { padding-top: 2.5rem; padding-bottom: 3rem; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: 2.1rem; margin: 0 0 0.5rem; }
.lede, .intro p { color: var(--muted); }

.eyebrow, .meta, .provenance, .comment-meta, time, .count, .pager {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}
.eyebrow { margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
.eyebrow a { color: inherit; text-decoration: none; }
.meta { margin: 0 0 2rem; }

.prose img { max-width: 100%; height: auto; display: block; margin: 1.25rem auto; border-radius: 4px; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--rule); color: var(--muted); }
.prose pre, .prose code { font-size: 0.9em; overflow-x: auto; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose { overflow-wrap: break-word; }

.provenance { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.provenance code { font-size: 0.8rem; word-break: break-all; }

.comments { margin-top: 3rem; }
.comments h2 { font-size: 1.2rem; font-family: var(--sans); }
.comment { padding: 1rem 0; border-top: 1px solid var(--rule); font-size: 1rem; }
.comment .prose p { margin: 0.4rem 0; }
.comment-meta { margin: 0; }
.comment-meta strong { color: var(--text); }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.pager a { max-width: 48%; }

.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 2rem 0 3rem; }
.section-card { display: block; padding: 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; color: var(--text); text-decoration: none; }
.section-card:hover { border-color: var(--accent); }
.section-card h2 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.section-card p { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.95rem; }

.list-heading { font-size: 1.3rem; margin: 2.5rem 0 0.75rem; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.post-list time { display: block; }
.post-list.cards li { padding: 1rem 0; }
.post-list.cards p { margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--muted); }

.site-footer { padding-bottom: 3rem; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.album-card { display: flex; flex-direction: column; gap: 0.25rem; color: var(--text); text-decoration: none; }
.album-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--rule); }
.album-card:hover .album-title { color: var(--accent); }
.album-title { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
figure.photo { margin: 2rem 0; }
figure.photo img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 4px; }
figure.photo figcaption { margin-top: 0.6rem; font-size: 0.95rem; }
figure.photo .location { color: var(--muted); font-family: var(--sans); font-size: 0.85rem; }
figure.photo .prose p { margin: 0.3rem 0; }
.missing-img { display: inline-block; font: 0.8rem var(--sans); color: var(--muted); border: 1px dashed var(--rule); padding: 0.3rem 0.6rem; border-radius: 4px; }
figure.photo.small img { margin: 0; image-rendering: auto; }

/* ---- picture-forward listings ---- */
main.wrap.wide { max-width: 72rem; }
main.wide .intro, main.wide > h1, main.wide > .lede { max-width: 40rem; }
.list-heading .more { float: right; font: 0.85rem var(--sans); font-weight: 400; margin-top: 0.4rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; color: var(--text); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card:hover .card-title { color: var(--accent); }
.card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--rule); }
.card-body { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.8rem 0.95rem 1rem; }
.card-title { font-weight: 600; line-height: 1.3; }
.card-excerpt { font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
.album-grid.strip { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); margin-bottom: 1rem; }

/* larger photos inside posts */
.post .prose img { border-radius: 6px; }
.post .prose a:has(> img) { display: block; }

/* ---- archive: year photo grids ---- */
.year-jump { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; font: 0.9rem var(--sans); margin-bottom: 1rem; }
.year { scroll-margin-top: 1rem; }
.year-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.4rem; margin: 0 0 1rem; }
.year-photos a { display: block; border-radius: 4px; overflow: hidden; background: var(--rule); }
.year-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform 0.2s; }
.year-photos a:hover img { transform: scale(1.05); }
.more-photos { margin: -0.4rem 0 1rem; font-family: var(--sans); font-size: 0.9rem; }
.more-photos summary { cursor: pointer; color: var(--accent); margin-bottom: 0.6rem; }
.post-list.columns { columns: 2 22rem; column-gap: 2.5rem; }
.post-list.columns li { break-inside: avoid; }

/* ---- full-screen photo viewer ---- */
.prose img, figure.photo:not(.small) img { cursor: zoom-in; }
dialog.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #f3efe8; }
dialog.lightbox::backdrop { background: rgba(10, 9, 8, 0.94); }
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: calc(100vw - 7rem); }
.lightbox img { max-width: 100%; max-height: calc(100vh - 6rem); object-fit: contain; border-radius: 4px; cursor: default; }
.lightbox figcaption { margin-top: 0.75rem; font: 0.9rem/1.4 var(--sans); text-align: center; }
.lightbox .lb-post { color: #f0a47c; margin-left: 0.5rem; }
.lightbox .lb-count { color: #a29b90; margin-left: 0.5rem; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, 0.1); color: #fff; border: 0; border-radius: 999px; width: 3rem; height: 3rem; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255, 255, 255, 0.25); }
.lightbox .lb-close { top: 1rem; right: 1rem; font-size: 1.8rem; }
.lightbox .lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
@media (max-width: 40rem) {
  .lightbox figure { max-width: 100vw; }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 0.75rem; transform: none; }
  .lightbox img { max-height: calc(100vh - 9rem); }
}
