/* ==========================================================================
   mobile-native.css - platform-layer fixes for touch devices.
   Linked from every page and widget right after the viewport meta tag.
   Capability queries only, never device sniffing. Hover styles are gated
   per page behind (hover: hover) and (pointer: fine), this file supplies
   the matching touch behavior. Source: the mobile-native skill.
   ========================================================================== */

html {
  -webkit-tap-highlight-color: transparent; /* no gray flash on tap */
  -webkit-text-size-adjust: 100%;           /* no font inflation in landscape */
  text-size-adjust: 100%;
}

/* Tap fires immediately, no double-tap-zoom wait. */
a, button, [role="button"], summary, label, select {
  touch-action: manipulation;
}

/* Controls are not selectable text. Body copy and links stay selectable. */
button, [role="button"], summary {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* iOS zooms the page when an input under 16px takes focus. Zero specificity
   (:where) so a page's own larger size still wins. */
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"], [type="button"], [type="range"]), textarea, select) {
  font-size: 16px;
}

/* Press feedback on touch, since the tap highlight is gone. Instant, no transition. */
@media (pointer: coarse) {
  a.btn:active, .btn:active, button:active, [role="button"]:active {
    opacity: 0.8;
  }
}
