:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1f2430;
  --text-muted: #5f6473;
  --accent: #6366f1;
  --accent-dark: #4338ca;
  --border: #e6e6ef;
  --shadow: 0 2px 10px rgba(20, 20, 40, 0.06);
  --shadow-hover: 0 8px 24px rgba(20, 20, 40, 0.12);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151d;
    --surface: #1d1f29;
    --text: #eceef3;
    --text-muted: #a4a8b8;
    --accent: #818cf8;
    --accent-dark: #a5b4fc;
    --border: #2c2e3a;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  line-height: 0;
}

.banner-image {
  display: block;
  width: 100%;
  height: auto;
}

/* 画面上は非表示だが、SEOやスクリーンリーダー用にテキストとして残す */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main {
  padding: 48px 24px 80px;
}

.category-section {
  margin-bottom: 56px;
}

.category-section h2 {
  font-size: 1.3rem;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.book-cover-wrap {
  position: relative;
  /* Kindle表紙の標準サイズ（1600x2560px = 5:8）に合わせて、上下が切れないようにする */
  aspect-ratio: 5 / 8;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  overflow: hidden;
}

.book-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.book-cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.book-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
}

.book-author {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.book-desc {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-grow: 1;
}

.book-btn {
  display: inline-block;
  text-align: center;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.book-btn:hover {
  background: var(--accent-dark);
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.site-footer {
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
