/**
 * FACCES Education - read aloud controls.
 *
 * Palette lifted from the plugin's own styles.php so these do not look bolted
 * on: brand #C98E34, borders #ddd8d0 / #e6e1d8, surface #faf8f5.
 *
 * Doubled class selectors in a few places to win specificity ties against the
 * plugin's inline stylesheet, which is emitted in the body and therefore comes
 * after this file.
 */

.ffw-ra-unavailable .ffw-ra,
.ffw-ra-unavailable .ffw-ra-bar {
	display: none !important;
}

/* ------------------------------------------------------------ block button */

.ffw-ra-block.ffw-ra-block {
	position: relative;
	padding-right: 3rem;
}

.ffw-ra-btn.ffw-ra-btn {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	margin: 0;
	padding: 0;
	border: 2px solid #ddd8d0;
	border-radius: 100px;
	background: #faf8f5;
	color: #6b6558;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ffw-ra-btn.ffw-ra-btn:hover {
	border-color: #C98E34;
	color: #C98E34;
}

.ffw-ra-btn.ffw-ra-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(201, 142, 52, 0.3);
}

.ffw-ra-btn.ffw-ra-btn.is-speaking {
	background: #C98E34;
	border-color: #C98E34;
	color: #fff;
}

.ffw-ra__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ffw-ra__icon svg {
	width: 1.05rem;
	height: 1.05rem;
	fill: currentColor;
	display: block;
}

/* --------------------------------------------------------------- page bar */

.ffw-ra-bar {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 1.25rem;
}

.ffw-ra-bar__btn.ffw-ra-bar__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	padding: 0.55rem 1.15rem;
	border: 2px solid #ddd8d0;
	border-radius: 100px;
	background: #faf8f5;
	color: #4a4539;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ffw-ra-bar__btn.ffw-ra-bar__btn:hover {
	border-color: #C98E34;
	color: #C98E34;
}

.ffw-ra-bar__btn.ffw-ra-bar__btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(201, 142, 52, 0.3);
}

.ffw-ra-bar__btn.ffw-ra-bar__btn.is-speaking {
	background: #C98E34;
	border-color: #C98E34;
	color: #fff;
}

.ffw-ra-bar__btn .ffw-ra__icon svg {
	width: 1.15rem;
	height: 1.15rem;
}

/* ------------------------------------------------------ currently speaking */

.ffw-ra-speaking.ffw-ra-speaking {
	background: #fdf7ec;
	box-shadow: 0 0 0 3px rgba(201, 142, 52, 0.28);
	border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
	.ffw-ra-btn.ffw-ra-btn,
	.ffw-ra-bar__btn.ffw-ra-bar__btn {
		transition: none;
	}
}

/* Small screens: the button is easier to reach on the right of a short row. */
@media (max-width: 480px) {
	.ffw-ra-block.ffw-ra-block {
		padding-right: 2.75rem;
	}

	.ffw-ra-bar {
		justify-content: stretch;
	}

	.ffw-ra-bar__btn.ffw-ra-bar__btn {
		width: 100%;
		justify-content: center;
	}
}
