
/* MOMONCHY COVER SYSTEM — authoritative bookshelf/cover rules.
   All cover geometry lives here. Do not add cover fixes to stories.css. */
:root{--m-cover-radius:10px 18px 18px 10px;--m-cover-shadow:0 0 0 1px rgba(105,95,103,.08),7px 11px 20px rgba(55,43,52,.13)}
.m-book-entry{display:flex!important;flex-direction:column!important;align-items:center!important;text-align:center!important;gap:0!important;min-width:0!important}
.m-book{position:relative!important;display:block!important;width:100%!important;height:auto!important;aspect-ratio:210/257!important;overflow:hidden!important;border:3px solid #fff!important;border-radius:var(--m-cover-radius)!important;background:#0d65bd!important;box-shadow:var(--m-cover-shadow)!important;transform:none!important;color:#fff!important;text-decoration:none!important;isolation:isolate!important}
.m-book:hover{transform:translateY(-4px)!important;box-shadow:0 0 0 1px rgba(105,95,103,.08),9px 15px 25px rgba(55,43,52,.18)!important}
.m-book::before{content:""!important;position:absolute!important;left:0!important;top:0!important;bottom:0!important;width:7px!important;background:linear-gradient(90deg,rgba(40,39,55,.20),rgba(255,255,255,.18) 48%,rgba(255,255,255,0))!important;z-index:8!important;pointer-events:none!important}
.m-book::after{display:none!important;content:none!important}
.m-book__cover{position:absolute!important;inset:0!important;display:block!important;padding:0!important;overflow:hidden!important;border-radius:6px 14px 14px 6px!important;background-image:linear-gradient(rgba(0,22,68,.025),rgba(0,22,68,.025)),var(--m-cover-bg,url("../img/covers/book_cover_base.png"))!important;background-position:center center!important;background-size:cover!important;background-repeat:no-repeat!important}
.m-book__series{position:absolute!important;z-index:5!important;top:14px!important;left:12px!important;right:12px!important;display:block!important;margin:0!important;width:auto!important;text-align:center!important;font-family:Georgia,"Times New Roman",serif!important;font-size:10px!important;line-height:1.1!important;letter-spacing:.18em!important;font-weight:700!important;color:rgba(255,245,249,.95)!important;text-shadow:0 1px 5px rgba(1,29,78,.35)!important}
.m-book__title{position:absolute!important;z-index:5!important;top:34px!important;left:12px!important;right:12px!important;display:block!important;width:auto!important;max-width:none!important;min-height:2.55em!important;margin:0!important;padding:0 3px!important;text-align:center!important;font-family:var(--site-font-round,"Hiragino Sans","Yu Gothic",Meiryo,sans-serif)!important;font-size:clamp(18px,1.65vw,23px)!important;line-height:1.27!important;font-weight:700!important;color:#fff!important;text-shadow:0 1px 3px rgba(0,28,74,.56),0 3px 12px rgba(0,28,74,.28)!important;white-space:normal!important;word-break:keep-all!important;overflow-wrap:normal!important}
.m-book__character{position:absolute!important;z-index:4!important;left:50%!important;right:auto!important;bottom:8%!important;width:58%!important;height:48%!important;max-width:none!important;max-height:none!important;transform:translateX(-50%)!important;object-fit:contain!important;opacity:1!important;filter:drop-shadow(0 8px 11px rgba(5,28,62,.18))!important}
.m-book__no{position:absolute!important;z-index:5!important;right:10px!important;bottom:8px!important;top:auto!important;display:block!important;font-family:var(--site-font-body,"Yu Gothic",Meiryo,sans-serif)!important;font-size:11px!important;line-height:1!important;font-weight:700!important;color:rgba(255,255,255,.88)!important}
.m-book.small,.m-book.mini{width:100%!important;height:auto!important;aspect-ratio:210/257!important}
.m-book.large,.m-book--featured{width:min(296px,100%)!important;height:auto!important;aspect-ratio:210/257!important}
.m-book.large .m-book__title,.m-book--featured .m-book__title{font-size:clamp(22px,2vw,28px)!important;top:36px!important}
.m-book.large .m-book__series,.m-book--featured .m-book__series{font-size:11px!important;top:15px!important}
.m-book.large .m-book__character,.m-book--featured .m-book__character{width:60%!important;height:50%!important}
/* First book is the same cover template; it simply uses no character image. */
#firstBookCover.m-book{transform:none!important}
#firstBookCover .cover-group-full,#firstBookCover .cover-trio,#firstBookCover .cover-whisper{display:none!important}
#firstBookCover .m-book__cover{background-image:linear-gradient(rgba(0,22,68,.025),rgba(0,22,68,.025)),var(--m-cover-bg,url("../img/covers/story_forest_bg.png"))!important}
/* Metadata order is always: title → CTA/status → description. */
.m-book-meta{display:flex!important;flex-direction:column!important;align-items:center!important;width:100%!important;padding-top:15px!important;text-align:center!important}
.m-book-meta__title{order:1!important;display:block!important;margin:0!important;font-size:17px!important;line-height:1.45!important;font-weight:700!important;color:#5d493f!important}
.m-book-meta__cta,.m-book-meta__status{order:2!important;margin-top:10px!important;margin-bottom:0!important}
.m-book-meta__desc{order:3!important;margin:10px 0 0!important;max-width:95%!important;font-size:14px!important;line-height:1.85!important;color:#927f83!important}
/* Archive grids use exactly the same cover component. */
.original-library-grid .m-book,.provisional-library-grid .m-book{width:100%!important}
.original-library-grid .m-book__title,.provisional-library-grid .m-book__title{font-size:clamp(19px,1.7vw,23px)!important}
/* Character shelves inherit the same geometry, while keeping their existing grid behavior. */
.bookcase .m-book,.mini-bookcase .m-book,.forest-bookcase .m-book{width:100%!important}
.bookcase .m-book__title{font-size:clamp(19px,1.7vw,23px)!important}
.mini-bookcase .m-book__title,.forest-bookcase .m-book__title{font-size:clamp(17px,1.45vw,21px)!important}
@media(max-width:720px){
  .m-book__series{top:12px!important;font-size:9px!important}
  .m-book__title{top:30px!important;font-size:18px!important;line-height:1.25!important}
  .m-book-meta{padding-top:13px!important}
  .m-book-meta__title{font-size:16px!important}
  .m-book.large,.m-book--featured{width:min(72vw,270px)!important}
  .m-book.large .m-book__title,.m-book--featured .m-book__title{top:33px!important;font-size:23px!important}
}

/* AUTHORITATIVE OVERRIDES
   stories.css still contains historical cover rules. These selectors deliberately
   outrank them so all future cover changes live in this file only. */
html body .book-object.m-book{
  width:100%!important;height:auto!important;aspect-ratio:210/257!important;
  border:3px solid #fff!important;border-radius:var(--m-cover-radius)!important;
  overflow:hidden!important;background:#0d65bd!important;box-shadow:var(--m-cover-shadow)!important;
  transform:none!important;color:#fff!important;
}
html body .book-object.m-book.large,
html body .book-object.m-book.m-book--featured{width:min(296px,100%)!important;height:auto!important;aspect-ratio:210/257!important}
html body .book-object.m-book .book-cover-inner.m-book__cover{
  position:absolute!important;inset:0!important;padding:0!important;overflow:hidden!important;
  border-radius:6px 14px 14px 6px!important;
  background-image:linear-gradient(rgba(0,22,68,.025),rgba(0,22,68,.025)),var(--m-cover-bg,url("../img/covers/book_cover_base.png"))!important;
  background-position:center center!important;background-size:cover!important;background-repeat:no-repeat!important;
}
html body .book-object.m-book .book-cover-inner.m-book__cover .series.m-book__series{
  position:absolute!important;top:14px!important;left:12px!important;right:12px!important;
  display:block!important;width:auto!important;margin:0!important;text-align:center!important;
  font-size:10px!important;line-height:1.1!important;letter-spacing:.18em!important;font-weight:700!important;
  color:rgba(255,245,249,.95)!important;z-index:5!important;
}
html body .book-object.m-book .book-cover-inner.m-book__cover strong.m-book__title{
  position:absolute!important;top:34px!important;left:12px!important;right:12px!important;
  display:block!important;width:auto!important;max-width:none!important;min-height:2.55em!important;
  margin:0!important;padding:0 3px!important;text-align:center!important;
  font-size:clamp(18px,1.65vw,23px)!important;line-height:1.27!important;font-weight:700!important;
  color:#fff!important;z-index:5!important;
}
html body .book-object.m-book .book-cover-inner.m-book__cover > img.m-book__character:not(.real-cover-img){
  position:absolute!important;left:50%!important;right:auto!important;bottom:8%!important;
  width:58%!important;height:48%!important;max-width:none!important;max-height:none!important;
  transform:translateX(-50%)!important;object-fit:contain!important;opacity:1!important;
  filter:drop-shadow(0 8px 11px rgba(5,28,62,.18))!important;z-index:4!important;
}
html body .book-object.m-book .book-cover-inner.m-book__cover .book-no.m-book__no{
  position:absolute!important;right:10px!important;bottom:8px!important;top:auto!important;
  display:block!important;font-size:11px!important;line-height:1!important;font-weight:700!important;
  color:rgba(255,255,255,.88)!important;z-index:5!important;
}
html body #firstBookCover.book-object.m-book.first-story-cover{
  width:min(296px,100%)!important;height:auto!important;aspect-ratio:210/257!important;transform:none!important;
}
html body #firstBookCover.book-object.m-book.first-story-cover .book-cover-inner.m-book__cover{
  padding:0!important;
  background-image:linear-gradient(rgba(0,22,68,.025),rgba(0,22,68,.025)),url("../img/covers/story_forest_bg.png")!important;
}
html body #firstBookCover.book-object.m-book.first-story-cover .book-cover-inner.m-book__cover .series.m-book__series{top:15px!important;font-size:11px!important}
html body #firstBookCover.book-object.m-book.first-story-cover .book-cover-inner.m-book__cover strong.m-book__title{
  top:36px!important;left:12px!important;right:12px!important;margin:0!important;
  width:auto!important;max-width:none!important;font-size:clamp(22px,2vw,28px)!important;text-align:center!important;
}
html body .book-entry.m-book-entry .book-meta.m-book-meta{
  display:flex!important;flex-direction:column!important;align-items:center!important;gap:0!important;
  width:100%!important;padding-top:15px!important;text-align:center!important;
}
html body .book-entry.m-book-entry .book-meta.m-book-meta > b.m-book-meta__title{order:1!important;margin:0!important;font-size:17px!important;line-height:1.45!important}
html body .book-entry.m-book-entry .book-meta.m-book-meta > .m-book-meta__cta,
html body .book-entry.m-book-entry .book-meta.m-book-meta > .m-book-meta__status{order:2!important;margin-top:10px!important;margin-bottom:0!important}
html body .book-entry.m-book-entry .book-meta.m-book-meta > p.m-book-meta__desc{order:3!important;margin:10px 0 0!important;max-width:95%!important;font-size:14px!important;line-height:1.85!important}
@media(max-width:720px){
  html body .book-object.m-book .book-cover-inner.m-book__cover .series.m-book__series{top:12px!important;font-size:9px!important}
  html body .book-object.m-book .book-cover-inner.m-book__cover strong.m-book__title{top:30px!important;font-size:18px!important}
  html body #firstBookCover.book-object.m-book.first-story-cover{width:min(72vw,270px)!important}
  html body #firstBookCover.book-object.m-book.first-story-cover .book-cover-inner.m-book__cover strong.m-book__title{top:33px!important;font-size:23px!important}
}


/* UNIFIED COVER CONTRACT v2 — 2026-08-30
   No cover is allowed to be visually special. All books use the same component. */
html body .m-book,
html body #firstBookCover.m-book{
  width:100%!important;
  max-width:260px!important;
  aspect-ratio:210/257!important;
  height:auto!important;
  border:3px solid #fff!important;
  border-radius:var(--m-cover-radius)!important;
  box-shadow:var(--m-cover-shadow)!important;
  background:#0d65bd!important;
  overflow:hidden!important;
  transform:none!important;
}
html body .m-book .m-book__cover,
html body #firstBookCover.m-book .m-book__cover{
  position:absolute!important;
  inset:0!important;
  padding:0!important;
  background-image:linear-gradient(rgba(0,22,68,.025),rgba(0,22,68,.025)),url("../img/covers/story_forest_bg.png")!important;
  background-position:center center!important;
  background-size:cover!important;
  background-repeat:no-repeat!important;
}
html body .m-book .m-book__series,
html body #firstBookCover.m-book .m-book__series{
  top:14px!important;
  left:12px!important;
  right:12px!important;
  font-size:10px!important;
  line-height:1.1!important;
  text-align:center!important;
  letter-spacing:.18em!important;
}
html body .m-book .m-book__title,
html body #firstBookCover.m-book .m-book__title{
  top:34px!important;
  left:12px!important;
  right:12px!important;
  width:auto!important;
  max-width:none!important;
  margin:0!important;
  min-height:2.55em!important;
  padding:0 3px!important;
  font-size:23px!important;
  line-height:1.27!important;
  text-align:center!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  color:#fff!important;
  z-index:6!important;
}
html body .m-book .m-book__title--medium{font-size:21px!important}
html body .m-book .m-book__title--long{font-size:18px!important;line-height:1.22!important}
html body .m-book .m-book__character,
html body #firstBookCover.m-book .m-book__character{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  left:50%!important;
  bottom:8%!important;
  width:58%!important;
  height:48%!important;
  transform:translateX(-50%)!important;
  object-fit:contain!important;
  z-index:4!important;
}
html body .m-book .m-book__no,
html body #firstBookCover.m-book .m-book__no{
  right:10px!important;
  bottom:8px!important;
  font-size:11px!important;
}
/* Featured placement may differ, but the book itself does not. */
html body #first .featured-book-wrap{
  min-height:0!important;
  width:100%!important;
  max-width:260px!important;
  justify-self:center!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
html body #first .featured-book-stage{
  grid-template-columns:260px minmax(0,1fr)!important;
  align-items:center!important;
}
html body #firstBookCover .cover-group-full,
html body #firstBookCover .cover-trio,
html body #firstBookCover .cover-whisper{display:none!important}
@media(max-width:800px){
  html body #first .featured-book-stage{grid-template-columns:1fr!important}
  html body #first .featured-book-wrap{max-width:260px!important;margin-inline:auto!important}
}
@media(max-width:620px){
  html body .m-book,
  html body #firstBookCover.m-book{max-width:240px!important}
  html body .m-book .m-book__series,
  html body #firstBookCover.m-book .m-book__series{top:12px!important;font-size:9px!important}
  html body .m-book .m-book__title,
  html body #firstBookCover.m-book .m-book__title{top:30px!important;font-size:20px!important}
  html body .m-book .m-book__title--medium{font-size:18px!important}
  html body .m-book .m-book__title--long{font-size:16px!important}
}

/* FINAL VERIFIED SIZE CONTRACT — 2026-08-30
   Featured / archive / character shelves use the same displayed book width.
   Parent grids may shrink it on narrow screens, but no section enlarges it. */
html body .book-object.m-book,
html body #firstBookCover.book-object.m-book{
  width:min(240px,100%)!important;
  max-width:240px!important;
  height:auto!important;
  aspect-ratio:210/257!important;
}
html body #first .featured-book-wrap{
  width:240px!important;
  max-width:100%!important;
}
html body #first .featured-book-stage{
  grid-template-columns:240px minmax(0,1fr)!important;
}
@media(max-width:800px){
  html body #first .featured-book-stage{grid-template-columns:1fr!important}
  html body #first .featured-book-wrap{width:min(240px,100%)!important}
}
@media(max-width:620px){
  html body .book-object.m-book,
  html body #firstBookCover.book-object.m-book{width:min(220px,100%)!important;max-width:220px!important}
  html body #first .featured-book-wrap{width:min(220px,100%)!important}
}




/* FOREST BACKGROUND CONTRACT — every placeholder cover uses the Morirunastella forest full-bleed. */
html body .m-book .m-book__cover,
html body #firstBookCover.m-book .m-book__cover{
  background-color:#0d65bd!important;
  background-image:url("../img/covers/story_forest_bg.png")!important;
  background-position:center center!important;
  background-size:cover!important;
  background-repeat:no-repeat!important;
  isolation:isolate!important;
}
html body .m-book .m-book__forest-bg,
html body #firstBookCover.m-book .m-book__forest-bg{
  display:block!important;
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  background-image:linear-gradient(rgba(0,22,68,.025),rgba(0,22,68,.025)),url("../img/covers/story_forest_bg.png")!important;
  background-position:center center!important;
  background-size:cover!important;
  background-repeat:no-repeat!important;
  opacity:1!important;
  z-index:0!important;
  pointer-events:none!important;
}
html body .m-book .m-book__series,
html body .m-book .m-book__title,
html body .m-book .m-book__character,
html body .m-book .m-book__trio,
html body .m-book .m-book__no{
  position:absolute!important;
  z-index:4!important;
}
/* Prevent historical background rules from creating a smaller forest rectangle. */
html body .m-book .m-book__cover::before,
html body .m-book .m-book__cover::after{
  display:none!important;
  content:none!important;
}


/* 2026-09-06: cover-title fit guard
   MOMONCHY shelf titles are designed as two balanced lines.
   Long titles shrink instead of leaving the book cover. */
html body .m-book .m-book__title,
html body #firstBookCover.m-book .m-book__title{
  left:10px!important;
  right:10px!important;
  max-width:calc(100% - 20px)!important;
  width:auto!important;
  box-sizing:border-box!important;
  white-space:normal!important;
  overflow-wrap:normal!important;
  word-break:keep-all!important;
  text-wrap:balance!important;
  text-align:center!important;
}
html body .m-book .m-book__title--medium{
  font-size:19px!important;
  line-height:1.20!important;
}
html body .m-book .m-book__title--long{
  font-size:16px!important;
  line-height:1.16!important;
}
@media(max-width:620px){
  html body .m-book .m-book__title,
  html body #firstBookCover.m-book .m-book__title{
    left:8px!important;
    right:8px!important;
    max-width:calc(100% - 16px)!important;
    font-size:18px!important;
    line-height:1.20!important;
  }
  html body .m-book .m-book__title--medium{font-size:16.5px!important}
  html body .m-book .m-book__title--long{font-size:14.5px!important;line-height:1.16!important}
}
