/* 木の本棚と紙。見出しは明朝、本文はゴシック。アクセントは真鍮色 */
:root {
  --paper: #f5efe4; --card: #fffcf6; --ink: #2b2119; --sub: #77685a; --line: #e4d9c7;
  --wood: #2e1f15; --wood-2: #4a3221; --brass: #9a6a1f; --brass-soft: #f3e6cc; --star: #c48a1c;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.9; font-family: var(--gothic); }
.wrap { max-width: 760px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
a { color: var(--brass); }
h1, h2, h3 { font-family: var(--mincho); font-weight: 800; letter-spacing: .02em; text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.45; margin: 0 0 6px; }
h2 { font-size: 21px; margin: 44px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* ヘッダー：木の棚板 */
header.site { background: var(--wood); border-bottom: 4px solid var(--wood-2); }
header.site .wrap { display: flex; justify-content: space-between; align-items: center; padding-block: 14px; }
header.site a { color: #f5ead6; text-decoration: none; font-family: var(--mincho); font-weight: 800; font-size: 18px; letter-spacing: .08em; }
header.site nav a { font-family: var(--gothic); font-weight: 400; font-size: 13px; letter-spacing: 0; opacity: .85; }

/* ヒーロー：図書館の写真の上に白い明朝 */
.hero { position: relative; overflow: hidden; background: var(--wood) url(assets/hero.jpg) center 35% / cover no-repeat; color: #fbf4e6; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,20,13,.5), rgba(30,20,13,.82)); }
.hero-in { position: relative; z-index: 1; display: grid; gap: 14px; padding-block: 56px 44px; }
.hero h1 { font-size: clamp(28px, 6vw, 40px); color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero p { margin: 0; }
.hero .small { color: #e9dcc4; }
.hero .small b { color: #fff; }
.search { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.search input { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 17px; padding: 13px 16px; border: 0; border-radius: 6px; background: #fffcf6; color: var(--ink); }
.search button { font: inherit; font-size: 16px; font-weight: 700; padding: 13px 28px; border: 0; border-radius: 6px; background: var(--brass); color: #fff; cursor: pointer; }
.search button:disabled { opacity: .6; }
.search input:focus-visible, .search button:focus-visible, .hint:focus-visible { outline: 3px solid #e8c27a; outline-offset: 2px; }
.hints { font-size: 13px; color: #e9dcc4; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hint { font: inherit; font-size: 13px; background: rgba(255,252,246,.12); color: #fbf4e6; border: 1px solid rgba(255,252,246,.3); border-radius: 999px; padding: 2px 12px; cursor: pointer; }
.hint:hover { background: rgba(255,252,246,.22); }
.period { display: flex; flex-wrap: wrap; gap: 8px; }
.period label { border: 1px solid rgba(255,252,246,.35); border-radius: 6px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.period input { margin-right: 6px; accent-color: var(--brass); }
.period label:has(input:checked) { background: rgba(255,252,246,.16); border-color: #e8c27a; }
details.small summary { cursor: pointer; }
details input { width: 64px; font: inherit; }
.small { font-size: 13px; color: var(--sub); }

/* 検索結果 */
.status { margin: 28px 0 10px; font-size: 14px; color: var(--sub); }
.status b { color: var(--ink); font-size: 16px; }
.error { color: #a1301e; }
#mine h3 { font-size: 16px; margin: 32px 0 10px; }
.mine { display: grid; gap: 2px; background: var(--brass-soft); border: 1px solid #e2cb9c; border-radius: 6px; padding: 12px 16px; margin-bottom: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.mine b { font-family: var(--mincho); font-size: 16px; }
.result { display: grid; grid-template-columns: 80px 1fr; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-bottom: 10px; }
.result > div { min-width: 0; }
.result img { width: 80px; height: auto; box-shadow: 2px 3px 8px rgba(43,33,25,.25); }
.result h3 { font-size: 17px; margin: 0; line-height: 1.5; }
.stars { color: var(--star); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.review { font-size: 13px; padding: 4px 12px; border-radius: 4px; background: var(--brass-soft); color: #6e4a12; text-decoration: none; font-weight: 700; border: 1px solid #e2cb9c; }

/* テーマ・カード */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.theme { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--wood-2); border-radius: 4px; padding: 12px 14px; color: inherit; text-decoration: none; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.theme b { font-family: var(--mincho); }
.theme small { color: var(--sub); white-space: nowrap; }
.theme:hover, .card:hover, .mine:hover { border-color: var(--brass); }
.cards { display: grid; gap: 12px; margin-top: 16px; }
.card { display: grid; grid-template-columns: 72px 1fr; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px;
  color: inherit; text-decoration: none; font-size: 14px; line-height: 1.75; }
.card > span { min-width: 0; }
.card img { width: 72px; height: auto; box-shadow: 2px 3px 8px rgba(43,33,25,.25); }
.card b { display: block; font-family: var(--mincho); font-size: 16px; }
.card small { display: block; color: var(--sub); }
.card em { font-style: normal; font-size: 11px; background: var(--brass-soft); color: #6e4a12; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }

/* 本のページ */
.draft { background: var(--brass-soft); color: #6e4a12; text-align: center; padding: 6px; font-size: 13px; }
.crumb { font-size: 13px; color: var(--sub); } .crumb a { color: inherit; }
.book-head { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.book-head > div { min-width: 0; }
.book-head img { width: 150px; height: auto; box-shadow: 4px 6px 16px rgba(43,33,25,.3); }
.meta { font-size: 13px; color: var(--sub); margin: 2px 0; }
.rating span { color: var(--star); letter-spacing: 2px; }
.buy { display: inline-block; margin-top: 12px; color: #fff; background: var(--brass); padding: 9px 20px; border-radius: 6px; text-decoration: none; font-weight: 700; }
.buy.small { margin: 0; padding: 4px 12px; font-size: 13px; color: #fff; }
.oneline { font-family: var(--mincho); font-size: 19px; font-weight: 600; line-height: 1.8; margin: 32px 0 0; padding: 20px 22px; background: var(--card); border-left: 4px solid var(--brass); }
ul { padding-left: 1.3em; }
li + li { margin-top: 4px; }
.note { font-size: 13px; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; color: var(--wood-2); border: 1px solid var(--wood-2); border-radius: 999px; padding: 2px 12px; text-decoration: none; }
.owner { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; margin-top: 48px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.owner > div { min-width: 0; }
.owner img { width: 96px; height: 96px; }
.owner b { font-family: var(--mincho); font-size: 17px; }
.owner p { margin: 6px 0 0; font-size: 14px; color: var(--sub); }
footer { font-size: 12px; color: var(--sub); border-top: 1px solid var(--line); margin-top: 48px; }
@media (max-width: 520px) {
  .book-head { grid-template-columns: 96px 1fr; gap: 16px; } .book-head img { width: 96px; }
  .hero-in { padding-block: 40px 32px; }
}
@media (prefers-reduced-motion: no-preference) { .theme, .card, .mine { transition: border-color .15s; } }
