* { 
    /* Universal selector, adds rules to all elements unless superceded */
    box-sizing: border-box; 
    cursor: url(/index_assets/phalanx.cur), auto;
    --clr-footer: hsl(323 21% 16%);
    --clr-neon: hsl(229, 100%, 50%);
    --clr-bg: hsl(323 21% 16%);
}
*:active{
    cursor: url(/index_assets/phalanxpress.cur), auto;
}

/*----------------------------------------------------------------------------*/

body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: black;
    max-width: 100%;
}

header {background-image: url(/index_assets/skull.gif);}
nav {background: rgba(128, 128, 128, 0.75);}
main {background: rgba(255, 165, 0, 0.75);}
footer {background: var(--clr-footer);}

body {
    /* default display layout, should be optimised for smallest size */
    display: grid;
    grid-template-columns: 1.5em 1fr 4fr 1.5em;
    grid-template-rows: 7.5em/*5*/ 1fr 3em; /*3em, changed for neon button*/
    grid-template-areas: 
        "header header header header"
        ". nav main ."
        ". footer footer ."
}

/*------------------------HEADER----------------------------------------------*/

header{
    display: flex;
    justify-content: center;
    align-items: center;
}

header > h1 {
    background-color: rgba(248, 224, 4, 0.95);
    border:1px solid white;
    border-radius: 5em;
    flex: 1 1 auto /*only the text will resize*/;
    overflow: hidden;
    font-weight: bold;
    text-align: center;
    padding: 0.5em;
}

header > img {
    /*resize with window*/
    max-width:100%;
    max-height:100%;
}

/*--------------------------------NAVBAR------------------------------------*/

nav > button {
    display: block;
    margin: auto;
    background-color: rgba(235, 45, 45, 0.5);
    border-left: 1px;
    border-top: 1px;
    outline: none;
    transition: 0.3s;
    padding: 10px 10px;
}

nav > button:hover {
    background-color: rgb(202, 100, 77);
}
nav > button:active {
    background-color: brown;
}

.tabimage{
    /*attached to the tab buttons*/
    height: 112.5px;
    width: 150px;
}

.tablinks > span{
    /*tab button text box*/
    background-color: rgb(211, 224, 235);
    white-space: pre;    
    display: block;
}

/*----------------------MAIN CONTENT-------------------------------------*/

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5em;
}

.defaultcontent > h4, .defaultcontent > h3, .defaultcontent > p{
    padding: .5em 2em;
    border:1px solid black;
    border-radius: .5em;
    background-color: rgb(230, 190, 105);
    text-align: center;
}
.defaultcontent > h4 {
    display: inline-block;
}

.defaultcontent > a {
    background-color: grey;
    padding: .5em .5em;
    border: 2px solid black;
    border-radius: .5em;
    margin : 0 10%;
}
.defaultcontent > a:hover {
    background-color: rgb(87, 86, 86);
    box-shadow: 0.1em 0.1em 0.2em black;
    color: white;
}

/*---------------------TAB CONTENT------------------------------*/

.tabcontent {
    display: none;
}

.tabcontent > h3 {
    text-align: center;
    border: 1px solid black;
    border-radius: .5em;
    background-color: rgb(230, 190, 105);
}

.tabcontent > a, .tabcontent > button {
    font-size: 1em;
    background-color: grey;
    padding: .5em .5em;
    border: 2px solid black;
    border-radius: .5em;
}
.tabcontent > a:hover {
    background-color: rgb(87, 86, 86);
    box-shadow: 0.1em 0.1em 0.2em black;
    color: white;
}

.tabcontent > button {
    transform: translateX(1em) translateY(-0.1em);
    padding: .5em 2em;
}
.tabcontent > button:hover {
    background-color: rgb(87, 86, 86);
    box-shadow: 0.1em 0.1em 0.2em black;
    color: white;
}

.tabcontent > img {
    max-width: 60vw;
}

/*-------------------TABLES---------------------------------------------------*/

table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    border: 3px solid black;
    background-color: rgba(227, 226, 245, 0.897);
}
th, td {
    padding: 0.5em 0.5em;
    overflow: hidden;
}
th {
    border-top: 2px dashed black;
    border-bottom: 2px dashed black;
}
tr, td {    
    border-right: 1px solid black;
}
#game-table-safe > tbody > tr, #game-table-unsafe > tbody > tr {
    border-bottom: 1px solid black;
}
.divider {
    border-bottom: 1px solid black;
}
.programme-table-wide > tbody > tr > td > img {
    display: block;
    margin-left: auto; margin-right: auto;
}

tbody > tr > td > a {
    display: inline-block;    
    margin-left: 50%; transform:translateX(-50%);
    color: var(--clr-neon);
    text-decoration: none;
    text-align: center;
    border: var(--clr-neon) .2em solid;
    border-radius: .3em;
    padding: 0.25em 1em;
    text-shadow: 0 0 0.25em hsla(0, 0%, 100%, 0.3), 0 0 0.25em currentColor ;
    box-shadow: inset 0 0 .5em var(--clr-neon), 0 0 .5em var(--clr-neon);
    position:relative;
    transition: background-color 100ms linear;
}
tbody > tr > td > a::after{
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    box-shadow: 0 0 2em 0.5em var(--clr-neon);
    opacity: 0;
    transition: opacity 100ms linear;
}
tbody > tr > td > a:hover, tbody > tr > td > a:focus{
    background-color: var(--clr-neon);
    color: whitesmoke;
    text-shadow: none;
}
tbody > tr > td > a:hover::before, tbody > tr > td > a:focus::before{ 
    opacity: 1;
}
tbody > tr > td > a:hover::after, tbody > tr > td > a:focus::after{
    opacity: 1;
}

.errors-and-biases tr:nth-child(even), .table-of-contents tr:nth-child(even){
    background-color: #D6EEEE;
}

/* --------------------------ARTICLES-------------------------------- */

article > a, article > h4 > a {
    background-color: grey;
    padding: .5em .5em;
    border: 2px solid black;
    border-radius: .5em;
    margin : 0 10%;
}
article > a:hover, article > h4 > a:hover {
    background-color: rgb(87, 86, 86);
    box-shadow: 0.1em 0.1em 0.2em black;
    color: white;
}
article > h5 {
    text-align: left;
    padding: 1em;
    border: 1px solid black;
    border-radius: .5em;
    background-color: rgb(230, 190, 105);
}
 



/*---------------ADJUSTMENTS FOR SMALL SCREEN---------------------------------*/

@media only screen and (max-width: 901px /*change back to 480*/){
    footer {display: none;}
    body {
        /* default display layout, should be optimised for smallest size */
        grid-template-columns:1fr;
        grid-template-rows: 5em 1fr 19fr;
        grid-template-areas: 
            "header"
            "nav"
            "main"
    }

    header > h1 {
        padding: 0;
    }

    nav > button {
        display: inline-block;
    }
    .tabimage {
        display: none;
    }
    .tabcontent > img, td > img {
        display: none;
    }
    .programme-table-wide {
        display: none;
    }
    

}
@media only screen and (min-width: 901px /*change back to 480*/){
    .programme-table-narrow {
        display: none;
    }
}
@media only screen and (max-width: 1000px /*change back to 480*/){
    #game-table-safe > tbody > tr > .image-column, #game-table-safe > tbody > .image-column, 
    #game-table-unsafe > tbody > tr > .image-column, #game-table-unsafe > tbody > .image-column {
        display: none;        
    }
}

header{grid-area: header;}
nav{grid-area: nav;}
main {grid-area: main;}
footer {grid-area: footer;}

/*-----------------------SPECIFIC FIXES-----------------------------------------------*/

#canvas1 {
    position:absolute;
    top: 0;
    left: 0;
    z-index: -1;
    filter: blur(2px) contrast(10);
}

#quiz-link {
    display: inline-block;
    margin-left: 4em;
}

/* remove anchor styling from anchors behind images */
#quiz-link-img, #quiz-link-img:hover {
    display: inline-block;
    margin-left: 4em;
    background-color: initial;
    padding: auto;
    border: 0; border-radius: 0;
    box-shadow: none;
}

.tabcontent > .image-anchor, .tabcontent > .image-anchor:hover {
    background-color: initial;
    padding: auto;
    border: 0; border-radius: 0;
    box-shadow: none;
}

#game-table-safe, #game-table-unsafe {
    max-width: 75%;
}

#game-table-safe > tbody > tr > .image-column > a, #game-table-safe > tbody > tr > .image-column > a::after,
#game-table-safe > tbody > tr > .image-column > a:focus, #game-table-unsafe > tbody > tr > .image-column > a, #game-table-unsafe > tbody > tr > .image-column > a::after,
#game-table-unsafe > tbody > tr > .image-column > a:focus {
    color: initial;
    border: none;
    text-shadow: none; box-shadow: none;
    background-color: initial;
}