/* FONT IMPORTS */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

/* MAIN STYLE VARIABLES */

:root {
    --clr-primary: black;
    --clr-secondary: grey;
    --clr-background: white;

    --content-width:600px;
    --content-col-width: calc(var(--content-width) + var(--pad-margin));
    --sidebar-col-width: 165px;

    --pad-margin: 30px;
    --display-mode: desktop;

    --header-height: 130px;
    --header-buffer-height: 20px;
    --footer-height: 100px;

    --vertical-shadow: 0px 5px 10px -11px var(--clr-secondary);
    --standard-shadow: 2px 2px 10px -3px var(--clr-secondary);
    --null-shadow: 0px 0px 0px var(--clr-secondary);

    --shadow-transition: box-shadow 0.5s;
    
}

/*TYPE*/

a{
    color:inherit;
}
a:visited {
    text-decoration-style: dashed;
}

/* main text type*/
body {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    line-height: 150%;
    overflow-y: scroll;
}

/* headers type */
h1, h2, h3, h4, h5, h6, .sub-heading, th {
    font-family: 'DM Sans', sans-serif;

}
h1, h2, .sub-heading {text-align: center;}
h1, h2 {
    margin-top: 2rem;
}

h1 {font-size: 2rem; line-height: 1.1;}
h2 {font-size: 1.5rem;  }
h3 {font-size: 1rem;}

/* text strength types */
strong {
    font-weight: bold;
}
em {
    font-style: italic;
}

/* paragraph spacing rules */
h3, h4, h5, h6, .block, p, table, blockquote, ol, ul, li {margin-top: 1rem;}
* > :first-child { margin-top: 0 !important;}

/* ordered list */
ol {
    list-style: decimal outside none;

}
ol li {
    padding-left: 1ch;
    margin-left: 2.5ch;
}
ol li::marker {
    font-weight: bold;
    padding-right: 1ch;
}

/* LAYOUT */

/* layout layers */
.layer {
    display: grid;
    grid-template-columns:  var(--sidebar-col-width) var(--content-col-width);
    grid-template-rows: var(--header-height) var(--header-buffer-height) auto var(--footer-height);
    /*sets the width in a way which allows the central column to be central*/
    width: calc(2 * var(--sidebar-col-width) + var(--content-col-width));
    /*centres the page horizontally*/
    left: 50%;
    min-height: 100vh;
    transform: translate(-50%, 0%);
}
.static {
    position: fixed;
    z-index: 1000;
    grid-template-areas: 
        " .   header "
        " .   nav2"
        " nav nav2"
        " .   nav2 ";
    pointer-events: none
}
.scroll {
    position: relative;
    grid-template-areas: 
        ".  ."
        ".  ."
        ".  content"
        ".  footer ";
    height: fit-content;
}

/* header */
header {
    padding: var(--pad-margin);
    grid-area: header;
    display: flex;
    justify-content: space-between;
    text-align: center;
    background-color: var(--clr-background);
    transition: box-shadow 0.2s;
    pointer-events: all;
}
header > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
}
.header-sub-heading{
    font-size: 1.2rem;
    padding-top: 0.1em;
    padding-bottom: 0.1em;
    margin-top: 0;
}
p.header-title {
    font-family: 'DM Sans', sans-serif;
    text-align: center;
    font-size: 2.3rem;
    line-height: 100%;
    margin-top: 0;
}

/* navigation */
nav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    color: var(--clr-secondary);
    background-color: var(--clr-background);
    opacity: 95%;
    pointer-events: all;
}
nav > * {
    padding-bottom: 1rem;
}
nav a:link {
    text-decoration: none;
    color: var(--clr-secondary);
}
nav a:visited {
    text-decoration: none;
    color: var(--clr-secondary);
}
nav a.c-p:link {
    font-weight: bold;
    color: var(--clr-primary);
}
nav a.c-p:visited {
    font-weight: bold;
    color: var(--clr-primary);
}
#hamburger {
    display: none;
    height: 3rem;
    width: 3rem;
    margin-top: auto;
    margin-bottom: auto;
    padding: 0px;
    border: none;
    background-color: var(--clr-background);
    transition: box-shadow 0.2s;
    outline: none;
    flex-shrink: 0;
}
#hamburger:hover{
    box-shadow: 2px 2px 3px var(--clr-secondary);
    outline: none;
    border: none;
}
#hamburger:focus{
    box-shadow: 2px 2px 3px var(--clr-secondary);
    outline: none;
}
#hamburger:focus-visible{
    border: none;
    outline: none;
}
#hamburger:active{
    box-shadow: inset 2px 2px 3px var(--clr-secondary);
    animation-name: depress;
    animation-duration: 0.2s;
    outline: none;
}

@keyframes depress {
    0%   {box-shadow: var(--standard-shadow)}
    50%  {box-shadow: var(--null-shadow)}
    51%  {box-shadow: inset var(--null-shadow)}
    100% {box-shadow: inset var(--standard-shadow)}
  }

/* content */
section {
    grid-area: content;
    padding: 0 var(--pad-margin);
}
img.profile-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* section where each internal div becomes a column */
.col.block {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
}
.col.block > div {
    flex-grow: 1;
    flex-basis: 0;
    margin-right: var(--pad-margin);
}
.col.block > div:last-child {
    margin-right: 0;
}

/* narrow screen centering changes*/
@media only screen and (max-width: 1000px) {
    .layer {
        left: 500px;
    }
}

/* mobile changes */
@media only screen and (max-width: 800px) {
    :root {
        --display-mode: mobile;
        --header-height: 125px;
        --sidebar-col-width: 0px;
        --content-col-width: min(100vw, var(--content-width));
    }
    body {
        width: 100%;
    }
    .layer {
        width: var(--content-col-width);
        left: 50%;
    }

    .header-sub-heading {
        display: none;
    }
    nav {
        grid-area: nav2;
        align-items: center;
        justify-content: center;
        display: none;
    }
    #west-manse {
        display: none;
    }
    #hamburger {
        display: inline;
    }
    .col.block {
        flex-direction: column;
    }
    .col.block > div{
        margin-right: 0;
        margin-bottom: var(--pad-margin);
    }
    .col.block > div:last-child {
        margin-bottom:0;
    }
    img.profile-img {
        height: var(--content-col-width);
    }
}

/* hide logo when things get narrow*/
@media only screen and (max-width: 500px) {
    .header-title {
        display: none;
    }
footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
}

/* really narrow devices */
@media only screen and (max-width: 300px) {
    :root {
        font-size: 10px;
        --header-height: 60px;
        --pad-margin: 10px;
    }
}

/* MISC */

/* normal table */
table {
    width: min-content;
}
table th {
    text-align: left;
    padding-right: 2ch;
}
table td {
    text-align: left;
    padding: 4px;
}

/* contacts table */
table.centre th {
    text-align: right;
    padding-right: 2ch;
}


/* footer */
footer {
    color: var(--clr-secondary);
    padding: var(--pad-margin);
    grid-area: footer;
    display: flex;
    justify-content: space-between;
}


/* visual styles */
.box {
    padding: var(--pad-margin);
    border: black;
    border-width: 2px;
    border-style: solid;
}
.centre {
    display: block;
    margin: auto;
}