/* Background-only correction. Text, links and templates keep their own styles. */
.page-frame-parchment.world-page {
  isolation: isolate;
}
.world-page .world-scroll {
  position: relative;
  width: min(calc(100vw - 1rem), 100%, 853px);
  min-height: 0;
  margin: auto;
  overflow: visible;
  background: #02050b;
  container-type: inline-size;
}
.world-scroll-top,
.world-scroll-bottom {
  position: relative;
  z-index: 1;
  width: 100%;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 100% auto;
}
.world-scroll-top {
  aspect-ratio: 1448 / 520;
  background-image: url('../images/pergamena-top.webp');
  background-position: center top;
  margin-bottom: -5cqw;
  mask-image: linear-gradient(#000 calc(100% - 5cqw), transparent);
}
.world-scroll-body {
  position: relative;
  isolation: isolate;
  min-height: 260px;
  background-image: url('../images/pergamena-body.webp');
  background-position: top center;
  background-size: 100% auto;
  background-repeat: no-repeat;
}
.world-scroll-body::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 142cqw 0 0;
  pointer-events: none;
  background: url('../images/pergamena-body-repeat.webp') top center / 100% auto repeat-y;
  mask-image: linear-gradient(transparent, #000 10cqw);
}
.world-scroll .parchment-page-content {
  position: relative;
  z-index: 2;
  width: 54%;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(24px, 4cqw, 40px) 0 calc(6cqw + 24px);
  overflow-wrap: anywhere;
}
.world-scroll-bottom {
  aspect-ratio: 1448 / 820;
  background-image: url('../images/pergamena-bottom.webp');
  background-position: center bottom;
  margin-top: -5cqw;
  mask-image: linear-gradient(transparent, #000 5cqw);
}
.world-scroll .parchment-side-note { display: none; }
.world-scroll .entry-content figure { max-width: 100%; }
.world-scroll .entry-content img,
.world-scroll .wp-post-image { max-width: 100%; height: auto; }
.world-scroll .entry-content iframe,
.world-scroll .entry-content video { max-width: 100%; }
@media (max-width: 760px) {
  .world-page .world-scroll { min-height: 0; }
  .world-scroll .parchment-page-content { width: 58%; margin: 0 auto; padding: 24px 0 calc(6cqw + 24px); }
}
/* The bookshelf uses the broad parchment area; ordinary Pages keep their 54% column. */
.world-page .world-scroll .parchment-page-content:has(.lbm-bazar-scene) {
  width: 90%;
}
@media (max-width: 760px) {
  .world-page .world-scroll .parchment-page-content:has(.lbm-bazar-scene) { width: 93%; }
}
/* Bazar alone enlarges all three original parchment panels by the same factor.
   The central library stays inside the resulting clear portion; other pages keep their geometry. */
.world-page .world-scroll--bazar {
  width: min(calc(100vw - 1rem), var(--lbm-parchment-max, 1380px));
  overflow: hidden;
}
.world-scroll--bazar .world-scroll-top,
.world-scroll--bazar .world-scroll-bottom { background-size: var(--lbm-parchment-scale, 100%) auto; }
.world-scroll--bazar .world-scroll-top {
  background-image: var(--lbm-parchment-top, url('../images/pergamena-top.webp'));
  height: calc(35.91cqw * var(--lbm-parchment-factor, 1));
  aspect-ratio: auto;
  margin-bottom: calc(-5cqw * var(--lbm-parchment-factor, 1));
}
.world-scroll--bazar .world-scroll-body {
  background-image: var(--lbm-parchment-body, url('../images/pergamena-body.webp'));
  background-size: var(--lbm-parchment-scale, 100%) auto;
}
.world-scroll--bazar .world-scroll-body::before {
  inset: calc(142cqw * var(--lbm-parchment-factor, 1)) 0 0;
  background-image: var(--lbm-parchment-repeat, url('../images/pergamena-body-repeat.webp'));
  background-size: var(--lbm-parchment-scale, 100%) auto;
}
.world-scroll--bazar .world-scroll-bottom {
  background-image: var(--lbm-parchment-bottom, url('../images/pergamena-bottom.webp'));
  height: calc(56.63cqw * var(--lbm-parchment-factor, 1));
  aspect-ratio: auto;
  margin-top: calc(-5cqw * var(--lbm-parchment-factor, 1));
}
.world-page .world-scroll--bazar .parchment-page-content:has(.lbm-bazar-scene) {
  width: var(--lbm-bazar-scene-width, 59%);
  min-width: 0;
  margin: 0 auto;
  padding: clamp(18px, 2cqw, 34px) 0 calc(4cqw + 12px);
  overflow-wrap: normal;
}
