/*
 * Reusable action primitives. Page composition belongs in dedicated layers.
 */

.bhw-button,
.wp-element-button,
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--bhw-space-2);
    min-height: var(--bhw-control-min-size);
    padding: var(--bhw-space-3) var(--bhw-control-padding-inline);
    border: 0;
    border-radius: var(--bhw-radius-pill);
    background: var(--bhw-color-accent);
    color: var(--bhw-color-focus-contrast);
    font-weight: var(--bhw-weight-semibold);
    line-height: var(--bhw-leading-tight);
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color var(--bhw-motion-fast) var(--bhw-easing-standard),
        transform var(--bhw-motion-fast) var(--bhw-easing-standard);
}

.bhw-button:hover,
.wp-element-button:hover,
button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    background: var(--bhw-color-accent-hover);
    color: var(--bhw-color-focus-contrast);
    transform: translateY(var(--bhw-hover-lift));
}

.bhw-button:active,
.wp-element-button:active,
button:active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active {
    background: var(--bhw-color-accent-active);
    transform: none;
}

.bhw-button[aria-disabled="true"],
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.bhw-button--secondary {
    border: var(--bhw-border-thin) solid var(--bhw-color-border-strong);
    background: var(--bhw-color-background-secondary);
    color: var(--bhw-color-text-primary);
}

.bhw-button--secondary:hover {
    border-color: var(--bhw-color-accent-hover);
    background: var(--bhw-color-panel);
    color: var(--bhw-color-text-primary);
}

.bhw-button--ghost {
    border: var(--bhw-border-thin) solid transparent;
    background: transparent;
    color: var(--bhw-color-accent);
}

.bhw-button--ghost:hover {
    border-color: var(--bhw-color-border-strong);
    background: var(--bhw-color-background-secondary);
    color: var(--bhw-color-accent-hover);
}

.bhw-button--text {
    min-height: var(--bhw-control-min-size);
    padding-inline: var(--bhw-space-2);
    border-radius: var(--bhw-radius-small);
    background: transparent;
    color: var(--bhw-color-accent);
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

.bhw-button--text:hover {
    background: transparent;
    color: var(--bhw-color-accent-hover);
    transform: none;
}

.bhw-button__icon {
    width: 1.25em;
    height: 1.25em;
    flex: 0 0 auto;
}

.bhw-button--loading::before {
    width: 1em;
    height: 1em;
    border: var(--bhw-border-strong) solid currentcolor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    content: "";
    animation: bhw-spin var(--bhw-motion-slow) linear infinite;
}

@keyframes bhw-spin {
    to {
        transform: rotate(1turn);
    }
}

[aria-busy="true"] {
    cursor: progress;
}

@media (max-width: 34.999rem) {
    .bhw-button--mobile-block {
        width: 100%;
    }
}
