@font-face {
    font-family: "Anton";
    src: url(/css/fonts/Anton/Anton-Regular.ttf);
}

@font-face {
    font-family: "Open Sans";
    src: url(/css/fonts/Open_Sans/static/OpenSans-Regular.ttf);
}

/* Generella regler */

html {
    font-size: 100%; /* För att kunna använda REM på ett bra sätt */
}

body {
    font: 300 1rem/1.375 "Open Sans", sans-serif;
    color: #212931;
    background-color: #0c718f;
    margin-top: 2rem;
}

h1, h2, h3, nav ul, table th {
    font-family: "Anton", sans-serif;
    font-weight: 300;
    /* letter-spacing: 0.075em; */
}

h1 {
    font-size: 1.8rem;
    text-transform: uppercase;
    color: #0c718f;
    border: 5px solid #0c718f;
    margin: 1rem;
    padding: 0.5rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

#products, #classes, #story, #newsletter {
    margin: 2rem 1rem 0;
}

article {
    margin-bottom: 2rem;
}

main, #container {
    background-color: white;
    margin: 0 auto;
    max-width: 74rem;
}

img {
    height: 100%;
    width: 100%;
    margin: 1rem 0;
}

div > header {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    height: 10rem;
    padding-bottom: 2rem;
    /* border: solid 1px black; */
}

header p {
    width: 75%;
    line-height: 1.5;
    text-align: center;
}

nav, footer {
    background-color: #f5f5f5;
}

main, footer {
    margin: 0 auto;
    max-width: 74rem;
}

/* Nav */

nav {
    font-size: 1.5rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}

nav ul {
    text-transform: uppercase;
    display: flex;
    justify-content: space-around;
    
}

nav ul li a {
    color: #08546B;
    text-decoration: none;
}

nav a:hover, nav a:focus {
    color: #000;
    font-weight: bold;
    
}

/* Tabell */

table, th, td, tr {
    display: block;
}

tr {
    border-bottom: 1px solid #ccc;
    padding-top: 0.5rem;
}

td {
    position: relative;
    padding-left: 50%;
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}


/* Flyttar bort rubriken och lägger i före varje del istället på liten skärm */

th {
    position: absolute;
    top: -9999px;
    left: -9999px;
}

td:before {
    position: absolute;
    top: 6px;
    left: 6px;

    font-family: "Open Sans", sans-serif;
    font-weight: 900;
    letter-spacing: 0.075em;
}

td:nth-of-type(1):before {
    content: "Class";
}

td:nth-of-type(2):before {
    content: "Price";
}

td:nth-of-type(3):before {
    content: "Description";
}


#story p {
    margin-bottom: 1rem;
}


/* Form */

aside {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    padding-bottom: 2rem;
    border: solid 1px black;    
}

#newsletter h2 {
    font-size: 2rem;
    margin-top: 1rem;
}

form {
    display: flex;
    justify-content: center;
}

ul > li > input[type="submit"] {
    /* Centrera knappen */
    display: block; 
    margin: 0 auto; 

    margin-top: 2rem;
}

input {
    border: 1px solid #dfdbdb;
    /* color: #212931; */
    font-size: 1.3rem;
}

input[type="submit"] {
    background-color: #212931;
    color: #fff;
    border: none;
    padding: 0.5rem 0.8rem;
}

input:focus, select:focus, textarea:focus {
    /* outline: none; */
    background-color: lightblue;
}

label {
    width: 100%;
    text-align: left;
    display: block;
}

input[type="submit"] {
    margin-bottom: 1rem;
}

#newsletter h2 {
    margin-bottom: 1rem;
}

form ul li {
    margin-top: 1rem;
}

footer {
    display: flex;
    flex-direction: column;
    margin-top: 4rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

footer p {
    font-size: 0.8rem;
    text-align: center;
    margin-bottom: 0.5rem;
    
}


@media(min-width:600px) {

    nav ul {
        justify-content: center;
    }

    nav ul li {
        margin: 0 1rem;
    }

    /* Table */

    table {
        display: table;
        border-collapse: separate;
        border-spacing: 2px;
        border-color: gray;
        max-width: 60rem; 
        margin-top: 1rem;
    }

    /* Tar bort rubrikerna framför och lägger tillbaka ovanför */
    td:before {
        content: none;
    }
    
    td:nth-of-type(1):before {
        content: none;
    }
    
    td:nth-of-type(2):before {
        content: none;
    }
    
    td:nth-of-type(3):before {
        content: none;
    }

    th {
        position: relative;
        top: 0px;
        left: 0px;
    }

    /* Resterande formattering av tabellen */
    
    th {
        display: table-cell;
        text-align: center;
        font-size: 0.8rem;
        font-weight: bold;
        padding: 0.75rem;
        text-transform: uppercase;
    }

    td {
        display: table-cell;
        text-align: left;
        padding: 0.3rem;
    }

    tr {
        display: table-row;
    }
    
    /* Form */

    label[for="form-name"], label[for="form-email"] {
        /* För att få till snygg linjering med label till vänster om input-boxarna */
        width: 4rem;
        float: left;
        text-align: right;
        margin-right: 1rem;
    }

    input[type="radio"] {
        width: 4rem;
        float: inline-start;
    }

    aside h3 {
        margin-left: 1.5rem;
        margin-top: 3rem;
    }

    aside {
        width: 70%;
        max-width: 40rem;
        margin: 0 auto;
    }

    #container {
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

    /* Behöver ändra tillbaka till hela bredden för dessa efter att lagt på koden för #container ovan. */
    header, nav, footer {
        width: 100%;
    }
 
    /* Skippade denna men så här lång sökväg behövdes för att få nth-of-type att funka */
    /* main > section > article:nth-of-type(2) > img {
        height: 90%;
        width: 90%;
    } */
      
    nav {
        font-size: 1.7rem;
    }

    img {
        width: 50%;
        margin: 0 1rem;
        float: right;
    }
}

@media(min-width:960px) {
    
    img {
        width: 20%;
    }

    #story img {
        float: right;
        width: 40%;
    }
}