:root {
  --paper: #f2f3f0;
  --ink: #191b18;
  --muted: #6d7268;
  --rule: #d5d7cf;
  --pine: #2c5045;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.65 Georgia, "Iowan Old Style", "Times New Roman", serif;
}

a { color: var(--pine); }
a:focus-visible { outline: 2px solid var(--pine); outline-offset: 3px; }

.masthead {
  max-width: 60rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.masthead-title {
  display: inline-block;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.masthead-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

main { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }

.empty { color: var(--muted); padding: 3rem 0; }

/* ---- index rail ---- */
.rail { list-style: none; margin: 0; padding: 0; }

.rail-item {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.rail-meta {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.3;
  padding-top: 0.35rem;
}
.rail-date { display: block; font-size: 1rem; font-weight: 600; }
.rail-year { display: block; font-size: 0.8rem; color: var(--muted); }

.rail-body h2 { margin: 0; font-size: 1.35rem; font-weight: 400; letter-spacing: -0.01em; }
.rail-body h2 a { text-decoration: none; }
.rail-body h2 a:hover { text-decoration: underline; }

.rail-place { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }

.rail-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 0.9rem;
}
.rail-strip img { width: 100%; height: 8.5rem; object-fit: cover; display: block; background: var(--rule); }

.rail-count {
  margin: 0.5rem 0 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---- day page ---- */
.day { padding: 2.5rem 0 4rem; }

.day-date {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}
.day-title { margin: 0.3rem 0 1.5rem; font-size: 2rem; font-weight: 400; letter-spacing: -0.015em; }

.prose { max-width: 34rem; }
.prose p { margin: 0 0 1.1rem; }

.gallery {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
}
.shot { margin: 0; }
.shot img { width: 100%; height: auto; display: block; background: var(--rule); cursor: zoom-in; }
.shot figcaption { margin-top: 0.4rem; font-size: 0.9rem; color: var(--muted); }

.daynav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.daynav-next { margin-left: auto; text-align: right; }

.backlink { margin-top: 1rem; font-size: 0.95rem; }

.footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(16, 17, 15, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 94vw; max-height: 92vh; text-align: center; }
.lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; }
.lightbox figcaption { color: #d9dad3; font-size: 0.9rem; padding: 0.75rem 1rem 0; }
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #e8e9e3;
  font-size: 2.25rem;
  line-height: 1;
  padding: 0.75rem 1rem;
  cursor: pointer;
}
.lb-close { top: 0.5rem; right: 0.75rem; }
.lb-prev { left: 0.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.25rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .rail-item { grid-template-columns: 1fr; gap: 0.5rem; padding: 1.5rem 0; }
  .rail-meta { padding-top: 0; }
  .rail-date { display: inline; }
  .rail-year { display: inline; margin-left: 0.35rem; }
  .rail-strip img { height: 6rem; }
  .day-title { font-size: 1.6rem; }
  .gallery { grid-template-columns: 1fr; }
}
