.legacy-button {
    display: inline-block;
    box-sizing: border-box;
    border: 1px solid var(--sammo-button-base1-border);
    border-radius: 3px;
    padding: 5px 10px;
    background: var(--sammo-button-base1-bg);
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

.legacy-button:hover,
.legacy-button:focus,
.legacy-button:active {
    border-color: var(--sammo-button-base1-hover-border);
    background: var(--sammo-button-base1-hover-bg);
    color: #fff;
}

.legacy-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgb(85 115 146 / 50%);
}

.legacy-button:disabled,
.legacy-button[aria-disabled='true'] {
    cursor: default;
    opacity: 0.65;
}

/*
 * Ref Bootstrap 5.2 + Lumen button family. This class owns the common raised
 * edge and pressed movement. Semantic modifiers below only select face, edge,
 * and text colors; width and fixed-height compensation stay with the owner.
 * Existing semantic modifiers also opt in for backward compatibility.
 */
.legacy-button:is(
    .legacy-button--lumen,
    .legacy-button--primary,
    .legacy-button--secondary,
    .legacy-button--danger,
    .legacy-button--info,
    .legacy-button--navigation,
    .legacy-button--dark
) {
    --legacy-button-bg: var(--sammo-button-primary-bg);
    --legacy-button-border: var(--sammo-button-primary-border);
    --legacy-button-color: #fff;
    margin-top: 0;
    border-color: var(--legacy-button-border);
    border-style: solid;
    border-width: 0 1px 4px;
    border-radius: 5.25px;
    padding: 5.25px 10.5px;
    background: var(--legacy-button-bg);
    color: var(--legacy-button-color);
    filter: none;
    line-height: 21px;
    /* Ref's framework baseline for these controls. */
    vertical-align: middle;
}

.legacy-button.legacy-button--secondary {
    --legacy-button-bg: var(--sammo-button-secondary-bg);
    --legacy-button-border: var(--sammo-button-secondary-border);
}

.legacy-button.legacy-button--danger {
    --legacy-button-bg: var(--sammo-button-danger-bg);
    --legacy-button-border: var(--sammo-button-danger-border);
}

.legacy-button.legacy-button--info {
    --legacy-button-bg: var(--sammo-button-info-bg);
    --legacy-button-border: var(--sammo-button-info-border);
}

.legacy-button.legacy-button--navigation {
    --legacy-button-bg: var(--sammo-button-navigation-bg);
    --legacy-button-border: var(--sammo-button-navigation-border);
}

.legacy-button.legacy-button--dark {
    --legacy-button-bg: var(--sammo-button-dark-bg);
    --legacy-button-border: var(--sammo-button-dark-border);
}

.legacy-button:is(
        .legacy-button--lumen,
        .legacy-button--primary,
        .legacy-button--secondary,
        .legacy-button--danger,
        .legacy-button--info,
        .legacy-button--navigation,
        .legacy-button--dark
    ):not(:disabled, [aria-disabled='true']):hover {
    margin-top: 1px;
    border-color: var(--legacy-button-border);
    border-bottom-width: 3px;
    background: var(--legacy-button-bg);
}

.legacy-button:is(
        .legacy-button--lumen,
        .legacy-button--primary,
        .legacy-button--secondary,
        .legacy-button--danger,
        .legacy-button--info,
        .legacy-button--navigation,
        .legacy-button--dark
    ):not(:disabled, [aria-disabled='true'])[aria-expanded='true'] {
    margin-top: 1px;
    border-color: var(--legacy-button-border);
    border-bottom-width: 3px;
    background: var(--legacy-button-bg);
}

.legacy-button:is(
        .legacy-button--lumen,
        .legacy-button--primary,
        .legacy-button--secondary,
        .legacy-button--danger,
        .legacy-button--info,
        .legacy-button--navigation,
        .legacy-button--dark
    ):not(:disabled, [aria-disabled='true']):active {
    margin-top: 2px;
    border-color: var(--legacy-button-border);
    border-bottom-width: 2px;
    background: var(--legacy-button-bg);
    box-shadow: none;
}

.legacy-button:is(
        .legacy-button--lumen,
        .legacy-button--primary,
        .legacy-button--secondary,
        .legacy-button--danger,
        .legacy-button--info,
        .legacy-button--navigation,
        .legacy-button--dark
    ):focus {
    border-color: var(--legacy-button-border);
    background: var(--legacy-button-bg);
}

/*
 * Split controls share one outer silhouette. Keep the main control's right
 * border as the subtle divider while removing every inner corner and the
 * toggle's overlapping left border. These rules intentionally follow the
 * Lumen family so its border shorthand cannot restore the inner rounding.
 */
.legacy-split-button > .main-menu-link {
    border-radius: 5.25px 0 0 5.25px;
}

.legacy-split-button > .legacy-split-button__toggle {
    border-left-width: 0;
    border-radius: 0 5.25px 5.25px 0;
}
