/*
 * NOCTRA 2.4.11 · GM Warehouse Mobile Polish
 * Public frontend only. Keeps desktop untouched and gives the Warehouse preset
 * a consistent mobile composition instead of a compressed desktop layout.
 */

@media (max-width: 900px) {
  body.preset-warehouse {
    --mobile-edge: clamp(16px, 4.4vw, 22px);
    --mobile-header: 76px;
    --header: var(--mobile-header);
  }

  body.preset-warehouse .container {
    width: min(var(--max), calc(100% - (var(--mobile-edge) * 2)));
  }

  /* ---------------------------------------------------------
     HEADER / NAVIGATION
     --------------------------------------------------------- */
  body.preset-warehouse .site-header,
  body.preset-warehouse .site-header.site-header--newsletter-hidden {
    height: var(--mobile-header);
    padding-left: max(var(--mobile-edge), env(safe-area-inset-left));
    padding-right: max(var(--mobile-edge), env(safe-area-inset-right));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 7px;
    align-items: center;
    background: rgba(9, 7, 14, .94);
    border-bottom: 1px solid rgba(139, 92, 246, .22);
    backdrop-filter: blur(16px) saturate(135%);
  }

  body.preset-warehouse .site-header.scrolled {
    height: 68px;
    background: rgba(8, 7, 12, .97);
  }

  body.preset-warehouse .brand {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 5;
    min-width: 0;
    max-width: 100%;
  }

  body.preset-warehouse .brand img,
  body.preset-warehouse .site-header.scrolled .brand img {
    width: 58px;
    height: 58px;
    max-width: 58px;
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
  }

  body.preset-warehouse .site-header.scrolled .brand img {
    width: 52px;
    height: 52px;
    max-width: 52px;
    max-height: 52px;
  }

  body.preset-warehouse .language-switch,
  body.preset-warehouse .site-header.site-header--newsletter-hidden .language-switch {
    grid-column: 2;
    grid-row: 1;
    position: static;
    z-index: 5;
    right: auto;
    top: auto;
    transform: none;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    padding: 0 4px;
    font-size: 1rem;
  }

  body.preset-warehouse .language-switch a {
    display: grid;
    place-items: center;
    width: 32px;
    height: 40px;
    opacity: .48;
  }

  body.preset-warehouse .language-switch a.active { opacity: 1; }
  body.preset-warehouse .language-switch > span { font-size: .62rem; opacity: .22; }

  body.preset-warehouse .menu-toggle {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    z-index: 6;
    justify-self: end;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 -6px 0 0;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: #fff;
    cursor: pointer;
  }

  body.preset-warehouse .menu-toggle:focus-visible {
    outline: 0;
    border-color: rgba(183, 164, 255, .72);
  }

  body.preset-warehouse .menu-toggle span {
    position: absolute;
    left: 9px;
    right: 9px;
    top: 50%;
    width: auto;
    height: 2px;
    margin: -1px 0 0;
    background: #f7f4fb;
    transform-origin: center;
  }

  body.preset-warehouse .menu-toggle span:first-child { transform: translateY(-5px); }
  body.preset-warehouse .menu-toggle span:last-child { transform: translateY(5px); }
  body.preset-warehouse .menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
  body.preset-warehouse .menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

  body.preset-warehouse .nav {
    position: fixed;
    z-index: 3;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding:
      calc(var(--mobile-header) + max(28px, env(safe-area-inset-top)))
      max(var(--mobile-edge), env(safe-area-inset-right))
      calc(36px + env(safe-area-inset-bottom))
      max(var(--mobile-edge), env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      radial-gradient(circle at 90% 8%, rgba(139, 92, 246, .17), transparent 32%),
      linear-gradient(180deg, rgba(8, 7, 13, .995), rgba(7, 6, 11, .995));
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-18px);
    transition: opacity .24s ease, transform .24s ease, visibility .24s;
  }

  body.preset-warehouse .nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  body.preset-warehouse .nav a {
    flex: 0 0 auto;
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 12px 2px;
    border-bottom: 1px solid rgba(183, 164, 255, .14);
    color: rgba(248, 245, 255, .88);
    font-family: var(--font-display);
    font-size: clamp(1.72rem, 8.2vw, 2.55rem);
    font-weight: 800;
    line-height: .96;
    letter-spacing: -.035em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  body.preset-warehouse .nav a.active {
    color: #B7A4FF;
  }

  body.preset-warehouse .nav a.active::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    margin-right: 12px;
    border-radius: 50%;
    background: #8B5CF6;
    box-shadow: 0 0 0 5px rgba(139, 92, 246, .11);
  }

  body.preset-warehouse .nav a::after { display: none; }
  body.preset-warehouse.menu-open .mobile-ticket { transform: translateY(160%) !important; }

  /* Floating ticket bar: respect safe areas and remain readable at 320–430px. */
  body.preset-warehouse .mobile-ticket {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid rgba(139, 92, 246, .28);
    background: #eeeaf6;
    color: #17131d;
  }

  body.preset-warehouse .mobile-ticket strong { min-width: 0; }

  /* ---------------------------------------------------------
     GLOBAL MOBILE RHYTHM
     --------------------------------------------------------- */
  body.preset-warehouse .section {
    padding-top: clamp(58px, 14vw, 82px);
    padding-bottom: clamp(58px, 14vw, 82px);
  }

  body.preset-warehouse .page-hero {
    padding-top: calc(var(--mobile-header) + 48px);
    padding-bottom: clamp(52px, 12vw, 74px);
  }

  body.preset-warehouse .page-hero h1 {
    max-width: 100%;
    font-size: clamp(3rem, 14vw, 5.5rem);
    line-height: .9;
    letter-spacing: -.05em;
    overflow-wrap: anywhere;
  }

  body.preset-warehouse .page-hero p { font-size: .98rem; }
  body.preset-warehouse .section-head { gap: 18px; }
  body.preset-warehouse .section-head h2 { overflow-wrap: anywhere; }

  /* ---------------------------------------------------------
     PROGRAM / EVENT CARDS
     --------------------------------------------------------- */
  body.preset-warehouse .event-view-tabs {
    gap: 8px;
    margin-bottom: 22px;
  }

  body.preset-warehouse .event-view-tabs a {
    min-height: 46px;
    padding: 9px 12px;
  }

  body.preset-warehouse .event-editorial-actions .btn,
  body.preset-warehouse .program-actions .btn {
    min-height: 46px;
  }

  /* ---------------------------------------------------------
     EVENT DETAIL
     --------------------------------------------------------- */
  body.preset-warehouse .event-detail-hero {
    min-height: 0;
    padding-top: calc(var(--mobile-header) + 36px);
    padding-bottom: 62px;
    align-items: flex-start;
  }

  body.preset-warehouse .event-detail-grid {
    gap: 42px;
  }

  body.preset-warehouse .event-poster {
    width: min(100%, 470px);
    margin-inline: auto;
  }

  body.preset-warehouse .event-poster::after {
    inset: 9px -9px -9px 9px;
  }

  body.preset-warehouse .event-poster img {
    width: 100%;
    max-height: none;
    object-fit: contain;
  }

  body.preset-warehouse .event-poster .sold-out-stamp,
  body.preset-warehouse .event-poster .event-status-stamp {
    max-width: calc(100% - 24px);
    padding: .68em .8em;
    font-size: clamp(.78rem, 3.5vw, 1rem);
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  body.preset-warehouse .event-detail-copy h1 {
    margin-bottom: 24px;
    font-size: clamp(3rem, 14vw, 5.4rem);
    line-height: .9;
    overflow-wrap: anywhere;
  }

  body.preset-warehouse .event-detail-date { gap: 14px; }
  body.preset-warehouse .event-detail-date strong { font-size: clamp(3.5rem, 16vw, 4.6rem); }
  body.preset-warehouse .event-detail-meta { gap: 7px; }

  body.preset-warehouse .event-share { margin-top: 40px; }
  body.preset-warehouse .event-share-copy strong {
    font-size: clamp(1.35rem, 7vw, 2rem);
    line-height: 1.08;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.preset-warehouse .event-share-actions {
    justify-content: stretch;
  }

  body.preset-warehouse .event-share-button {
    flex: 1 1 180px;
    min-height: 48px;
  }

  /* ---------------------------------------------------------
     ARTISTS
     --------------------------------------------------------- */
  body.preset-warehouse .artist-profile-hero {
    min-height: 0;
    padding-top: calc(var(--mobile-header) + 42px);
    padding-bottom: 66px;
  }

  body.preset-warehouse .artist-profile-grid { gap: 36px; }
  body.preset-warehouse .artist-profile-image {
    width: min(86vw, 430px);
    justify-self: center;
  }

  body.preset-warehouse .artist-profile-image::before { inset: -9px 9px 9px -9px; }
  body.preset-warehouse .artist-profile-copy h1 {
    font-size: clamp(3rem, 15vw, 5.2rem);
    overflow-wrap: anywhere;
  }

  body.preset-warehouse .artist-profile-tagline {
    color: #d8cfff;
    font-size: 1.08rem;
  }

  body.preset-warehouse .artist-socials a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ---------------------------------------------------------
     LOCATION / CONTACT / RENTAL
     --------------------------------------------------------- */
  body.preset-warehouse .visitor-info-head,
  body.preset-warehouse .location-floors-intro { gap: 18px; }

  body.preset-warehouse .visitor-info-card {
    min-height: 0;
    padding: 24px 22px;
  }

  body.preset-warehouse .rental-form-shell,
  body.preset-warehouse .contact-form-shell {
    gap: 30px;
    padding: clamp(22px, 5vw, 32px);
  }

  body.preset-warehouse .rental-form-intro { position: static; }
  body.preset-warehouse .rental-form-card { padding: clamp(20px, 5vw, 30px); }
  body.preset-warehouse .rental-field input,
  body.preset-warehouse .rental-field select,
  body.preset-warehouse .rental-field textarea { font-size: 16px; }

  body.preset-warehouse .rental-included-card,
  body.preset-warehouse .rental-usecase-grid--six .usecase-card { min-height: 0; }

  /* ---------------------------------------------------------
     GALLERY / LIGHTBOX
     --------------------------------------------------------- */
  body.preset-warehouse .gallery-lightbox {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  body.preset-warehouse .gallery-lightbox__panel { height: calc(100dvh - 16px); }
  body.preset-warehouse .gallery-lightbox__close { width: 48px; height: 48px; }
  body.preset-warehouse .gallery-lightbox__nav { width: 48px; height: 48px; }

  /* ---------------------------------------------------------
     PRETIX MODAL
     --------------------------------------------------------- */
  body.preset-warehouse .pretix-checkout-modal {
    place-items: end center;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  }

  body.preset-warehouse .pretix-checkout-modal__dialog {
    width: 100%;
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom));
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    border-bottom: 0;
  }

  /* ---------------------------------------------------------
     FOOTER
     --------------------------------------------------------- */
  body.preset-warehouse .footer-main { gap: 30px 24px; }
  body.preset-warehouse .footer-bottom { align-items: start; }
}

@media (max-width: 640px) {
  body.preset-warehouse { --mobile-edge: 16px; }

  body.preset-warehouse .site-header,
  body.preset-warehouse .site-header.site-header--newsletter-hidden {
    column-gap: 3px;
  }

  body.preset-warehouse .brand img {
    width: 54px;
    height: 54px;
    max-width: 54px;
    max-height: 54px;
  }

  body.preset-warehouse .site-header.scrolled .brand img {
    width: 49px;
    height: 49px;
    max-width: 49px;
    max-height: 49px;
  }

  body.preset-warehouse .language-switch { gap: 1px; padding-inline: 0; }
  body.preset-warehouse .language-switch a { width: 28px; }
  body.preset-warehouse .menu-toggle { width: 44px; height: 44px; }

  body.preset-warehouse .nav {
    padding-top: calc(var(--mobile-header) + max(22px, env(safe-area-inset-top)));
  }

  body.preset-warehouse .nav a {
    min-height: 54px;
    font-size: clamp(1.6rem, 8.8vw, 2.3rem);
  }

  body.preset-warehouse .mobile-ticket span { display: none; }
  body.preset-warehouse .mobile-ticket { grid-template-columns: minmax(0, 1fr) auto; }

  body.preset-warehouse .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  body.preset-warehouse .page-hero {
    padding-top: calc(var(--mobile-header) + 38px);
    padding-bottom: 50px;
  }

  body.preset-warehouse .event-editorial-actions,
  body.preset-warehouse .event-share-actions,
  body.preset-warehouse .artist-socials {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.preset-warehouse .event-editorial-actions .btn,
  body.preset-warehouse .event-share-button,
  body.preset-warehouse .artist-socials a {
    width: 100%;
    justify-content: center;
  }

  body.preset-warehouse .event-detail-grid { gap: 34px; }
  body.preset-warehouse .event-poster { width: min(88vw, 420px); }

  body.preset-warehouse .event-status-notice {
    display: grid;
    gap: 5px;
    padding: 12px 16px;
  }

  body.preset-warehouse .event-status-notice strong { font-size: .76rem; }

  body.preset-warehouse .rental-form-shell,
  body.preset-warehouse .contact-form-shell {
    width: min(var(--max), calc(100% - (var(--mobile-edge) * 2)));
    padding: 18px;
  }

  body.preset-warehouse .rental-form-card { padding: 20px 15px; }
  body.preset-warehouse .rental-format-grid { grid-template-columns: 1fr; }
  body.preset-warehouse .rental-choice-card { min-height: 0; }
  body.preset-warehouse .rental-form-step { grid-template-columns: 36px minmax(0, 1fr); }

  body.preset-warehouse .footer-main {
    grid-template-columns: 1fr;
    padding: 48px 0 38px;
  }

  body.preset-warehouse .footer-intro { grid-column: auto; }
  body.preset-warehouse .footer-bottom {
    display: grid;
    gap: 8px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.preset-warehouse .pretix-checkout-ticket,
  body.preset-warehouse .pretix-checkout-quantity,
  body.preset-warehouse .pretix-checkout-total {
    gap: 14px;
  }

  body.preset-warehouse .pretix-checkout-modal__event h2 {
    font-size: clamp(2rem, 11vw, 3.4rem);
    overflow-wrap: anywhere;
  }
}

/* Small phones / narrow browser windows. */
@media (max-width: 360px) {
  body.preset-warehouse { --mobile-edge: 13px; }
  body.preset-warehouse .brand img { width: 50px; height: 50px; }
  body.preset-warehouse .language-switch a { width: 25px; font-size: .9rem; }
  body.preset-warehouse .language-switch > span { display: none; }
  body.preset-warehouse .menu-toggle { width: 40px; }
  body.preset-warehouse .nav a { font-size: 1.55rem; }
}

/* Landscape phones: the navigation must stay scrollable instead of clipping. */
@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  body.preset-warehouse .nav {
    padding-top: calc(var(--mobile-header) + 12px);
    padding-bottom: 20px;
  }
  body.preset-warehouse .nav a {
    min-height: 42px;
    padding-block: 8px;
    font-size: clamp(1.35rem, 5vw, 1.85rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.preset-warehouse .nav,
  body.preset-warehouse .menu-toggle span { transition: none !important; }
}
