:root {
  --bg: #f6f4ef; --fg: #2b2a28; --muted: #8a867e; --line: #e4e0d8; --card: #fffdf9;
  --accent: #6b6f9c; --lb-bg: rgba(20, 19, 18, .96); --lb-fg: #eee9e1; --lb-muted: #a29d94;
  --serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", "Times New Roman", serif;
  --sans: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17181a; --fg: #e6e2da; --muted: #8b877f; --line: #2a2c30; --card: #1e2024; --accent: #9ea3d6; }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

header { max-width: 1400px; margin: 0 auto; padding: 44px 24px 12px; text-align: center; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: .18em; margin: 0; }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.tagline:empty { display: none; }
#filter { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
#filter button { font: inherit; font-size: 12px; letter-spacing: .08em; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
#filter button.on { color: var(--fg); border-color: var(--fg); }

main { max-width: 1400px; margin: 0 auto; padding: 18px 20px 60px; }
/* 段組みは JS が列を作って「いちばん短い列の下」に足す（CSS columns だと塊を足すたびに全カードが列を移動してちらつく） */
.grid { display: flex; gap: 18px; align-items: flex-start; }
.grid .col { flex: 1 1 0; min-width: 0; }
@media (max-width: 720px) { .grid { gap: 10px; } .card { margin-bottom: 10px !important; } main { padding: 10px 10px 40px; } }
.card { margin: 0 0 18px; display: block; background: var(--card); border-radius: 6px;
  overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: pointer; text-decoration: none; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.10); }
.card img { display: block; width: 100%; height: auto; background: var(--line); }
.card .t { font-family: var(--serif); font-size: 13.5px; letter-spacing: .04em; padding: 9px 12px 10px; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .t:empty { display: none; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.more { text-align: center; color: var(--muted); padding: 24px 0 8px; letter-spacing: .3em; font-size: 14px; }
footer { text-align: center; color: var(--muted); font-size: 11px; letter-spacing: .12em; padding: 30px 0 40px; }
footer .dot { margin: 0 8px; }

/* lightbox */
.lb { position: fixed; inset: 0; background: var(--lb-bg); color: var(--lb-fg); z-index: 50; }
.lb-inner { position: absolute; inset: 0; display: flex; align-items: stretch; }
.lb-fig { margin: 0; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 28px 70px; }
.lb-fig img { max-width: 100%; max-height: calc(100vh - 56px); width: auto; height: auto; object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-cap { flex: 0 0 340px; padding: 60px 40px 40px 8px; display: flex; flex-direction: column; justify-content: center;
  font-family: var(--serif); }
.lb-char { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; color: var(--lb-muted); text-transform: lowercase; }
.lb-char:empty { display: none; }
.lb-cap h2 { font-weight: 500; font-size: 20px; letter-spacing: .12em; margin: 8px 0 18px; }
.lb-cap p { margin: 0; font-size: 15px; line-height: 2.05; letter-spacing: .04em; white-space: pre-line; }
.lb-date { font-family: var(--sans); font-size: 11px; color: var(--lb-muted); letter-spacing: .1em; margin-top: 26px; }
.lb-close, .lb-nav { position: absolute; background: transparent; border: none; color: var(--lb-fg); cursor: pointer;
  font-size: 40px; line-height: 1; opacity: .55; padding: 10px 16px; z-index: 2; font-family: var(--sans); }
.lb-close:hover, .lb-nav:hover { opacity: 1; }
.lb-close { top: 8px; right: 12px; font-size: 32px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }
@media (max-width: 860px) {
  .lb-inner { flex-direction: column; overflow-y: auto; }
  .lb-fig { flex: 0 0 auto; padding: 48px 12px 12px; }
  .lb-fig img { max-height: 70vh; }
  .lb-cap { flex: 0 0 auto; padding: 8px 24px 60px; }
  .lb-nav { top: 36vh; }
}
