/* ==========================================================================
   Mobile presentation layout — <768px rules for the story presentation surface
   Targets: .presentation-root, .pres-*, .deck-dots, .tww-*, .visual-frame,
            .media-item, .narration-transcript
   Desktop: no-op (all rules live inside the 767px media query)

   NOTE: the retired SwipePanel primitive's own rule blocks (.swipe-panel,
   .swipe-panel-column, .swipe-panel-dot(s)) were excised 2026-08-14 along with
   js/mobile/swipe-panel.js, which had zero callers. The presentation-layout
   rules below are LIVE and are why this file survives. A rename to
   mobile-presentation-layout.css is deliberately deferred (it churns sw.js,
   index.html and the library docs).
   ========================================================================== */

@media (max-width: 767px) {

  /* ==========================================================================
     Story Presentation — Mobile Layout
     ========================================================================== */

  /* ── Presentation controls: move from right strip to bottom bar ── */
  .presentation-root .pres-controls {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 44px; /* above scrub bar (44px) */
    top: auto;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 76;
  }

  .presentation-root .pres-controls .narrative-toggle {
    order: -1;
  }

  .presentation-root .pres-controls .deck-dots {
    display: flex;
    flex-direction: row;
    gap: 4px;
  }

  .presentation-root .pres-controls .deck-dots .deck-dot {
    width: 8px;
    height: 8px;
  }

  /* ── Card padding: remove right padding (controls no longer on right) ── */
  .presentation-root .pres-card,
  .presentation-embedded .pres-card {
    padding-right: 8px !important;
    padding-bottom: 100px !important; /* clear scrub + controls */
  }

  .presentation-root .pres-card-inner {
    max-width: 100% !important;
  }

  /* ── TWW stage: single column on mobile ── */
  .presentation-root .tww-stage {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  /* Hide wings on mobile */
  .presentation-root .tww-left-wing,
  .presentation-root .tww-right-wing {
    display: none !important;
  }

  /* Center column: full width */
  .presentation-root .tww-center {
    grid-column: 1 !important;
  }

  /* Media items: ensure visible sizing */
  .presentation-root .media-item[data-slot="primary"] {
    max-height: 45vh;
  }

  /* ── Subtitles: position above controls ── */
  .presentation-root .pres-subtitles {
    bottom: 80px; /* above controls (32px) + scrub (44px) */
  }

  /* ── Header: tighter on mobile ── */
  .presentation-root .pres-header {
    padding: 8px 12px;
  }

  .presentation-root .pres-header-story {
    display: none;
  }

  .presentation-root .pres-header-separator {
    display: none;
  }

  /* ==========================================================================
     Story Presentation — Landscape Mode (two-column, no swipe needed)
     ========================================================================== */
  @media (orientation: landscape) and (max-height: 500px) {

    .presentation-root .pres-card-inner {
      display: flex !important;
      flex-direction: row !important;
      padding: 48px 8px 56px 8px !important;
      gap: 12px;
    }

    /* Left: narration (45%) */
    .presentation-root .narration-transcript,
    .presentation-root .visual-frame {
      flex: 0 0 45%;
      overflow-y: auto;
    }

    /* Right: primary media (55%) */
    .presentation-root .tww-stage {
      flex: 0 0 55%;
      grid-template-columns: 1fr !important;
    }

    /* Controls: compact horizontal bar */
    .presentation-root .pres-controls {
      bottom: 44px;
      padding: 4px 12px;
    }
  }

}
