body {
    font-family: Helvetica Neue, Helvetica, Arial, Sans-serif;
    background-color: white;
    margin: 0;
}

header, #headerframe {
    background-color: white;
    width: 100%;
    height: 300px;
    margin: 0;
    border: none;
    text-align: center;
    background-image: url(./junakuvat/nj-scenic.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    overflow: hidden;
    display: block;
}

h1 {
    font-weight: bold;
    font-size: 4em;
    text-shadow: 0 0 30px black;
    color: white;
    margin: 60px 0 10px 0;
}

main {
    background-color: white;
    width: calc(95% - 20px);
    margin: 5px auto;
    padding: 10px;
    text-align: center;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
}

main h2 {
    font-size: 2em;
}

main p {
    font-size: 0.9em;
    line-height: 1.4em;
    margin: 20px 50px;
}

.flex7 {
    width: 95%;
    margin: 5px auto;
    display: grid;
    grid: auto / repeat(7, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 5px;
    color: black;
    text-align: center;
}

.flex4 {
    width: 95%;
    margin: 5px auto;
    display: grid;
    grid: auto / repeat(4, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 5px;
    color: black;
    text-align: center;
}

.flex2 {
    width: 95%;
    margin: 5px auto;
    display: grid;
    grid: auto / repeat(2, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 5px;
    color: black;
    text-align: center;
}

.flex7 section, .flex4 section, .flex2 section {
    background-color: #FFF;
    padding: 0 10px 5px 10px;
}

.flex7 section p, .flex4 section p, .flex2 section p {
    font-size: 0.85em;
    line-height: 1.25em;
}

.togglePeruttu {
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 10px;
    display: block;
    color: #333;
    background-color: #EEE;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.juna {
    width: calc(100% - 20px);
    margin: 30px auto;
    background-color: #fff;
    text-align: left;
    font-size: 13px;
    line-height: 17px;
    display: grid;
    grid: auto / repeat(6, minmax(0, 1fr));
    column-gap: 0;
    row-gap: 10px;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.7);
    border-radius: 15px;
}

.peruttu {
    background-color: pink;
}

.juna1 {
    grid-column: 1 / 7;
    padding: 0 10px 10px 10px;
}

.juna2 {
    display: block;
    grid-column: 1 / 7;
}

.juna2 img {
    width: 100%;
    border-radius: 15px 15px 0 0;
}

.juna11 {
    grid-column: 1 / 3;
}

.juna12 {
    grid-column: 3 / 5;
}

.juna13 {
    grid-column: 5 / 7;
}

.juna21 {
    grid-column: 1 / 7;
}

.juna31 {
    grid-column: 1 / 4;
}

.juna32 {
    grid-column: 4 / 7;
}

.junapiilo {
    display: none;
    padding: 10px;
    text-align: center;
}

.junapiilo img {
    width: 100%;
    display: block;
    margin-top: 5px;
    border-radius: 5px;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.5);
}

.levee {
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 10px;
    background-color: #EEE;
    text-align: left;
    font-size: 13px;
    line-height: 17px;
}

.operaattori {
    max-height: 42px;
    max-width: 260px;
    width: initial;
    margin-bottom: 5px;
}

.operaattori2 {
    height: 30px;
    width: initial;
    margin-bottom: 5px;
}

.operaattori3 {
    height: 10px;
    width: initial;
    margin-bottom: 5px;
}

.junatyyppi {
    height: 10px;
    width: initial;
    vertical-align: 0px;
}

.junatyyppi2 {
    height: 14px;
    width: initial;
    vertical-align: -2px;
}

.junatyyppi-iso {
    height: 17px;
    width: initial;
    vertical-align: 0px;
}

.sbahn {
    color: #008d4f;
    font-size: 16px;
    font-weight: bold;
    vertical-align: -1px;
}

.palvelu {
    height: 17px;
    width: auto;
    vertical-align: -2px;
}

.class1 {
    background-color: black;
    color: white;
    padding: 0 2px;
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    line-height: 11px;
    border: 1px solid black;
}

.class2 {
    background-color: black;
    color: white;
    padding: 0 2px;
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    line-height: 11px;
    border: 1px solid black;
}

.leveelinkki img {
    width: calc(100% - 2px);
    border: 1px solid black;
    border-radius: 10px;
}

/* NOT REALLY OVERQUALIFIED - THESE ARE OK */

nav.flexnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

a.flexnav {
    width: 100px;
    margin: 10px;
    padding: 10px;
    background-color: #F5F5F5;
    display: block;
    color: #222;
    text-decoration: none;
    align-content: flex-end;
}

@keyframes flexnavhover {
    from {
        background-color: #F5F5F5;
        color: #222;
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
    to {
        background-color: #FBFBFB;
        color: #555;
        box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
    }
}

a.flexnav:hover, a.flexnav:active {
    background-color: #FBFBFB;
    color: #555;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
    animation-name: flexnavhover;
    animation-duration: 0.3s;
}

a.flexnav img {
    max-height: 35px;
    max-width: 100%;
    margin: 10px auto;
    border: 1px solid #F5F5F5;
    border-radius: 5px;
}

a.flexnav p {
    margin: 10px auto;
    text-decoration: none;
    font-size: 0.8em;
}

.flexnav-logo-container {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.flexnav-logo-container2 {
    display: flex;
    width: 100%;
    height: calc(100% - 45px);
    align-items: center;
    justify-content: center;
}

@media screen and (max-width: 1100px) {  /* LARGE TABLETS */
    header {
        width: 50%;
    }
    header h1 {
        font-size: 2em;
    }
    main p {
        margin: 20px auto;
    }
    .flex7, .flex4, .flex2 {
        width: 50%;
        grid: auto / 100%;
    }
    .juna2 {
        display: block;
    }
}

@media screen and (max-width: 767px) {  /* TABLETS */
    header {
        width: 100%;
    }
    main {
        width: calc(100% - 20px);
    }
    .flex7, .flex4, .flex2 {
        width: 100%;
    }
}

@media screen and (max-width: 479px) {  /* PHONES */
    header h1 {
        font-size: 2em;
    }
    .flex7, .flex4, .flex2 {
        grid: auto / 100%;
    }
}