/* === LAYOUT_GENERAL .CSS === 

        IDs and Classes
            Use IDs ("#xyz") for elements that are one time use.
            Use classes (".xyz") for things that repeat - remember DRY (Do not Repeat Yourself)

        Naming conventions
            files = use lowercase and join words using underscores 'this_is_an_example.php'
            IDs = use PascalCase
            classes = use camelCase

            use the 'object oriented css' convention, where an abject is referenced via '--'
            e.g. 
                .boxOne{} 
                .boxOne--rounded{}
                .boxOne--big{}
                .boxOne--small{}
        
        More info on specific parts
            - Navigation
                The main header is made up of 3 parts, the logo, small device navigation and large device navigation. All three are in fixed positions, but the visibility changes depending on the size of the viewing device.
            
            - Layout
                Then, directly underneath, is a page container (using position: absolute, margin-top: (height of the nav in px); top: 0;).
                Within that there is a sub container.
                body
                    - #Header
                    - #PageContainer - has no margin or padding.
                        > SubContainer
                        > Footer

                General content is located inside the sub container.            

    */

/* set default HTML attributes */
/* ============================================== */
   
    body { 
        background: var(--colour-background-1); 
        color: var(--colour-text-1); 
        font-family: var(--font-family); 
        font-size: var(--font-base); 
        line-height: var(--line-height);
    }

    a, a:visited, a:active {
        color: var(--colour-1);
        text-decoration: none;
    }

    h1, h2, h3, h4, h5, h6 {
        color: var(--colour-2);
    }

    p {
        margin-bottom: var(--space-2);
    }

    p:last-child{
        margin-bottom: var(--space-2);
    }

    ol, ul{
        margin: 0;
    }

    ol.nested, ul.nested{
        list-style-type: none;
        font-weight: bold;
    }

    ol.nested ol, ul.nested ul{
        text-indent: 10px;
        font-weight: normal;
    }

    li{
        margin-bottom: var(--space-2);
    }

/* Containers */
/* ============================================== */

    /* only used once per page to group the entire page AFTER THE HEADER */
    #PageContainer{
        position: absolute;
        top: var(--height-header);
        width: 100%;
        padding: 0;
        border: none;
    }

    /* group all sections of content (multiple boxes) */
    #SubContainer{
        position:static;
        background: linear-gradient(to right, rgba(var(--colour-background-3-transparent), 0.05), var(--colour-heading-1), rgba(var(--colour-background-3-transparent), 0.05));
        padding: var(--space-4) 5%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content:flex-start;
        text-align: center;
        min-height: calc(100vh - (var(--height-header) + var(--height-footer)));
    }

            /* LARGER DEVICES */
            /* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */

            @media (min-width: 639px){
                #SubContainer{
                    padding: var(--space-4) 10% 0 10%;
                }
            }

            @media (min-width: 959px){
                #SubContainer{
                    padding: var(--space-4) 20% 0 20%;
                }
            }

    /* boxes are structural */
    .box{
        width: 100%;
        padding: 0;
        overflow: hidden;
    }

    .box--WithPadding{
        width: 100%;
        padding: var(--space-4);
        overflow: hidden;
    }

    /* items are for styling */
    .item{
        text-align: left;
        background: var(--item-background);
        margin-bottom: var(--space-4);
        border-color: var(--item-border-colour);
        border-style: var(--item-border-style);
        border-width: var(--item-border-width);
    }

    .item--Title{
        text-align: center;
        margin-top: 1rem;
        margin-bottom: 1rem;
        color: var(--colour-1);
    }

    .item--SubTitle{
        text-align: center;
        margin-top: 0;
        margin-bottom: .5rem;
    }

    .item--SubSectionTitle{
        text-align: left;
        margin-bottom: .5rem;
        color: var(--colour-title-subsection-1);
    }

    .item--SubSectionSubTitle{
        text-align: left;
        margin-bottom: .5rem;
        color: var(--colour-2);
    }

    /* Remove the bottom margin from titles or sub-section titles that immediately preceed sub-titles or sub-section sub-titles. */
    .item--Title:has(+ .item--SubTitle), .item--SubSectionTitle:has(+ .item--SubSectionSubTitle){
        margin-bottom: calc(var(--space-2) * -1);       
    }
    
    .item--Heading{
        text-align: left;
        margin-top: var(--space-4);
        margin-bottom: 0;
        color: var(--colour-heading-1);
    }

    .item--CentreAlignedText{
        text-align: center;
    }

    .item:last-child{
        margin-bottom: var(--space-fixed-2);
    }
    
    #LinkToTop{
        position: fixed;
        bottom: 15px;
        left: calc(50% - 2rem);
        display: none; /* a script changes this to 'flex' once the screen is scrolled down at all */
        padding: 0;
        height: 4rem;
        width: 4rem;
        color: var(--colour-2);
        background: rgba(var(--colour-1-transparent), .9);
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        text-align: unset;
        border: solid white 1px;
    }

    .summary{
        font-weight: bold;
    }
    
    .summary:hover{
        color: var(--colour-1);
        cursor: pointer;
    }

    /* OPEN */
    .details[open]{
        position: relative;
    }

    .details[open] p:first-of-type{
        padding-top: 5px;
    }

    .details[open] .summary{
        color: var(--colour-1);
    }

/* Footer */
/* ============================================== */

    footer{
        position: static;
        height: var(--height-footer);
        width: 100%;
        background: var(--colour-background-3);
        padding: var(--space-4);
        font-size: var(--fs-xs);
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .footer--Left, .footer--Right{
        min-width: 50%;
    }

    .footer--Left{
        text-align: left;
    }

    .footer--Right{
        text-align: right;
    }

    .footer--Logo{
        display: inline;
        vertical-align:bottom;
        height: 20px;
        width: auto;
    }

            /* LARGER DEVICES */
            /* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */

            @media (min-width: 639px){
                .footer--Logo{
                    height: 25px;
                    vertical-align:middle;
                }
            }

            @media (min-width: 959px){
                .footer--Logo{
                    height: 30px;
                }
            }

            @media (min-width: 1279px){
                .footer--Logo{
                    height: 35px;
                }
            }

/* General Classes */
/* ============================================== */

    .anchor{
        position: relative;
        top: calc((var(--height-header) + 16px) * -1);
    }

/* Spacing */
/* ============================================== */

/* Flex helpers */
/* ============================================== */

/* Responsive helpers */
/* ============================================== */