/* Theater uses the home slider chrome. Closed strips scale in CSS only. */
.theater-page .page-wrap {
  padding: 22px 28px 36px;
}
.theater-page h1 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 0.9;
}
.theater-page .sub {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.theater-page .dots-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.theater-page .dots-bar .dot {
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(44, 39, 34, 0.16);
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  color: #2c2722;
  cursor: pointer;
}
.theater-page .dots-bar .dot.on {
  background: #2c2722;
  color: #fbf6ee;
  border-color: #2c2722;
}
.theater-page .reader {
  min-height: 0;
}
/* Side strips stay the book-page width. The center strip is the rest
   of the stage. The video lives in the left three quarters. */
.theater-page #windows {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 82px;
  grid-template-rows: auto;
  column-gap: 10px;
  height: auto;
  min-height: 0;
  align-items: stretch;
  overflow: visible;
}
.theater-page #windows > .window:not(.is-open) {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  height: auto;
  align-self: stretch;
}
.theater-page #windows > .window.is-open {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  aspect-ratio: auto;
  align-self: start;
  justify-self: stretch;
  overflow: visible;
}
.theater-page .window .book-side {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #efe6d6;
}
.theater-page .window.is-open .book-side {
  overflow: hidden;
}
.theater-page .window:not(.is-open) .book-side > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform-origin: center center;
  transition: transform 1.6s ease;
  transform: scale(1);
}
.theater-page .window:not(.is-open):hover .book-side > img {
  transform: scale(1.08);
  animation: none;
}
.theater-page .window:not(.is-open) .shade {
  font-size: 16px;
  line-height: 1.05;
  padding: 10px 6px;
}
.theater-page .theater-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.theater-page .theater-wait {
  margin: 0;
  padding: 28px 22px;
  text-align: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(32px, 4vw, 64px);
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: #2c2722;
}
.theater-page .theater-player {
  display: none;
  position: absolute;
  inset: 0;
}
.theater-page .theater-screen.is-ready .theater-player {
  display: block;
}
.theater-page .theater-screen.is-ready .theater-wait {
  display: none;
}
.theater-page .theater-player iframe,
.theater-page .theater-player video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  border: 0;
  object-fit: contain;
}
/* Shared slider rules pin a short row and hide overflow. The center
   frame has to stay 16:9, with the picture fully inside the box. */
.theater-page #windows {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}
.theater-page #windows > .window:not(.is-open) {
  flex: 0 0 82px !important;
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  height: auto !important;
}
.theater-page #windows > .window.is-open {
  display: block !important;
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
}
.theater-page #windows > .window.is-open .theater-screen,
.theater-page #windows > .window.is-open .theater-player {
  overflow: hidden !important;
}
.theater-controls {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 82px;
  column-gap: 10px;
  align-items: center;
  margin: 18px 0 0;
}
.theater-transport {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  width: 100%;
}
.theater-controls #hideBtn {
  margin-left: auto;
  flex: 0 0 auto;
}
.theater-controls button {
  width: 104px;
  height: 104px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}
.theater-controls button:focus-visible {
  outline: 2px solid #2c2722;
  outline-offset: 3px;
}
.theater-controls img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
@media (max-width: 800px) {
  .theater-page .page-wrap {
    padding: 16px 16px 28px;
  }
  .theater-page #windows {
    height: auto !important;
    min-height: 0 !important;
  }
  .theater-controls button {
    width: 76px;
    height: 76px;
  }
  .playlist-actions button,
  .playlist-head button {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
}
/* One center stage. The video is an exact 16:9 frame in the left three
   quarters. The playlist is the right quarter and matches that height. */
.theater-page .theater-stage {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  column-gap: 0;
  width: 100%;
  height: auto;
  border-radius: 18px;
  overflow: hidden;
  background: #efe6d6;
}
.theater-page.playlist-hidden .theater-stage {
  grid-template-columns: minmax(0, 1fr);
}
.theater-page .theater-panel {
  position: relative;
  inset: auto;
  min-width: 0;
  min-height: 0;
}
.theater-page #videoPanel {
  z-index: 1;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.theater-page #listPanel {
  z-index: 2;
  display: block;
  height: 0;
  min-height: 100%;
  align-self: stretch;
  background: #fbf6ee;
  overflow: hidden;
}
.theater-page.playlist-hidden #listPanel {
  display: none !important;
}
.theater-page .theater-playlist {
  position: absolute;
  inset: 0;
  height: auto;
  overflow: auto;
  padding: 10px 8px 12px;
  box-sizing: border-box;
}
.playlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.playlist-head .mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.playlist-link {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: #2c2722;
}
.playlist-link[hidden] {
  display: none !important;
}
.playlist-head button,
.playlist-actions button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  flex: 0 0 36px;
}
.playlist-head button img,
.playlist-actions button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.playlist-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}
.playlist-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.playlist-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 8px 8px 14px;
  background: #efe6d6;
  border-radius: 16px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.playlist-row.is-current {
  outline: 2px solid #2c2722;
}
.playlist-row.is-dragging {
  cursor: grabbing;
  opacity: 0.72;
}
.playlist-name {
  flex: 1 1 8em;
  min-width: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.playlist-actions {
  display: flex;
  gap: 6px;
}
.playlist-empty {
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.theater-controls #hideBtn[aria-pressed="false"] {
  opacity: 0.55;
}
