:root {
  --bg: #fbfaf7; --fg: #1f1f1d; --muted: #6b6a65; --line: #e4e1d9; --card: #ffffff;
  --accent: #2f6f5e; --tag-bg: #eef3f0; --radius: 10px; --max: 1100px; --prose: 760px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151614; --fg: #e8e6e0; --muted: #9a978f; --line: #2e2f2b; --card: #1d1e1b;
          --accent: #7cc3ac; --tag-bg: #233029; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
main { max-width: var(--max); margin: 0 auto; padding: 16px 16px 64px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted, .count, .crumbs, .meta { color: var(--muted); }
.count { font-size: .8em; font-weight: normal; }

.site-header { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 20px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.3rem; color: var(--fg); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .9rem; }
.tag { background: var(--tag-bg); padding: 0 8px; border-radius: 999px; }

.cards { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card .cover { display: block; aspect-ratio: 3 / 2; background: var(--line); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 16px 16px; }
.card h2 { margin: 0 0 4px; font-size: 1.2rem; line-height: 1.3; }
.card p { margin: 8px 0 0; }

.post header { max-width: var(--prose); margin: 24px auto 16px; }
.post h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 8px; }
.prose { max-width: var(--prose); margin: 0 auto; }
.prose h2, .prose h3 { line-height: 1.25; margin-top: 2em; }
.prose figure.photo { margin: 28px 0; }
.prose figure.photo img { border-radius: var(--radius); width: 100%; }
.prose figcaption { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.prose .photo-inline img { display: inline-block; max-height: 1.6em; vertical-align: middle; border-radius: 3px; }
.prose blockquote { margin: 1.5em 0; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }
.prose pre { overflow-x: auto; background: var(--card); padding: 12px; border-radius: var(--radius); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: 4px 10px; }

.post-gallery { max-width: var(--max); margin: 48px auto 0; border-top: 1px solid var(--line); }
.thumbs { list-style: none; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.thumbs.large { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.thumb-caption { font-size: .85rem; color: var(--muted); }

.photo-page .crumbs { display: flex; gap: 18px; flex-wrap: wrap; }
.photo-page main { max-width: 1400px; }
/* prev | photo | next – thumbnails aligned with the top edge of the photo */
.photo-stage { display: grid; grid-template-columns: 140px minmax(0, 1fr) 140px;
  grid-template-areas: "prev photo next"; gap: 16px; align-items: start; margin: 16px 0; }
.photo-stage .nav-prev { grid-area: prev; }
.photo-stage .nav-next { grid-area: next; }
.photo-large { grid-area: photo; margin: 0; }
.photo-large img { margin: 0 auto; max-height: 82vh; width: auto; border-radius: 6px; }
.photo-stage a.nav-prev, .photo-stage a.nav-next { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.photo-stage a.nav-next { align-items: flex-end; text-align: right; }
.photo-stage .nav-prev img, .photo-stage .nav-next img { width: 140px; height: 105px; object-fit: cover; border-radius: 6px; }
@media (max-width: 760px) {
  .photo-stage { grid-template-columns: 1fr 1fr; grid-template-areas: "photo photo" "prev next"; }
  .photo-stage .nav-prev img, .photo-stage .nav-next img { width: 120px; height: 90px; }
}
.photo-info { max-width: var(--prose); margin: 24px auto 0; }
.photo-info h1 { font-size: 1.5rem; }
.photo-info h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 4px; }
.photo-info p { margin: 0 0 8px; }
.keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.keywords span { background: var(--tag-bg); border-radius: 999px; padding: 0 8px; font-size: .85rem; }
.model { font-size: .8rem; color: var(--muted); }
.photo-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin-top: 20px;
  border-top: 1px solid var(--line); padding-top: 16px; }
.photo-meta dt { color: var(--muted); }
.photo-meta dd { margin: 0; overflow-wrap: anywhere; }

.taxonomy { list-style: none; padding: 0; columns: 3 200px; }
.taxonomy li { padding: 4px 0; }

.search-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.search-form input, .search-form select, .search-form button { font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); color: var(--fg); min-width: 0; }
.search-form input[type=search] { flex: 1 1 100%; font-size: 1.1rem; }
.search-form button { background: var(--accent); color: var(--bg); border: 0; cursor: pointer; }
.result-photos { list-style: none; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.result-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.result-photos p { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.result-posts { list-style: none; padding: 0; }
.result-posts li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.result-posts h3 { margin: 0; }
.result-posts p { margin: 4px 0 0; }
