/* Collectanea V4.0.11 · proportional books, compact museum mounts, mobile zoom, richer recessed Gothic tracery */

/* --- Mobile room zoom ---------------------------------------------------- */
.ct410-room-zoom{
  display:none;align-items:center;justify-content:space-between;gap:10px;
  margin:8px 0 10px;padding:8px 10px;border:1px solid rgba(67,57,48,.12);
  border-radius:10px;background:linear-gradient(180deg,rgba(250,248,243,.97),rgba(244,241,234,.92));
}
.ct410-room-zoom-label{font:600 .78rem/1.1 system-ui,sans-serif;color:#5d564e}
.ct410-room-zoom-controls{display:flex;align-items:center;gap:8px;min-width:0;flex:1;justify-content:flex-end}
.ct410-room-zoom-controls button{min-width:40px!important;width:40px!important;padding:0!important}
.ct410-room-zoom input[type=range]{flex:1;min-width:105px;max-width:260px}
.ct410-room-zoom output{min-width:3.4em;text-align:right;font:600 .76rem/1 system-ui,sans-serif;color:#433c35}
.ct410-room-zoom-viewport{overflow:visible}
.ct410-room-zoom-content{transform-origin:top left;transition:transform .16s ease}

/* --- Library geometry --------------------------------------------------- */
/* Render dimensions are already aspect-ratio-safe in JS; don't re-clamp only height in CSS. */
#libraryRoom .book-spine-v2,
#libraryRoom .ct408-front-book{
  max-height:none!important;max-width:none!important;box-sizing:border-box!important;
}
#libraryRoom .ct408-book-unit{box-sizing:border-box!important;overflow:visible!important}
#libraryRoom .real-shelf,
#libraryRoom .ct406-real-shelf,
#libraryRoom .ct408-real-shelf{overflow:visible!important}
#libraryRoom .shelf-back,
#libraryRoom .ct406-shelf-back,
#libraryRoom .ct408-shelf-back{overflow:visible!important;align-items:flex-end!important}

/* Front image occupies the actual cover plane rather than a differently proportioned inset frame. */
#libraryRoom .ct408-front-book{overflow:visible!important}
#libraryRoom .ct408-front-cover{
  inset:1px!important;border-radius:1px!important;
  background-size:contain!important;background-repeat:no-repeat!important;background-position:center!important;
}
#libraryRoom .ct408-front-edge{
  top:2px!important;bottom:2px!important;right:1px!important;width:2px!important;opacity:.68!important;pointer-events:none!important;
}
#libraryRoom .ct408-front-book.has-image .ct408-front-cover,
#libraryRoom .book-spine-v2.has-image{
  background-size:contain!important;background-repeat:no-repeat!important;background-position:center!important;
}

/* --- Gothic carving: retire V4.0.10's small decorative dots ----------- */
#libraryRoom .ct409-carving-crown::before,
#libraryRoom .ct409-carving-plinth::before,
#libraryRoom .ct409-carving-pilaster::before,
#libraryRoom .ct409-carving-pilaster::after{display:none!important}

/* One large, historically legible tracery field per timber member. The ornament is an incised
   channel mask, not a painted symbol: dark cut, upper-left highlight, lower-right depth shadow. */
#libraryRoom .ct409-carving-crown{
  left:13%!important;right:13%!important;top:5px!important;height:48px!important;
  align-items:center!important;justify-content:center!important;
}
#libraryRoom .ct409-carving-crown i{
  width:100%!important;height:44px!important;border:0!important;border-radius:0!important;
  background:rgba(12,6,3,.64)!important;
  -webkit-mask:url('assets/v411/gothic-tracery-crown.svg') center/100% 100% no-repeat!important;
  mask:url('assets/v411/gothic-tracery-crown.svg') center/100% 100% no-repeat!important;
  box-shadow:none!important;
  filter:drop-shadow(-1px -1px 0 rgba(230,190,142,.17)) drop-shadow(2px 2px 2px rgba(4,2,1,.55))!important;
  opacity:.78!important;
}
#libraryRoom .ct409-carving-crown i::before,
#libraryRoom .ct409-carving-crown i::after{display:none!important}

#libraryRoom .ct409-carving-pilaster{
  top:90px!important;bottom:84px!important;width:28px!important;align-items:flex-start!important;justify-content:center!important;
}
#libraryRoom .ct409-carving-pilaster.left{left:4px!important}
#libraryRoom .ct409-carving-pilaster.right{right:4px!important}
#libraryRoom .ct409-carving-pilaster i{
  width:20px!important;height:min(268px,72%)!important;border:0!important;border-radius:0!important;
  background:rgba(11,5,2,.62)!important;
  -webkit-mask:url('assets/v411/gothic-tracery-pilaster.svg') center/100% 100% no-repeat!important;
  mask:url('assets/v411/gothic-tracery-pilaster.svg') center/100% 100% no-repeat!important;
  box-shadow:none!important;
  filter:drop-shadow(-1px -1px 0 rgba(230,190,142,.14)) drop-shadow(2px 2px 2px rgba(4,2,1,.52))!important;
  opacity:.74!important;
}
#libraryRoom .ct409-carving-pilaster i::before,
#libraryRoom .ct409-carving-pilaster i::after{display:none!important}

#libraryRoom .ct409-carving-plinth{
  left:10%!important;right:10%!important;top:3px!important;bottom:3px!important;
  align-items:center!important;justify-content:center!important;
}
#libraryRoom .ct409-carving-plinth i{
  width:100%!important;height:40px!important;border:0!important;border-radius:0!important;
  background:rgba(12,6,3,.64)!important;
  -webkit-mask:url('assets/v411/gothic-tracery-plinth.svg') center/100% 100% no-repeat!important;
  mask:url('assets/v411/gothic-tracery-plinth.svg') center/100% 100% no-repeat!important;
  box-shadow:none!important;
  filter:drop-shadow(-1px -1px 0 rgba(230,190,142,.15)) drop-shadow(2px 2px 2px rgba(4,2,1,.54))!important;
  opacity:.76!important;
}
#libraryRoom .ct409-carving-plinth i::before,
#libraryRoom .ct409-carving-plinth i::after{display:none!important}

/* Let the wood itself carry the carving: subtle local recess under the tracery, no new furniture shape. */
#libraryRoom .ct406-cornice,
#libraryRoom .ct406-plinth{
  background-color:#402819!important;
  box-shadow:0 9px 14px rgba(22,13,8,.34),inset 0 2px 1px rgba(236,198,150,.07),inset 0 -8px 10px rgba(12,6,3,.31)!important;
}

/* --- Museum: minimal frame/mat envelope -------------------------------- */
#museumWrap .ct403-museum-unit,
#museumWrap .ct405-museum-unit{align-items:center!important;justify-content:flex-start!important}
#museumWrap .museum-object-v2{
  width:var(--obj-w)!important;height:var(--obj-h)!important;
  border:1px solid rgba(73,66,58,.44)!important;padding:0!important;
  background:transparent!important;box-shadow:0 3px 7px rgba(0,0,0,.11)!important;
}
#museumWrap .museum-object-v2:hover{box-shadow:0 6px 11px rgba(0,0,0,.15)!important}
#museumWrap .museum-object-v2 .object-mat{
  inset:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;
}
#museumWrap .museum-object-v2 .object-face{
  width:100%!important;height:100%!important;padding:0!important;border:0!important;
  background-size:contain!important;background-repeat:no-repeat!important;background-position:center!important;
}
/* Paintings keep only a very slim physical frame. */
#museumWrap .museum-object-v2.kind-painting,
#museumWrap .kind-painting.museum-object-v2{border:0!important;box-shadow:0 4px 9px rgba(0,0,0,.15)!important}
#museumWrap .museum-object-v2.kind-painting .object-mat,
#museumWrap .kind-painting .object-mat{
  padding:2px!important;border:1px solid #25170f!important;
  background-image:linear-gradient(90deg,#3a281b,#6d4b31 20%,#332116 32%,#69472f 58%,#2d1d13 80%,#5d3f2a)!important;
  box-shadow:inset 0 0 0 1px rgba(180,132,80,.24)!important;
}
#museumWrap .ct403-museum-plaque,
#museumWrap .ct405-museum-plaque{margin-top:4px!important;transform:none!important}

/* Quick preview: keep new library display selector compact. */
.ct-object-preview-library-display{margin:14px 0 2px;padding:10px 12px;border-radius:9px}
.ct-object-preview-library-display .ct409-display-head p{margin-bottom:7px;font-size:.78rem}
.ct-object-preview-library-display .ct409-display-row{padding:7px 0}

@media(max-width:760px){
  .ct410-room-zoom{display:flex!important}
  .ct410-room-zoom-viewport{
    overflow:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;
    padding-bottom:2px;
  }
  .ct410-room-zoom-viewport.is-zoomed{
    max-height:72dvh;border:1px solid rgba(73,66,58,.12);border-radius:11px;background:rgba(255,255,255,.20);
  }
  .ct410-room-zoom-content{width:100%!important;max-width:none!important;will-change:transform}
  #libraryRoom .ct409-carving-crown{left:10%!important;right:10%!important}
  #libraryRoom .ct409-carving-pilaster{opacity:.68!important}
  #libraryRoom .ct409-carving-plinth{left:7%!important;right:7%!important}
}

@media(prefers-reduced-motion:reduce){.ct410-room-zoom-content{transition:none!important}}

/* Higher-specificity museum geometry overrides legacy per-kind width reductions. */
#museumWrap .ct403-museum-unit.kind-sheet .museum-object-v2,
#museumWrap .ct403-museum-unit.kind-special .museum-object-v2,
#museumWrap .ct403-museum-unit.kind-codex .museum-object-v2,
#museumWrap .ct403-museum-unit.kind-scroll .museum-object-v2,
#museumWrap .ct403-museum-unit.kind-painting .museum-object-v2{
  width:var(--obj-w)!important;height:var(--obj-h)!important;box-sizing:border-box!important;
}

@media(max-width:760px){
  #libraryRoom .ct408-bookcase-bay{
    flex:0 0 max(88vw,var(--ct408-bay-w))!important;
    width:max(88vw,var(--ct408-bay-w))!important;
    min-width:max(88vw,var(--ct408-bay-w))!important;
    max-width:none!important;
  }
  .ct410-room-zoom-viewport{touch-action:pan-x pan-y pinch-zoom!important}
}

/* Missing-measure state must not create a second, differently sized visual frame around an object. */
#museumRoom .ct403-museum-unit.measure-missing,
#museumRoom .ct405-museum-unit.measure-missing,
#libraryRoom .book-spine-v2.measure-missing,
#libraryRoom .ct408-front-book.measure-missing{outline:none!important}

/* Deeper carved-bevel pass for the Gothic tracery: duplicate masks become highlight/shadow lips. */
#libraryRoom .ct409-carving-crown::before,
#libraryRoom .ct409-carving-crown::after,
#libraryRoom .ct409-carving-plinth::before,
#libraryRoom .ct409-carving-plinth::after,
#libraryRoom .ct409-carving-pilaster::before,
#libraryRoom .ct409-carving-pilaster::after{
  content:""!important;display:block!important;position:absolute!important;pointer-events:none!important;
}
#libraryRoom .ct409-carving-crown::before,
#libraryRoom .ct409-carving-crown::after{
  left:0;right:0;top:2px;height:44px;
  -webkit-mask:url('assets/v411/gothic-tracery-crown.svg') center/100% 100% no-repeat;
  mask:url('assets/v411/gothic-tracery-crown.svg') center/100% 100% no-repeat;
}
#libraryRoom .ct409-carving-plinth::before,
#libraryRoom .ct409-carving-plinth::after{
  left:0;right:0;top:50%;height:40px;transform:translateY(-50%);
  -webkit-mask:url('assets/v411/gothic-tracery-plinth.svg') center/100% 100% no-repeat;
  mask:url('assets/v411/gothic-tracery-plinth.svg') center/100% 100% no-repeat;
}
#libraryRoom .ct409-carving-pilaster::before,
#libraryRoom .ct409-carving-pilaster::after{
  left:4px;right:4px;top:0;height:min(268px,72%);
  -webkit-mask:url('assets/v411/gothic-tracery-pilaster.svg') center/100% 100% no-repeat;
  mask:url('assets/v411/gothic-tracery-pilaster.svg') center/100% 100% no-repeat;
}
#libraryRoom .ct409-carving-crown::before,
#libraryRoom .ct409-carving-plinth::before,
#libraryRoom .ct409-carving-pilaster::before{
  background:rgba(2,1,0,.36)!important;transform:translate(1.4px,1.6px);
  filter:blur(.2px);opacity:.86;
}
#libraryRoom .ct409-carving-crown::after,
#libraryRoom .ct409-carving-plinth::after,
#libraryRoom .ct409-carving-pilaster::after{
  background:rgba(242,205,157,.20)!important;transform:translate(-1px,-1px);opacity:.58;
}
/* restore centering transform for plinth pseudos while adding bevel offsets */
#libraryRoom .ct409-carving-plinth::before{transform:translate(1.4px,calc(-50% + 1.6px))}
#libraryRoom .ct409-carving-plinth::after{transform:translate(-1px,calc(-50% - 1px))}
