/*
 * Styles the "Home" escape hatch injected into the Authelia portal.
 *
 * Served by nginx at https://auth.summitstack.xyz/summitstack-home.css (see
 * nginx/auth.summitstack.xyz.conf) and pulled in by a sub_filter that adds a
 * <link> to the portal's <head>.
 *
 * It has to be an external same-origin stylesheet: Authelia sends a
 * nonce-based Content-Security-Policy, which blocks inline <style> blocks and
 * inline style="" attributes, but permits 'self' stylesheets.
 *
 * Deliberately neutral — this sits on top of Authelia's own theme, so it
 * borrows nothing from it and imposes nothing on it.
 */

.ss-home {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2147483647;

    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;

    border: 1px solid rgb(128 128 128 / 0.35);
    border-radius: 8px;
    background: rgb(255 255 255 / 0.9);
    color: #333;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;

    transition: border-color 120ms ease, background-color 120ms ease;
}

.ss-home:hover {
    border-color: rgb(128 128 128 / 0.6);
    background: #fff;
}

.ss-home:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Authelia's default theme is 'auto', so match whichever it resolved to. */
@media (prefers-color-scheme: dark) {
    .ss-home {
        background: rgb(30 30 34 / 0.9);
        color: #e6e6ea;
        border-color: rgb(160 160 170 / 0.3);
    }

    .ss-home:hover {
        background: #1e1e22;
        border-color: rgb(160 160 170 / 0.55);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ss-home { transition: none; }
}

/* Keep clear of the portal card on very small screens. */
@media (max-width: 30rem) {
    .ss-home {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.35rem 0.6rem;
    }
}
