/*
 * The single source of truth for the button component (templates/components/button.peb).
 *
 * Both macros render class="button", so the <a> and the <button> variant have to end up
 * identical: Tailwind's preflight strips the color and underline off every <a>, and the
 * browser gives <button> its own font, border and background, so both are reset here.
 *
 * On the site's black background a solid red block is too loud, so the button sits on a
 * dark surface with white text and only borrows the red as an accent: a hairline that
 * warms up on hover, a soft red wash behind it, and the focus ring.
 */
.button {
    /* Same red as --accent in layout.css / portal/layout.css, but owned by the component so
       the button looks the same on every page regardless of which layout is loaded. */
    --button-accent: rgb(210 28 22);
    --button-surface: var(--panel);
    --button-surface-hover: #341a19; /* the accent at 14% over the surface */
    --button-surface-active: #421a19; /* the accent at 22% over the surface */
    --button-border: rgb(74 74 74);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
   /* border: 1px solid var(--button-border);*/
    border-radius: 8px;
    background: var(--raise);
    color: #ffffff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
                transform 0.1s ease;
}

/* A visited link-button must not fall back to the browser's purple. */
.button:visited {
    color: #ffffff;
}

.button:hover {
    border-color: var(--button-accent);
    background: var(--button-surface-hover);
}

.button:active {
    background: var(--button-surface-active);
    box-shadow: none;
    transform: translateY(1px);
}

.button:focus-visible {
    outline: none;
    border-color: var(--button-accent);
    box-shadow: 0 0 0 3px rgb(210 28 22 / 0.35);
}

.button:disabled,
.button[aria-disabled="true"] {
    border-color: var(--button-border);
    background: var(--button-surface);
    box-shadow: none;
    transform: none;
    opacity: 0.5;
    cursor: not-allowed;
}
