:root {
  --bg: #faf8f5;
  --text: #2c2622;
  --muted: #8a7f78;
  --accent: #b89b7a;
  --card: #ffffff;
  --border: #e8e2db;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 540px) {
  .container { padding: 0 14px; }
}

/* Header */
.site-header {
  padding: 32px 0 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header h1 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.15em;
}
@media (max-width: 540px) {
  .site-header { padding-top: 20px; }
  .site-header h1 { font-size: 22px; letter-spacing: 0.1em; }
  .site-header .tagline { font-size: 11px; }
}
.site-header h1 a { color: inherit; }
.site-header .tagline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.1em;
}

/* Site Navigation - カテゴリメニュー */
.site-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.site-nav a {
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.08em;
  padding: 16px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  background: var(--card);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-nav a:nth-child(3n) { border-right: none; }
.site-nav a:nth-child(n+4) { border-top: 1px solid var(--border); }
.site-nav a:hover {
  background: #f3ede5;
  color: var(--accent);
}
.site-nav a.active {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 540px) {
  .site-nav { font-size: 12px; }
  .site-nav a {
    font-size: 12px;
    padding: 12px 4px;
    letter-spacing: 0.04em;
  }
}

/* Hero */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h2 {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
@media (max-width: 540px) {
  .hero { padding: 36px 0 24px; }
  .hero h2 { font-size: 26px; }
  .hero p { font-size: 13px; }
}
.hero p {
  color: var(--muted);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
}

/* Genre cards (top page) */
.genres {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 40px 0 80px;
}
@media (min-width: 720px) {
  .genres { grid-template-columns: repeat(3, 1fr); }
}
.genre-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 48px 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.genre-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.genre-card .genre-name {
  font-size: 20px;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}
.genre-card .genre-count {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* Gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 20px 0 80px;
}
@media (min-width: 720px) {
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (min-width: 1024px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
}
/* トップページは常に4列・スマホ2列 */
.gallery-top {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) {
  .gallery-top { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .gallery-top { grid-template-columns: repeat(4, 1fr); }
}
.gallery-item {
  display: flex;
  flex-direction: column;
}
.gallery-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #efe9e1;
  border-radius: 2px;
  cursor: pointer;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.gallery-thumb:hover img { transform: scale(1.05); }
.gallery-caption {
  padding: 10px 4px 0;
  text-align: center;
}
.gallery-caption .item-name {
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 4px;
}
.gallery-caption .item-price {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Page title */
.page-title {
  text-align: center;
  padding: 60px 0 20px;
}
.page-title h2 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.15em;
}
.page-title .back {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.page-title .back:hover { color: var(--accent); }

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* Lightbox - popup style */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 25, 22, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-popup {
  background: var(--card);
  border-radius: 8px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.lightbox.active .lightbox-popup {
  transform: scale(1);
  opacity: 1;
}
.lightbox-image-wrap {
  background: #f0eae2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  flex: 1;
  min-height: 0;
}
.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}
.lightbox-info {
  padding: 18px 24px 22px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.lightbox-name {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 6px;
}
.lightbox-price {
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}
@media (max-width: 540px) {
  .lightbox { padding: 16px; }
  .lightbox-image-wrap img { max-height: 55vh; }
  .lightbox-info { padding: 14px 16px 18px; }
  .lightbox-name { font-size: 14px; }
  .lightbox-price { font-size: 13px; }
}
