:root {
    --main-theme-color: #4e91ad;
}

/* DEFAULTS */

html, body, div, span, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, img, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, a, article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section {
    margin: 0;
    padding: 0;
    border: 0;
    font: inherit;
    vertical-align: baseline;
}

html {
	box-sizing: border-box;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

*, *:before, *:after {
	box-sizing: inherit;
}

ul, ol {
    list-style-position: inside;
}

nav ul, footer ul {
	list-style-type: none;
}

strong {
    font-weight: bolder;
}

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  margin: 0;
}

/* Correct the inability to style clickable types in iOS and Safari. */

button, [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
}


/* COLOUR SCHEME */

body, button {
    color: #222;
}

footer {
    & a {
        color: #222;
        text-decoration: none;
    }
}


/* TYPOGRAPHY */

body {
    font-family: "Montserrat", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
    font-weight: 400;
    line-height: 1;
}

@media (min-resolution: 2dppx) {
    body {
        font-weight: 300;
    }
}

main, aside, footer {
    line-height: 1.5;
}

h1, h2, h3, nav a {
    letter-spacing: 0.1em;
}

h1 {
    font-size: 1.25rem;
    text-transform: uppercase;
    line-height: 1;
}

h2 { 
    font-size: 1.125rem;
    text-transform: uppercase;
    margin-bottom: 0.5em;
}

header h1 {
    font-size: 1.125rem;
}

header a {
    color: #222;
    text-decoration: none;
}

#main-menu a {
    text-transform: uppercase;
}

main h1 {
    text-align: center;
    margin-bottom: 2em;
}

main p {
    margin: 0 0 1em 0;
}

#footer-links li, #contact-details p {
    margin-bottom: 0.5em;
}


/* IMAGES & VIDEO */

img {
    display: block;
	margin: 0;
	width: 100%;
    height: auto;
    vertical-align: bottom;
}


/* NAVIGATION */

body.menu-open {
    & main, footer {
        opacity: 0.5;
    }
}

#main-menu {
    height: 100%;
    width: 0;
    max-width: 30em;
    position: fixed;
    z-index: 1000;
    opacity: 1; /* Counteract dimming of body above */
    top: 0;
    right: 0;
    background-color: white;
    overflow-x: hidden; /* Disable horizontal scroll */
    padding-top: 3.25rem;
    transition: 0.3s;

    &.open {
        width: 100%;
        border-left: 1px solid #222;
    }

    & ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
    }   

    & li {
        line-height: 1.2;
    }

    & a {
        color: #333;
        padding: 0.75em 1em;
        display: inline-block;
        text-decoration: none;
    }

    & a:hover {
        color: var(--main-theme-color);
    }   
}

#main-menu-open-button {
	display: block;
    font-size: 2rem;
    text-align: right;
    line-height: 1;
    padding: 0.2em 0;
    cursor: pointer;
}

#main-menu-close-button {
    position: absolute;
    top: 0.7em;
    right: 0.7em;
    font-size: 2rem;
    line-height: 1;
    margin-top: 0;
    padding: 0;
    border: 0;
    background-color: #fff;
    cursor: pointer;
}

/* Forms */


#UserDefinedForm {
    & .userform, #content > p {
        max-width: 24em;
        margin-left: auto;
        margin-right: auto;
    }   
}

.userform {    
    & .field {
        margin-bottom: 1em;
    }
    
    & label.left {
        margin-bottom: 0.25em;
        font-weight: inherit;
    }
    
    & textarea, input:not([type="submit"]):not([type="checkbox"]) {
        width: 100%;
    }
}

/* =============================================================================
   LAYOUT
   =============================================================================  */

/* DEFAULT LAYOUT - SINGLE COLUMN */

body {
    height: 100vh;
    display: grid;
    grid-template-rows: max-content 1fr max-content;
    grid-template-areas: "header"
                         "main"
                         "footer";
    row-gap: 2em;
    
    &#HomePage {
        grid-template-areas: "header"
                             "banner"
                             "main"
                             "footer";
        grid-template-rows: max-content max-content 1fr max-content;
    }

}

header, main, footer {
    padding: 1em;
}

header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#banner {
    grid-area: banner;
}

main {
    grid-area: main;
    
    & #content {
        max-width: 40em;
        margin: 0 auto;
    }
    
    /* & > picture { */
        /* display: block; */
        /* margin-bottom: 2em; */
    /* } */
}

footer {
    grid-area: footer;
    
    & > div {
        margin-bottom: 2em;
    }
}

#gallery {
    display: grid;
    grid-template-columns: 1fr minmax(12em, 18em) 1fr;
    row-gap: 2em;

    & > * {
        grid-column: 2;
    }
}

@media screen and (width >= 30em) {
    body {
        grid-template-columns: 1fr minmax(12em, 18em) minmax(12em, 18em) 1fr;
        grid-template-areas: "header header header header"
                             " . main main . "
                             "footer footer footer footer";
        column-gap: 2em;
        row-gap: 2em;
 
        &#HomePage {
            grid-template-areas: "header header header header"
                                 "banner banner banner banner"
                                 ". main main ."
                                 "footer footer footer footer";
        }
    }
    
    header {
        padding: 2em 2em 0 2em;
    }

    main {
        padding: 0;
        
        & h1 {
            margin-bottom: 4em;
        }
        
        /* & > picture { */
            /* margin-bottom: 4em; */
        /* } */
    }  

    #gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 2em;
    }
    
    #gallery > * {
        grid-column: auto;
    }
    
    #gallery > a {
        cursor: zoom-in;
    }

    footer {
        padding: 0 1em 2em 1em;
    }   
}


@media screen and (width >= 44em) {
    body {
        row-gap: 4em;
    }
}


/* MEDIUM LAYOUT */

@media screen and (min-width: 64em) {

    body {
        grid-template-columns: 1fr repeat(3, 18em) 1fr;
        grid-template-areas: "header header header header header"
                             " . main main main . "
                             "footer footer footer footer footer";
        
        &#HomePage {
            grid-template-areas: "header header header header header"
                                 "banner banner banner banner banner"
                                 ". main main main ."
                                 "footer footer footer footer footer";
        }
    }
        
    #gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 2em;
    }
    
    footer {
        & #copyright {
            text-align: center;
            /* grid-column: 4; */
            /* align-self: end; */
        }
    }
    
    /* Main Menu */
    #main-menu {
        position: static;
        width: auto;
        max-width: max-content;
        height: auto;
        overflow-x: visible;
        padding: 0;
    
        & > ul {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
            margin: 0;
            padding: 0;
            border-top: 0;
        }
    
        & a {
            font-size: 0.9375rem;
            margin: 0 0 0 2em;
            padding: 0;
        }
        
        & .current > a {
            color: var(--main-theme-color);
        }
    }
    
    #main-menu-open-button, #main-menu-close-button {
        display: none !important;
    }

}

/* LARGE LAYOUT */

@media screen and (min-width: 92em) {
    
    body {
        grid-template-columns: 1fr 2fr repeat(3, 22em) 2fr 1fr;
        grid-template-areas: " . header header header header header . "
                             " . . main main main . . "
                             " . footer footer footer footer footer . ";
        column-gap: 4em;
        row-gap: 6em;

        &#HomePage {
        grid-template-areas: " . header header header header header . "
                             " banner banner banner banner banner banner banner "
                             " . . main main main . ."
                             " . footer footer footer footer footer . ";
        }
    }
    
    header {
        align-items: center;
        padding: 3em 0 0 0;
    }
    
    /* main { */
        /* & > picture { */
            /* margin-bottom: 6em; */
        /* } */
    /* } */
        
    #gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4em;
    }

}
