/**
 * _buttons.css — what Astra's button settings don't cover. Primary and secondary are Astra's (Customizer → Global →
 * Buttons, written by site-defaults.php); Spectra Buttons inherit them (uag_btn_inherit_from_theme): a primary renders
 * a.uagb-buttons-repeater.wp-block-button__link, a secondary a.uagb-buttons-repeater.ast-outline-button, inside
 * div.wp-block-uagb-buttons-child, which carries the classes below.
 * Owns: no underline on button links; wrapping in a Buttons row; .rl-btn-tertiary; the disabled state; carousel arrows.
 * Doesn't own: the focus outline (_base.css); buttons inside navy bands (_surfaces.css).
 * Depends on: global/_tokens.css. Spectra puts style="border-width:revert-layer" on a secondary's link, which beats any
 * stylesheet border width.
 */

/* Astra underlines every content link, button-styled ones included. */
:is(.entry-content, .editor-styles-wrapper, [class^="astra-advanced-hook-"]) a:is(.wp-block-button__link, .uagb-buttons-repeater, .wp-element-button, .ast-outline-button) {
	text-decoration: none;
}

body:not(.wp-admin) :is(.wp-block-button__link, .uagb-buttons-repeater, .ast-outline-button, .ast-button, .button) {
	transition: background-color var(--rl-ease), border-color var(--rl-ease), color var(--rl-ease);
}

/* A row of buttons wraps onto a new line when it runs out of room, instead of squeezing every label onto two lines. */
:is(.site, .editor-styles-wrapper) .wp-block-uagb-buttons.wp-block-uagb-buttons .uagb-buttons__wrap {
	flex-wrap: wrap;
}

:is(.site, .editor-styles-wrapper) .wp-block-uagb-buttons.wp-block-uagb-buttons .wp-block-uagb-buttons-child {
	flex-shrink: 0;
	max-width: 100%;
}

/* Tertiary / ghost: navy text with an arrow; hover underlines it (the kit's accent text is 2.6:1 — SITE-STANDARDS.md →
   Deviations). */
:is(.site, .editor-styles-wrapper) .rl-btn-tertiary.rl-btn-tertiary .uagb-buttons-repeater.uagb-buttons-repeater {
	padding: 0;
	border-style: none;
	background: transparent;
	color: var(--rl-color-brand);
	text-underline-offset: 3px;
}

:is(.site, .editor-styles-wrapper) .rl-btn-tertiary.rl-btn-tertiary .uagb-buttons-repeater.uagb-buttons-repeater:is(:hover, :focus-visible) {
	background: transparent;
	color: var(--rl-color-brand);
	text-decoration: underline 2px var(--rl-color-alt-brand);
}

.rl-btn-tertiary .uagb-button__link::after {
	content: " →";
	content: " →" / "";
}

/* Disabled: #E7E7E7 fill, #767676 text (4.54:1 on it), not-allowed. */
body:not(.wp-admin) :is(.wp-block-button__link, button, input[type="submit"], .ast-outline-button):is(:disabled, [aria-disabled="true"]) {
	border-color: var(--rl-color-disabled);
	background: var(--rl-color-disabled);
	color: var(--rl-color-disabled-text);
	cursor: not-allowed;
}

/* Carousel arrows: 48px circles, a 1px teal border, a teal arrow; hover fills teal with a navy arrow. Swiper draws the
   glyph in ::after with its icon font. */
:is(.site, .editor-styles-wrapper) .wp-block-uagb-slider.wp-block-uagb-slider :is(.swiper-button-prev, .swiper-button-next),
:is(.site, .editor-styles-wrapper) :is(.wp-block-uagb-post-carousel.wp-block-uagb-post-carousel, .wp-block-uagb-testimonial.wp-block-uagb-testimonial) :is(.slick-prev, .slick-next) {
	--swiper-navigation-size: 48px;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	border: 1px solid var(--rl-color-alt-brand);
	border-radius: 50%;
	background: transparent;
	color: var(--rl-color-alt-brand);
	fill: currentColor;
	transition: background-color var(--rl-ease), color var(--rl-ease);
}

:is(.site, .editor-styles-wrapper) .wp-block-uagb-slider.wp-block-uagb-slider :is(.swiper-button-prev, .swiper-button-next)::after {
	font-family: var(--rl-font-body);
	font-size: 20px;
	line-height: 1;
	color: inherit;
}

:is(.site, .editor-styles-wrapper) .wp-block-uagb-slider.wp-block-uagb-slider .swiper-button-prev::after {
	content: "←" / "";
}

:is(.site, .editor-styles-wrapper) .wp-block-uagb-slider.wp-block-uagb-slider .swiper-button-next::after {
	content: "→" / "";
}

:is(.site, .editor-styles-wrapper) .wp-block-uagb-slider.wp-block-uagb-slider :is(.swiper-button-prev, .swiper-button-next):is(:hover, :focus-visible),
:is(.site, .editor-styles-wrapper) :is(.wp-block-uagb-post-carousel.wp-block-uagb-post-carousel, .wp-block-uagb-testimonial.wp-block-uagb-testimonial) :is(.slick-prev, .slick-next):is(:hover, :focus-visible) {
	background: var(--rl-color-alt-brand);
	color: var(--rl-color-brand);
}

/* Carousel dots: 8px. */
:is(.site, .editor-styles-wrapper) .wp-block-uagb-slider.wp-block-uagb-slider .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	background: var(--rl-color-border);
	opacity: 1;
}

:is(.site, .editor-styles-wrapper) .wp-block-uagb-slider.wp-block-uagb-slider .swiper-pagination-bullet-active {
	background: var(--rl-color-brand);
}
