/* ============================================
   CAFE BOOK TEMPLATE
   ブックカフェ — 生成りの紙×墨×紺インク×しおりの赤
   一冊の本の体裁（扉・目次・章・図版・脚注・奥付）で組む
============================================ */

:root {
  /* Color */
  --paper: #f2ede2; /* 生成りの紙 */
  --paper-deep: #e8e0cf; /* 少し焼けた紙 */
  --paper-light: #f8f5ee;
  --sumi: #2a2724; /* 墨（文字） */
  --ink: #24345a; /* 紺のインク */
  --ink-light: #dfe3ec;
  --ribbon: #a3362e; /* しおりの赤 */
  --muted: #6c6458;
  --line: rgba(42, 39, 36, 0.2);
  --line-soft: rgba(42, 39, 36, 0.1);

  /* Font */
  --font-body: "BIZ UDPMincho", "Hiragino Mincho ProN", serif;
  --font-head: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --font-en: "EB Garamond", "Times New Roman", serif;

  --container: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --header-h: 72px;
  --section-space: clamp(80px, 11vw, 150px);

  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--paper);
  color: var(--sumi);
  line-height: 2;
  letter-spacing: 0.05em;
  overflow-x: hidden;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

figure {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

section[id] {
  scroll-margin-top: var(--header-h);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 400;
  padding: 8px 16px;
  background: var(--sumi);
  color: var(--paper);
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: var(--section-space) 0 0;
}

/* 見出しは意味の切れ目で改行（自動の折り返しで単語を割らない） */
h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 500;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

/* 栞の先の切れ込み */

/* ============================================
   Header / 目次ナビ
============================================ */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 300;
  height: var(--header-h);
  background: rgba(242, 237, 226, 0.94);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.header.is-scrolled {
  border-bottom-color: var(--line);
}

.header__inner {
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.logo__sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2em;
}

.logo__main {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.24em;
}

.toc-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px 0 12px;
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: 0.3em;
}

.toc-toggle__lines {
  display: grid;
  gap: 5px;
  width: 22px;
}

.toc-toggle__lines i {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.toc-toggle__lines i:nth-child(2) {
  width: 70%;
}

.nav__title {
  display: none;
}

.nav__list {
  display: flex;
  gap: clamp(14px, 1.8vw, 26px);
}

.nav__list a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 0;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav__list b {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 12px;
  color: var(--ribbon);
}

.nav__list a:hover {
  color: var(--ink);
}

/* PCのヘッダーには主な章だけ出す（全部は目次パネルに） */
.nav__list .is-sub {
  display: none;
}

@media (max-width: 1023px) {
  .toc-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
    background: var(--paper);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .nav__title {
    display: block;
    font-family: var(--font-head);
    font-size: 22px;
    letter-spacing: 0.6em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sumi);
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
    max-width: 520px;
  }

  .nav__list .is-sub {
    display: block;
  }

  .nav__list a {
    gap: 16px;
    padding: 13px 0;
    font-size: 17px;
    border-bottom: 1px dotted var(--line);
  }

  .nav__list b {
    min-width: 1.5em;
    font-size: 15px;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .toc-toggle__lines i:nth-child(1) {
    transform: translateY(6px) rotate(35deg);
  }

  body.nav-open .toc-toggle__lines i:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .toc-toggle__lines i:nth-child(3) {
    transform: translateY(-6px) rotate(-35deg);
  }
}

/* ============================================
   柱（ページ上部の章名と頁数）
============================================ */
.folio {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  margin-bottom: clamp(36px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.15em;
}

.folio span:last-child {
  font-family: var(--font-en);
  font-size: 15px;
}

/* 章見出し（左寄せ・章番号は赤、説明は小さく） */
.chapter-head {
  margin-bottom: clamp(32px, 5vw, 56px);
}

.chapter-head__num {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 14px;
  color: var(--ribbon);
  letter-spacing: 0.3em;
  padding-left: 18px;
  position: relative;
  margin-bottom: 4px;
}

.chapter-head__num::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--ribbon);
}

.chapter-head__title {
  font-size: clamp(28px, 4.2vw, 42px);
  letter-spacing: 0.14em;
  line-height: 1.5;
}

.chapter-head__title small {
  font-size: 0.5em;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.chapter-head__note {
  max-width: 34em;
  margin-top: 14px;
  font-size: 15px;
  color: var(--muted);
}

/* ============================================
   扉（ヒーロー）
============================================ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-h);
}

.hero__plate {
  position: relative;
  padding: clamp(20px, 3vw, 40px);
  padding-right: 0;
  display: flex;
  flex-direction: column;
}

.hero__plate img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  filter: sepia(0.18) saturate(0.85);
}

.hero__plate figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.hero__page {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto;
  column-gap: clamp(28px, 4vw, 56px);
  align-content: center;
  padding: clamp(48px, 7vw, 96px) clamp(28px, 6vw, 88px);
}

/* 扉の上から下がる栞 */
.hero__ribbon {
  position: absolute;
  top: 0;
  right: clamp(36px, 7vw, 96px);
  width: 14px;
  height: clamp(140px, 28vh, 260px);
  background: var(--ribbon);
}

.hero__ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  border-left: 7px solid var(--ribbon);
  border-right: 7px solid var(--ribbon);
  border-bottom: 7px solid transparent;
}

.hero__genre {
  grid-column: 1 / -1;
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: 0.5em;
  color: var(--muted);
  margin-bottom: 24px;
}

.hero__title {
  grid-row: 2 / 5;
  writing-mode: vertical-rl;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 700;
  line-height: 1;
}

.hero__title-main {
  font-size: clamp(64px, 8vw, 104px);
  letter-spacing: 0.18em;
}

.hero__title-kana {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.5em;
  color: var(--muted);
}

.hero__copy {
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-family: var(--font-head);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.9;
  letter-spacing: 0.1em;
  align-self: end;
}

.hero__lead {
  margin-top: 20px;
  font-size: 15px;
  max-width: 24em;
}

.hero__imprint {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 32px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* ============================================
   目次
============================================ */
.toc {
  padding: clamp(72px, 10vw, 128px) 0 0;
}

.toc__inner {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  max-width: 920px;
}

.toc__title {
  font-size: 22px;
  letter-spacing: 0.8em;
}

.toc__list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  text-decoration: none;
  transition: color 0.2s;
}

.toc__list b {
  flex: none;
  width: 4.2em;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 14px;
  color: var(--ribbon);
}

.toc__name {
  font-size: 16px;
}

/* 点線のリーダー */
.toc__list i {
  flex: 1;
  min-width: 24px;
  border-bottom: 1px dotted var(--muted);
  transform: translateY(-5px);
}

.toc__page {
  font-family: var(--font-en);
  font-size: 17px;
  min-width: 2ch;
  text-align: right;
}

.toc__list a:hover {
  color: var(--ink);
}

/* ============================================
   序 はじめに
============================================ */
.preface__grid {
  display: grid;
  grid-template-columns: auto minmax(0, 30em) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.preface__title {
  writing-mode: vertical-rl;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: 0.2em;
  line-height: 1.8;
  height: 12em;
}

.preface__body p + p {
  margin-top: 1.4em;
}

.preface__body p {
  text-indent: 1em;
}

.preface__sign {
  text-align: right;
  text-indent: 0 !important;
  font-size: 14px;
  color: var(--muted);
}

.preface__sign span {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--sumi);
  letter-spacing: 0.2em;
}

.preface__facts {
  display: grid;
  gap: 18px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.preface__facts dt {
  font-size: 13px;
  color: var(--muted);
}

.preface__facts dd {
  font-family: var(--font-en);
  font-size: 34px;
  line-height: 1.2;
  color: var(--ink);
}

.preface__facts small {
  font-family: var(--font-body);
  font-size: 14px;
  margin-left: 2px;
  color: var(--sumi);
}

/* ============================================
   第一章 品書き
============================================ */
.menu__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.menu__cat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 19px;
  letter-spacing: 0.12em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--sumi);
  margin-bottom: 6px;
}

.menu__cat em {
  font-family: var(--font-en);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.menu__list + .menu__cat,
.menu__tip + .menu__cat {
  margin-top: 40px;
}

.menu__list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
}

.menu__name {
  font-size: 16px;
  line-height: 1.6;
}

.menu__name small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.menu__list i {
  flex: 1;
  min-width: 16px;
  border-bottom: 1px dotted var(--muted);
  align-self: center;
}

.menu__price {
  font-family: var(--font-en);
  font-size: 18px;
  white-space: nowrap;
}

.menu__tip {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink);
}

.menu__plate {
  margin-top: 40px;
}

.menu__plate img,
.beans__plate img,
.plate img {
  width: 100%;
  object-fit: cover;
  filter: sepia(0.12) saturate(0.9);
}

.menu__plate figcaption,
.beans__plate figcaption,
.plate figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ============================================
   第二章 時間割
============================================ */
.hours .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.timetable {
  border-top: 2px solid var(--sumi);
  border-bottom: 2px solid var(--sumi);
}

.timetable__row {
  display: grid;
  grid-template-columns: 80px 190px minmax(0, 1fr);
  align-items: baseline;
  gap: 24px;
  padding: 26px 0;
}

.timetable__row + .timetable__row {
  border-top: 1px solid var(--line);
}

.timetable__period {
  font-family: var(--font-head);
  font-size: 26px;
  color: var(--ink);
}

.timetable__time {
  font-family: var(--font-en);
  font-size: 24px;
  letter-spacing: 0.02em;
}

.timetable__time span {
  margin: 0 6px;
  color: var(--muted);
}

.timetable__body h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.timetable__body p {
  font-size: 15px;
  max-width: 36em;
}

/* 金曜の夜だけ紺の地に */
.timetable__row--night {
  background: var(--ink);
  color: var(--paper);
  padding-left: 20px;
  padding-right: 20px;
  margin: 0 -20px;
}

.timetable__row--night .timetable__period {
  color: var(--paper);
}

.timetable__row--night .timetable__time span {
  color: var(--ink-light);
}

/* ============================================
   第三章 豆と素材（脚注）
============================================ */
.beans__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.beans__plate img {
  aspect-ratio: 5 / 6;
}

.beans__body {
  font-size: 17px;
  line-height: 2.2;
}

.beans__body sup {
  font-size: 12px;
  line-height: 0;
  margin-left: 1px;
}

.beans__body sup a {
  color: var(--ribbon);
  text-decoration: none;
  padding: 2px;
}

.footnotes {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--sumi);
  width: 100%;
}

.footnotes li {
  display: grid;
  grid-template-columns: 3em minmax(0, 1fr);
  font-size: 14px;
  line-height: 1.85;
  padding: 6px 0;
  color: var(--muted);
}

.footnotes b {
  font-weight: 400;
  color: var(--ribbon);
}

.footnotes li:target {
  background: var(--paper-deep);
}

.beans__shop {
  margin-top: 28px;
  font-size: 15px;
}

.beans__shop a {
  color: var(--ink);
  text-underline-offset: 4px;
}

/* ============================================
   第四章 今月の選書（背表紙）
============================================ */
.shelf__wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
}

.shelf__books {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 12px;
  min-height: 300px;
  border-bottom: 10px solid var(--sumi); /* 棚板 */
}

.spine {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 16px 0 12px;
  width: var(--w, 48px);
  height: var(--h, 240px);
  background: var(--c, var(--ink));
  color: var(--paper);
  border-radius: 2px 2px 0 0;
  transition: transform 0.35s var(--ease);
}

.spine span {
  writing-mode: vertical-rl;
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: 0.2em;
  line-height: 1;
}

/* 背表紙の上下の帯 */
.spine::before,
.spine::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.spine::before {
  top: 8px;
}

.spine::after {
  bottom: 6px;
}

.spine:hover {
  transform: translateY(-4px);
}

.spine[aria-selected="true"] {
  transform: translateY(-18px);
}

.spine--1 { --c: #24345a; --h: 230px; --w: 44px; }
.spine--2 { --c: #b8a46a; --h: 190px; --w: 38px; color: var(--sumi); }
.spine--3 { --c: #2a2724; --h: 270px; --w: 54px; }
.spine--4 { --c: #a3362e; --h: 246px; --w: 46px; }
.spine--5 { --c: #d9cfb9; --h: 212px; --w: 50px; color: var(--sumi); }
.spine--6 { --c: #5f6f6a; --h: 180px; --w: 40px; }
.spine--7 { --c: #6b4a3a; --h: 236px; --w: 42px; }

.book-card {
  position: relative;
  padding: 32px clamp(24px, 3vw, 40px) 28px;
  background: var(--paper-light);
  border: 1px solid var(--line);
}

/* 本に挟んだ栞 */
.book-card::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 28px;
  width: 10px;
  height: 52px;
  background: var(--ribbon);
}

.book-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 13px;
  color: var(--muted);
}

.book-card__title {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.14em;
  margin: 6px 0 14px;
}

.book-card__comment {
  font-size: 16px;
  min-height: 6em;
}

.book-card__by {
  margin-top: 16px;
  text-align: right;
  font-size: 14px;
  color: var(--ink);
}

.book-card.is-changing .book-card__title,
.book-card.is-changing .book-card__comment {
  opacity: 0;
}

.book-card__title,
.book-card__comment {
  transition: opacity 0.25s;
}

/* ============================================
   第五章 席と設備
============================================ */
.seats__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.floor svg {
  width: 100%;
  height: auto;
  color: var(--sumi);
  background: var(--paper-light);
}

.floor__furniture {
  fill: var(--paper-deep);
  stroke: var(--sumi);
  stroke-width: 1;
}

.floor__shelf {
  fill: var(--sumi);
}

.floor__counter {
  fill: var(--ink);
}

.floor__seat circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
}

.floor__num {
  font-family: var(--font-head);
  font-size: 18px;
  fill: var(--ribbon);
}

.floor__label {
  font-size: 15px;
  fill: var(--muted);
}

.floor__label--light {
  fill: var(--paper);
}

.floor figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.seats__legend li {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.seats__legend li:first-child {
  padding-top: 0;
}

.seats__legend b {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 20px;
  color: var(--ribbon);
  line-height: 1.5;
}

.seats__legend h3 {
  font-size: 17px;
}

.seats__legend p {
  font-size: 15px;
  color: var(--muted);
}

.facilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--sumi);
}

.facilities > div {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
}

.facilities dt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 16px;
  min-width: 7.5em;
}

.facilities svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.facilities dd {
  font-size: 14px;
  color: var(--muted);
}

.facilities em {
  font-style: normal;
  font-family: var(--font-head);
  color: var(--ribbon);
  margin-right: 6px;
  font-size: 16px;
}

/* ============================================
   第六章 お願い（PCは縦書き）
============================================ */
.rules {
  background: linear-gradient(var(--paper), var(--paper)) top / 100% var(--section-space) no-repeat,
    var(--paper-deep);
  padding-bottom: clamp(64px, 9vw, 120px);
}

.rules .folio {
  border-bottom-color: rgba(42, 39, 36, 0.3);
}

.rules__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.rules__list {
  writing-mode: vertical-rl;
  height: 23em;
  font-family: var(--font-head);
  font-size: 18px;
  line-height: 2.4;
  letter-spacing: 0.12em;
  justify-self: end;
  max-width: 100%;
}

.rules__list li {
  padding-left: 0.6em;
}

.rules__list b {
  font-weight: 500;
  color: var(--ribbon);
}

/* ============================================
   第七章 図版（ギャラリー）
============================================ */
.plates__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.plate--a {
  grid-column: 1 / 6;
  grid-row: 1 / 3;
}

.plate--a img {
  aspect-ratio: 4 / 5;
}

.plate--b {
  grid-column: 7 / 13;
}

.plate--b img {
  aspect-ratio: 10 / 7;
}

.plate--c {
  grid-column: 8 / 12;
}

.plate--c img {
  aspect-ratio: 1;
}

.plate--d {
  grid-column: 2 / 11;
  margin-top: clamp(8px, 2vw, 24px);
}

.plate--d img {
  aspect-ratio: 7 / 4;
}

.plate figcaption b {
  font-weight: 400;
  color: var(--ribbon);
  margin-right: 10px;
}

.insta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: center;
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.insta__text {
  font-size: 15px;
}

.insta__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 17px;
  text-underline-offset: 5px;
}

.insta__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.insta__grid a {
  display: block;
  overflow: hidden;
}

.insta__grid img {
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(0.4) sepia(0.2);
  transition: filter 0.3s;
}

.insta__grid a:hover img {
  filter: none;
}

/* ============================================
   第八章 お知らせ・カレンダー
============================================ */
.news__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.news__list li {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.news__list li:last-child {
  border-bottom: 1px solid var(--line);
}

.news__list time {
  font-family: var(--font-en);
  font-size: 18px;
  color: var(--ink);
  line-height: 1.7;
}

.news__list time small {
  font-family: var(--font-body);
  font-size: 12px;
  margin-left: 4px;
  color: var(--muted);
}

.news__list p {
  font-size: 15px;
}

/* 手帳のような月間カレンダー */
.calendar {
  padding: 24px clamp(16px, 3vw, 28px) 20px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
}

.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar__title {
  font-size: 19px;
  letter-spacing: 0.1em;
}

.calendar__title span {
  font-family: var(--font-en);
  font-size: 1.3em;
  margin-right: 2px;
}

.calendar__nav {
  width: 44px;
  height: 44px;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background 0.2s;
}

.calendar__nav:hover {
  background: var(--ink-light);
}

.calendar__nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.calendar__week,
.calendar__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar__week {
  border-bottom: 1px solid var(--sumi);
  font-size: 13px;
  text-align: center;
  padding-bottom: 4px;
}

.calendar__week span:first-child {
  color: var(--ribbon);
}

.calendar__days span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-family: var(--font-en);
  font-size: 17px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.calendar__days .is-closed {
  color: var(--paper);
  background: var(--ribbon);
  background-clip: content-box;
  padding: 4px;
}

.calendar__days .is-short::after,
.calendar__days .is-event::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 16px;
  height: 2px;
  margin-left: -8px;
  background: var(--ink);
}

.calendar__days .is-event::after {
  height: 5px;
  width: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
}

.calendar__days .is-today {
  outline: 1px solid var(--sumi);
  outline-offset: -4px;
}

.calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.calendar__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar__legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
}

.calendar__legend .is-closed {
  background: var(--ribbon);
}

.calendar__legend .is-short {
  height: 2px;
  background: var(--ink);
}

.calendar__legend .is-event {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.calendar__notes {
  margin-top: 10px;
  font-size: 14px;
}

.calendar__notes li {
  padding: 4px 0;
  border-top: 1px dotted var(--line);
}

.calendar__notes b {
  font-family: var(--font-en);
  font-weight: 400;
  font-size: 16px;
  margin-right: 8px;
  color: var(--ink);
}

/* ============================================
   付録 ご予約と持ち帰り
============================================ */
.appendix__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 64px);
}

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

/* 図書カードのような短冊 */
.slip {
  position: relative;
  display: grid;
  gap: 2px;
  height: 100%;
  min-height: 120px;
  padding: 18px 20px 18px 26px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.slip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--ink);
  transition: background 0.25s;
}

.slip:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.slip:hover::before {
  background: var(--ribbon);
}

.slip__label {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 15px;
  color: var(--ribbon);
}

.slip__main {
  font-family: var(--font-head);
  font-size: 18px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.slip__note {
  font-size: 13px;
  color: var(--muted);
}

.appendix__takeout {
  margin-top: 32px;
  padding: 14px 0;
  border-top: 1px dotted var(--muted);
  border-bottom: 1px dotted var(--muted);
  font-size: 15px;
}

/* ============================================
   奥付（アクセス）
============================================ */
.colophon {
  padding-bottom: var(--section-space);
}

.colophon__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: stretch;
}

.colophon__card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--sumi);
  outline: 1px solid var(--sumi);
  outline-offset: -7px;
}

.colophon__title {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.2em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sumi);
}

.colophon__edition {
  font-size: 14px;
  margin: 14px 0 18px;
  color: var(--muted);
}

.colophon__list > div {
  display: grid;
  grid-template-columns: 5em minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  font-size: 15px;
  line-height: 1.8;
}

.colophon__list dt {
  color: var(--muted);
  letter-spacing: 0.3em;
}

.colophon__list a {
  color: var(--ink);
  text-underline-offset: 4px;
}

.colophon__map {
  min-height: 360px;
  border: 1px solid var(--line);
}

.colophon__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  filter: grayscale(0.7) sepia(0.15);
}

/* ============================================
   Footer
============================================ */
.footer {
  background: var(--sumi);
  color: var(--paper);
  padding: 48px 0 40px;
}

.footer__inner {
  display: grid;
  gap: 8px;
}

.footer__name {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.3em;
}

.footer__note {
  font-size: 14px;
  opacity: 0.8;
}

.footer__copy {
  font-family: var(--font-en);
  font-size: 13px;
  opacity: 0.6;
}

.footer__copy small {
  font-size: inherit;
}

/* ============================================
   スクロールリビール（JSが html に .js-book を付けたときだけ隠す）
============================================ */
.js-book [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js-book [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================
   Responsive
============================================ */
@media (max-width: 1023px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero__plate {
    padding: 16px var(--gutter) 0;
  }

  .hero__plate img {
    flex: none;
    aspect-ratio: 16 / 10;
  }

  .hero__page {
    padding: 48px var(--gutter) 24px;
  }

  .hero__ribbon {
    display: none;
  }

  .preface__grid {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .preface__facts {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-left: 0;
    padding-top: 20px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .menu__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .menu__plate {
    grid-column: 1 / -1;
    margin-top: 0;
    max-width: 520px;
  }

  .menu__plate img {
    aspect-ratio: 16 / 10;
  }

  .shelf__wrap,
  .seats__grid,
  .rules__grid,
  .appendix__grid,
  .colophon__grid,
  .news__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .news__grid .calendar {
    max-width: 480px;
  }

  .floor {
    max-width: 560px;
  }

  .facilities {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* タブレット以下は縦書きをやめて横組みに */
  .rules__list {
    writing-mode: horizontal-tb;
    height: auto;
    justify-self: stretch;
    font-size: 17px;
    line-height: 1.9;
  }

  .rules__list li {
    display: grid;
    grid-template-columns: 2.2em minmax(0, 1fr);
    padding: 12px 0;
    border-bottom: 1px solid rgba(42, 39, 36, 0.15);
  }

  .insta {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  body {
    font-size: 15px;
  }

  .hero__plate img {
    aspect-ratio: 4 / 3;
  }

  .hero__page {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 22px;
    padding-top: 36px;
  }

  .hero__genre {
    margin-bottom: 16px;
  }

  .hero__title-main {
    font-size: 58px;
  }

  .hero__lead {
    grid-column: 1 / -1;
    margin-top: 24px;
  }

  .hero__imprint {
    grid-column: 1 / -1;
  }

  .toc__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .toc__list b {
    width: 3.6em;
    font-size: 13px;
  }

  .toc__name {
    font-size: 15px;
  }

  .preface__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .preface__title {
    writing-mode: horizontal-tb;
    height: auto;
    font-size: 26px;
  }

  .preface__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preface__facts dd {
    font-size: 30px;
  }

  .menu__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .timetable__row {
    grid-template-columns: 3.4em minmax(0, 1fr);
    gap: 4px 14px;
    padding: 20px 0;
  }

  .timetable__time {
    font-size: 21px;
  }

  .timetable__period {
    font-size: 21px;
    white-space: nowrap;
  }

  .timetable__body {
    grid-column: 2;
  }

  .timetable__row--night {
    padding-left: 14px;
    padding-right: 14px;
    margin: 0 -14px;
  }

  .beans__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .beans__plate img {
    aspect-ratio: 4 / 3;
  }

  .beans__body {
    font-size: 16px;
  }

  /* 背表紙は少し細く、7冊が375pxに収まるように */
  .shelf__books {
    gap: 4px;
    padding: 0 4px;
    min-height: 240px;
    justify-content: center;
  }

  .spine {
    width: calc(var(--w, 48px) * 0.8);
    height: calc(var(--h, 240px) * 0.8);
  }

  .spine span {
    font-size: 14px;
    letter-spacing: 0.12em;
  }

  .spine[aria-selected="true"] {
    transform: translateY(-12px);
  }

  .facilities {
    grid-template-columns: minmax(0, 1fr);
  }

  .plates__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px 12px;
  }

  .plate--a {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .plate--a img {
    aspect-ratio: 4 / 3;
  }

  .plate--b {
    grid-column: 1 / -1;
  }

  .plate--c {
    grid-column: 1 / 5;
  }

  .plate--d {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .insta__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appendix__links {
    grid-template-columns: minmax(0, 1fr);
  }

  .slip {
    min-height: 0;
  }

  .colophon__list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .colophon__map,
  .colophon__map iframe {
    min-height: 300px;
  }
}

/* ============================================
   動きを減らす設定
============================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js-book [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
