/**
 * wizpos-touch.css -- the staff screens on a touch terminal.
 *
 * WHY THIS FILE EXISTS.
 *
 * On a touch monitor a finger never delivers a clean click. It lands, it drags a pixel, it rests.
 * Chrome reads a press-and-drag across a page as a TEXT SELECTION, so the button label, the total,
 * the table name and the tab caption all highlight blue under the cashier's finger -- and on many
 * panels a slightly long press also raises the browser's own link/image callout. Nothing in the app
 * was broken: the page had simply never said that its own chrome is not selectable text, because on
 * a desktop mouse it never mattered. A mouse click does not select; a finger does.
 *
 * WHAT IT CHANGES, and why each line is here rather than being one blanket rule:
 *
 *   1. user-select: none on the whole document. A drag that starts on a button and ends on the
 *      total must select nothing at all, so this cannot be limited to buttons -- the drag leaves
 *      the button. This is why the rule is on body and not on the controls.
 *
 *   2. Text is turned back on for the things a cashier genuinely needs: typing fields, and anything
 *      marked .wr-selectable for a phone number, an order code or a bill line that is read aloud.
 *      A blanket rule with no exceptions breaks copy-and-paste in the one place it is useful.
 *
 *   3. tap-highlight is removed. Chrome paints a translucent grey rectangle over whatever was
 *      tapped; on a till that reads as a second selection and looks like a rendering fault.
 *
 *   4. touch-action: manipulation on controls removes the 300ms wait for a possible double-tap zoom
 *      and, with it, the accidental zoom when a cashier taps the same key twice quickly. Panning and
 *      scrolling still work, which is why this is not touch-action: none.
 *
 *   5. Images and links lose their long-press callout, which is the iOS "save image / open in new
 *      tab" sheet -- on a shop tablet that pops up over the till and has to be dismissed.
 */

html {
        -webkit-tap-highlight-color: transparent;
}

body {
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
}

/* Text the cashier may need to type into, copy, or read out. */
input,
textarea,
select,
[contenteditable="true"],
.wr-selectable,
code,
.wizpos-print-area {
        -webkit-user-select: text;
        -moz-user-select: text;
        user-select: text;
        -webkit-touch-callout: default;
}

/*
 * The controls themselves. `manipulation` keeps scrolling and pinch but drops the double-tap zoom,
 * and the cursor is left alone so a hybrid till with a mouse still shows a pointer over a button.
 */
button,
a,
label,
summary,
select,
[role="button"],
[role="tab"],
[role="menuitem"],
[role="option"],
.btn,
.nav-link {
        touch-action: manipulation;
}

/* A tap must never start a drag-select on an image or a table cell. */
img,
svg,
td,
th,
h1,
h2,
h3,
h4,
h5,
h6 {
        -webkit-user-select: none;
        user-select: none;
}
