:root {
  --paper: #ECE8DE;
  --paper-deep: #E1DCCE;
  --ink: #1F2A44;
  --ink-soft: #4A5468;
  --stamp-red: #C33C2E;
  --line: #C9C2AE;
  --tag-a: #6B7A5E;
  --tag-b: #B4832A;
  --tag-c: #7A5B8C;
  --tag-d: #3E7C8C;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    linear-gradient(var(--paper) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper) 1px, transparent 1px);
  color: var(--ink);
  font-family: "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

a { color: inherit; }

/* --- 上部：アフィリエイト表記バナー --- */
.disclosure {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  text-align: center;
  padding: 6px 12px;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .disclosure {
    font-size: 0.62rem;
    padding: 5px 10px;
    line-height: 1.5;
  }
}

/* --- ヘッダー --- */
header {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  text-align: center;
}

.site-title {
  font-family: "Noto Serif JP", serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.06em;
  margin: 0;
}

.site-title a {
  text-decoration: none;
  color: inherit;
}

.site-sub {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

/* 判子風の日付スタンプ */
.stamp {
  position: absolute;
  top: 28px;
  right: 24px;
  width: 108px;
  height: 108px;
  border: 3px solid var(--stamp-red);
  border-radius: 50%;
  color: var(--stamp-red);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-9deg);
  font-family: "Noto Serif JP", serif;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  mix-blend-mode: multiply;
  opacity: 0.9;
  text-decoration: none;
}
.stamp .y { font-size: 0.72rem; display: block; }
.stamp .md { font-size: 1.35rem; display: block; }
.stamp .dow { font-size: 0.72rem; display: block; }

@media (max-width: 640px) {
  .stamp { position: static; margin: 20px auto 0; }
}

/* --- サイト内ナビゲーション（カレンダー・アーカイブへの導線） --- */
.site-nav {
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
}

.site-nav a:hover {
  background: var(--ink);
  color: var(--paper);
}

/* --- 目次（出版社アンカー） --- */
nav.toc {
  max-width: 960px;
  margin: 0 auto 8px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
nav.toc a {
  text-decoration: none;
  font-size: 0.82rem;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.date-notice {
  max-width: 960px;
  margin: 0 auto 20px;
  padding: 0 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--stamp-red);
}

/* --- 日付ナビゲーション --- */
.date-nav {
  max-width: 960px;
  margin: 0 auto 28px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.date-nav a,
.date-nav span.disabled {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.date-nav a:hover {
  background: var(--ink);
  color: var(--paper);
}

.date-nav span.disabled {
  opacity: 0.35;
  cursor: default;
}

.date-nav .current {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 4px;
  border: none;
  background: none;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

/* --- 出版社セクション --- */
.publisher {
  margin-top: 52px;
  scroll-margin-top: 20px;
}

.publisher-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.publisher-head .bar {
  width: 10px;
  height: 22px;
  background: var(--accent, var(--tag-a));
  flex: none;
}

.publisher-head h2 {
  font-family: "Noto Serif JP", serif;
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: 0.03em;
}

.publisher-head .count {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.titles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 640px) {
  .titles {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
  }
}

.card {
  background: #F5F2E9;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent, var(--tag-a));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: color-mix(in srgb, var(--accent, var(--tag-a)) 18%, #F5F2E9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card .thumb-fallback {
  font-family: "Noto Serif JP", serif;
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--accent, var(--tag-a));
  opacity: 0.6;
}

.card .body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card .title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
}

.card .author {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.card .price {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* --- サムネイル内のリンク：クリック（タップ）で表示 --- */
.card .links {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 6px;
  position: absolute;
  inset: 0;
  padding: 10px;
  background: rgba(31, 42, 68, 0);
  opacity: 0;
  transition: background 0.18s, opacity 0.18s;
  pointer-events: none;
}

.card .thumb.show-links .links {
  background: rgba(31, 42, 68, 0.72);
  opacity: 1;
  pointer-events: auto;
}

.card .thumb {
  cursor: pointer;
}

.card .links a {
  text-decoration: none;
  font-size: 0.72rem;
  text-align: center;
  padding: 6px 10px;
  flex: 1 1 auto;
  min-width: fit-content;
  white-space: nowrap;
  border: 1px solid var(--paper);
  color: var(--paper);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}

.card .links a:hover {
  background: var(--paper);
  color: var(--ink);
}

/* タップできることが分かるよう、閉じているときも右下に小さくヒントアイコンを出す */
.card .thumb:not(.show-links)::after {
  content: "🔗";
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.85rem;
  background: rgba(31, 42, 68, 0.55);
  color: var(--paper);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}


.empty, .error {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 20px;
}

/* --- アーカイブ一覧 --- */
.archive-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.archive-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.archive-list li a {
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink);
  font-size: 0.9rem;
}

.archive-list li a:hover {
  background: var(--ink);
  color: var(--paper);
}

.back-link {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px 0;
}

.back-link a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
}

/* --- 発売予定カレンダー --- */
.cal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 20px;
}

.cal-month-title {
  font-family: "Noto Serif JP", serif;
  font-size: 1.2rem;
  text-align: center;
  margin: 32px 0 12px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
  padding-bottom: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: 1px solid transparent;
  color: var(--ink-soft);
}

.cal-cell.has-release {
  background: var(--paper-deep);
  border-color: var(--line);
}

.cal-cell.has-release a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.cal-cell.has-release a:hover {
  background: var(--ink);
  color: var(--paper);
}

.cal-cell .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--stamp-red);
  margin-top: 2px;
}

.cal-cell.today {
  box-shadow: inset 0 0 0 2px var(--stamp-red);
}

.cal-cell.current-day {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.cal-cell.current-day .dot {
  background: var(--paper);
}

/* --- フッター：規約系 --- */
footer {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 48px 24px 60px;
}

footer .inner {
  max-width: 720px;
  margin: 0 auto;
}

footer h3 {
  font-family: "Noto Serif JP", serif;
  font-size: 1rem;
  margin: 28px 0 8px;
}
footer h3:first-child { margin-top: 0; }

footer p {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.copyright {
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 32px;
}
