/* ARCHIMETRICA 410 — iPhone/PWA navigation and touch controls. */
@media (hover:none), (pointer:coarse), (max-width:980px){
  /* Native mobile taps must win over desktop cursor/hover layers. */
  a, button, [role="button"]{
    -webkit-tap-highlight-color:rgba(255,255,255,.08);
    touch-action:manipulation;
  }

  .lightbox-toolbar{
    z-index:40!important;
    top:max(10px, env(safe-area-inset-top))!important;
    right:max(8px, env(safe-area-inset-right))!important;
    gap:2px!important;
    pointer-events:auto!important;
  }
  .lightbox-toolbar button{
    min-width:44px!important;
    width:48px!important;
    min-height:44px!important;
    height:48px!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }

  /* The desktop lightbox uses an invisible half-screen navigation target and a custom cursor.
     On touch there is no cursor, so show real arrows and keep generous hit areas. */
  .lightbox-nav{
    z-index:20!important;
    top:64px!important;
    bottom:60px!important;
    width:26%!important;
    min-width:64px!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }
  .lightbox-prev{left:0!important}
  .lightbox-next{right:0!important}
  .lightbox-nav::after{
    content:"";
    position:absolute;
    top:50%;
    width:38px;
    height:10px;
    background:url('../assets/icons/arrow-corporate.png') center/100% 100% no-repeat;
    opacity:.82;
    filter:drop-shadow(0 1px 2px rgba(0,0,0,.65));
    transform:translateY(-50%);
    pointer-events:none;
  }
  .lightbox-prev::after{left:max(12px, env(safe-area-inset-left));transform:translateY(-50%) scaleX(-1)}
  .lightbox-next::after{right:max(12px, env(safe-area-inset-right))}

  .lightbox-stage,
  .lightbox-stage > img,
  .lightbox-stage > video{
    -webkit-user-select:none;
    user-select:none;
    -webkit-touch-callout:none;
  }

  .lightbox-close,
  [data-lightbox-grid],
  [data-lightbox-play],
  [data-lightbox-fullscreen],
  .project-footer-top,
  .next-project,
  .site-nav a,
  .language button{
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }
}

@supports (-webkit-touch-callout:none){
  /* iOS Safari: avoid a transparent desktop pointer layer ever becoming a hit target. */
  .lightbox-pointer-cross,.lightbox-pointer-ring,#pointer-dot,#pointer-ring{pointer-events:none!important}
}
