/*
 * Page frame around the Outfitter: background, header and footer.
 * (The Outfitter itself is styled in outfitter.css.)
 */
body {
    background-color: #1a1a1a;
    color: #c0c0c0;
    font-family: Verdana, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #2a2a2a;
    padding: 15px 20px;
    text-align: center;
    border-bottom: 2px solid #111;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

header h1 {
    margin: 0 0 5px 0;
    color: #e0e0e0;
    font-size: 26px;
    text-shadow: 1px 1px 2px #000;
}

header p {
    margin: 0;
    font-size: 12px;
    color: #909090;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    /* "safe": if the Outfitter is ever wider than the window, it starts at the left
     * edge (and can be scrolled) instead of being cut off on both sides */
    justify-content: safe center;
    align-items: flex-start;
    padding: 25px 15px;
}

#outfiter_container {
    background-color: #383839;
    padding: 6px;
    border: 2px solid #757575;
    border-bottom-color: #2a2a2a;
    border-right-color: #2a2a2a;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

footer {
    background-color: #2a2a2a;
    padding: 15px 20px;
    text-align: center;
    border-top: 2px solid #111;
    font-size: 11px;
    color: #8F8F8F;
    margin-top: auto;
    /* Pushes footer to the absolute bottom */
}

footer p {
    margin: 4px 0;
}

footer a {
    color: #c0c0c0;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

footer a:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* Wide screens: the Outfitter uses the window width up to 1460px - at that width
 * the preview column reaches the preview's maximum width (720px, see "WIDE
 * SCREENS" in css/outfitter.css) - and fills the height between header and footer
 * up to a maximum. Header and footer get fixed heights so that css/outfitter.css
 * can work out the room that is left. On larger screens the Outfitter is centred. */
@media (min-width: 1181px) {
    :root {
        --page-header-h: 82px;
        --page-footer-h: 68px;
        --page-pad-y: 25px;
    }

    header {
        height: var(--page-header-h);
        box-sizing: border-box;
    }

    footer {
        height: var(--page-footer-h);
        box-sizing: border-box;
    }

    main {
        padding-top: var(--page-pad-y);
        padding-bottom: var(--page-pad-y);
    }

    #outfiter_container {
        width: 100%;
        max-width: 1460px;
        box-sizing: border-box;
        /* centred vertically once it has reached its maximum height */
        align-self: safe center;
    }
}

/* Short wide screens (e.g. 1366 x 768 laptops): a slimmer header and footer leave
 * enough height for the whole Outfitter, link included. */
@media (min-width: 1181px) and (max-height: 820px) {
    :root {
        --page-header-h: 54px;
        --page-footer-h: 46px;
        --page-pad-y: 12px;
    }

    header {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    header h1 {
        font-size: 20px;
        margin-bottom: 2px;
    }

    header p {
        font-size: 11px;
    }

    footer {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    footer p {
        margin: 2px 0;
    }
}

/* Shown instead of the Outfitter when it cannot start (see outfitter.js) */
.outfiter_fatal {
    max-width: 480px;
    margin: 20px;
    color: #ffb4a8;
    font-size: 13px;
    line-height: 1.5;
}

/* Narrow screens: compact header, container uses the full width (no sideways
 * scrolling). Keep the breakpoint in sync with css/outfitter.css. */
@media (max-width: 1180px) {
    header {
        padding: 10px 12px;
    }

    header h1 {
        font-size: 20px;
        margin: 0 0 2px 0;
    }

    header p {
        font-size: 11px;
    }

    main {
        padding: 10px 6px;
    }

    #outfiter_container {
        width: 100%;
        max-width: 760px;
        box-sizing: border-box;
        padding: 6px;
    }
}

/* Contrast: these greys passed 4.5:1 only barely (or not at all) on #2a2a2a. */
header p,
footer {
    color: #a0a0a0;
}

@media (prefers-reduced-motion: reduce) {
    footer a {
        transition: none;
    }
}

/* Shown above the Outfitter when an entry in js/outfitter-new-assets.js could not be
 * added (see outfitter.js). Everything else keeps working. */
.outfiter_notice {
    margin: 0 0 6px 0;
    padding: 6px 10px;
    border: 1px solid #7a4a40;
    background: #3a2a28;
    color: #ffd0c8;
    font-size: 12px;
    line-height: 1.4;
}
