/**
 * Logout Button block.
 *
 * Two jobs only:
 *
 * 1. Position the button (centred by default) — deterministic, so it does not
 *    depend on core's layout CSS being present.
 * 2. Provide a *fallback* button skin for themes that define none.
 *
 * The fallback lives inside :where(), which has zero specificity, so any rule
 * from the theme, theme.json styles.elements.button, Global Styles, or the core
 * block-library stylesheet overrides it without needing !important.
 */

/* 1. Positioning. */

.ycm-logout-button {
	display: flex;
	flex-wrap: wrap;
}

.ycm-logout-button--left {
	justify-content: flex-start;
}

.ycm-logout-button--center {
	justify-content: center;
}

.ycm-logout-button--right {
	justify-content: flex-end;
}

.ycm-logout-button__inner {
	max-width: 100%;
}

/* 2. Fallback button skin — overridden by the theme whenever it defines one. */

:where( .ycm-logout-button__link ) {
	display: inline-block;
	box-sizing: border-box;
	padding: 0.75em 1.5em;
	border: none;
	border-radius: var( --wp--preset--spacing--20, 4px );
	background-color: var( --wp--preset--color--primary, #3858e9 );
	color: var( --wp--preset--color--base, #fff );
	font-size: inherit;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease-in-out;
	word-break: break-word;
}

:where( .ycm-logout-button__link:hover, .ycm-logout-button__link:focus ) {
	opacity: 0.85;
	text-decoration: none;
}

/*
 * Many themes (Hello Elementor included) underline every <a> site-wide, which
 * leaks into the button. Scoped to the block wrapper so it beats generic link
 * rules without resorting to !important — a theme targeting the button classes
 * directly can still override it.
 */
.ycm-logout-button .ycm-logout-button__link,
.ycm-logout-button .ycm-logout-button__link:hover,
.ycm-logout-button .ycm-logout-button__link:focus {
	text-decoration: none;
}

/* Keyboard focus stays visible even when the theme restyles the button. */
.ycm-logout-button__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
