/* BankMovie V296 — iOS Safe-Area header fix + movie-page hero offset
   Keeps Android/desktop geometry untouched. On iPhone/iPad the mobile header
   reserves the real status-bar / Dynamic-Island area before laying out controls.
   Additionally, movie detail heroes get a small extra top offset so the poster
   never visually collides with the iOS status region after the header is lifted. */
@media (max-width: 991.98px) {
  html.bm-ios-safe-header {
    --bm-ios-header-safe-top: max(env(safe-area-inset-top, 0px), var(--bm-ios-vv-top, 0px), var(--bm-ios-safe-fallback, 0px));
    --bm-ios-movie-hero-shift: clamp(12px, calc(var(--bm-ios-header-safe-top) * 0.36), 24px);
    --bm-ios-movie-poster-shift: clamp(4px, calc(var(--bm-ios-header-safe-top) * 0.14), 10px);
  }

  html.bm-ios-safe-header body #siteHeader#siteHeader,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-solid,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-glass,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-admin,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-public-header-v148,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-mobile-header-hidden,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-mobile-header-compact,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-mobile-floating-glass-v148612 {
    top: 0 !important;
    inset: 0 0 auto 0 !important;
    box-sizing: border-box !important;
    height: calc(58px + var(--bm-ios-header-safe-top)) !important;
    min-height: calc(58px + var(--bm-ios-header-safe-top)) !important;
    padding-top: var(--bm-ios-header-safe-top) !important;
  }

  /* Keep the control row itself at the original 58px height; only move the row
     below the unsafe system area. */
  html.bm-ios-safe-header body #siteHeader#siteHeader .header-inner,
  html.bm-ios-safe-header body #siteHeader#siteHeader.header-admin .header-inner,
  html.bm-ios-safe-header body #siteHeader#siteHeader.bm-public-header-v148 .header-inner {
    box-sizing: border-box !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    margin: 0 !important;
  }

  /* iOS Safari can briefly report a fractional viewport offset while its bars
     animate. Keep the controls stable rather than letting them jump into the
     status bar. */
  html.bm-ios-safe-header body #siteHeader#siteHeader .menu-btn,
  html.bm-ios-safe-header body #siteHeader#siteHeader .bm-header-collection,
  html.bm-ios-safe-header body #siteHeader#siteHeader .notif-bell,
  html.bm-ios-safe-header body #siteHeader#siteHeader .bm-header-search,
  html.bm-ios-safe-header body #siteHeader#siteHeader .logo {
    translate: none !important;
  }

  /* V296: movie pages need a touch more breathing room than the homepage.
     Shift the hero block down a little so the poster clears the lifted iOS header. */
  html.bm-ios-safe-header body.movie-page .movie-detail,
  html.bm-ios-safe-header body.bm-movie-template-cinematic .movie-detail,
  html.bm-ios-safe-header body.movie-page[data-bm-mobile-layout] .movie-detail {
    margin-top: var(--bm-ios-movie-hero-shift) !important;
  }

  html.bm-ios-safe-header body.movie-page .movie-detail > .poster-col,
  html.bm-ios-safe-header body.bm-movie-template-cinematic .movie-detail > .poster-col,
  html.bm-ios-safe-header body.movie-page[data-bm-mobile-layout] .movie-detail > .poster-col {
    margin-top: var(--bm-ios-movie-poster-shift) !important;
  }

  /* If the page uses a centered poster stack, keep the title rhythm intact too. */
  html.bm-ios-safe-header body.movie-page .movie-title-fa,
  html.bm-ios-safe-header body.movie-page .movie-title-en {
    scroll-margin-top: calc(74px + var(--bm-ios-header-safe-top)) !important;
  }
}
