/* ==========================================================================
 * Shared button component.
 *
 * Why this file exists: .c-btn / .c-btn--primary were defined inside page
 * stylesheets (profile.css, auth.css, and a third private copy in
 * dashboard.css) rather than as a component. Any page that used the class
 * without also loading one of those two files rendered a completely unstyled
 * native <button>. That hit the dashboard three separate times, and
 * .c-btn--sm was referenced in several files but never defined anywhere, so it
 * silently did nothing.
 *
 * Load order safety: header.php loads assets/css/components/* before the
 * page-specific $cssFile. A page that ships its own .c-btn therefore still
 * wins, so this file only supplies defaults for pages that have none. It is
 * deliberately not a replacement for the page-level copies.
 *
 * Values match profile.css, which was the most complete of the three.
 * ========================================================================== */
/* ==========================================================================
 * Shared button component.
 *
 * Why this file exists: .c-btn / .c-btn--primary were defined inside page
 * stylesheets (profile.css, auth.css, and a third private copy in
 * dashboard.css) rather than as a component. Any page that used the class
 * without also loading one of those two files rendered a completely unstyled
 * native <button>. That hit the dashboard three separate times, and
 * .c-btn--sm was referenced in several files but never defined anywhere, so it
 * silently did nothing.
 *
 * Load order safety: header.php loads assets/css/components/* before the
 * page-specific $cssFile. A page that ships its own .c-btn therefore still
 * wins, so this file only supplies defaults for pages that have none. It is
 * deliberately not a replacement for the page-level copies.
 *
 * Values match profile.css, which was the most complete of the three.
 * ========================================================================== */

.c-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

/* Without this a <button> is a different box model to an <a>, so a primary
 * button built from an anchor gains a baseline-alignment gap. */
.c-btn {
    line-height: 1.4;
    text-decoration: none;
}

.c-btn--primary {
    background-color: var(--color-primary);
    color: white;
}

.c-btn--primary:hover {
    filter: brightness(1.1);
}

.c-btn--outline {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.c-btn--outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.c-btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.c-btn--ghost:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary);
}

.c-btn--danger {
    background-color: var(--color-danger, #ef4444);
    color: white;
}

.c-btn--danger:hover {
    filter: brightness(1.1);
}

/* Was referenced in navbar/profile/interests but never defined anywhere. */
.c-btn--sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    gap: 0.3rem;
}

.c-btn--lg {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
}

.c-btn:disabled,
.c-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Visible focus for keyboard users. Only shown for keyboard interaction so it
 * does not add a ring on every mouse click. */
.c-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
