/* Reset-ish */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "YuGothic", Meiryo, sans-serif;
  color: #333;
  background: #fff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Layout */
.container { width: min(1100px, 100%); margin: 0 auto; padding: 16px; }
.page-title { font-size: 1.2rem; margin: 16px 0 12px; }
.lead { color:#666; margin-bottom: 16px; }

/* Header & Hamburger */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: #fff; border-bottom: 1px solid #eee;
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 8px 56px; /* 右側にボタン余白 */
}
.brand { font-weight: 700; letter-spacing: .02em; }

.nav-toggle { display: none; }

.hamburger {
  position: fixed; top: 10px; right: 10px;
  width: 40px; height: 40px; z-index: 1001;
  border-radius: 8px; background: #1111;
  backdrop-filter: blur(5px);
  cursor: pointer;
}
.hamburger::before, .hamburger::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: #111;
  transform-origin: center; transition: transform .25s ease, top .25s ease, bottom .25s ease, opacity .2s;
}
.hamburger::before { top: 14px; }
.hamburger::after  { bottom: 14px; }
/* 開いている時の背景変化（:has ではなく :checked ベースで確実に） */
.nav-toggle:checked + .hamburger { background: #1112; }

.nav-toggle:checked + .hamburger::before { top: 19px; transform: rotate(45deg); }
.nav-toggle:checked + .hamburger::after  { bottom: 19px; transform: rotate(-45deg); }

.global-nav {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.9);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
  display: grid; place-items: center; padding: 24px;
}
.global-nav ul { width: min(720px, 100%); max-height: 80vh; overflow: auto; }
.global-nav li + li { margin-top: 8px; }
.global-nav a {
  display: block; padding: 14px 16px; border-radius: 10px;
  background: rgba(255,255,255,.06); color: #fff; font-weight: 600;
}
.global-nav a.active { background: rgba(255,255,255,.18); }

/* “ふわっ”入場用の内側ラッパー */
.global-nav .nav-panel {
  transform: scale(0.98);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle:checked ~ .global-nav { opacity: 1; visibility: visible; }
.nav-toggle:checked ~ .global-nav .nav-panel {
  transform: scale(1);
  opacity: 1;
}

/* Cards (Home) */
.card-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
.card {
  border: 1px solid #eee; border-radius: 14px; overflow: hidden;
  background: #fff; display: grid; grid-template-rows: 140px auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.card-thumb {
  background: #f4f4f4 center/cover no-repeat;
  display: grid; place-items: center;
}
.no-image { color:#777; font-size: .9rem; }
.card-meta { display: flex; gap: 8px; align-items: center; padding: 10px 12px; }
.card-meta .code {
  font: 700 .8rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: #111; color: #fff; padding: 2px 6px; border-radius: 6px;
}
.card-meta .label { font-weight: 600; }

/* Gallery (Category pages) */
.gallery-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
.gallery-item { border-radius: 8px; overflow: hidden; border: 1px solid #eee; }

/* Footer */
.site-footer { padding: 24px 16px; color:#777; text-align: center; }

/* Lightbox “ふわっと”演出 */
#lightbox .lb-outerContainer {
  animation: lbPop .28s ease-out both;
  will-change: transform, opacity;
}
@keyframes lbPop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
#lightbox .lb-dataContainer {
  animation: lbFadeUp .22s ease-out .08s both;
}
@keyframes lbFadeUp {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);  opacity: 1; }
}

/* モーション軽減への配慮（任意） */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
