/* 絵本の表紙の CSS。替えたのは3か所だけ：
   1. html と body の両方に overflow-x:hidden を付けない → body だけ overflow-x:clip（上の帯 sticky が効くように）
   2. .stage の高さ calc(100svh - 46px) → calc(var(--vh-lock-100, 100svh) - 46px)（がたつかない作り・vh-lock）
   3. 栞の列の高さを 49px に決めた（押したときに表紙が上下に動かない。0.3.0）
   本の下・動きを控えめにする設定・栞のページの形は site.css。 */
:root {
  --desk-top: #f3ece2;
  --desk-bottom: #ddd0be;
  --linen-base: #e6dbcd;
  --paper-cream: #faf6ef;
  --ink-main: #43362c;
  --ink-soft: #6c5b4d;
  --ink-muted: #93806f;
  --gold-foil: #9a7b4f;
  --gold-light: #c9ae82;
  --light-intensity: 1;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink-main);
  font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  background:
    radial-gradient(
      circle at 50% 44%,
      rgba(255, 224, 168, 0.36) 0%,
      rgba(239, 230, 218, 0.44) 48%,
      rgba(212, 198, 179, 0.88) 100%
    ),
    linear-gradient(165deg, var(--desk-top) 0%, var(--desk-bottom) 100%);
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: clip; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.26;
  background-image:
    radial-gradient(rgba(90, 70, 50, 0.06) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 0);
  background-size: 22px 22px, 17px 17px;
  background-position: 0 0, 9px 11px;
}

/* ========== TOP BAR ========== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(250, 246, 239, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(154, 123, 79, 0.18);
}

.brand-mini {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand-mini-en {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-main);
  white-space: nowrap;
}
.brand-mini-pill {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold-foil);
  background: rgba(154, 123, 79, 0.1);
  border: 1px solid rgba(154, 123, 79, 0.25);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* ========== STAGE ========== */
.stage {
  position: relative;
  z-index: 1;
  min-height: calc(var(--vh-lock-100, 100svh) - 46px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 20px;
}

.book-stage-wrap {
  position: relative;
  width: min(95vw, 620px);
}

.cover-shell {
  position: relative;
  width: 100%;
}

/* ===== 8 OVERLAPPING ANTIQUE COTTON-PAPER BOOKMARKS (アンティーク栞 × 8) ===== */
.bookmark-row-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 14px 10px 0;
  margin-bottom: -1px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 94%, transparent 100%);
}
.bookmark-row-wrap::-webkit-scrollbar {
  display: none;
}
.bookmark-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  width: max-content;
  height: 49px; /* いちばん高い栞（今のページ）と同じ。押した栞と前の栞が同時に伸び縮みしても、表紙が上下に動かない（0.3.0） */
  padding: 0 76% 0 4px;
}

.bookmark-tab {
  position: relative;
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(84px, 22.5vw, 104px);
  height: calc(37px - var(--bm-depth, 0) * 1.2px);
  padding: 5px 10px 4px;
  border-radius: 6px 6px 0 0;
  border: 1px solid rgba(146, 118, 82, 0.38);
  border-bottom: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(104, 82, 56, 0.03) 0px,
      rgba(104, 82, 56, 0.03) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.16) 0px,
      rgba(255, 255, 255, 0.16) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(180deg, var(--bm-top, #f3eadc) 0%, var(--bm-bot, #e2d4be) 100%);
  color: #634d36;
  font-family: "Shippori Mincho", serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow:
    4px 2px 7px rgba(54, 36, 18, 0.22),
    -2px 1px 4px rgba(54, 36, 18, 0.08),
    inset 0 1px 0 rgba(255, 253, 248, 0.80);
  filter: brightness(calc(1 - var(--bm-depth, 0) * 0.03));
  transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease, background 0.22s ease, color 0.22s ease, border-color 0.25s ease;
}
.bookmark-tab + .bookmark-tab {
  margin-left: -12px;
}

/* Inner fine antique gilt border */
.bookmark-tab::before {
  content: "";
  position: absolute;
  inset: 3px 3px 0 3px;
  border-radius: 3px 3px 0 0;
  border: 1px solid rgba(154, 122, 78, 0.24);
  border-bottom: none;
  pointer-events: none;
}

/* Recessed pocket shadow where bookmarks tuck behind the top edge */
.bookmark-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: linear-gradient(180deg, transparent 0%, rgba(56, 38, 20, 0.18) 100%);
  pointer-events: none;
}

.bm-pin {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  margin-bottom: 4px;
  background: rgba(154, 120, 72, 0.62);
  box-shadow: 0 1px 0 rgba(255, 252, 245, 0.7);
  flex-shrink: 0;
}
.bm-label {
  display: block;
  text-shadow: 0 1px 0 rgba(255, 252, 244, 0.55);
}

.bookmark-tab:hover {
  border-color: rgba(142, 108, 64, 0.58);
  color: #48341f;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(104, 82, 56, 0.025) 0px,
      rgba(104, 82, 56, 0.025) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(180deg, #faf4ea 0%, #ede0cc 100%);
}

.bookmark-tab.is-active {
  height: 49px;
  padding-bottom: 8px;
  color: #3f2b16;
  font-weight: 600;
  border-color: rgba(142, 106, 58, 0.72);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(104, 82, 56, 0.025) 0px,
      rgba(104, 82, 56, 0.025) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(180deg, #fdfaf3 0%, #f1e6d4 100%);
  box-shadow:
    5px 2px 10px rgba(52, 34, 16, 0.26),
    -3px 2px 8px rgba(52, 34, 16, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  filter: brightness(1);
  z-index: 30 !important;
}
.bookmark-tab.is-active::before {
  border-color: rgba(154, 120, 72, 0.48);
}
.bookmark-tab.is-active .bm-pin {
  background: #9a7642;
  width: 4px;
  height: 4px;
}

/* Cohesive 3-tone antique cotton-paper harmony */
.bm-c1, .bm-c4, .bm-c7 { --bm-top: #f2e9db; --bm-bot: #e2d4be; }
.bm-c2, .bm-c5, .bm-c8 { --bm-top: #eee3d8; --bm-bot: #dccbb9; }
.bm-c3, .bm-c6         { --bm-top: #ece8de; --bm-bot: #dad2c3; }

/* ===== MAIN TACTILE LINEN COVER WITH REAL BOOK PAGE-STACK THICKNESS & SILKY CROSS-FADE ===== */
.linen-cover {
  position: relative;
  z-index: 5;
  width: 100%;
  aspect-ratio: 754 / 946;
  border-radius: 10px 14px 14px 10px;
  background-color: var(--linen-base);
  box-shadow:
    -6px 18px 40px rgba(67, 50, 34, 0.22),
    0 3px 8px rgba(67, 50, 34, 0.12),
    4px 4px 0 -1px #f7f1e7,
    5px 5px 0 0 #d5c5b0,
    8px 8px 0 -1px #f1e8da,
    9px 9px 0 0 #cbb89f,
    12px 12px 0 -1px #ebe0ce,
    13px 13px 0 0 #bfa98e,
    16px 20px 30px rgba(67, 50, 34, 0.18);
  text-align: center;
  overflow: hidden;
}

/* Dual-layer cross-fade images (zero flicker, zero white flash!) */
.cover-photo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
#cover-img-next {
  opacity: 0;
  transition: opacity 0.56s cubic-bezier(0.22, 1, 0.36, 1);
}
#cover-img-next.is-visible {
  opacity: 1;
}

/* Subtle warm LED glow radiating softly from the center oval frame */
.cover-center-glow {
  position: absolute;
  left: 50%;
  top: 49.5%;
  width: 34%;
  height: 28%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(
    circle,
    rgba(255, 224, 150, 0.36) 0%,
    rgba(255, 198, 114, 0.14) 55%,
    transparent 78%
  );
  animation: ledBreath 5.2s ease-in-out infinite;
}
@keyframes ledBreath {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 1; }
}

/* Top debossed linen title */
.cover-overlay-top {
  position: absolute;
  top: 2.2%;
  left: 22%;
  right: 22%;
  z-index: 6;
  pointer-events: none;
  text-align: center;
}
.cover-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.22rem, 3.0vw, 1.68rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(94, 68, 38, 0.9);
  margin: 0;
  line-height: 1.02;
  mix-blend-mode: multiply;
  text-shadow:
    0 1px 0 rgba(255, 250, 240, 0.62),
    0 -0.8px 0.8px rgba(46, 30, 14, 0.32);
}
.cover-subtitle {
  font-size: clamp(0.64rem, 1.45vw, 0.74rem);
  letter-spacing: 0.22em;
  color: rgba(110, 82, 48, 0.88);
  margin: 3px 0 0;
  mix-blend-mode: multiply;
  text-shadow:
    0 1px 0 rgba(255, 250, 240, 0.55),
    0 -0.6px 0.6px rgba(46, 30, 14, 0.24);
}

/* Bottom debossed linen chapter label with smooth fade */
.cover-overlay-bottom {
  position: absolute;
  bottom: 2.4%;
  left: 20%;
  right: 20%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.cover-genres {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(0.92rem, 2.3vw, 1.12rem);
  font-weight: 600;
  color: rgba(82, 56, 28, 0.95);
  letter-spacing: 0.22em;
  mix-blend-mode: multiply;
  text-shadow:
    0 1px 0 rgba(255, 250, 240, 0.62),
    0 -0.8px 0.8px rgba(42, 26, 12, 0.34);
  transition: opacity 0.28s ease;
}
.cover-genres.is-fading {
  opacity: 0;
}
.cover-genres::before,
.cover-genres::after {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 82, 48, 0.55), transparent);
}

/* Gentle centered LINE CTA shown cleanly below the book ONLY when 「ご予約」 bookmark is active */
.reserve-cta-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  min-height: 46px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.reserve-cta-bar.is-shown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.cta-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid #6b5235;
  background: linear-gradient(180deg, #6e563d 0%, #55402c 100%);
  color: #fbf7f1;
  font-family: "Shippori Mincho", serif;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 8px 20px rgba(67, 50, 34, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  text-align: center;
}
.cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(67, 50, 34, 0.28);
}

@media (max-width: 780px) {
  .brand-mini-pill {
    display: none;
  }
  .stage {
    padding: 6px 6px 18px;
  }
  .linen-cover {
    border-radius: 10px;
  }
  .cover-overlay-top {
    top: 2.0%;
    left: 20%;
    right: 20%;
  }
  .cover-overlay-bottom {
    bottom: 2.2%;
    left: 18%;
    right: 18%;
  }
}
  
