/* ==========================================================================
   Pressed state, one for everything you can tap (owner INBOX #736.6, REPORT-site-polish-2026-11-12 item 1).
   ONE stylesheet, loaded on every front-end page (inc/avs-press.php).

   What a press looks like: the element darkens a little and shrinks to 97 %, in 120 ms, and comes back the same way.
   Where it applies, the browser's own tap flash (Android's blue box) is switched off. Elements that are not in the
   list below keep the browser's flash, so nothing is left with no feedback at all.

   The list (section 1): every real button, every <summary>, and links that are boxes: class names holding
   btn / pill / chip / card / tile / cta / tab / ticket, plus the home quick picks and ticket quick links (plain <a>).
   Plain text links are not in it.

   Why "scale" and not "transform": the scale property adds to an element's own transform (coverflow tilt, the
   stacking cards, the soft-lift buttons' 1 px press) and never replaces it. No colours are set: the darkening is a
   brightness filter, so every button, pill and card keeps its own guide colours.

   NOT in the list, on purpose: "stretched" links (a small link whose ::after covers its whole card, e.g. the home
   ticket's .fs-strip-stretch). A scale or filter on such a link would pull its ::after back onto the link itself
   mid-press and the tap would be lost. Their class names hold "stretch"; keep that word in any new one.

   Reduced motion: darkens only, no shrinking, no transition.
   ========================================================================== */

/* ---- 1. The list: no browser tap flash, and a gentle way back after the press ---------------------------------- */
:where(
	button,
	summary,
	[role="button"],
	input[type="submit"],
	input[type="button"],
	a[class*="btn"],
	a[class*="pill"],
	a[class*="chip"],
	a[class*="card"],
	a[class*="tile"],
	a[class*="cta"],
	a[class*="tab"],
	a[class*="ticket"],
	.fs-find-picks a,
	.fs-strip-quick a
):not([class*="stretch"]):not([disabled]):not([aria-disabled="true"]) {
	-webkit-tap-highlight-color: transparent;
	/* zero specificity (:where): an element's own transition always wins; this only covers the ones with none */
	transition: scale .12s ease, filter .12s ease;
}

/* ---- 1b. Touch screens: a held press must not start the phone's own long-press effects (#742) --------------------
   Seen on an iPhone: pressing a gold button on or near its label turned it black. The labels were selectable text
   (user-select: text) inside links with the default long-press "lift" (-webkit-touch-callout: default). iOS draws
   that lift / selection as a plate behind the label, filled with the nearest solid background-color; the buttons
   are painted with a gradient (no background-color), so the plate took the page's near-black navy.
   Fix: on touch screens the label is not selectable and the long-press lift is off, so the only thing a press
   shows is section 2 (darken + shrink). The tap itself is untouched. Mouse users can still select the text.
   Zero specificity (:where): a page rule that asks for the long-press menu keeps it (job cards:
   "body.aviju-page a.aviju-card { -webkit-touch-callout: default }", so "open in new tab" still works there). */
@media (hover: none) and (pointer: coarse) {
	:where(
		button,
		summary,
		[role="button"],
		input[type="submit"],
		input[type="button"],
		a[class*="btn"],
		a[class*="pill"],
		a[class*="chip"],
		a[class*="card"],
		a[class*="tile"],
		a[class*="cta"],
		a[class*="tab"],
		a[class*="ticket"],
		.fs-find-picks a,
		.fs-strip-quick a
	):not([class*="stretch"]) {
		-webkit-user-select: none;
		user-select: none;
		-webkit-touch-callout: none;
	}
}

/* ---- 2. The press ------------------------------------------------------------------------------------------------ */
html body :is(
	button,
	summary,
	[role="button"],
	input[type="submit"],
	input[type="button"],
	a[class*="btn"],
	a[class*="pill"],
	a[class*="chip"],
	a[class*="card"],
	a[class*="tile"],
	a[class*="cta"],
	a[class*="tab"],
	a[class*="ticket"],
	.fs-find-picks a,
	.fs-strip-quick a
):not([class*="stretch"]):not([disabled]):not([aria-disabled="true"]):not(#avs-press):active {
	scale: .97;
	filter: brightness(.9);
	transition: scale .12s ease, filter .12s ease;
}

/* ---- 3. Reduced motion: darken only ----------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	:where(
		button, summary, [role="button"], input[type="submit"], input[type="button"],
		a[class*="btn"], a[class*="pill"], a[class*="chip"], a[class*="card"], a[class*="tile"], a[class*="cta"],
		a[class*="tab"], a[class*="ticket"], .fs-find-picks a, .fs-strip-quick a
	):not([class*="stretch"]) {
		transition: none;
	}
	html body :is(
		button, summary, [role="button"], input[type="submit"], input[type="button"],
		a[class*="btn"], a[class*="pill"], a[class*="chip"], a[class*="card"], a[class*="tile"], a[class*="cta"],
		a[class*="tab"], a[class*="ticket"], .fs-find-picks a, .fs-strip-quick a
	):not([class*="stretch"]):not(#avs-press):active {
		scale: none;
		transition: none;
	}
}
