/* Behsarma site master + special-edition flipbook integration */

body.about-edition-page #layout {
  overflow: visible;
}

body.about-edition-page .about-edition-root {
  --edition-gutter: clamp(20px, 5vw, 72px);
  --edition-chrome-top: 140px;
  --edition-band-height: calc(100dvh - var(--edition-chrome-top));
  position: relative;
  z-index: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
}

body.about-edition-page .about-edition-root main#main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  position: relative;
}

body.about-edition-page .about-edition-root--read {
  background: var(--r-paper, #f0e8d7);
}

body.about-edition-page .about-edition-root .skip {
  position: absolute;
  left: -9999px;
}

body.about-edition-page .about-edition-root .skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10000;
}

/* Desktop magazine: full-width band between header and footer */
@media (min-width: 1024px) {
  html.book body.about-edition-page {
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: var(--desk, #1b1814);
  }

  html.book body.about-edition-page .about-edition-root {
    position: relative;
    isolation: isolate;
    min-height: var(--edition-band-height);
  }

  html.book body.about-edition-page .about-edition-root .app {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: var(--edition-band-height) !important;
    min-height: var(--edition-band-height) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1;
  }

  html.book body.about-edition-page .about-edition-root #stage {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: var(--edition-gutter) !important;
    right: var(--edition-gutter) !important;
  }

  /* Side gutters: wheel scrolls the page; flip gestures stay on the book */
  html.book body.about-edition-page .about-edition-root .app::before,
  html.book body.about-edition-page .about-edition-root .app::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--edition-gutter);
    z-index: 2;
    pointer-events: auto;
  }

  html.book body.about-edition-page .about-edition-root .app::before {
    right: 0;
  }

  html.book body.about-edition-page .about-edition-root .app::after {
    left: 0;
  }

  /* Text drawer: inside the about band only (not under header/footer) */
  html.book:not(.viewer-failed) body.about-edition-page #matn {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 50% !important;
    max-width: 50% !important;
    height: auto !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.42) !important;
    transform: translateX(104%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.45s cubic-bezier(0.2, 0.75, 0.2, 1), visibility 0s linear 0.45s !important;
  }

  html.book.drawer-open:not(.viewer-failed) body.about-edition-page #matn {
    transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 50 !important;
    transition: transform 0.45s cubic-bezier(0.2, 0.75, 0.2, 1) !important;
  }

  html.book.drawer-open body.about-edition-page {
    overflow: hidden !important;
  }

  html.book.drawer-open body.about-edition-page .about-edition-root > .scrim {
    position: absolute !important;
    inset: 0 !important;
    z-index: 40 !important;
    pointer-events: auto !important;
  }

  html.book.drawer-open body.about-edition-page .about-edition-root .app {
    z-index: 1;
  }

  /* Fullscreen: immersive book only (not site header/footer) */
  body.about-edition-page .about-edition-root .app:fullscreen,
  body.about-edition-page .about-edition-root .app:-webkit-full-screen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    min-height: 100vh !important;
    margin: 0 !important;
    z-index: 2147483646 !important;
  }

  body.about-edition-page .about-edition-root .app:fullscreen #stage,
  body.about-edition-page .about-edition-root .app:-webkit-full-screen #stage {
    left: 0 !important;
    right: 0 !important;
  }

  body.about-edition-page .about-edition-root .app:fullscreen::before,
  body.about-edition-page .about-edition-root .app:fullscreen::after,
  body.about-edition-page .about-edition-root .app:-webkit-full-screen::before,
  body.about-edition-page .about-edition-root .app:-webkit-full-screen::after {
    display: none !important;
  }
}

/* Mobile / narrow: reading column only */
@media (max-width: 1023.98px) {
  body.about-edition-page {
    background: var(--r-paper, #f0e8d7);
  }
}
