/* RMH — Gallery arrows always visible on phones, with safe touch targets. */
@media (max-width: 640px) {
  .gallery-modal[open] {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: 100%;
    max-height: 100dvh;
    padding: 64px 0 45px;
    overflow: hidden;
  }
  .gallery-modal__view {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    height: auto;
    gap: 0;
    touch-action: pan-y;
  }
  .gallery-modal__view img {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
  }
  .gallery-modal__nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 50%;
    background: rgba(97,32,39,.88);
    color: #fff;
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .gallery-modal__nav[data-gallery-prev] {left: 12px;right: auto;}
  .gallery-modal__nav[data-gallery-next] {right: 12px;left: auto;}
  .gallery-modal__nav .i {width: 20px;height: 20px;stroke-width: 2;}
  .gallery-modal__nav:focus-visible {outline: 3px solid #E18763;outline-offset: 3px;}
  .gallery-modal__close {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 12;
    width: 44px;
    height: 44px;
  }
  .gallery-modal__caption {
    box-sizing: border-box;
    flex: none;
    margin: 9px 12px 0;
    min-height: 24px;
    line-height: 1.4;
    text-align: center;
    font-size: .74rem;
  }
}
