/* 熙樂 Ciel — 共用章節頁首 V2（首頁、價目表）
 * 共用 DOM：.story-book-page > header.story-chapter >
 *   figure.story-chapter-figure > img.story-chapter-art
 *   div.story-chapter-title > h1.story-chapter-heading
 * 全部在同一處控制，不再由兩個頁面的舊 CSS 分別決定。
 */
:root {
  --ciel-paper:#fbf0db;
  --ciel-ink:#704b35;
  --ciel-muted-ink:#85664c;
  --ciel-soft-border:rgba(182,141,102,.37);
  --ciel-sage:#718258;
  --ciel-title-family:'Iansui','DFKai-SB','STKaiti',serif;
  --ciel-body-family:'Huninn','Microsoft JhengHei',sans-serif;
  --ciel-content-leading:1.85;
  --ciel-card-radius:24px;
}

/* Same frame material behind both artwork and page content.
   The image has a transparent watercolor fade, so a different frame
   background visibly changed its colors even when image dimensions matched. */
#view-home .cmp-b-book.story-book-page,
#view-pricing .pbst-frame.story-book-page,
#view-promo .promo-frame.story-book-page ,
#view-notices .notices-frame.story-book-page {
  position:relative;
  width:min(100%,970px) !important;
  max-width:970px !important;
  margin:0 auto !important;
  padding:0 0 1rem !important;
  border:1px solid rgba(186,144,98,.42) !important;
  border-radius:26px !important;
  overflow:hidden !important;
  isolation:isolate;
  background:
    radial-gradient(ellipse at 5% 18%,rgba(236,194,168,.12),transparent 29rem),
    radial-gradient(ellipse at 90% 77%,rgba(184,202,164,.12),transparent 32rem),
    url('../images/paper-wash.webp') center top / 100% auto repeat-y,
    var(--ciel-paper) !important;
  box-shadow:0 14px 34px rgba(107,76,45,.09) !important;
}

/* Shared header markup, dimensions and underlay across all designed chapters. */
#view-home .story-book-page > .story-chapter,
#view-pricing .story-book-page > .story-chapter,
#view-promo .story-book-page > .story-chapter ,
#view-notices .story-book-page > .story-chapter {
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  align-items:center !important;
  gap:0 !important;
  position:relative !important;
  width:100% !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible !important;
  background:transparent !important;
  isolation:isolate;
}
#view-home .story-chapter-figure,
#view-pricing .story-chapter-figure,
#view-promo .story-chapter-figure ,
#view-notices .story-chapter-figure {
  display:block !important;
  position:relative !important;
  flex:0 0 auto !important;
  width:100% !important;
  height:auto !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
  background:var(--ciel-paper) !important;
}
#view-home .story-chapter-art,
#view-pricing .story-chapter-art,
#view-promo .story-chapter-art ,
#view-notices .story-chapter-art {
  display:block !important;
  position:relative !important;
  inset:auto !important;
  width:100% !important;
  height:auto !important;
  max-width:none !important;
  max-height:none !important;
  aspect-ratio:auto !important;
  object-fit:contain !important;
  object-position:center center !important;
  opacity:.95 !important;
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 90%,rgba(0,0,0,.75) 95%,transparent 100%) !important;
  mask-image:linear-gradient(to bottom,#000 0%,#000 90%,rgba(0,0,0,.75) 95%,transparent 100%) !important;
  pointer-events:none;
}
#view-home .story-chapter-title,
#view-pricing .story-chapter-title,
#view-promo .story-chapter-title ,
#view-notices .story-chapter-title {
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  position:relative !important;
  isolation:isolate;
  flex:0 0 auto !important;
  width:min(86%,710px) !important;
  max-width:min(86%,710px) !important;
  min-width:0 !important;
  min-height:clamp(120px,11vw,130px) !important;
  height:auto !important;
  padding:.75rem 1.45rem !important;
  margin:-3px auto 0 !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  background:url('../images/organic-plaque-v2.webp') center / 100% 100% no-repeat !important;
  transform:rotate(-.16deg) !important;
  text-align:center !important;
  color:var(--ciel-ink) !important;
}
#view-home .story-chapter-title::before,
#view-pricing .story-chapter-title::before,
#view-promo .story-chapter-title::before ,
#view-notices .story-chapter-title::before {
  content:none !important;
  display:none !important;
}
#view-home .story-chapter-heading,
#view-pricing .story-chapter-heading,
#view-promo .story-chapter-heading ,
#view-notices .story-chapter-heading {
  display:block !important;
  width:auto !important;
  max-width:100% !important;
  min-width:0 !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:none !important;
  box-shadow:none !important;
  font-family:var(--ciel-title-family) !important;
  font-size:clamp(1.6rem,6.15vw,3.45rem) !important;
  font-weight:400 !important;
  font-style:normal !important;
  line-height:1.34 !important;
  letter-spacing:.04em !important;
  color:var(--ciel-ink) !important;
  text-shadow:0 1px 1px rgba(255,250,237,.9) !important;
  white-space:normal !important;
  overflow-wrap:anywhere;
  text-wrap:balance;
}
#view-home .story-chapter + .cmp-b-preamble,
#view-pricing .story-chapter + .pbst-contents {
  margin-top:0 !important;
  padding-top:.55rem !important;
}

@media(max-width:767px) {
  #view-home .story-chapter-title,
  #view-pricing .story-chapter-title,
#view-promo .story-chapter-title ,
#view-notices .story-chapter-title {
    width:90% !important;
    max-width:90% !important;
    min-height:93px !important;
    padding:.8rem 1rem !important;
  }
  #view-home .story-chapter-heading,
  #view-pricing .story-chapter-heading,
#view-promo .story-chapter-heading ,
#view-notices .story-chapter-heading {
    font-size:clamp(1.52rem,6.2vw,2.13rem) !important;
    line-height:1.36 !important;
    letter-spacing:.022em !important;
  }
  #view-home .story-chapter + .cmp-b-preamble,
  #view-pricing .story-chapter + .pbst-contents {
    padding-top:.35rem !important;
  }
}
@media(max-width:359px) {
  #view-home .story-chapter-title,
  #view-pricing .story-chapter-title,
#view-promo .story-chapter-title ,
#view-notices .story-chapter-title {
    padding-inline:.75rem !important;
    min-height:91px !important;
  }
  #view-home .story-chapter-heading,
  #view-pricing .story-chapter-heading,
#view-promo .story-chapter-heading ,
#view-notices .story-chapter-heading {
    font-size:1.52rem !important;
    letter-spacing:.014em !important;
  }
}
@media(prefers-reduced-motion:reduce) {
  #view-home .story-chapter,
  #view-pricing .story-chapter,
#view-promo .story-chapter ,
#view-notices .story-chapter {
    transition:none !important;
  }
}
/* Non-home chapters: retain the shared parchment title, omit the repeated hero artwork. */
#view-promo .story-chapter--title-only,
#view-notices .story-chapter--title-only {
  padding-top:clamp(.75rem,2.5vw,1.6rem) !important;
}
#view-promo .story-chapter--title-only .story-chapter-title,
#view-notices .story-chapter--title-only .story-chapter-title {
  margin:0 auto !important;
}

/* Reserve homepage hero geometry before the image has decoded (CLS prevention). */
#view-home .story-chapter-art { aspect-ratio: 1024 / 650 !important; }
