/*
 * shs-crosshair.css: rifle-scope reticle cursor (see shs-crosshair.js).
 *
 * The native cursor is hidden only while html.shs-crosshair-live is set.
 * The doubled class (0,2,x) beats the Customizer rules
 * `*{cursor:crosshair}`, `a:hover{cursor:cell!important}` and
 * `a:hover img, button:hover{cursor:cell!important}` (at most 0,1,2).
 */

html.shs-crosshair-live.shs-crosshair-live,
html.shs-crosshair-live.shs-crosshair-live *,
html.shs-crosshair-live.shs-crosshair-live *::before,
html.shs-crosshair-live.shs-crosshair-live *::after {
	cursor: none !important;
}

/* Where the reticle steps aside, give form fields their normal cursor
   instead of the Customizer's `*{cursor:crosshair}`. */
html.shs-crosshair-ready.shs-crosshair-ready input,
html.shs-crosshair-ready.shs-crosshair-ready textarea,
html.shs-crosshair-ready.shs-crosshair-ready select,
html.shs-crosshair-ready.shs-crosshair-ready [contenteditable] {
	cursor: auto;
}

.shs-crosshair {
	--shs-ch-ink: #121212;
	--shs-ch-halo: rgba(255, 255, 255, 0.78);
	--shs-ch-red: #e91e28;
	--shs-ch-red-deep: #cc0000;
	position: fixed;
	left: 0;
	top: 0;
	z-index: 2147483647;
	width: 128px;
	height: 128px;
	margin: 0;
	padding: 0;
	border: 0;
	pointer-events: none;
	user-select: none;
	opacity: 0;
	visibility: hidden;
	transform: translate3d(-200px, -200px, 0);
	will-change: transform;
	contain: layout style size;
	transition: opacity 0.12s linear, visibility 0s linear 0.12s;
}

.shs-crosshair--visible {
	opacity: 1;
	visibility: visible;
	transition: none;
}

.shs-crosshair__layer {
	position: absolute;
	left: 0;
	top: 0;
	width: 128px;
	height: 128px;
	transform-origin: 64px 64px;
	pointer-events: none;
}

.shs-crosshair__ring,
.shs-crosshair__posts {
	will-change: transform;
	transition: scale 0.14s ease-out;
}

.shs-crosshair .shs-crosshair__svg {
	display: block;
	width: 128px;
	height: 128px;
	max-width: none;
	max-height: none;
	overflow: visible;
	margin: 0;
	transform: none;
}

/* Etched ink over a light halo */
.shs-crosshair .shs-ch-ink {
	fill: none;
	stroke: var(--shs-ch-ink);
	stroke-linecap: butt;
	transition: stroke 0.12s linear;
}
.shs-crosshair .shs-ch-ink-fill {
	fill: var(--shs-ch-ink);
	stroke: none;
	transition: fill 0.12s linear;
}
.shs-crosshair .shs-ch-halo {
	fill: none;
	stroke: var(--shs-ch-halo);
	stroke-linecap: round;
}
.shs-crosshair .shs-ch-halo-fill {
	fill: var(--shs-ch-halo);
}
.shs-crosshair .shs-ch-stop {
	stroke-opacity: 0.55;
}
.shs-crosshair .shs-ch-glow {
	fill: var(--shs-ch-red);
	opacity: 0;
	transition: opacity 0.12s linear;
}

/* On target: illuminated red centre, red fine hairs, the duplex posts and
   ring close in a little. */
.shs-crosshair--target .shs-crosshair__posts {
	scale: 0.9;
}
.shs-crosshair--target .shs-crosshair__ring {
	scale: 0.95;
}
.shs-crosshair--target .shs-ch-hair,
.shs-crosshair--target .shs-ch-tube {
	stroke: var(--shs-ch-red-deep);
}
.shs-crosshair--target .shs-ch-post {
	fill: #2a0000;
}
.shs-crosshair--target .shs-ch-aim {
	fill: #ff2b2b;
}
.shs-crosshair--target .shs-ch-glow {
	opacity: 0.45;
}

/* Muzzle-blink of the illuminated dot while the recoil peaks */
.shs-crosshair--firing .shs-ch-glow {
	opacity: 0.7;
}
.shs-crosshair--firing .shs-ch-aim {
	fill: #ff2b2b;
}

@media (prefers-reduced-motion: reduce) {
	.shs-crosshair,
	.shs-crosshair__ring,
	.shs-crosshair__posts,
	.shs-crosshair .shs-ch-ink,
	.shs-crosshair .shs-ch-ink-fill,
	.shs-crosshair .shs-ch-glow {
		transition: none;
	}
}

@media print {
	.shs-crosshair {
		display: none !important;
	}
}
