@import url(https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css);
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400&display=swap');

/* Most general CSS code is sorted from top-down in the stylesheet */
/* CSS custom properties */
:root {
    --theme-red: #f30b0b;
    --theme-white: #eeeeee;
    --theme-black: #222222;
    --theme-gray: #dddddd;
    --gap-distance: 30px;
}

body {
    font-family: 'Open Sans';
    font-size: 18px;
    line-height: 22px;
}

p {
    line-height: 24px;
}

a {
    text-decoration: none;
    color: inherit;
}

h2 {
    font-size: 36px;
    font-weight: 600;
    line-height: 3rem;
}

h3 {
    font-size: 30px;
    color: var(--theme-red);
    margin-bottom: 15px;
}

img {
    max-width: 100%;
}

.header ul {
    display: flex;
    align-items: center;
}

/* The navigation menu */
.nav {
    display: flex;
    justify-content: space-between;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    background-color: white;
    z-index: 1;
}

.nav .logo {
    height: 60px;
}

.nav .socials a {
    margin: 10px;
}
.nav .socials a:hover img{
    transform: scale(1.5);
}
.nav .socials img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all .5s ease-out;
}

/* Navigation button, also called a hamburger menu */
.nav-button {
    height: 60px;
    width: 60px;
    background:  url(../img/ic_menu_white_24px.svg) no-repeat center;
    background-size: 60%;
    border: none;
    cursor: pointer;
    transition: all .5s ease-in-out;
}

/* The currently selected internal link */
.current a {
    color: white;
    background-color: var(--theme-red);
}

/* Banner, also called a hero */
.banner {
    height: 450px;
    background: url(../img/hero.jpg) no-repeat center;
    background-size: cover;
    display: flex;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1s 1s;
    animation-fill-mode: forwards;
}

.banner img {
    background-color: white;
    padding: 25px;
    opacity: 0;
    animation: slideIn .5s 2s;
    animation-fill-mode: forwards;
}

.banner p {
    margin: 15px 0;
    line-height: 2rem;
}

.main {
    display: flex;
    flex-direction: column;
}

.grid-parent {
    display: grid;
    /* The "--grid-columns" variable is defined in the HTML code's individual grid-parents' attributes */
    grid-template-columns: var(--grid-columns);
    gap: var(--gap-distance);
}

.grid-parent:not(:last-child) {
    margin-bottom: var(--gap-distance);
}

.readmore-button {
    border: none;
    color: white;
    background-color: var(--theme-black);
    padding: 8px 20px;
    margin-top: 12px;
}

.newsletter button {
    background-color: var(--theme-red);
    color: white;
}

.card {
    box-shadow: rgba(0, 0, 0, 0.15) 0.5px 1.95px 2.6px;

}

/* Symmetrical card-height in grid-parent, not solely determined by card content */
.main .card {
    height: 100%;
}

/* Prevents description from hugging the walls of the card */
.card .description {
    padding: 20px;
}

.card-header {
    background-color: var(--theme-red);
    display: flex;
    align-items: center;
    color: white;
    padding: 12px;
    position: relative;
}
.card-header p{
    margin-left: 30px;
}
/* Small logo on each card-header, depending on their location in the content section */
.card-header::before {
    content: url(../img/card-suits-spades.png);
    position: absolute;
    top: 15px;
}

.sidebar .card-header {
    background-color: var(--theme-black);
}

.content {
    padding: 50px 0;
}

.content .columns {
    display: flex;
    flex: 1;
    gap: var(--gap-distance);
    padding: 0 var(--gap-distance);
}

.newsletter .card-content {
    background-color: var(--theme-gray);
    display: flex;
    flex-direction: column;
    padding: 16px;
    row-gap: 10px;
}

.newsletter input,
.newsletter button {
    border: none;
    padding: 8px;
}

.footer {
    background-color: var(--theme-black);
    height: 400px;
}

.footer p {
    color: white;
    line-height: 30px;
}

.footer .inner-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
}


/* Static sidebar width, unlike the main part of content-section, as part of our design-style*/
.sidebar {
    min-width: 300px;
    row-gap: var(--gap-distance);
}

.sidebar .card-header::before {
    content: url(../img/card-suits-hearts.png);
}

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar li:nth-child(2n+1) {
    background-color: var(--theme-gray);
}

.sidebar li {
    display: flex;
    padding: 8px;
}

.sidebar time {
    min-width: 100px;
}

.card img {
    min-width: 100%;
}

.footer .inner-wrapper {
    padding: 0 var(--gap-distance);
}

/* Media queries responsible for changes in css code at different screen sizees */
@media (max-width: 1920px) {
    .inner-wrapper {
        max-width: 1080px;
        margin: 0 auto;
    }

    .internal-links a {
        line-height: 54px;
        padding: 19px;
        transition: background-color .7s ease, color .7s ease;
    }

    .internal-links a:hover {
        background-color: var(--theme-black);
        color: white;
    }

    .nav .nav-button-parent {
        display: none;
    }

}

@media (max-width: 960px) {
    .grid-parent {
        grid-template-columns: none;
    }

    .footer {
        height: 600px;
    }

    .internal-links {
        position: fixed;
        right: -100%;
        top: 60px;
        flex-direction: column;
        width: 100%;
        height: 100%;
        transition: all 0.3s;
        background-color: var(--theme-black);
    }

    .internal-links li{
        min-width: 100%;
    }

    .internal-links a{
        display: block;
    }

    .internal-links li + li a{
        color: white;
        background-color: var(--theme-black);
    }

    .internal-links.active {
        right: 0;
    }
    .internal-links a:hover{
        color: var(--theme-black);
        background-color: white;
    }

    .nav .nav-button-parent {
        display: block;
    }
    .nav-button.active{
        transform: rotateZ(180deg);
    }
    .nav-button-parent{
        background-color: var(--theme-red);
    }
    
}

@media (max-width: 768px) {

    .columns {
        flex-direction: column;
    }

    .footer {
        height: 750px;
    }
}

/* Keyframes responsible for animating the banner */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes slideIn {
    0% {
        transform: translateX(-50%);
        opacity: 0;
    }

    100% {
        transform: translateX(0%);
        opacity: 1;
    }
}
