/*!
 * The press — how every link and button in the platform answers a hand.
 *
 * Browsers and WordPress answer a click with a BLUE focus ring that lingers
 * on the element after the mouse has moved on — most visibly on the admin
 * menu, where it reads as a broken highlight in a product that is otherwise
 * paper and brass. The rule here is simple and absolute:
 *
 *   A POINTER never gets a ring. The press itself is the feedback — the
 *   element gives slightly under the finger and glows brass while held.
 *
 *   A KEYBOARD still gets a ring, because a person tabbing through the
 *   screen is steering by it — but it is BRASS, never blue. Removing it
 *   entirely would strand keyboard users; recoloring it keeps them moving
 *   and keeps the palette whole.
 *
 * Loaded on both sides of the house — wp-admin and the guest site — so blue
 * does not survive anywhere.
 */

/* ---- no ring for the pointer, anywhere, ever ---- */
a:focus:not(:focus-visible):not(:active),
button:focus:not(:focus-visible):not(:active),
input:focus:not(:focus-visible):not(:active),
select:focus:not(:focus-visible):not(:active),
textarea:focus:not(:focus-visible):not(:active),
[tabindex]:focus:not(:focus-visible):not(:active),
.wp-core-ui .button:focus:not(:focus-visible):not(:active),
.wp-core-ui .button-primary:focus:not(:focus-visible):not(:active),
#adminmenu a:focus:not(:focus-visible):not(:active),
#wpadminbar a:focus:not(:focus-visible):not(:active) {
	outline: none !important;
	box-shadow: none !important;
}

/* ---- the keyboard's ring: brass, never blue ---- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
.wp-core-ui .button:focus-visible,
.wp-core-ui .button-primary:focus-visible,
#adminmenu a:focus-visible,
#wpadminbar a:focus-visible {
	outline: 2px solid rgba(201, 162, 39, .85) !important;
	outline-offset: 2px;
	box-shadow: none !important;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: none !important;
	border-color: rgba(201, 162, 39, .8) !important;
	box-shadow: 0 0 0 2px rgba(201, 162, 39, .28) !important;
}

/* WP paints some of its blue as border-color on focused fields — retint. */
.wp-core-ui input[type="text"]:focus,
.wp-core-ui input[type="search"]:focus,
.wp-core-ui input[type="email"]:focus,
.wp-core-ui input[type="url"]:focus,
.wp-core-ui input[type="password"]:focus,
.wp-core-ui input[type="number"]:focus,
.wp-core-ui input[type="tel"]:focus,
.wp-core-ui select:focus,
.wp-core-ui textarea:focus {
	border-color: rgba(201, 162, 39, .8) !important;
	box-shadow: 0 0 0 1px rgba(201, 162, 39, .35) !important;
}

/* No grey/blue tap flash on touch devices either. */
a, button, [role="button"], label, .blxrt-btn, .rng {
	-webkit-tap-highlight-color: transparent;
}

/* ---- the press: the element gives under the hand and glows brass ---- */
a:active,
button:active,
[role="button"]:active,
input[type="submit"]:active,
input[type="button"]:active,
.wp-core-ui .button:active,
.wp-core-ui .button-primary:active,
#adminmenu a:active {
	transform: translateY(1px) scale(.985);
	transition: transform .06s ease, box-shadow .06s ease;
	box-shadow: 0 0 0 3px rgba(201, 162, 39, .22) !important;
	outline: none !important;
}
/* Plain inline PROSE links dip without the glow halo — a paragraph link with
   a ring around it reads as a form control. Menus and lists of doors keep
   the glow: an <li> in a nav is a button in every way that matters. */
p a:active, td a:active {
	box-shadow: none !important;
	transform: translateY(1px);
}

/* ---- the seat you're in: selected menu items breathe, faintly ----
   The same idea as the dispatch board's live-trip glow — a slow brass
   breath, quiet enough to feel rather than notice — on the CURRENT item of
   the admin menu, its open submenu entry, and the rail's active door. */
@keyframes blx-sel-breathe {
	0%, 100% { box-shadow: inset 3px 0 0 rgba(201, 162, 39, .85), 0 0 12px rgba(201, 162, 39, .08); }
	50%      { box-shadow: inset 3px 0 0 rgba(201, 162, 39, .85), 0 0 20px rgba(201, 162, 39, .20); }
}
#adminmenu li.menu-top.current > a.menu-top,
#adminmenu li.wp-has-current-submenu > a.wp-has-current-submenu,
#adminmenu .wp-submenu li.current > a,
.blx-rail-nav a.on {
	animation: blx-sel-breathe 3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
	#adminmenu li.menu-top.current > a.menu-top,
	#adminmenu li.wp-has-current-submenu > a.wp-has-current-submenu,
	#adminmenu .wp-submenu li.current > a,
	.blx-rail-nav a.on {
		animation: none;
		box-shadow: inset 3px 0 0 rgba(201, 162, 39, .85), 0 0 16px rgba(201, 162, 39, .14);
	}
}

/* Anyone who asks the OS for less motion gets the glow without the give. */
@media (prefers-reduced-motion: reduce) {
	a:active, button:active, [role="button"]:active,
	input[type="submit"]:active, input[type="button"]:active,
	.wp-core-ui .button:active, .wp-core-ui .button-primary:active, #adminmenu a:active {
		transform: none;
	}
}
