/* The active screen owns one photograph. Keep the right-hand controls on a quiet surface. */
main[data-action-scene] {
  --scene-rgb: 9 13 20;
  --scene-focal: 72%;
  position: relative;
  isolation: isolate;
  background: rgb(var(--scene-rgb));
}
body[data-public-theme="light"] main[data-action-scene] { --scene-rgb: 248 249 251; }
main[data-action-scene="code.webp"] { --scene-focal: 65%; }
main[data-action-scene="reservation.webp"] { --scene-focal: 77%; }
main[data-action-scene="conduite.jpg"] { --scene-focal: 84%; }
main[data-action-scene="equipe.webp"] { --scene-focal: 70%; }

.action-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.action-backdrop img {
  width: 58%;
  height: 80%;
  display: block;
  object-fit: cover;
  object-position: var(--scene-focal) center;
  mask-image: linear-gradient(to bottom, #000 0 70%, transparent);
}
.action-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent 34%, rgb(var(--scene-rgb) / .14) 41%, rgb(var(--scene-rgb) / .92) 52%, rgb(var(--scene-rgb)) 58%),
    linear-gradient(to bottom, rgb(var(--scene-rgb) / .35), transparent 16%);
}
main[data-action-scene] .stage > .intro {
  position: relative;
  isolation: isolate;
  align-self: end;
  justify-content: end;
}
main[data-action-scene] .stage > .intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -70px calc(-1 * var(--pad) - 60px) calc(-1 * var(--pad)) calc(-1 * var(--pad));
  background: linear-gradient(0deg, rgb(var(--scene-rgb) / .98), rgb(var(--scene-rgb) / .88) calc(100% - 70px), transparent);
  mask-image: linear-gradient(to right, #000 0 56%, #000e 70%, transparent);
  pointer-events: none;
}
main[data-action-scene] .progress { position: relative; isolation: isolate; }
main[data-action-scene] .progress::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--pad));
  background: rgb(var(--scene-rgb) / .95);
}
.scene-zoom {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  align-self: flex-start;
  margin-top: 10px;
  padding: 10px;
  color: var(--text);
  border: 1px solid currentColor;
  border-radius: 50%;
  background: rgb(var(--scene-rgb) / .93);
}
.scene-zoom svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The booking form uses both columns; give it an image-led heading and a solid form floor. */
body.cinema-public main[data-action-scene] .booking-workspace {
  background: transparent;
  position: relative;
}
main[data-action-scene]:has(.booking-workspace) .action-backdrop img {
  width: 100%;
  height: clamp(180px, 38vh, 330px);
  object-position: var(--scene-focal) 46%;
}
main[data-action-scene]:has(.booking-workspace) .action-backdrop::after {
  background: linear-gradient(to bottom, transparent 0 3%, rgb(var(--scene-rgb)) clamp(150px, 27vh, 255px));
}
main[data-action-scene] .booking-heading {
  min-height: clamp(86px, 18vh, 172px);
  align-items: end;
  margin-bottom: 0;
  padding-bottom: 14px;
}
main[data-action-scene] .booking-heading > div,
main[data-action-scene] .booking-heading .text-button {
  background: rgb(var(--scene-rgb) / .96);
  border-radius: 6px;
  padding-inline: 10px;
}
.booking-heading-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}
main[data-action-scene] .booking-heading-actions .scene-zoom { align-self: center; margin: 0; }
main[data-action-scene] .booking-layout {
  position: relative;
  isolation: isolate;
  padding-top: 12px;
}
main[data-action-scene] .booking-layout::before {
  content: "";
  position: absolute;
  inset: 0 calc(-1 * var(--pad)) -30px;
  z-index: -1;
  background: rgb(var(--scene-rgb));
}

@media (min-width: 761px) {
  body.cinema-public main[data-action-scene] .exam-list-view .stage {
    width: min(57%, 900px);
    margin-inline: auto max(0px, calc((100vw - 1640px) / 2));
    padding-inline-start: clamp(32px, 5vw, 80px);
    background: linear-gradient(90deg, transparent, rgb(var(--scene-rgb) / .98) clamp(32px, 5vw, 80px));
  }
  main[data-action-scene] .exam-list-view .stage > .intro::before { display: none; }
}

@media (max-width: 760px) {
  main[data-action-scene] { --scene-mobile-height: clamp(160px, 42vw, 225px); }
  .action-backdrop img {
    width: 100%;
    height: var(--scene-mobile-height);
    object-position: var(--scene-focal) 58%;
    mask-image: none;
  }
  .action-backdrop::after {
    background: linear-gradient(to bottom, transparent 45px, rgb(var(--scene-rgb)) var(--scene-mobile-height));
  }
  main[data-action-scene] .flow .stage {
    isolation: isolate;
    align-items: stretch;
    justify-content: safe flex-start;
  }
  main[data-action-scene] .flow .stage::before {
    content: "";
    display: block;
    flex: none;
    height: clamp(64px, 12svh, 112px);
    pointer-events: none;
  }
  main[data-action-scene] .flow .stage > .intro {
    align-self: stretch;
  }
  main[data-action-scene] .flow .stage > .intro::before {
    inset-inline: calc(-1 * var(--pad));
    mask-image: none;
  }
  main[data-action-scene] .flow .stage > .intro,
  main[data-action-scene] .flow .stage > .choice-area {
    position: relative;
    isolation: isolate;
  }
  main[data-action-scene] .flow .stage > .choice-area::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    inset: -12px calc(-1 * var(--pad)) calc(-1 * var(--pad));
    background: rgb(var(--scene-rgb));
  }
  main[data-action-scene] .code-entry .stage > .intro { display: contents; }
  main[data-action-scene] .code-entry .intro::before { display: none; }
  main[data-action-scene] .code-entry .stage::before { grid-row: 1; }
  main[data-action-scene] .code-entry .intro h1 {
    grid-row: 2;
    justify-self: start;
    border-radius: 5px;
    padding: 3px 8px;
    background: rgb(var(--scene-rgb) / .96);
  }
  main[data-action-scene] .code-entry .choice-area { grid-row: 3; }
  main[data-action-scene] .code-entry .intro p { grid-row: 4; }
  main[data-action-scene] .code-entry .intro .primary { grid-row: 5; }
  main[data-action-scene] .code-entry .scene-zoom { grid-row: 6; }
  main[data-action-scene] .scene-zoom { margin-top: 6px; }
  main[data-action-scene] .booking-layout::before { inset-inline: -18px; }
}

@media (forced-colors: active) {
  main[data-action-scene] { background: Canvas; }
  .action-backdrop,
  main[data-action-scene] .stage::before,
  main[data-action-scene] .stage > .intro::before,
  main[data-action-scene] .stage > .choice-area::before,
  main[data-action-scene] .progress::before,
  main[data-action-scene] .booking-layout::before { display: none; }
  main[data-action-scene] .scene-zoom { color: ButtonText; background: ButtonFace; }
  main[data-action-scene] .booking-heading { min-height: auto; }
}

dialog .entry-scene {
  display: block;
  width: 100%;
  height: clamp(90px, 18svh, 155px);
  border-radius: 12px;
  object-fit: cover;
  object-position: center 53%;
  margin: 2px 0 18px;
}
dialog:has(.entry-scene) .close { z-index: 1; }
@media (forced-colors: active), (max-height: 520px) {
  dialog .entry-scene { display: none; }
}
