/*
 * The text-button appearance and the size scale, and deliberately nothing else.
 *
 * Shape, motion and the pressed shape morph belong to the theme and arrive through
 * `wp-element-button`; redeclaring them here would produce a second copy that agrees only by
 * coincidence. What is owned here is what cannot arrive: core resolves a block style variation
 * against `styles.blocks.<blockName>.variations`, the theme registers `text` for `core/button`
 * alone, and the class core generates for it is a per-request counter — so no markup this block
 * emits can reach those rules. This block also ships to sites running other themes.
 *
 * Every rule carries two classes on purpose. Global styles emit as
 * `:root :where(.wp-element-button, …)`, which `:where()` reduces to the specificity of `:root`
 * alone; a single-class rule ties and loses on source order.
 *
 * Opacities are the theme's state-layer tokens rather than the literal percentages from the M3
 * spec, so a theme that retunes its state layers retunes this too.
 */

.axismundi-interaction {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.axismundi-interaction .axismundi-interaction__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border: 0;
	background-color: transparent;
	background-image: none;
	/*
	 * The label takes the surrounding text colour and each type colours itself on interaction —
	 * a Like turns red, a Repost turns primary. A row of actions that is primary before anyone
	 * touches it competes with the post it belongs to.
	 */
	color: inherit;
	font-family: var(--wp--preset--font-family--roboto-flex, inherit);
	font-size: var(--wp--preset--font-size--label-large, 0.875rem);
	font-weight: 500;
	letter-spacing: 0.1px;
	text-decoration: none;
	cursor: pointer;
}

/*
 * Icon size is the theme's `--md-icon-size`, never `font-size`.
 *
 * The theme's icon rule reads that variable and falls back to 24px, so setting `font-size` here
 * both fights the contract and silently changes the size — which is what made every control
 * shrink when they moved into this block.
 */
.axismundi-interaction .axismundi-interaction__button .material-symbols-outlined {
	--md-icon-size: 1.25rem;
}

/* M3 Button — Size — Xsmall: 32dp container, 20dp icon, 12dp flanks, 4dp between icon and label. */
.axismundi-interaction .axismundi-interaction__button.is-size-xs {
	min-block-size: 2rem;
	padding-inline: 0.75rem;
	gap: 0.25rem;
	line-height: 1.25rem;
}

/* The 40dp control the rest of the theme's buttons already use. */
.axismundi-interaction .axismundi-interaction__button.is-size-sm {
	min-block-size: 2.5rem;
	padding-inline: var(--wp--preset--spacing--200, 1rem);
	gap: 0.375rem;
	line-height: 1.429;
}

/* M3 Button — Color — Text: the ground stays transparent and the state layer is the feedback. */
.axismundi-interaction .axismundi-interaction__button:hover {
	background-color: color-mix(in srgb, currentColor calc(var(--md-sys-state-hover-state-layer-opacity, 0.08) * 100%), transparent);
}

.axismundi-interaction .axismundi-interaction__button:focus-visible {
	background-color: color-mix(in srgb, currentColor calc(var(--md-sys-state-focus-state-layer-opacity, 0.1) * 100%), transparent);
}

.axismundi-interaction .axismundi-interaction__button:active {
	background-color: color-mix(in srgb, currentColor calc(var(--md-sys-state-pressed-state-layer-opacity, 0.1) * 100%), transparent);
}

/*
 * A toggle's selected state keeps the hover state layer after the pointer leaves.
 *
 * Color still comes from the interaction type below (error for Like, primary for
 * Repost and Vote), so this is an affordance for an existing choice rather than a
 * second visual language for every button in the row.
 */
.axismundi-interaction .axismundi-interaction__button.is-selected {
	background-color: color-mix(in srgb, currentColor calc(var(--md-sys-state-hover-state-layer-opacity, 0.08) * 100%), transparent);
}

/*
 * What each interaction does when you touch it.
 *
 * These are the affordances the six separate buttons each carried, and they are the reason a
 * reader can tell them apart without reading the labels: a Like fills its heart and turns the
 * error colour, a Repost turns its arrows through half a circle. They belong to the type rather
 * than to the control, which is why they hang off `is-type-*` and not off the button.
 *
 * Fill and rotation are animated rather than switched. The theme registers `--md-icon-fill` as a
 * typed custom property precisely so it can be transitioned; a plain custom property would jump.
 */
.axismundi-interaction .axismundi-interaction__button .material-symbols-outlined {
	transition:
		--md-icon-fill var(--md-sys-motion-duration-short3, 150ms) var(--md-sys-motion-easing-standard, ease),
		transform var(--md-sys-motion-duration-short3, 150ms) var(--md-sys-motion-easing-standard, ease);
}

.axismundi-interaction.is-type-like .axismundi-interaction__button:hover,
.axismundi-interaction.is-type-like .axismundi-interaction__button:focus-visible,
.axismundi-interaction.is-type-like .axismundi-interaction__button.is-selected {
	color: var(--wp--preset--color--error, #b3261e);
}

.axismundi-interaction.is-type-like .axismundi-interaction__button:hover .material-symbols-outlined,
.axismundi-interaction.is-type-like .axismundi-interaction__button:focus-visible .material-symbols-outlined,
.axismundi-interaction.is-type-like .axismundi-interaction__button.is-selected .material-symbols-outlined {
	--md-icon-fill: 1;
}

.axismundi-interaction.is-type-dislike .axismundi-interaction__button:hover,
.axismundi-interaction.is-type-dislike .axismundi-interaction__button:focus-visible,
.axismundi-interaction.is-type-dislike .axismundi-interaction__button.is-selected {
	color: var(--wp--preset--color--error, #b3261e);
}

.axismundi-interaction.is-type-dislike .axismundi-interaction__button:hover .material-symbols-outlined,
.axismundi-interaction.is-type-dislike .axismundi-interaction__button:focus-visible .material-symbols-outlined,
.axismundi-interaction.is-type-dislike .axismundi-interaction__button.is-selected .material-symbols-outlined {
	--md-icon-fill: 1;
}

.axismundi-interaction.is-type-announce .axismundi-interaction__button:hover,
.axismundi-interaction.is-type-announce .axismundi-interaction__button:focus-visible,
.axismundi-interaction.is-type-announce .axismundi-interaction__button.is-selected,
.axismundi-interaction.is-type-reply .axismundi-interaction__button:hover,
.axismundi-interaction.is-type-reply .axismundi-interaction__button:focus-visible,
.axismundi-interaction.is-type-quote .axismundi-interaction__button:hover,
.axismundi-interaction.is-type-quote .axismundi-interaction__button:focus-visible,
.axismundi-interaction.is-type-reaction .axismundi-interaction__button:hover,
.axismundi-interaction.is-type-reaction .axismundi-interaction__button:focus-visible {
	color: var(--wp--preset--color--primary, #6750a4);
}

.axismundi-interaction.is-type-announce .axismundi-interaction__button:hover .material-symbols-outlined,
.axismundi-interaction.is-type-announce .axismundi-interaction__button:focus-visible .material-symbols-outlined,
.axismundi-interaction.is-type-announce .axismundi-interaction__button.is-selected .material-symbols-outlined {
	transform: rotate(-180deg);
}

/*
 * A community vote is one policy control: up, net score, down.
 *
 * The group owns the outline and the 2px joins; individual buttons still inherit their shape
 * from the theme's core-button bridge. That keeps this recognisably one choice without making
 * a second button system that drifts from the rest of the interface.
 */
.axismundi-interaction.is-type-vote .axismundi-interaction__group {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 2px;
	border: 1px solid var(--wp--preset--color--outline-variant, rgba(0, 0, 0, 0.16));
	border-radius: 1.375rem;
	background-color: var(--wp--preset--color--surface-container-lowest, transparent);
}

.axismundi-interaction.is-type-vote .axismundi-interaction__value {
	min-inline-size: 2rem;
	padding-inline: 0.25rem;
	color: var(--wp--preset--color--on-surface-variant, currentColor);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	line-height: 2rem;
	text-align: center;
}

/* A vote colours the side the reader is on, and only that side. */
.axismundi-interaction.is-type-vote .axismundi-interaction__button:hover,
.axismundi-interaction.is-type-vote .axismundi-interaction__button:focus-visible,
.axismundi-interaction.is-type-vote .axismundi-interaction__button.is-selected {
	color: var(--wp--preset--color--primary, #6750a4);
}

.axismundi-interaction.is-type-vote .axismundi-interaction__button.is-selected .material-symbols-outlined {
	--md-icon-fill: 1;
}

.axismundi-interaction .axismundi-interaction__button:disabled {
	color: color-mix(in srgb, var(--wp--preset--color--on-surface, #1d1b20) 38%, transparent);
	cursor: not-allowed;
}

.axismundi-interaction__count,
.axismundi-interaction__label {
	line-height: inherit;
}

.axismundi-interaction__status {
	font-size: 0.875rem;
}

/* A two-command menu, not a dialog: Repost and Quote are peer commands. */
.axismundi-announce-menu {
	position: fixed;
	z-index: 20;
	display: grid;
	min-inline-size: 10rem;
	padding-block: 0.25rem;
	background-color: var(--wp--preset--color--surface-container-low, Canvas);
	color: var(--wp--preset--color--on-surface, CanvasText);
	border-radius: 0.75rem;
	box-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 2px 6px 2px rgb(0 0 0 / 15%);
}

.axismundi-announce-menu[hidden] {
	display: none;
}

.axismundi-announce-menu__action {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-block-size: 2.5rem;
	padding-inline: 0.75rem 1rem;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: var(--wp--preset--font-size--label-large, 0.875rem);
	font-weight: 500;
	text-align: start;
	text-decoration: none;
	cursor: pointer;
}

.axismundi-announce-menu__action:hover,
.axismundi-announce-menu__action:focus-visible {
	background-color: color-mix(in srgb, currentColor calc(var(--md-sys-state-hover-state-layer-opacity, 0.08) * 100%), transparent);
}

.axismundi-announce-menu__action:disabled {
	color: color-mix(in srgb, var(--wp--preset--color--on-surface, CanvasText) 38%, transparent);
	cursor: wait;
}

@media (forced-colors: active) {
	.axismundi-interaction .axismundi-interaction__button {
		color: ButtonText;
	}

	.axismundi-interaction .axismundi-interaction__button:disabled {
		color: GrayText;
	}

	.axismundi-announce-menu {
		outline: 1px solid CanvasText;
		box-shadow: none;
	}
}
