/*
   Element defaults on top of Bootstrap. Reads css/tokens.css.
*/

html {
    font-size: 16px;
    scroll-padding-top: calc(var(--bj-topbar-height) + 56px);
}

body {
    font-family: var(--bj-font);
    background-color: var(--bj-bg);
    color: var(--bj-text);
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--bj-accent);
    text-decoration: none;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--bj-accent-hover);
    text-decoration: underline;
}

/* A link inside running text is underlined, so that it is not told apart by colour alone. */
p a:not(.btn):not(.bj-entity),
.bj-icon-list a:not(.btn):not(.bj-entity),
.bj-prose a:not(.btn) {
    text-decoration: underline;
}

/* One visible focus style for everything interactive. */
:focus-visible {
    outline: 2px solid var(--bj-info);
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.btn-close:focus-visible {
    outline: 2px solid var(--bj-info);
    outline-offset: 2px;
    box-shadow: none;
}

h1, .h1 { font-size: var(--bj-text-xl); font-weight: 600; line-height: var(--bj-leading-tight); }
h2, .h2 { font-size: var(--bj-text-lg); font-weight: 600; line-height: var(--bj-leading-tight); }
h3, .h3 { font-size: var(--bj-text-md); font-weight: 600; }
h4, .h4, h5, .h5, h6, .h6 { font-size: var(--bj-text-md); font-weight: 600; }

hr {
    border-color: var(--bj-border);
    opacity: 1;
}

/* Numbers line up in columns and do not jump when they change. */
.bj-num,
.bj-stat-value,
.bj-chip-value,
[data-bj-countdown],
table td,
table th {
    font-variant-numeric: tabular-nums;
}

.bj-tone-money { color: var(--bj-money); }
.bj-tone-respect { color: var(--bj-respect); }
.bj-tone-danger { color: var(--bj-danger); }
.bj-tone-info { color: var(--bj-info); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.bj-tone-muted { color: var(--bj-text-muted); }

/* Links written by the BBCode renderer ([user], [gang] and the links inside help texts) carry this
   class. The name is historical; it follows the accent like any other link. */
.fg-color-green,
.fg-color-green:link,
.fg-color-green:visited {
    color: var(--bj-accent);
    text-decoration: none;
}

.fg-color-green:hover {
    color: var(--bj-accent-hover);
    text-decoration: underline;
}

/* A value with no spaces to wrap at (a file path, an address): let it break anywhere rather than
   push the page wider. */
.bj-break-anywhere {
    overflow-wrap: anywhere;
    min-width: 0;
}
