/*
 * ADS-Netz — mobile-only overrides.
 * Desktop/browser layout is unchanged: every rule lives inside mobile media queries.
 * Sparkle uses a fixed 960px canvas; js/mobile.js zooms #ads-m-scale and injects hamburger.
 */

/* Touch / phone viewports only — not resized desktop windows with a mouse */
@media screen and (max-width: 959px) and (pointer: coarse),
       screen and (max-width: 959px) and (hover: none) {
  html {
    overflow-x: hidden !important;
    max-width: 100% !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  body,
  body#b {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    /* Fixed hamburger must not inherit Sparkle body zoom */
    zoom: 1 !important;
  }

  #ads-m-scale {
    min-width: 0;
    width: 960px;
    max-width: none;
    transform-origin: top left;
  }

  /* Restore text selection on mobile (Sparkle disables it on li p) */
  li p {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
  }

  a[style*="display:block"] {
    -webkit-tap-highlight-color: rgba(113, 33, 119, 0.25);
  }

  h1 {
    letter-spacing: 0.12em !important;
  }

  /* Sparkle sidebar menu replaced by hamburger on mobile */
  ul.menu-dropdown.ads-m-hide-sparkle-menu {
    display: none !important;
  }

  /* ----- Hamburger + drawer (injected by js/mobile.js) ----- */
  #ads-m-nav {
    display: block;
  }

  .ads-m-nav-toggle {
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    z-index: 100002;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #712177;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ads-m-nav-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  .ads-m-nav-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 16px;
  }

  .ads-m-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 1px;
    background: #fff;
    transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
  }

  .ads-m-bar:nth-child(1) {
    top: 0;
  }
  .ads-m-bar:nth-child(2) {
    top: 7px;
  }
  .ads-m-bar:nth-child(3) {
    top: 14px;
  }

  /* Icon → X when open */
  #ads-m-nav.is-open .ads-m-bar:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
  }
  #ads-m-nav.is-open .ads-m-bar:nth-child(2) {
    opacity: 0;
  }
  #ads-m-nav.is-open .ads-m-bar:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
  }

  .ads-m-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(20, 10, 24, 0.45);
  }

  .ads-m-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100001;
    width: min(86vw, 320px);
    height: 100%;
    max-height: 100dvh;
    margin: 0;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 0
      calc(16px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .ads-m-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 56px 12px 20px;
    border-bottom: 1px solid #e6d6ea;
  }

  .ads-m-nav-title {
    margin: 0;
    font-family: Lato, Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #712177;
  }

  .ads-m-nav-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
  }

  .ads-m-nav-list li {
    margin: 0;
    padding: 0;
  }

  .ads-m-nav-list a {
    display: block;
    padding: 14px 20px;
    font-family: Lato, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.35;
    color: #222;
    text-decoration: none;
    border-bottom: 1px solid #f0e6f2;
    -webkit-tap-highlight-color: rgba(113, 33, 119, 0.15);
  }

  .ads-m-nav-list a:active,
  .ads-m-nav-list a:focus-visible {
    background: #f7eef8;
    color: #712177;
  }

  html.ads-m-nav-lock,
  html.ads-m-nav-lock body {
    overflow: hidden !important;
  }
}

/* Outside the mobile gate: never show injected chrome (desktop safety) */
@media screen and (min-width: 960px),
       screen and (pointer: fine) and (hover: hover) {
  #ads-m-nav {
    display: none !important;
  }
}

@media screen and (max-width: 480px) and (pointer: coarse),
       screen and (max-width: 480px) and (hover: none) {
  html,
  body,
  body#b {
    overflow-x: hidden !important;
  }
}
