/* ============================================================
   WORKS page + 漫画リーダー (2026-09-23 新設)
   トークンは style.css の :root をそのまま使う
   ============================================================ */

/* ---------- page head ---------- */
.works-head-section { padding: calc(var(--header-h) + 56px) 0 56px; }
.works-head-section .section-head { margin-bottom: 20px; }
.works-crumb {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.works-crumb a { color: var(--gold); }
.works-crumb a:hover { text-decoration: underline; }
.works-crumb span { margin: 0 10px; }
.works-lead { color: var(--text-dim); font-size: 17px; max-width: 640px; }

.global-nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

.works-block { padding: 96px 0; }
.works-block .works-sub-title { margin-bottom: 40px; }

/* ---------- book feature ---------- */
.book-feature { grid-template-columns: minmax(0, 0.8fr) 1fr; }
.book-cover {
  display: block;
  width: 100%;
  max-width: 420px;
  justify-self: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
}
.book-cover img {
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -22px rgba(36, 31, 24, 0.55);
  transition: transform 0.3s ease-out;
}
.book-cover:hover img { transform: translateY(-4px); }
.book-cover:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; }
.book-feature .btn { cursor: pointer; }
.works-note-after { margin-top: 14px; }
.work-actions button.btn { font-family: var(--font-body); }

.works-upcoming { margin-bottom: 0; }

/* ============ reader ============ */
html.reader-open { overflow: hidden; }

.reader {
  --r-bg: #16130F;
  --r-fg: #F4EFE5;
  --r-dim: #B5AA98;
  --r-gold: #C9A25A;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: var(--r-bg);
  color: var(--r-fg);
  display: none;
  flex-direction: column;
  overscroll-behavior: contain;
}
.reader[open] { display: flex; }
.reader::backdrop { background: rgba(22, 19, 15, 0.92); }

.reader-bar {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 44px;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 12px 0 20px;
  border-bottom: 1px solid rgba(201, 162, 90, 0.22);
}
.reader-title {
  font-family: var(--font-mincho);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-count {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--r-dim);
}
.reader-close {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--r-fg);
  cursor: pointer;
}
.reader-close:hover { color: var(--r-gold); }

.reader-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 88px;
  touch-action: pan-y pinch-zoom;
  container-type: size;
}
/* 絵は3:4。ステージの縦横どちらにも収まる最大サイズにする */
.reader-sheet {
  width: min(100cqw, 75cqh);
  aspect-ratio: 3 / 4;
  position: relative;
}
.reader-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: opacity 0.18s ease-out;
}
.reader-img.is-loading { opacity: 0.25; }

.reader-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 64px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(244, 239, 229, 0.06);
  border: 1px solid rgba(201, 162, 90, 0.35);
  color: var(--r-fg);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.1em;
  transition: background 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}
.reader-arrow:hover { background: rgba(201, 162, 90, 0.2); color: #fff; }
.reader-arrow:focus-visible { outline: 2px solid var(--r-gold); outline-offset: 2px; }
.reader-arrow:disabled { opacity: 0.2; cursor: default; background: none; }
.reader-next { left: 12px; }
.reader-prev { right: 12px; }

.reader-end {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px;
  text-align: center;
  border: 1px solid rgba(201, 162, 90, 0.35);
  background: #1F1B15;
}
.reader-end[hidden] { display: none; }
.reader-end h2 {
  font-family: var(--font-mincho);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.16em;
  color: var(--r-gold);
}
.reader-end p { font-size: 15px; color: var(--r-dim); max-width: 26em; line-height: 1.9; }
.reader-end-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 280px; }
.reader-end .btn { text-align: center; cursor: pointer; }
.reader-end .btn-line { color: var(--r-fg); border-color: rgba(201, 162, 90, 0.6); }
.reader-end .btn-line:hover { background: rgba(201, 162, 90, 0.15); }

.reader-foot {
  flex: none;
  padding: 8px 24px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.reader-slider {
  width: min(560px, 100%);
  accent-color: var(--r-gold);
  cursor: pointer;
}
.reader-hint { font-size: 12px; color: var(--r-dim); letter-spacing: 0.06em; }
.reader-hint-sp { display: none; }

@media (prefers-reduced-motion: reduce) {
  .reader-img, .book-cover img { transition: none; }
  .book-cover:hover img { transform: none; }
}

@media (max-width: 860px) {
  .works-head-section { padding: calc(var(--header-h) + 36px) 0 36px; }
  .works-block { padding: 72px 0; }
  .works-block .works-sub-title { flex-direction: column; gap: 2px; margin-bottom: 28px; }
  .works-block .works-sub-title span { font-size: 15px; }
  .book-feature { grid-template-columns: 1fr; }
  .book-cover { max-width: 320px; }

  .reader-bar { height: 48px; padding: 0 4px 0 16px; gap: 10px; }
  .reader-title { font-size: 14px; }
  .reader-count { font-size: 13px; }
  .reader-stage { padding: 6px 0; }
  /* スマホは画面いっぱいに絵を出し、矢印は絵の上に小さく重ねる */
  .reader-arrow {
    width: 40px; height: 72px;
    background: rgba(22, 19, 15, 0.55);
    border-color: rgba(201, 162, 90, 0.25);
  }
  .reader-arrow span { display: none; }
  .reader-next { left: 4px; }
  .reader-prev { right: 4px; }
  .reader-foot { padding: 6px 16px 10px; }
  .reader-hint-pc { display: none; }
  .reader-hint-sp { display: inline; }
}
