/*
 * Fonts
 */

@font-face {
    font-family: 'Philosopher';
    src: url('/static/fonts/philosopher/Philosopher-Regular.ttf');
}
@font-face {
    font-family: 'Philosopher';
    src: url('/static/fonts/philosopher/Philosopher-Bold.ttf');
    font-weight: bold;
}
@font-face {
    font-family: 'Philosopher';
    src: url('/static/fonts/philosopher/Philosopher-BoldItalic.ttf');
    font-weight: bold;
    font-style: italic;
}
@font-face {
    font-family: 'Philosopher';
    src: url('/static/fonts/philosopher/Philosopher-Italic.ttf');
    font-style: italic;
}

@font-face {
    font-family: 'PT Sans';
    src: url('/static/fonts/pt-sans/PTSans-Regular.ttf');
}
@font-face {
    font-family: 'PT Sans';
    src: url('/static/fonts/pt-sans/PTSans-Bold.ttf');
    font-weight: bold;
}
@font-face {
    font-family: 'PT Sans';
    src: url('/static/fonts/pt-sans/PTSans-BoldItalic.ttf');
    font-weight: bold;
    font-style: italic;
}
@font-face {
    font-family: 'PT Sans';
    src: url('/static/fonts/pt-sans/PTSans-Italic.ttf');
    font-style: italic;
}

/*
 * Variables
 */

:root {
    /* PXG palette colours */

    /* "Jet" */
    --clr-pxg-dark: #2d2c2d;
    /* "Cinnabar" */
    --clr-pxg-red: #f1372a;
    /* "Yellow Orange Color Wheel */
    --clr-pxg-orange: #f8951d;
    /* "Cultured" */
    --clr-pxg-light: #eaebee;
    /* "Rich Black FOGRA 39" */
    --clr-pxg-black: #0a0a0a;

    /* Font colours */
    --clr-font-dark: var(--clr-pxg-dark);
    --clr-font-light: var(--clr-pxg-light);

    /* Background colours */
    --clr-bg-dark: var(--clr-pxg-dark);
    --clr-bg-medium: #4d4c4c;
    --clr-bg-light: var(--clr-pxg-light);

    /* Link colours */
    --clr-link:         var(--clr-pxg-orange);
    --clr-link-hover:   var(--clr-pxg-red);
    --clr-link-visited: purple;

    /* Dimensions */
    --dim-bg-img-padding: 25px;
    --dim-min-content-border: 20px;
    --dim-user-bar-height: 1.8rem;
}

/*
 * General
 */

html {
    background-color: var(--clr-bg-dark);
    min-width: 100vw;
    min-height: 100vh;
}

body {
    width: 700px;
    max-width: calc(100vw - 2*var(--dim-min-content-border));
    margin: 0 auto;
}

#background-image {
    position: fixed;
    top:    var(--dim-bg-img-padding);
    left:   var(--dim-bg-img-padding);
    height: calc(100vh - 2*var(--dim-bg-img-padding));
    width:  calc(100vw - 2*var(--dim-bg-img-padding));
    opacity: 0.13;
    z-index: -1;
    object-position: center;
    object-fit: fill;
}

#user-bar {
    position: fixed;
    top: 0;
    left: 0;
    text-align: center;
    vertical-align: middle;
    height: var(--dim-user-bar-height);
    width: 100vw;
    background-color: magenta;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
}
#user-bar.logged-in {
    background-color: #1c640d;
}
#user-bar.logged-out {
    background-color: #640d4e;
}
#user-bar form {
    margin: 0;
    display: inline-block;
}
#user-bar button {
    margin-left: 1.5em;
}
button.link {
    padding: 0;
    border: none;
    background: none;
    color: var(--clr-link);
    transition: color 160ms;
    cursor: pointer;
}
button.link:hover {
    color: var(--clr-link-hover);
}

#user-bar-vspace {
    display: block;
    width: 100%;
    height: var(--dim-user-bar-height);
}

img.icon {
    height: 0.95em;
    display: inline-block;
}

/*
 * Typography
 */

html {
    font-size: 18px;
    color: var(--clr-font-light);
    font-family: 'PT Sans';
}

input, button {
    font-family: 'PT Sans';
    font-size: 0.8rem;
}

h1, h2, h3, h4, h5 {
    font-family: 'Philosopher';
    padding: 0;
    margin: 2.0rem 0 0.9rem;
    line-height: 1.24em;
}

h1 { font-size: 2.441rem; }
h2 { font-size: 1.953rem; }
h3 { font-size: 1.563rem; }
h4 { font-size: 1.25rem;  }
h5 { font-size: 1rem;     }

p, li, td {
    line-height: 1.5em;
}

p {
    margin: 10px 0 10px 0;
    overflow-wrap: break-word;
}

a {
    color: var(--clr-link);
    transition: color 160ms;
}
a:hover {
    color: red;
    color: var(--clr-link-hover);
}
a:visited {
    color: var(--clr-link-visited);
}

code {
    font-size: 0.9em;
}

.fail {
    color: var(--clr-pxg-red);
}

/*
 * Forms
 */

form {
    margin: 2em 0;
}

label {
    font-weight: bold;
}

input {
    padding: 0.6em;
    margin: 0.1em;
    border-radius: 0.6em;
}
input[type='file'] {
    background-color: var(--clr-bg-medium);
}

button, input[type='submit'] {
    padding: 0.5em;
    margin: 0.2em;
}

/*
 * Login page
 */

section#login {
    text-align: center;
    margin: 4em 0;
}

section#login #header-logo {
    width: 16em;
    max-width: 80%;
}

section#login h1 {
    margin-top: 0.5em;
    font-size: 2.2rem;
}

/*
 * Random images
 */

figure.rndim {
    margin: 2em auto;
    min-width: 300px;
    max-width: 90%;
}

figure.rndim img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    min-height: 250px;
    max-height: 500px;
    object-fit: contain;
}

figure.rndim figcaption {
    text-align: center;
}
