/* ====================================================
   野営の記録 — Dark Natural Theme
   ==================================================== */

:root {
  /* palette */
  --bg:        #131210;
  --surface:   #1b1a16;
  --surface-h: #222019;
  --text:      #cac5b6;
  --text-dim:  #68655c;
  --accent:    #9e8652;
  --line:      rgba(210, 200, 178, 0.09);

  /* type */
  --serif: "Noto Serif JP", "YuMincho", "Yu Mincho", "Hiragino Mincho Pro", Georgia, serif;
  --sans:  "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic Pro", system-ui, sans-serif;
  --mono:  "SF Mono", "Consolas", "Courier New", monospace;

  --hdr: 54px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  min-height: 100vh;
}


/* ── Header ─────────────────────────────── */

#site-header {
  position: sticky;
  top: 0;
  height: var(--hdr);
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}

.site-logo {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--text);
  text-decoration: none;
}


/* ── Home ────────────────────────────────── */

.home {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

.home-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}

.home-heading {
  font-family: var(--serif);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.home-count {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  opacity: 0.6;
}

/* 2-column card grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}


/* ── Post card ───────────────────────────── */

.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s;
}
.post-card:hover { background: var(--surface-h); }

.card-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0d0c0a;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.78) saturate(0.82);
  transition: filter 0.4s, transform 0.5s;
}
.post-card:hover .card-thumb img {
  filter: brightness(0.92) saturate(0.95);
  transform: scale(1.03);
}

.card-body {
  padding: 14px 18px 18px;
}
.card-date {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 5px;
}
.card-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 6px;
}
.card-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 10px;
}
.card-count {
  font-size: 0.68rem;
  color: var(--text-dim);
  opacity: 0.55;
  letter-spacing: 0.05em;
}


/* ── Post page ───────────────────────────── */

.post-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 100px;
}

/* Back nav */
.post-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.back-btn {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--text); }
.back-arrow { font-size: 1.05rem; line-height: 1; }

/* Cover */
.post-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: #0d0c0a;
  margin-bottom: 28px;
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.8) saturate(0.82);
}

/* Post heading */
.post-head {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.post-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 10px;
}
.post-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.08em;
  line-height: 1.3;
  margin-bottom: 10px;
}
.post-subtitle {
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* Body */
.post-body {
  margin-bottom: 48px;
}
.post-body p {
  font-size: 0.93rem;
  line-height: 2.15;
  color: var(--text-dim);
  margin-bottom: 1.6em;
}
.post-body p:last-child { margin-bottom: 0; }

/* Gallery */
.gallery-sep {
  height: 1px;
  background: var(--line);
  margin-bottom: 20px;
}
.gallery-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.gallery-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.gallery-total {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  opacity: 0.55;
  letter-spacing: 0.1em;
}

/* ── Instagram-style square grid ──────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.photo-cell {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  background: #0d0c0a;
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82) saturate(0.82);
  transition: filter 0.25s, transform 0.3s;
}
.photo-cell:hover img {
  filter: brightness(1.0) saturate(1.0);
  transform: scale(1.06);
}


/* ── Lightbox ────────────────────────────── */

.lb {
  position: fixed;
  inset: 0;
  background: rgba(9, 8, 7, 0.97);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.lb--hidden { display: none; }

.lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 94vw;
  max-height: 94vh;
}
#lb-img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  border-radius: 1px;
}
#lb-count {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: #4a4840;
}

.lb-btn {
  position: fixed;
  background: none;
  border: none;
  color: #4a4840;
  cursor: pointer;
  padding: 16px;
  line-height: 1;
  transition: color 0.2s;
  z-index: 201;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover { color: var(--text); }

.lb-btn--close { top: 16px; right: 20px; font-size: 1rem; letter-spacing: 0.05em; }
.lb-btn--prev  { left: 12px;  top: 50%; transform: translateY(-50%); font-size: 2.8rem; }
.lb-btn--next  { right: 12px; top: 50%; transform: translateY(-50%); font-size: 2.8rem; }


/* ── Responsive ──────────────────────────── */

@media (max-width: 700px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
  .card-thumb {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 480px) {
  #site-header { padding: 0 16px; }
  .home         { padding: 28px 12px 60px; }
  .post-page    { padding: 20px 14px 80px; }
  .photo-grid   { gap: 2px; }
  .lb-btn--prev { left: 4px; }
  .lb-btn--next { right: 4px; }
}
