/*
 * Interaction states: one system for every button, link and card, loaded last
 * so it wins over the component styles. Colors are semantic tokens, so each
 * collection (section style) tints its own hover. Motion stays at a 150ms
 * color fade (brand book, Accessibility); nothing moves or scales.
 *
 *   Filled button   the fill shifts to --button-hover. Nothing else changes.
 *   Outline button  a soft fill appears and the border goes to full text color.
 *   Text link       underline thickens and the color moves toward --text.
 *                   (Underlines belong to links, never to buttons.)
 *   Card or arch    the edge goes to a color visible on the page and a thin
 *                   inner frame appears: a double outline.
 *   Pressed         everything darkens a little for as long as it is held.
 * Keyboard focus keeps its own 2px ring (site.css); hover never replaces it.
 */

/* One transition for everything interactive. */
.as-pill,
.wp-block-button__link,
.as-textlink,
.as-fork a,
.as-stores summary,
.as-collection,
.as-shelf__card,
.as-dialog__close,
.as-nav .wp-block-navigation-item__content,
.as-wordmark,
.as-footer__links a,
.as-contents__link,
.as-diary__title,
.as-diary__listen,
.as-platforms a,
.as-crumbs a,
.as-reviewline a,
.as-archive-line a,
.as-also-format a,
.as-buybox__notes a,
.as-stores li a,
.wc-block-components-button,
.single_add_to_cart_button,
.wpcf7 input,
.wpcf7 select,
.wpcf7 textarea,
.wpcf7 button {
	transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, outline-color 150ms ease, text-decoration-color 150ms ease;
}

/* ---- Filled buttons: the fill changes, nothing else ---- */
.as-pill--fill:hover,
.as-pill--buy:hover,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover,
.wp-block-woocommerce-product-button .wp-block-button__link:hover,
.wc-block-components-button:not(.is-link):hover,
.single_add_to_cart_button:hover,
.wpcf7 input[type="submit"]:hover,
.wpcf7 button[type="submit"]:hover {
	background: var(--button-hover) !important;
	border-color: var(--button-hover);
	color: var(--on-button) !important;
	text-decoration: none;
}

/* ---- Outline buttons: a soft fill and a full-strength border ---- */
.as-pill:not(.as-pill--fill):not(.as-pill--buy):hover,
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.as-theme-toggle:hover,
.as-dialog__close:hover {
	background: color-mix(in srgb, var(--text) 14%, transparent);
	border-color: var(--text);
	color: var(--text);
	text-decoration: none;
}

/* The podcast pitch band wears butter pills on teal. */
.as-pitch .as-pill:hover {
	background: var(--dos-cream);
	border-color: var(--dos-cream);
	color: var(--dos-ink);
	text-decoration: none;
}

/* ---- Text links ---- */
.as-textlink:hover,
.as-platforms a:hover,
.as-crumbs a:hover,
.as-reviewline a:hover,
.as-archive-line a:hover,
.as-also-format a:hover,
.as-buybox__notes a:hover,
.as-stores li a:hover,
.as-footer__links a:hover,
.as-player__listen:hover {
	color: var(--text);
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}
.as-diary__listen:hover {
	color: var(--dos-ink);
	text-decoration: none;
}
.as-wordmark:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 8px;
}
.as-nav .wp-block-navigation-item__content:hover:not([aria-current="page"]) {
	color: var(--text);
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 8px;
}

/* ---- Cards, arches, the fork and the stores list ---- */
.as-collection:hover,
.as-shelf__card:hover {
	border-color: var(--c-edge, var(--c-mark));
}
.as-collection:hover:not(:focus-visible),
.as-shelf__card:hover:not(:focus-visible) {
	/* Both lines of the double frame share one color (--c-frame where a
	   collection sets one; Writing and Tech use their mark, which equals their edge). */
	outline: 1px solid var(--c-frame, var(--c-mark));
	outline-offset: -6px;
}
.as-fork a:hover {
	border-color: var(--accent);
	background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.as-stores summary:hover {
	background: color-mix(in srgb, var(--text) 8%, transparent);
	color: var(--text);
}

/* ---- Form fields respond too ---- */
.wpcf7 input:hover:not(:focus),
.wpcf7 select:hover:not(:focus),
.wpcf7 textarea:hover:not(:focus),
.wc-block-components-text-input input:hover:not(:focus) {
	border-color: var(--text) !important;
}

/* ---- Pressed ---- */
.as-pill:active,
.wp-block-button__link:active,
.wc-block-components-button:active,
.single_add_to_cart_button:active,
.wpcf7 input[type="submit"]:active,
.wpcf7 button[type="submit"]:active,
.as-dialog__close:active {
	filter: brightness(0.92);
}

@media (prefers-reduced-motion: reduce) {
	.as-pill,
	.wp-block-button__link,
	.as-textlink,
	.as-fork a,
	.as-stores summary,
	.as-collection,
	.as-shelf__card,
	.as-dialog__close,
	.as-nav .wp-block-navigation-item__content,
	.wc-block-components-button,
	.single_add_to_cart_button,
	.wpcf7 input,
	.wpcf7 select,
	.wpcf7 textarea,
	.wpcf7 button {
		transition: none;
	}
}
