/* NAWG Web - Main Site - Global Styles */

/* Reset most default layout styles */
*
{
    margin: 1em 0 0 0;
    border: 0;
    padding: 0;
}
*:first-child, body, *.br
{
    margin-top: 0;
}

/* Top level containers */
html
{
    padding: 1vh;
    font-family: "Verdana", "DejaVu Sans", sans-serif;
    font-size: large;
    background-color: #808080;
    color: #303030;
}
body
{
    padding: 1vh;
    background-color: #909090;
}
header, footer, nav, main
{
    margin-top: 1vh;
    padding: 1vh;
    background-color: #a0a0a0;
}

/* Containers - colours getting progressively darker */
section, article
{
    padding: 1vh;
    background-color: #b0b0b0;
}

/* Headings */
h6
{
    font-size: 110%;
}
h5
{
    font-size: 120%;
}
h4
{
    font-size: 130%;
}
h3
{
    font-size: 140%;
}
h2
{
    font-size: 150%;
}
h1
{
    font-size: 160%;
}

/* Lists */
menu
{
    list-style-type: none;
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
    padding-inline-start: 0;
    padding-inline-end: 0;
    margin: 0.5em 0 0 0;
    padding: 0 0 0 1em;
    & menu
    {
        padding-left: 2em;
    }
    & li
    {
        margin-top: 0.5vh;
    }
}
ol
{
    list-style: decimal outside;
    padding-left: 2em;
    & ol
    {
        list-style-type: lower-alpha;
        & ol
        {
            list-style-type: lower-roman;
        }
    }
}
ul
{
    list-style: disc outside;
    padding-left: 2em;
    & ul
    {
        list-style-type: circle;
    }
    &.plain
    {
        list-style-type: none;
    }
}
li
{
    margin-top: 0.5em;
}

/* Tables */
table, th, td
{
    border: 2px solid;
    &.plain, &.plain th, &.plain td
    {
        border: 0;
    }
    &.layout, &.layout th, &.layout td
    {
        border: 0; /* TODO: remove this legacy */
    }
}
table
{
    border-collapse: collapse;
    margin-top: 1em;
    &.full
    {
        width: 100%;
    }
    &.tac
    {
        margin-left: auto;
        margin-right: auto;
    }
}
th, td
{
    padding: 0.3em 0.5em;
    text-align: left;
    vertical-align: top;
}

/* Forms and controls */
form
{
    padding: 1vh;
}
input, textarea, button, select
{
    padding: 0.2em;
    background-color: #f0f0f0;
    font-size: 100%;
    &:disabled
    {
        background-color: #808080;
    }
}
input[type="text"], input[type="password"]
{
    height: 1.5em;
}
button, input[type="submit"], input[type="reset"], input[type="button"]
{
    border: 2px solid;
}

/* Paragraphs and related */
blockquote
{
    padding: 1vh 2em;
}
p
{
    margin-top: 1em;
}

/* Links */
a, form.accounts input[type=submit]
{
    color: #0000c0;
    text-decoration: none;
    padding: 0.1em;
}
a:hover, form.accounts input[type=submit]:hover
{
    cursor: pointer;
    background-color: #0000c0;
    color: #f0f0f0;
}
a.button
{
    border: 2px solid #303030;
    padding: 0.1em 0.4em;
    background-color: #f0f0f0;
    &:hover
    {
        background-color: #0000c0;
    }
}

/* Positioning */
*.tal
{
    text-align: left;
}
*.tar
{
    text-align: right;
}
*.tac
{
    text-align: center;
}
*.vat
{
    vertical-align: top;
}
*.vam
{
    vertical-align: middle;
}
*.vab
{
    vertical-align: bottom;
}
*[class|=columns], *.columns
{
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    gap: 1vh;
    & > *
    {
        margin-top: 0;
    }
}
*[class|=columns-apart], *.columns-apart
{
    justify-content: space-between;
}
*.columns-2, *.columns-apart-2
{
    & > *
    {
        max-width: 40%;
    }
}
*.columns-3, *.columns-apart-3
{
    & > *
    {
        max-width: 31%;
    }
}
*[class|=grid]
{
    display: grid;
    grid-template-columns: auto auto;
    gap: 2vh 2vw;
    & > *
    {
        margin-top: 0;
    }
}
*.grid-3
{
    grid-template-columns: auto auto auto;
}
*.grid-4
{
    grid-template-columns: auto auto auto auto;
}
*.dead-center
{
    display: flex;
    justify-content: center;
    align-items: center;
}
*.floatl
{
    float: left;
    margin-right: 1em;
    margin-bottom: 1em;
}
*.floatr
{
    float: right;
    margin-left: 1em;
    margin-bottom: 1em;
}
*.clearl
{
    clear: left;
}
*.clearr
{
    clear: right;
}
*.clear
{
    clear: both;
}
*.iblock
{
    display: inline-block;
}

/* Textual adjustments */
*.smaller
{
    font-size: smaller;
}
*.larger
{
    font-size: larger;
}
*.mono, *.email, *.link-mag, address, *.number, *.price, code
{
    font-family: "consolas", "DejaVu Sans Mono", monospace;
}
*.number, *.price
{
    text-align: right;
}
*.price::before
{
    content: "\a3"; /* Pound sign */
}
*.nowrap
{
    white-space: nowrap;
}

/* Images */
div.image
{
    display: inline-block;
    overflow: clip;
    & a
    {
        margin: 0;
        border-radius: 0;
        padding: 0;
    }
    & img
    {
        display: block;
        width: 100%;
    }
    & p
    {
        margin-top: 0.5em;
        text-align: center;
    }
}
*.image-bg
{
    background-repeat: no-repeat;
    background-size: 100%;
    background-blend-mode: screen;
}

/* Red-Amber-Green (RAG) colour scheme */
*.rag-red, *.error
{
    color: #c00000;
}
*.rag-amber, *.warning
{
    color: #c06000;
}
*.rag-green, *.good
{
    color: #008000;
}

/* Make these stand out as problems with the website, rather than just highlighting for attention */
*.error::before
{
    content: "Error: ";
}
*.warning::before
{
    content: "Warning: ";
}
*.broken-link::after
{
    content: " (broken link)"
}

/* Link magazine */
span.link-mag
{
    /*color: #800080;*/
    font-style: italic;
}

/* Miscellaneous */
*.hidden
{
    display: none;
}
*.bold
{
    font-weight: bolder;
}
*.italic
{
    font-style: italic;
}
*.dim
{
    color: #808080;
}
*.lite
{
    background-color: #e0e0e0;
}
*.notice
{
    background-color: #d0d0d0;
}
*.normal
{
    color: inherit;
    font-weight: normal;
    font-style: normal;
}
address
{
    font-style: normal;
    white-space: pre-wrap;
}
*.plain-text
{
    white-space: pre-wrap;
}
*.meta
{
    clear: both;
    font-size: smaller;
}
hr
{
    margin-top: 1em;
    border: 1px solid;
}

/* Hide the experimental access level options -- eventually get rid of this and the markup */
section.access-experiment
{
    display: none;
}
