/*
 * Base rules for every page.
 *
 * The root element of a page (and the header, the dialog and the note at the
 * bottom) carries the class "ui". Element rules are written with :where(), so
 * that any component class wins over them without extra weight.
 */

/* 1. Box model and the hidden attribute */
.ui,
.ui *,
.ui *::before,
.ui *::after {
    box-sizing: border-box;
}

/* The hidden attribute always wins, also over a component's own display. */
.ui[hidden],
.ui [hidden] {
    display: none !important;
}

/* 2. Text */
.ui {
    color: var(--c-text);
    font: var(--t-body)/1.4 system-ui, sans-serif;
}

:where(.ui) h1 {
    margin: 0;
    font-size: var(--t-display);
    font-weight: 700;
}

:where(.ui) h2 {
    margin: 0;
    font-size: var(--t-body);
    font-weight: 600;
}

:where(.ui) p {
    margin: 0;
}

:where(.ui) a {
    color: var(--c-link);
}

.ui .muted {
    color: var(--c-muted);
}

.ui .small {
    font-size: var(--t-label);
}

/* 3. Form elements */
:where(.ui) button,
:where(.ui) input,
:where(.ui) select,
:where(.ui) textarea {
    font: inherit;
    color: inherit;
}

:where(.ui) button {
    cursor: pointer;
}

:where(.ui) button:disabled {
    cursor: default;
}

:where(.ui) form {
    margin: 0;
}

/* One visible focus ring for keyboard users, on every control and link. */
.ui :focus-visible {
    outline: 3px solid var(--c-link);
    outline-offset: 2px;
}

/* 4. The page itself */
.ui-body {
    margin: 0;
    background: var(--c-bg);
}
