/**
 * buttons.css — Button Components
 * ============================================================
 * All button variants used across the system.
 * Depends on: 1-tokens.css
 * ============================================================
 */

/* --------------------------------------------------------
 * BASE BUTTON
 * -------------------------------------------------------- */
.btn {
    font-size: var(--text-base);
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-sm);
    font-weight: var(--font-semibold);
}

/* --------------------------------------------------------
 * SIZE VARIANTS
 * -------------------------------------------------------- */
.btn-sm {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-4);
}

.btn-lg {
    font-size: var(--text-md);
    padding: var(--space-4) var(--space-8);
}

/* --------------------------------------------------------
 * SPECIAL BUTTONS — gradient submit
 * -------------------------------------------------------- */
.btn-submit {
    background: var(--gradient-primary);
    color: var(--color-white);
    padding: var(--space-4) var(--space-9);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    border: none;
    transition: var(--transition-base);
    font-size: var(--text-base);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    color: var(--color-white);
}

/* --------------------------------------------------------
 * ACCENT BUTTON — color inherited from the parent's --accent var
 * -------------------------------------------------------- */
/* Pairs with .module-card.is-accent: the card sets `--accent: #hex` and the
   button picks it up, so a card's button always matches its section color.
   Drives Bootstrap's own --bs-btn-* variables so it works with the .btn
   machinery (rest, hover, focus, active). Falls back to the brand primary. */
.btn-accent {
    /* The fill is the accent's strong step when it has one (.accent-amber...):
       the lighter accents read at 2.4-3.8:1 under white text. */
    --accent-fill: var(--accent-strong, var(--accent, var(--color-primary)));
    --bs-btn-color: var(--color-white);
    --bs-btn-bg: var(--accent-fill);
    --bs-btn-border-color: var(--accent-fill);
    --bs-btn-hover-color: var(--color-white);
    --bs-btn-hover-bg: var(--accent-fill);
    --bs-btn-hover-border-color: var(--accent-fill);
    --bs-btn-focus-shadow-rgb: 130, 130, 130;
    --bs-btn-active-color: var(--color-white);
    --bs-btn-active-bg: var(--accent-fill);
    --bs-btn-active-border-color: var(--accent-fill);
    --bs-btn-disabled-color: var(--color-white);
    --bs-btn-disabled-bg: var(--accent-fill);
    --bs-btn-disabled-border-color: var(--accent-fill);
}

/* Darken slightly on hover/active without needing per-color rules. */
.btn-accent:hover  { filter: brightness(0.92); }
.btn-accent:active { filter: brightness(0.86); }

/* Outline counterpart — accent-colored outline that fills on hover. Use for a
   card's secondary action alongside a solid .btn-accent primary. */
.btn-outline-accent {
    --bs-btn-color: var(--accent, var(--color-primary));
    --bs-btn-border-color: var(--accent, var(--color-primary));
    --bs-btn-bg: transparent;
    --bs-btn-hover-color: var(--color-white);
    --bs-btn-hover-bg: var(--accent, var(--color-primary));
    --bs-btn-hover-border-color: var(--accent, var(--color-primary));
    --bs-btn-active-color: var(--color-white);
    --bs-btn-active-bg: var(--accent, var(--color-primary));
    --bs-btn-active-border-color: var(--accent, var(--color-primary));
}

/* --------------------------------------------------------
 * VIEW (eye) BUTTON — soft school color everywhere
 * The full btn-outline-primary view icon reads too loud in
 * list/table action groups. Soften any eye button to a muted
 * tint of the school color at rest that fills on hover.
 * (--brand-* from 4-components/theme-colors.css.)
 * -------------------------------------------------------- */
.btn-outline-primary:has(> .bi-eye),
.btn-outline-primary:has(> .bi-eye-fill) {
    --bs-btn-color: var(--brand-ink, var(--color-primary));
    --bs-btn-border-color: color-mix(in srgb, var(--brand-ink, var(--color-primary)) 35%, transparent);
    --bs-btn-bg: var(--brand-soft, transparent);
    --bs-btn-hover-color: var(--color-white);
    --bs-btn-hover-bg: var(--color-primary);
    --bs-btn-hover-border-color: var(--color-primary);
    --bs-btn-active-color: var(--color-white);
    --bs-btn-active-bg: var(--color-primary);
    --bs-btn-active-border-color: var(--color-primary);
}
