/* Base styles. Every colour is a token from tokens.css; nothing here knows about light or dark. */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
    color: var(--accent);
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.muted {
    color: var(--text-3);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--canvas);
    border-bottom: 1px solid var(--border);
}

.site-title {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 0.25rem;
    margin-right: auto;

    a {
        padding: 0.3rem 0.8rem;
        border-radius: 0.4rem;
        color: var(--text-2);
        text-decoration: none;

        &:hover {
            color: var(--text);
        }

        &[aria-current] {
            background: var(--surface-muted);
            color: var(--accent);
        }
    }
}

.site-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    color: var(--text-2);
}

.site-main {
    max-width: 60rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;

    /* Pages with many columns, like the forecast grid, use the whole window. */
    &.is-wide {
        max-width: none;
    }
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.35rem;
    background: var(--canvas);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;

    &:hover {
        border-color: var(--accent);
    }

    &.is-primary {
        border-color: var(--accent);
        background: var(--accent);
        color: var(--on-accent);

        &:hover {
            background: var(--accent-hover);
        }
    }
}

.flash {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    background: var(--surface-subtle);

    &.is-success {
        color: var(--positive);
    }

    &.is-danger,
    &.is-error {
        color: var(--negative);
    }
}

.login-card {
    max-width: 24rem;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 0.5rem;

    h1 {
        margin-top: 0;
    }
}

.login-sso-logo {
    width: 1.1rem;
    height: 1.1rem;
}
