/* 文庫発売スケジュール！ - 共通スタイル
 * bunko-framework.html から抽出
 */
:root {
  --bg-primary: #faf8f5;
  --bg-card: #ffffff;
  --bg-accent: #f0ebe4;
  --bg-label: #3d2e1e;
  --text-primary: #2c2418;
  --text-secondary: #6b5d4f;
  --text-muted: #9b8e7e;
  --accent-warm: #c4713b;
  --accent-warm-light: #e8a06a;
  --accent-green: #4a7c59;
  --accent-blue: #4a6a8c;
  --border-soft: #e5ddd3;
  --border-card: #ece6dc;
  --shadow-card: 0 1px 3px rgba(60,40,20,0.06), 0 4px 12px rgba(60,40,20,0.04);
  --shadow-hover: 0 2px 8px rgba(60,40,20,0.1), 0 8px 24px rgba(60,40,20,0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --font-body: 'Noto Sans JP', sans-serif;
  --font-accent: 'Zen Maru Gothic', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, #3d2e1e 0%, #5a4232 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(30,20,10,0.15);
}
.header-top {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-family: var(--font-accent);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}
.site-logo .icon { font-size: 1.5rem; }
.header-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.header-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: 20px;
  transition: all 0.2s;
  font-weight: 500;
}
.header-nav a:hover, .header-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
  margin-left: 8px;
}
.hamburger:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.5); }
.hamburger .hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(40,28,18,0.5);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.25s;
}
.nav-overlay.open { display: block; opacity: 1; }

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 88vw;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-card);
  box-shadow: -4px 0 20px rgba(40,28,18,0.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  overflow-y: auto;
  padding: 0;
}
.nav-drawer.open { transform: translateX(0); }

.nav-drawer-header {
  background: linear-gradient(135deg, #3d2e1e 0%, #5a4232 100%);
  color: #fff;
  padding: 18px 24px;
  font-family: var(--font-accent);
  font-size: 1.1rem;
  font-weight: 700;
}
.nav-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}
.nav-close:hover { background: rgba(255,255,255,0.15); }

.nav-list {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}
.nav-list li { border-bottom: 1px solid var(--border-soft); }
.nav-list li.nav-divider {
  border-bottom: none;
  height: 12px;
  background: var(--bg-accent);
  margin: 8px 0;
}
.nav-list li:last-child { border-bottom: none; }
.nav-list a {
  display: block;
  padding: 14px 24px;
  font-size: 0.92rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-list a:hover {
  background: var(--bg-accent);
  color: var(--accent-warm);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

/* ===== PAGE HERO (H1) ===== */
.page-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px 20px;
}
.page-hero h1 {
  font-family: var(--font-accent);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.page-hero h1 .year-month { color: var(--accent-warm); }
.page-hero .description {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 720px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  max-width: 1120px;
  margin: 0 auto 8px;
  padding: 0 20px;
}
.search-bar form {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-card);
}
.search-bar input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 0.92rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--text-primary);
}
.search-bar button {
  padding: 8px 20px;
  background: var(--accent-warm);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.search-bar button:hover { background: var(--accent-warm-light); }

/* ===== MONTH NAV ===== */
.month-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.month-nav::-webkit-scrollbar { display: none; }
.month-nav a {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  transition: all 0.2s;
  white-space: nowrap;
}
.month-nav a:hover { border-color: var(--accent-warm); color: var(--accent-warm); }
.month-nav a.current {
  background: var(--accent-warm);
  color: #fff;
  border-color: var(--accent-warm);
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.filter-bar .label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.filter-btn:hover { border-color: var(--accent-warm); color: var(--accent-warm); }
.filter-btn.active { background: var(--bg-label); color: #fff; border-color: var(--bg-label); }

/* ===== DATE GROUP ===== */
.date-group { margin-bottom: 28px; }
.date-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  position: sticky;
  top: 56px;
  background: var(--bg-primary);
  padding: 8px 0;
  z-index: 10;
}
.date-heading h2 {
  font-family: var(--font-accent);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.date-heading .day-badge {
  background: var(--accent-warm);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}
.date-heading .count {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.date-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

/* ===== BOOK CARD ===== */
.book-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.book-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  text-decoration: none;
  color: inherit;
}
.book-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  border-color: var(--accent-warm);
}
.book-card .book-title { color: var(--text-primary); }
.book-card:hover .book-title { color: var(--accent-warm); }
.book-cover {
  width: 80px;
  height: 115px;
  background: linear-gradient(135deg, #e8ddd0, #d6c9b8);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding: 6px;
  position: relative;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover .placeholder-text {
  font-family: var(--font-accent);
  font-size: 0.7rem;
  line-height: 1.4;
}
.book-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.book-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.label-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.label-kadokawa  { background: #fce8e8; color: #b33636; }
.label-shincho   { background: #e8f0e8; color: #3a6b3a; }
.label-kodansha  { background: #e8ecf4; color: #3a4e7a; }
.label-hayakawa  { background: #f0ecf4; color: #5a3a7a; }
.label-bunshun   { background: #fdf0e0; color: #8a6520; }
.label-chikuma   { background: #e8eff4; color: #3a5a7a; }
.label-iwanami   { background: #f4ece8; color: #7a4a3a; }
.label-shueisha  { background: #fce8ec; color: #a33645; }
.label-shogakukan{ background: #e8f4ec; color: #3a7a5a; }
.label-kobunsha  { background: #ecf0f8; color: #3a5a8a; }
.label-chuko     { background: #f0e8e0; color: #6a4a2a; }
.label-php       { background: #f4f0e8; color: #7a6a3a; }
.label-other     { background: #f0f0f0; color: #666666; }

.new-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--accent-warm);
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
}
.book-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 2px;
}
.book-title a { color: inherit; text-decoration: none; }
.book-title a:hover { color: var(--accent-warm); }
.book-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.book-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.book-price { color: var(--accent-warm); font-weight: 700; }
.book-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.btn-rakuten {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #bf0000;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font-body);
}
.btn-rakuten:hover { opacity: 0.85; }
.btn-amazon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ff9900;
  color: #111;
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font-body);
}
.btn-amazon:hover { opacity: 0.85; }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.sidebar-box h3 {
  font-family: var(--font-accent);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-warm);
}
.sidebar-links { list-style: none; }
.sidebar-links li { border-bottom: 1px solid var(--border-soft); }
.sidebar-links li:last-child { border-bottom: none; }
.sidebar-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 2px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-links a:hover { color: var(--accent-warm); }
.sidebar-links .count-badge {
  font-size: 0.7rem;
  background: var(--bg-accent);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* ===== RANKING LIST ===== */
.ranking-list {
  list-style: none;
  counter-reset: rank;
  padding: 0;
  margin: 0;
}
.ranking-list li {
  counter-increment: rank;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.ranking-list li:last-child { border-bottom: none; }
.ranking-list li::before {
  content: counter(rank);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-accent);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.ranking-list li:nth-child(1)::before { background: #d4a84b; color: #fff; }
.ranking-list li:nth-child(2)::before { background: #a0a0a0; color: #fff; }
.ranking-list li:nth-child(3)::before { background: #b87a4b; color: #fff; }
.ranking-list a {
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  display: block;
}
.ranking-list a:hover { color: var(--accent-warm); }
.ranking-list .rank-title {
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ranking-list .rank-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.ranking-list .rank-review {
  color: var(--accent-warm);
  font-weight: 600;
}

/* ===== CALENDAR ===== */
.calendar-box { padding: 18px; }
.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cal-nav h3 {
  font-family: var(--font-accent);
  font-size: 1rem;
  border: none;
  padding: 0;
  margin: 0;
}
.cal-nav button {
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.75rem;
}
.cal-hd {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0;
}
.cal-hd.sun { color: #c0392b; }
.cal-hd.sat { color: #2c5282; }
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  color: var(--text-muted);
}
.cal-cell.cm { color: var(--text-primary); }
.cal-cell.has-rel { background: var(--bg-accent); cursor: pointer; }
.cal-cell.has-rel:hover { background: var(--accent-warm); color: #fff; }
.cal-cell.is-today { outline: 2px solid var(--accent-warm); }
.cal-cell .day-number { font-weight: 700; }
.cal-cell .comic-count {
  font-size: 0.6rem;
  color: var(--accent-warm);
  font-weight: 600;
}
.cal-cell.has-rel:hover .comic-count { color: #fff; }

/* ===== INTERNAL LINK SECTION (SEO) ===== */
.seo-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 40px;
}
.seo-section h2 {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.label-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: var(--shadow-card);
}
.label-grid a:hover {
  border-color: var(--accent-warm);
  box-shadow: var(--shadow-hover);
}
.label-grid a .arrow {
  color: var(--text-muted);
  transition: transform 0.2s;
}
.label-grid a:hover .arrow {
  transform: translateX(3px);
  color: var(--accent-warm);
}

/* ===== TOP-PAGE SECTIONS ===== */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
}
.section-card h2 {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-card h2 .count-badge {
  background: var(--accent-warm);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
}
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--accent-warm);
  text-decoration: none;
  font-weight: 600;
}
.more-link:hover { text-decoration: underline; }

/* ===== BOOK TABLE (toggle view) ===== */
.book-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.book-table th, .book-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}
.book-table th { background: var(--bg-accent); color: var(--text-secondary); font-weight: 600; }
.book-table a { color: var(--text-primary); text-decoration: none; }
.book-table a:hover { color: var(--accent-warm); }

/* ===== ITEM DETAIL PAGE ===== */
.item-detail {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.item-detail .book-image-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.item-detail .cover-large {
  width: 200px;
  height: 286px;
  background: linear-gradient(135deg, #e8ddd0, #d6c9b8);
  border-radius: 6px;
  overflow: hidden;
}
.item-detail .cover-large img { width: 100%; height: 100%; object-fit: cover; }

/* 表紙下の購入ボタン群（控えめなアウトラインスタイル） */
.purchase-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 200px;
}
.purchase-buttons .btn {
  display: block;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.purchase-buttons .btn:hover { opacity: 0.88; transform: translateY(-1px); }
.purchase-buttons .btn-rakuten { background: #bf0000; color: #fff; }
.purchase-buttons .btn-amazon  { background: #ff9900; color: #111; }
.purchase-buttons .btn-kindle  { background: #232f3e; color: #fff; }

.item-detail h1 {
  font-family: var(--font-accent);
  font-size: 1.4rem;
  margin-bottom: 6px;
  line-height: 1.5;
}
.item-detail .author { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 14px; }
.item-detail .author a { color: var(--accent-warm); text-decoration: none; }
.item-detail .author a:hover { text-decoration: underline; }
.item-detail table.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 0.85rem;
}
.item-detail table.info-table th,
.item-detail table.info-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.item-detail table.info-table th {
  background: var(--bg-accent);
  font-weight: 600;
  color: var(--text-secondary);
  width: 100px;
  white-space: nowrap;
}
.item-detail .caption {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin: 14px 0;
  white-space: pre-wrap;
}

/* ===== モバイル底部 sticky CTA バー（PC では非表示） ===== */
.sticky-cta-bar { display: none; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-label);
  color: rgba(255,255,255,0.6);
  padding: 30px 20px;
  font-size: 0.78rem;
  text-align: center;
}
.site-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 6px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-card);
}
.pagination a:hover { border-color: var(--accent-warm); color: var(--accent-warm); }
.pagination .current { background: var(--accent-warm); color: #fff; border-color: var(--accent-warm); }

/* ===== RESPONSIVE ===== */

/* 画像はみ出し防止（共通） */
img { max-width: 100%; height: auto; }
/* 横スクロール防止（モバイルのみ。デスクトップの sticky を壊さないため html には適用しない） */
@media (max-width: 768px) {
  body { overflow-x: hidden; }
}

/* タブレット（〜960px）: サイドバー縮小 */
@media (max-width: 960px) {
  .main-layout { grid-template-columns: 1fr 240px; gap: 20px; padding: 0 16px 32px; }
  .seo-section, .page-hero, .breadcrumb, .month-nav, .search-bar { padding-left: 16px; padding-right: 16px; }
}

/* モバイル（〜768px） */
@media (max-width: 768px) {
  body { line-height: 1.7; }

  /* レイアウト */
  .main-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 12px 32px;
  }

  /* ヘッダー */
  .site-header { position: relative; } /* sticky をやめてページ高さを稼ぐ */
  .header-top {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 12px;
    align-items: center;
  }
  .site-logo { font-size: 1.0rem; gap: 6px; flex: 1; min-width: 0; }
  .site-logo .icon { font-size: 1.2rem; }
  .header-nav { gap: 2px; display: none; } /* モバイルではヘッダーリンクは隠してハンバーガーに集約 */
  .hamburger { width: 36px; height: 36px; margin-left: 4px; }
  .hamburger .hamburger-line { width: 18px; }

  /* パンくず */
  .breadcrumb { padding: 8px 12px; font-size: 0.72rem; line-height: 1.6; }
  .breadcrumb span { margin: 0 4px; }

  /* H1 */
  .page-hero { padding: 12px 12px 16px; }
  .page-hero h1 { font-size: 1.2rem; line-height: 1.5; }
  .page-hero .description { font-size: 0.82rem; line-height: 1.7; }

  /* 検索バー */
  .search-bar { padding: 0 12px; }
  .search-bar form { padding: 6px; gap: 6px; }
  .search-bar input[type="text"] { font-size: 0.88rem; padding: 8px 10px; min-width: 0; }
  .search-bar button { padding: 8px 14px; font-size: 0.82rem; flex-shrink: 0; }

  /* 月別ナビ */
  .month-nav { padding: 0 12px 12px; gap: 4px; }
  .month-nav a { padding: 6px 12px; font-size: 0.78rem; }

  /* フィルタバー */
  .filter-bar { gap: 6px; margin-bottom: 14px; }
  .filter-bar .label { font-size: 0.75rem; width: 100%; margin-bottom: 4px; }
  .filter-btn { padding: 6px 10px; font-size: 0.72rem; }

  /* 書籍カード */
  .book-card {
    grid-template-columns: 70px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .book-cover { width: 70px; height: 100px; }
  .book-title { font-size: 0.9rem; }
  .book-author { font-size: 0.74rem; margin-bottom: 4px; }
  .book-meta {
    gap: 6px 10px;
    font-size: 0.7rem;
    margin-bottom: 4px;
  }
  .book-meta span { display: inline-block; }
  .label-tag { font-size: 0.62rem; padding: 1px 6px; }
  .new-badge { font-size: 0.58rem; }

  /* セクションカード */
  .section-card { padding: 14px; margin-bottom: 16px; }
  .section-card h2 { font-size: 1rem; gap: 8px; flex-wrap: wrap; }

  /* 日付グルーピング見出し（stickyやめる→重なり防止） */
  .date-heading {
    position: static;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
  }
  .date-heading h2 { font-size: 0.95rem; }
  .date-heading .day-badge { font-size: 0.65rem; padding: 2px 8px; }
  .date-heading .count { font-size: 0.7rem; }

  /* レーベルグリッド */
  .label-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .label-grid a { padding: 10px 12px; font-size: 0.82rem; }
  .seo-section { padding: 0 12px 28px; }
  .seo-section h2 { font-size: 1.05rem; }

  /* サイドバー */
  .sidebar-box { padding: 14px; }
  .sidebar-box h3 { font-size: 0.9rem; }
  .sidebar-links a { padding: 10px 2px; font-size: 0.82rem; }

  /* カレンダー */
  .calendar-box, .cal-grid { font-size: 0.7rem; }
  .cal-cell { padding: 1px; }
  .cal-cell .day-number { font-size: 0.78rem; }
  .cal-cell .comic-count { font-size: 0.55rem; }
  .cal-nav h3 { font-size: 0.95rem; }

  /* 書籍詳細 */
  .item-detail {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    margin-bottom: 16px;
  }
  /* 画像エリア：縦並び（表紙→購入ボタン） */
  .item-detail .book-image-area {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .item-detail .cover-large {
    width: 160px;
    height: auto;
    aspect-ratio: 7 / 10;
    margin: 0 auto;
  }
  .item-detail .purchase-buttons {
    width: 100%;
    max-width: 280px;
  }
  .item-detail .purchase-buttons .btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  .item-detail h1 { font-size: 1.15rem; line-height: 1.5; text-align: left; }
  .item-detail .author { font-size: 0.85rem; margin-bottom: 10px; }
  .item-detail table.info-table { font-size: 0.78rem; }
  .item-detail table.info-table th { width: 80px; padding: 6px 8px; font-size: 0.75rem; }
  .item-detail table.info-table td { padding: 6px 8px; }
  .item-detail .caption { font-size: 0.82rem; line-height: 1.8; }

  /* モバイル底部 sticky CTA バー */
  .sticky-cta-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    z-index: 100;
  }
  .sticky-cta-bar .sticky-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
    text-align: center;
    padding: 0 8px;
  }
  .sticky-cta-bar .sticky-btn-rakuten { background: #bf0000; }
  .sticky-cta-bar .sticky-btn-amazon  { background: #ff9900; color: #111; }
  /* sticky CTA がある詳細ページのみ、フッターが隠れないよう余白を入れる */
  body:has(.sticky-cta-bar) { padding-bottom: 60px; }

  /* フッター */
  .site-footer { padding: 22px 14px; font-size: 0.72rem; }
  .footer-links { gap: 12px; font-size: 0.78rem; }
  .footer-links a { padding: 4px 0; }

  /* ページネーション */
  .pagination a, .pagination span { padding: 8px 12px; font-size: 0.78rem; min-width: 36px; text-align: center; }

  /* 検索フォーム（search.php）の2カラムを1カラムに */
  form[action="/bunko/search.php"] > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* 小型スマホ（〜480px） */
@media (max-width: 480px) {
  .header-top { padding: 8px 10px; }
  .site-logo { font-size: 0.98rem; }
  .header-nav a { font-size: 0.74rem; padding: 3px 8px; }

  .page-hero h1 { font-size: 1.05rem; }
  .page-hero .description { font-size: 0.78rem; }

  /* 書籍カードをコンパクトに */
  .book-card { grid-template-columns: 60px 1fr; gap: 10px; padding: 10px; }
  .book-cover { width: 60px; height: 86px; }
  .book-title { font-size: 0.85rem; line-height: 1.45; }
  .book-author { font-size: 0.72rem; }
  .book-meta { font-size: 0.66rem; gap: 4px 8px; }

  /* カレンダーセル */
  .cal-grid { gap: 2px; }
  .cal-cell { padding: 0; }
  .cal-cell .day-number { font-size: 0.72rem; }
  .cal-cell .comic-count { font-size: 0.5rem; line-height: 1.1; }
  .cal-hd { padding: 4px 0; font-size: 0.7rem; }

  /* セクションカードのパディング縮小 */
  .section-card { padding: 12px; }

  /* 詳細ページ（さらに小型スマホ用） */
  .item-detail { padding: 12px; }
  .item-detail .book-image-area { gap: 8px; }
  .item-detail .cover-large { width: 140px; }
  .item-detail .purchase-buttons { max-width: 240px; }
  .item-detail .purchase-buttons .btn { padding: 7px 8px; font-size: 0.75rem; }
  .item-detail h1 { font-size: 1.05rem; }

  /* SEOグリッド */
  .seo-section h2 { font-size: 1rem; margin-bottom: 12px; }

  /* フッターリンクは縦並びに近い形に */
  .footer-links { gap: 8px 14px; }
}
