/* XLOUD iPad/Safari compatibility patch v2.4.
   Loaded after the cinematic styles. No changes to the approved desktop artwork. */
html, body { max-width: 100%; overflow-x: hidden; }
#page-wrapper, #start, #body-wrapper { min-width: 0; }
#header .navbar, .xc-wide, .xc-hero-text, .xc-feature-grid, .xc-player-center,
.xc-book-columns, .xc-booking-form, .xc-beats-preview { min-width: 0; }

/* Safari paints the image/video and its text overlays more reliably when
   they have positive, explicit stacking levels (rather than z-index:-1). */
.xc-home-hero { position: relative !important; isolation: isolate !important; }
.xc-home-hero .xc-hero-photography { z-index: 0 !important; }
.xc-home-hero::before { z-index: 1 !important; pointer-events: none !important; }
.xc-home-hero .xc-hero-layout { position: relative !important; z-index: 2 !important; }
.xc-home-hero .xc-motion-toggle { z-index: 4 !important; }
.xc-home-hero .xc-hero-video { -webkit-backface-visibility: hidden; backface-visibility: hidden; }

/* Quark's original mobile menu changes at 840px, but XLOUD used 850px.
   Tablets can be wider than both; give iPads a dependable touch menu. */
@media (min-width: 841px) and (max-width: 1180px) {
  #header .navbar-section.desktop-menu, #header .dropmenu { display: none !important; }
  body .mobile-menu { display: block !important; }
}
@media (max-width: 1180px) {
  body .mobile-menu { position: fixed !important; top: 0 !important; right: 0 !important;
    z-index: 2300 !important; width: 72px; height: 92px; }
  body .mobile-menu .button_container { position: absolute; top: 32px !important;
    right: max(20px, env(safe-area-inset-right)) !important; z-index: 2301 !important;
    width: 32px; height: 28px; padding: 0; }
  body .mobile-menu .button_container span { background: #f9edf9 !important; }
  body .mobile-menu .button_container.active { position: fixed !important; }
  body .mobile-container { position: relative !important; top: 0 !important;
    left: 0 !important; z-index: 2200 !important; }
  body .mobile-container .overlay { position: fixed !important; top: 0 !important;
    left: 0 !important; width: 100% !important; z-index: 2200 !important;
    background: rgba(5, 5, 17, .98) !important; -webkit-overflow-scrolling: touch; }
  body .mobile-container .overlay.open { height: 100vh !important;
    opacity: 1 !important; visibility: visible !important; overflow-y: auto !important; }
  body .mobile-container .overlay-menu { height: calc(100% - 104px) !important;
    padding-bottom: 48px; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
  body.mobile-nav-open { overflow: hidden !important; }
  #header .navbar-section.logo { flex: 0 1 auto; min-width: 0 !important; }
  body.xloud-is-home #header .navbar, body.xloud-is-inner #header .navbar { justify-content: flex-start !important; }
  .xc-feature-grid > *, .xc-player-layout > *, .xc-book-columns > * { min-width: 0; }
}
@media (max-width: 850px) {
  body .mobile-menu { height: 78px; }
  body .mobile-menu .button_container { top: 25px !important; }
  .xc-home-hero .xc-hero-video { object-fit: cover !important; object-position: center !important; }
  .xc-home-hero .xc-hero-photography { -webkit-transform: translateZ(0); transform: translateZ(0); }
}
@media (min-width: 651px) and (max-width: 1040px) {
  .xc-feature-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .xc-feature-grid > .xc-feature:last-child { grid-column: 1 / -1 !important; }
  .xc-player-layout { grid-template-columns: 130px minmax(0,1fr) !important; }
  .xc-track-list { grid-column: 1 / -1 !important; }
  .xc-hero-text { max-width: min(640px, 100%) !important; }
}
@media (max-width: 650px) {
  .xc-feature-grid { grid-template-columns: 1fr !important; }
  .xc-feature-grid > .xc-feature:last-child { grid-column: auto !important; }
}
/* Responsive embedded players should never push the page offscreen. */
#start iframe, #body-wrapper iframe, .xc-soundcloud iframe {
  max-width: 100% !important; box-sizing: border-box !important;
}
@media (prefers-reduced-motion: reduce) {
  .xc-home-hero .xc-hero-video { display: none !important; }
  .xc-home-hero .xc-hero-photography { animation: none !important; }
}
@supports (height: 100dvh) {
  @media (max-width: 1180px) {
    body .mobile-container .overlay.open { height: 100dvh !important; }
  }
}
