/* ------------------- */
/* Reset               */
/* ------------------- */

/* Box sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Reset margins */
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
    margin: 0;
}

/* set up the body */
body {
    line-height: 1.5;
    min-height: 100vh;
}

/* make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}

/* make form elements easier to work with */
input,
button,
textarea,
select {
    font: inherit;
}

/* remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------- */
/* Styling             */
/* ------------------- */

:root {
    --primary-dark: #22333b;
    --primary-light: #556770;
}

body {
    background-color: white;
    padding-top: 4rem;
    padding-bottom: 12.5rem;
    font-family:monospace;
    font-size: 1rem;
}

body > div {
    padding-inline: 1rem;
    text-align: center;
}

main {
    padding: 1rem;
}

.card-block h1 {
    text-align: center;
    border-bottom: 2px solid gray;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.card-block__grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    max-width: 1000px;
    margin: auto;
}

.card {
    border: 1px solid grey;
    display: flex;
    flex-direction: row;
    max-width: 42em;
    margin-inline: auto;
    background-color: var(--primary-light);
    color: white;
    position: relative;
}

.card > div {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    flex-basis: 100%;
    font-size: 1rem;
    position: relative;
}

.card > div > img {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 8rem;
    padding: 1.5rem;
}

.card > img {
    object-fit: cover;
    width: 40%;
    aspect-ratio: 1;
}

.card > div p:first-of-type {
    font-weight: 800;
    text-align: left;
    padding-bottom: .5rem;
}

.card > div p:last-of-type {
    display: flex;
    align-items: flex-end;
    justify-content: end;
    flex-basis: 100%;
    font-weight: 600;
}

.extra-info {
    display: none;
}

/* Styling expanded cards */

.expanded-style__card .extra-info {
    display: block;
}


.expanded-style__card > div p:nth-of-type(3),
.expanded-style__card > div p:nth-of-type(3) {
    padding-bottom: 1.8rem;
}

.expanded-style__card > div p {
    padding-block: .2rem;
}

.expanded-style__card {
    background-color: white;
    color: black;
    display: flex;
    flex-direction: column;
    border: none;
}

/* .expanded-style__card::after {
    content: '';
    width: 100%;
    left: 50%;
    translate: -50% 0;
    aspect-ratio: 1;
    background-color: var(--primary-dark);
    opacity: 50%;
    position: absolute;
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
} */

.expanded-style__card > div {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    flex-basis: 100%;
}

.expanded-style__card > img {
    object-fit: cover;
    width: 100%;
    aspect-ratio: unset;
}

.expanded-style__card > div p:first-of-type {
    font-weight: 400;
    text-align: center;
    font-size: 1.5rem;
}

.expanded-style__card > div p:last-of-type {
    display: flex;
    align-items: flex-end;
    justify-content: end;
    flex-basis: 100%;
}

button {
    padding: .5rem 1rem;
    cursor: pointer;
    border: 1px solid grey;
    background-color: white;
    font-size: .8rem;
}

button img {
    margin: auto;
}

.occupy-line {
    grid-column: 1 / -1;
}

.occupy-cell {
    grid-column: span 1;
}

/* Developer Tools */

.navigation {
    padding: 1rem;
    padding-bottom: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-dark);
    display: flex;
    align-items: end;
    justify-content: center;
    gap: .5rem;
}

.navigation button {
    border-radius: 1rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border: 0;
    background-color: var(--primary-dark);
    color: white;
}

.navigation .logotype {
    display: none;
}

.active-tab {
    background-color: white !important;
    color: black !important;
}

@media (min-width: 35em) {

    .navigation .logotype {
        display: block;
        width: 50px;
        margin-left: auto;
        padding-bottom: 1rem;
    }

    button {
        font-size: 1rem;
    }

    .card > div p:first-of-type {
        padding-bottom: 1.6rem;
    }

    .card > div p:nth-of-type(3),
    .card > div p:nth-of-type(5) {
        padding-bottom: 1.8rem;
    }

    .extra-info {
        display: none;
    }

    .card-block__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        border: 1px solid grey;
        display: flex;
        flex-direction: column;
    }
    
    .card > div {
        padding: 1rem;
    }
    
    .card > img {
        object-fit: cover;
        width: 100%;
    }
    
    .card > div p:first-of-type {
        font-weight: 800;
        text-align: center;
    }
    
    .card > div p:last-of-type {
        text-align: right;
    }
    
    .expanded-style__card {
        border: none;
    }
}

@media (min-width: 50em) {

    .card-block__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card {
        max-width: unset;
    }

    .card > div p {
        padding-block: .5rem;
    }
    
    .expanded-style__card {
        background-color: white;
        display: flex;
        flex-direction: row;
        border: 1px solid grey;
    }
    
    .expanded-style__card > div {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        flex-basis: 100%;
    }
    
    .expanded-style__card > img {
        object-fit: cover;
        width: 40%;
    }
    
    .expanded-style__card > div p:first-of-type {
        font-weight: 800;
        text-align: left;
    }
    
    .expanded-style__card > div p:last-of-type {
        display: flex;
        align-items: flex-end;
        justify-content: end;
        flex-basis: 100%;
    }
}

.is-visible {
    display: block;
}

/* This is a utility class for showing and hiding cards specifically */
.is-visible-flex {
    display: flex;
}

.not-visible {
    display: none;
}

.close-btn {
    margin-left: auto;
    margin-right: .8rem;
    margin-top: 1rem;
}