/* Filaro Collection - Design Stories as a real phone page
   09/Aug/26 Paul unlock: phone Explore tool pages start here.
   Scoped to body[data-design-stories-page] - does not change drawer chrome on books.
   Desktop books still use the media drawer. */

body[data-design-stories-page] {
  overflow: hidden;
  background: #0a0a0a;
  min-height: 100svh;
  min-height: 100dvh;
  /* Guard: drawer scroll-lock must never collapse this page */
  position: relative !important;
  top: auto !important;
  width: auto !important;
}

/* Minimal site-nav chrome (books keep full inline SSOT; this page is tool-only) */
body[data-design-stories-page] .site-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 1.25rem var(--gutter, clamp(1.25rem, 4vw, 3.5rem));
  color: #fff;
  background: transparent;
}
body[data-design-stories-page] .site-nav__brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
body[data-design-stories-page] .site-nav__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
body[data-design-stories-page] .site-nav__logo {
  height: calc(1.1rem * 1.1 * 1.1);
  width: auto;
  opacity: 0.95;
}
body[data-design-stories-page] .site-nav__address {
  margin: 0;
  line-height: 0;
  opacity: 0.9;
}
body[data-design-stories-page] .site-nav__address-img {
  display: block;
  height: 1.2rem;
  width: auto;
}
body[data-design-stories-page] .site-nav__book {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 3.5vw, 3.25rem);
}
body[data-design-stories-page] .site-nav__links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: calc(0.8125rem + 2px);
  font-weight: 500;
}
body[data-design-stories-page] .site-nav__links a {
  text-decoration: none;
  opacity: 0.9;
  color: inherit;
}
body[data-design-stories-page] .site-nav__end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.3vw, 1.05rem);
  padding-left: clamp(1rem, 2.5vw, 2rem);
}
body[data-design-stories-page] .site-nav__tools {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.3vw, 1.05rem);
}
body[data-design-stories-page] .site-nav__sound-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
body[data-design-stories-page] .site-nav__sound {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  padding: 4px;
  color: inherit;
  opacity: 0.5;
}
body[data-design-stories-page] .site-nav__sound svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
body[data-design-stories-page] .site-nav__sound .icon-unmuted { display: none; }
body[data-design-stories-page] .site-nav__sound:not(.is-muted) .icon-muted { display: none; }
body[data-design-stories-page] .site-nav__sound:not(.is-muted) .icon-unmuted { display: block; }
body[data-design-stories-page] .site-nav__ot img {
  display: block;
  height: 0.85rem;
  width: auto;
}

body[data-design-stories-page] .media-drawer,
body[data-design-stories-page] .media-drawer.is-open,
body[data-design-stories-page] .media-drawer.is-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  background: #0a0a0a;
}

body[data-design-stories-page] .media-drawer__panel {
  position: absolute;
  inset: 0;
  transform: none !important;
  transition: none !important;
  will-change: auto;
  background: #0a0a0a;
}

/* Cinema under nav - own behaviour, not Story plate snap */
body[data-design-stories-page] .media-view {
  min-height: 100svh;
  min-height: 100dvh;
}

/*
  Phone upright (portrait): show the FULL film (16:9 contain) centred in the page.
  Play / seek / Sound / CC + captions sit UNDER the picture on the black band.
  Fail-if: cover crop; controls overlaid on the film.
*/
@media (max-width: 767px) and (orientation: portrait) {
  body[data-design-stories-page] .media-drawer,
  body[data-design-stories-page] .media-drawer.is-open,
  body[data-design-stories-page] .media-drawer.is-page,
  body[data-design-stories-page] .media-drawer__panel {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    background: #0a0a0a !important;
  }
  body[data-design-stories-page] .media-view,
  body[data-design-stories-page] .media-view__stage {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #0a0a0a !important;
  }
  body[data-design-stories-page] .media-view__stage {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: stretch !important;
  }
  body[data-design-stories-page] .media-view__scrim,
  body[data-design-stories-page] .media-view__fallback {
    display: none !important;
  }
  body[data-design-stories-page] .media-view__frame {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    background: #0a0a0a !important;
    overflow: visible !important;
  }
  body[data-design-stories-page] .media-view__video {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    aspect-ratio: 16 / 9;
    object-fit: contain !important;
    object-position: center center !important;
    background: #0a0a0a !important;
  }
  body[data-design-stories-page] .media-view__captions {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0.9rem var(--gutter, 1.25rem) 0.55rem !important;
    transform: none !important;
    z-index: 8;
    box-sizing: border-box;
    text-align: center;
    /* Cream on black - fail-if black-on-black */
    color: #f7f5ef !important;
    -webkit-text-fill-color: #f7f5ef !important;
    background: #0a0a0a !important;
    text-shadow: none !important;
    font-size: 1.05rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    letter-spacing: 0.01em !important;
    min-height: 3.4rem;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
  }
  body[data-design-stories-page] .media-view__captions[hidden],
  body[data-design-stories-page] .media-view__captions[data-empty="1"] {
    display: block !important;
    /* Empty band stays; no invisible black text */
    color: #f7f5ef !important;
    -webkit-text-fill-color: #f7f5ef !important;
    visibility: visible !important;
    min-height: 3.4rem;
  }
  body[data-design-stories-page] .media-view__controls {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 70;
    margin: 0 !important;
    padding: 0.55rem var(--gutter, 1.25rem) calc(0.85rem + env(safe-area-inset-bottom, 0px)) !important;
    background: #0a0a0a !important;
    pointer-events: none;
  }
  /* Room under the bar for Turn phone (upright cinema) */
  body[data-design-stories-page].ds-phase-cinema .media-view__controls {
    padding-bottom: calc(2.35rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  body[data-design-stories-page] .media-view__controls > * {
    pointer-events: auto;
  }
  /* Centre Play sits on the film band, not the whole phone */
  body[data-design-stories-page].ds-phase-cinema.ds-needs-play .ds-play-ask {
    justify-content: center;
    padding-bottom: 0;
  }
}

/* Phone landscape / sideways cinema: edge fill (cover) */
@media (max-width: 767px) and (orientation: landscape) {
  body[data-design-stories-page] .media-view__video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

body[data-design-stories-page] .media-view__chrome {
  z-index: 80;
}

/* Controls above any play ask remnant - seek must stay tappable */
body[data-design-stories-page] .media-view__controls {
  z-index: 70;
  pointer-events: none;
}
body[data-design-stories-page] .media-view__controls > * {
  pointer-events: auto;
}

body[data-design-stories-page] .media-view__captions {
  z-index: 8;
  color: #f7f5ef;
}

/* Page has hamburger Back / book hops - no drawer close X */
body[data-design-stories-page] .media-view__close,
body[data-design-stories-page] .media-view__chrome:empty {
  display: none !important;
}

/* Phone face: hide desktop book row (same as other books) */
@media (max-width: 767px) {
  body[data-design-stories-page] .site-nav {
    grid-template-columns: 1fr auto !important;
  }
  body[data-design-stories-page] .site-nav__book,
  body[data-design-stories-page] .site-nav__ot,
  body[data-design-stories-page] .explore-nav__word {
    display: none !important;
  }
  body[data-design-stories-page] .site-nav__end {
    grid-column: 2 !important;
    padding-left: 0.35rem !important;
  }
  body[data-design-stories-page] .site-nav__address {
    display: block;
    margin-left: 0.2rem;
    margin-top: 0.28rem;
  }
  body[data-design-stories-page] .site-nav__address-img {
    height: 1.15rem;
    max-width: min(52vw, 12.5rem);
  }
  body[data-design-stories-page] .site-nav__logo {
    height: calc(1.1rem * 1.1 * 1.1 * 1.05 * 1.05);
  }
  /* Taller seek hit target for thumb drag on phone */
  body[data-design-stories-page] .media-view__seek {
    height: 1.75rem;
  }
  body[data-design-stories-page] .media-view__seek::-webkit-slider-thumb {
    width: 11px;
    height: 11px;
    margin-top: -5px;
  }
}

@media (min-width: 768px) {
  body[data-design-stories-page] .explore-nav__item--current {
    opacity: 1;
  }
}

/* Arrive face: choose how to watch (no autoplay).
   Phone portrait: choices sit UNDER the still - not overlaid on the film. */
.ds-arrive {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100svh;
  height: 100dvh;
  z-index: 58;
  align-items: center;
  justify-content: center;
  padding: var(--gutter, 1.25rem);
  background: rgba(10, 10, 10, 0.55);
  color: #fff;
  text-align: center;
  pointer-events: auto;
  box-sizing: border-box;
}
body.ds-phase-arrive .ds-arrive {
  display: flex;
}
.ds-arrive__card {
  max-width: 18rem;
}
.ds-arrive__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: var(--tracking-label, 0.1em);
  text-transform: uppercase;
  opacity: 0.7;
}
.ds-arrive__title {
  margin: 0 0 1.35rem;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.ds-arrive__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
}
.ds-arrive__btn {
  appearance: none;
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0.55rem 0.15rem 0.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: var(--tracking-label, 0.1em);
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Collection convention: underline draw on hover - no shaded pill */
.ds-arrive__btn::after {
  content: "";
  position: absolute;
  left: 0;
  width: calc(100% + 0.12em);
  bottom: 0.1em;
  height: 1px;
  background: #fff;
  opacity: 1;
  transform: scaleX(0);
  transform-origin: left center;
}
.ds-arrive__btn:hover::after,
.ds-arrive__btn:focus-visible::after {
  animation: ds-arrive-underline-draw 0.35s ease forwards;
}
.ds-arrive__btn:focus-visible {
  outline: 1px solid rgba(247, 245, 239, 0.55);
  outline-offset: 3px;
}
.ds-arrive__btn--primary {
  border: 0;
  background: transparent;
}
@keyframes ds-arrive-underline-draw {
  from { transform: scaleX(0); opacity: 1; background: #fff; }
  to { transform: scaleX(1); opacity: 1; background: #fff; }
}
body.ds-phase-arrive .media-view__controls,
body.ds-phase-arrive .media-view__captions,
body.ds-phase-wait-sideways .media-view__controls,
body.ds-phase-wait-sideways .media-view__captions {
  display: none !important;
}

@media (max-width: 767px) and (orientation: portrait) {
  body.ds-phase-arrive .ds-arrive {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    background: transparent;
    pointer-events: none;
  }
  body.ds-phase-arrive .ds-arrive__card {
    position: absolute;
    /* Sit just under the centred 16:9 still (full width of the phone) */
    top: calc(50% + (100vw * 9 / 16) / 2);
    left: 0;
    right: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0.85rem var(--gutter, 1.25rem) calc(1.1rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: #0a0a0a;
    pointer-events: auto;
  }
  body.ds-phase-arrive .ds-arrive__eyebrow {
    margin-bottom: 0.35rem;
  }
  body.ds-phase-arrive .ds-arrive__title {
    margin-bottom: 0.85rem;
    font-size: 1rem;
  }
  body.ds-phase-arrive .ds-arrive__actions {
    gap: 0.55rem;
  }
  body.ds-phase-arrive .ds-arrive__btn {
    width: auto;
  }
}

/* Sideways wait face (after "Turn phone, then watch") */
.ds-rotate-ask {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100svh;
  height: 100dvh;
  z-index: 58;
  align-items: center;
  justify-content: center;
  padding: var(--gutter, 1.25rem);
  background: #0a0a0a;
  color: #fff;
  text-align: center;
  pointer-events: auto;
  box-sizing: border-box;
}
body.ds-phase-wait-sideways .ds-rotate-ask {
  display: flex;
}
.ds-rotate-ask__card {
  max-width: 16rem;
}
.ds-rotate-ask__glyph {
  display: inline-flex;
  margin-bottom: 1.1rem;
  opacity: 0.9;
}
.ds-rotate-ask__glyph svg {
  width: 3rem;
  height: 3rem;
}
.ds-rotate-ask__title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.ds-rotate-ask__note {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: var(--tracking-label, 0.1em);
  text-transform: uppercase;
  opacity: 0.62;
}
.ds-rotate-ask__dismiss {
  appearance: none;
  margin: 0;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.62rem;
  letter-spacing: var(--tracking-label, 0.1em);
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  opacity: 0.7;
  cursor: pointer;
}

/* Upright cinema: still offer sideways (under the bar) */
.ds-cinema-turn {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
  z-index: 72;
  margin: 0;
  padding: 0.35rem var(--gutter, 1.25rem);
  border: 0;
  background: transparent;
  color: #f7f5ef;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: var(--tracking-label, 0.1em);
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0.72;
}
.ds-cinema-turn::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  margin: 0.35rem auto 0;
  background: currentColor;
}
.ds-cinema-turn:hover::after,
.ds-cinema-turn:focus-visible::after {
  animation: ds-arrive-underline-draw 0.35s ease forwards;
}
.ds-cinema-turn:focus-visible {
  outline: 1px solid rgba(247, 245, 239, 0.45);
  outline-offset: 0.25rem;
}
@media (max-width: 767px) and (orientation: portrait) {
  body.ds-phase-cinema .ds-cinema-turn:not([hidden]) {
    display: block;
  }
}
@media (min-width: 768px), (orientation: landscape) {
  .ds-cinema-turn {
    display: none !important;
  }
}

/* Cinema Play ask - after arrive choice */
.ds-play-ask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 54;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0 0 5.5rem;
  border: 0;
  background: rgba(10, 10, 10, 0.28);
  color: #fff;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  pointer-events: none;
}
body.ds-phase-cinema.ds-needs-play .ds-play-ask {
  display: flex;
}
.ds-play-ask__disc,
.ds-play-ask__label {
  pointer-events: auto;
  cursor: pointer;
}
.ds-play-ask__disc {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 0;
  background: rgba(10, 10, 10, 0.35);
}
.ds-play-ask__disc svg {
  width: 1.55rem;
  height: 1.55rem;
  margin-left: 0.15rem;
}
.ds-play-ask__label {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: var(--tracking-label, 0.1em);
  text-transform: uppercase;
  opacity: 0.85;
}

@media (min-width: 768px) {
  .ds-arrive,
  .ds-rotate-ask,
  .ds-play-ask,
  .ds-cinema-turn {
    display: none !important;
  }
}
