:root {
  --paper: #f7f0e3; --paper-2: #efe4d0; --card: #fffdf8; --ink: #2b2623; --sub: #6f6258; --line: #e3d6c1;
  --accent: #c4553a; --accent-2: #a9432b; --accent-soft: #f6dfd6;
  --work: #6f9177; --people: #c4553a; --love: #d68aa0; --kids: #d7a13f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  font-weight: 500; line-height: 1.75; letter-spacing: 0.02em;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(43, 38, 35, 0.06) 1px, transparent 1.4px);
  background-size: 18px 18px;
}
a { color: inherit; }
.pr { margin: 0 0 16px; color: var(--sub); font-size: 11px; line-height: 1.6; }
.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; }

/* はじめの絵と見出し */
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; padding: 28px 0 0; }
.kicker { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: 14px; }
h1 { margin: 0; font-size: clamp(44px, 12vw, 84px); font-weight: 900; line-height: 1.05; letter-spacing: 0.04em; }
h1 .small { display: block; font-size: 0.42em; letter-spacing: 0.12em; color: var(--sub); }
.lead { margin: 14px 0 8px; max-width: 30em; color: var(--sub); font-size: 15px; }
.ig {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--card); font-weight: 700; font-size: 14px; text-decoration: none; box-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap;
}
.ig:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.hero-akari { position: relative; margin: 0; width: clamp(112px, 28vw, 150px); }
.hero-akari img { display: block; width: 100%; height: auto; }
.bubble {
  position: absolute; top: 4%; right: 78%; width: max-content; max-width: 11em; padding: 10px 14px;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--card); font-size: 13px; font-weight: 700; line-height: 1.5;
}
.bubble::after {
  content: ""; position: absolute; right: -10px; top: 18px; width: 14px; height: 14px; background: var(--card);
  border-right: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: rotate(45deg);
}

/* 悩みの棚（絞り込み） */
.shelves-bar { position: sticky; top: 0; z-index: 5; margin-top: 10px; padding: 12px 0; background: linear-gradient(var(--paper) 78%, rgba(247,240,227,0)); }
.shelves { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.shelves::-webkit-scrollbar { display: none; }
.shelf {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--ink);
  border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.shelf small { min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: var(--paper-2); font-size: 12px; text-align: center; }
.shelf.on { background: var(--ink); color: var(--card); }
.shelf.on small { background: rgba(255,255,255,.18); }
.shelf::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--ink); }
.shelf.work::before { background: var(--work); } .shelf.people::before { background: var(--people); }
.shelf.love::before { background: var(--love); } .shelf.kids::before { background: var(--kids); }
.shelf[data-filter="all"]::before { display: none; }
.wood { height: 12px; margin: 0 0 22px; border-radius: 6px; background: linear-gradient(#c79b6d, #a87a4f); box-shadow: 0 4px 0 #8a6240; }

/* 本の札 */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; padding-bottom: 12px; }
.book {
  position: relative; display: flex; flex-direction: column; padding: 20px 18px 18px 26px; border: 2px solid var(--ink);
  border-radius: 20px; background: var(--card); box-shadow: 5px 5px 0 var(--ink);
}
.book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; border-radius: 18px 0 0 18px; background: var(--accent); }
.book.work::before { background: var(--work); } .book.people::before { background: var(--people); }
.book.love::before { background: var(--love); } .book.kids::before { background: var(--kids); }
.book[hidden] { display: none; }
.ask { margin: 0; color: var(--sub); font-size: 13px; font-weight: 700; }
.worry { margin: 2px 0 14px; font-size: 21px; font-weight: 900; line-height: 1.45; }
.body { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.cover { display: block; width: 96px; height: auto; border-radius: 4px; box-shadow: 0 6px 14px rgba(43,38,35,.28); }
.titlecard {
  display: flex; align-items: center; justify-content: center; width: 96px; aspect-ratio: 600 / 860; padding: 8px;
  border: 2px solid var(--ink); border-radius: 4px; background: var(--paper-2); font-size: 12px; font-weight: 900; line-height: 1.4; text-align: center;
}
.meta .title { margin: 0; font-size: 16px; font-weight: 900; line-height: 1.5; }
.meta .by { margin: 4px 0 8px; color: var(--sub); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.axis, .chip { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.axis { background: var(--paper-2); }
.chip { background: var(--accent-soft); color: var(--accent-2); }
.note { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: start; margin: 16px 0; }
.face { width: 48px; height: 48px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; object-fit: cover; }
.note p {
  position: relative; margin: 0; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--paper);
  font-size: 14px; line-height: 1.7;
}
.buy {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border: 2px solid var(--ink);
  border-radius: 14px; background: var(--accent); color: #fff; font-weight: 900; font-size: 16px; text-decoration: none; box-shadow: 3px 3px 0 var(--ink);
}
.buy:hover { background: var(--accent-2); }
.buy:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.buy:focus-visible, .shelf:focus-visible, .ig:focus-visible { outline: 3px solid var(--kids); outline-offset: 3px; }

/* 準備中の棚 */
.empty { display: grid; justify-items: center; gap: 6px; padding: 26px 16px 34px; text-align: center; color: var(--sub); }
.empty img { width: min(260px, 70%); height: auto; }
.empty p { margin: 0; font-weight: 700; }
.empty[hidden] { display: none; }

footer { margin-top: 30px; padding: 26px 0 40px; border-top: 2px dashed var(--line); color: var(--sub); font-size: 12px; line-height: 1.8; }
footer p { margin: 0 0 6px; }
footer strong { color: var(--ink); }

@media (max-width: 419px) {
  .bubble { display: none; }  /* スマホの幅では見出しに重なるので出さない */
}
@media (max-width: 359px) {
  /* 狭い画面：あかりと見出しを小さくして折り返しを防ぐ */
  .ig { font-size: 12px; padding: 7px 12px; }
  .hero-akari { width: 84px; }
  h1 { font-size: 36px; }
  h1 .small { font-size: 13px; letter-spacing: 0.04em; }
  .kicker { font-size: 12px; }
}
h1, h1 .small { word-break: keep-all; }
@media (min-width: 760px) {
  .hero { padding-top: 48px; }
  .lead { font-size: 16px; }
  .worry { font-size: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  .book { animation: rise .5s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* 本のページ */
.crumbs { margin: 18px 0 0; font-size: 12px; color: var(--sub); }
.crumbs a { color: var(--sub); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.article { max-width: 680px; margin: 0 auto; padding-bottom: 12px; }
.article-head { padding: 22px 0 8px; }
.article-head h1 { font-size: clamp(26px, 7vw, 40px); line-height: 1.4; letter-spacing: 0.02em; }
.talk { display: grid; gap: 16px; margin: 18px 0 26px; }
.talk section { padding: 16px 18px; border: 2px solid var(--ink); border-radius: 18px; background: var(--card); }
.talk h2 { margin: 0 0 6px; font-size: 13px; font-weight: 900; color: var(--accent); }
.talk p { margin: 0; font-size: 16px; line-height: 1.9; }
.talk .turn { background: var(--accent-soft); }
.article .book { margin-bottom: 22px; }
.article .book .title { font-size: 18px; }
.more { display: flex; justify-content: center; margin: 8px 0 0; }
.more a { font-weight: 700; }
.book .title a { text-decoration: none; }
.book .title a:hover { text-decoration: underline; }
.readmore { display: block; margin: -4px 0 14px; font-size: 13px; font-weight: 700; color: var(--accent-2); }
.about { margin-top: 34px; padding: 20px 18px; border-radius: 18px; background: var(--paper-2); }
.about h2 { margin: 0 0 8px; font-size: 16px; font-weight: 900; }
.about p { margin: 0 0 8px; font-size: 14px; color: var(--sub); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.worry a { text-decoration: none; }
.worry a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
