:root {
    /* Colors: */
    --base-primary-200: 33;
    --clr-primary-200: 	hsl(var(--base-primary-200), 74%, 80%);
    --clr-primary-200-lighter: 	hsl(var(--base-primary-200), 74%, 90%);
    --clr-primary-200-darker: 	hsl(var(--base-primary-200), 64%, 70%);

    --base-primary-400: 22;
    --clr-primary-400: 	hsl(var(--base-primary-400), 31%, 34%);
    --clr-primary-400-lighter: 	hsl(var(--base-primary-400), 25%, 50%);
    --clr-primary-400-darker: 	hsl(var(--base-primary-400), 25%, 24%);
    
    --base-accent-900: 22;
    --clr-accent-900: hsl(var(--base-accent-900), 74%, 53%);
    --clr-accent-900-lighter: hsl(var(--base-accent-900), 84%, 63%);
    --clr-accent-900-darker: hsl(var(--base-accent-900), 84%, 43%);

    --clr-primary-700: #3E1A0D;
    --clr-secondary-100: #FFF8F5;
    --clr-secondary-1000: #260A00;
    --clr-accent-100: #7E98B1;
    --clr-accent-200: #3B7BB7;
    --clr-text: #303030;

    /* font-family*/
    --ff-primary: "Merriweather", serif; 
    --ff-secondary: "Poppins", sans-serif; 

    /* font-sizes */
    --fs-copy: 16px;
    --fs-300: 18px;
    --fs-400: 20px;
    --fs-500: 30px;
    --fs-600: 38px;
    --fs-700: 54px;

    /* font-weight */
    --fw-300: 300;
    --fw-400: 400;
    --fw-700: 700;

    /* button shadows */
    --button-tactile: inset 2px 2px 4px rgba(255, 255, 255, 0.2);
    --button-tactile-pressed: inset 2px 2px 3px rgba(0, 0, 0, 0.2);
    --button-tactile-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);

    /* border-radius */
    --rounded-100: 0.2em;
    --rounded-200: 0.3em;

    /* utility */
    --max-width-body: 1200px; 
    --max-width-1000: 1000px; 
    --max-width-copy: 800px; 
    --margin-inline: 32px;
    --margin-center: auto;
    --section-space: 8rem;
    --section-space-small: 2rem;
}

/* utility classes*/
.max-width-body { max-width: var(--max-width-body); }
.max-width-1000 { max-width: var(--max-width-1000); }
.max-width-copy { max-width: var(--max-width-copy); }
.margin-inline {  margin-inline: var(--margin-inline);}
.margin-center {  margin-inline: var(--margin-center);}
.section-space {  margin-top: var(--section-space);}
.section-space-small {  margin-top: var(--section-space-small);}
.active { text-decoration: underline;}
.hidden { display: none !important;}
.container { display: flex; flex-direction: row;}
.flex-container { display: flex; flex-direction: column;}
.flex-spread {display: flex; justify-content: space-between;}
.overflow-x-hidden { overflow-x: hidden; }
.disable-scroll { overflow: hidden;}
.modal-disable-scroll { overflow: hidden;}
.text-center {text-align: center;}

@media only screen and (min-width: 769px) {
    :root {
        --fs-copy: 18px;
        --fs-400: 22px;
        --fs-500: 32px;
        --fs-600: 42px;
        --fs-700: 64px;
    }
    .flex-row-pc { flex-flow: row wrap; margin-inline: auto;}
    .modal-disable-scroll { padding-right: 15px;}
}


/* css reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: inherit;
    list-style: none;
    text-decoration: none;
}
/**/

h1::first-letter, 
h2::first-letter, 
h3::first-letter {
    text-transform: capitalize;
}

.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: var(--clr-primary-200);
    padding: 0.5em;
    translate: 0 -120%;
    opacity: 0;
}

.skip-link:focus {
    translate: 0 0;;
    opacity: 1;
}

h1 {
    --fs-700: 54px;
    font-size: var(--fs-700);
    font-family: var(--ff-primary);
    font-weight: var(--fw-700);
}

h2 {
    font-size: var(--fs-600);
    font-family: var(--ff-primary);
    font-weight: var(--fw-400);
    margin-bottom: 1rem;
}

h3 {
    font-size: var(--fs-500);
    font-family: var(--ff-primary);
    font-weight: var(--fw-400);
}

.paragraph-header {
    font-size: var(--fs-400);
    font-family: var(--ff-secondary);
    font-weight: var(--fw-700);
}

li, p {
    color: var(--clr-text);
    font-family: var(--ff-secondary);
}

.input-field {
    padding: 1rem;
    font-size: var(--fs-300);
    font-family: var(--ff-secondary);
    border: 1px solid var(--clr-primary-400);
    border-radius: 5px;
}

/* components */

.btn {
    /* https://gist.github.com/MoOx/9137295 */
    border: none;
    -webkit-font-smoothing: inherit; /* Corrects font smoothing for webkit */
    -moz-osx-font-smoothing: inherit; /* Corrects font smoothing for webkit */
    -webkit-appearance: none; /* Corrects inability to style clickable `input` types in iOS */
    /**/
}

.btn:hover {
    cursor: pointer;
}

.btn--cta {
    background-color: var(--clr-accent-900);
    color: white;
    padding-block: 1em;
    padding-inline: 2em;
    border-radius: var(--rounded-100);
    font-size: var(--fs-300);
}

.btn--cta:hover {
    background-color: var(--clr-accent-900-lighter);
}

.btn--arrow {
    background-color: var(--clr-primary-200);
    border: 1px solid var(--clr-primary-700);
    padding-inline: 0.75em;
    padding-block:  0.25em;
    font-size: var(--fs-300);
    box-shadow: var(--button-tactile-shadow);
}

.fa-chevron-right, .fa-chevron-left {
    color: var(--clr-primary-700);
}

.btn--arrow:hover{
    background-color: #ecc493;
    box-shadow: var(--button-tactile), var(--button-tactile-shadow);
}
.btn--arrow:active{
    background-color: #ecc493;
    box-shadow: var(--button-tactile-pressed);
    transform: translate(1px, 1px) ;
}

.btn--tactile {
    box-shadow: var(--button-tactile), var(--button-tactile-shadow);
}
.btn--tactile:active {
    box-shadow: var(--button-tactile-pressed);
    transform: translateX(1px);
}

.breadcrumbs {
    font-size: var(--fs-300);
    margin: 1em 0 1em 1em;
    font-family: var(--ff-secondary);
    font-weight: 300;
    cursor: default;
}

.breadcrumbs > *:not(:last-child):hover {
    text-decoration: underline;
    cursor: pointer;
}

/**/

body {
    background-color: var(--clr-secondary-100);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    --height-header: 70px;
    height: var(--height-header);
    display: flex;
    justify-content: center;
    background-color: var(--clr-secondary-1000);
    border-bottom: 3px solid var(--clr-primary-200);
    z-index: 10;
}

footer {
    background-color: var(--clr-secondary-1000);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 150px;
    margin-top: auto;
    border-top: 3px solid var(--clr-primary-200);
}

footer > * {
    color: var(--clr-secondary-100);
    margin: 1em;
}

/* navbar */
.navbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--clr-secondary-1000);
    padding-inline: var(--margin-inline);
    max-width: 1500px;
    width: 100%;
}

.logo {
    height: 100%;
    z-index: 11;
    /* margin-block: 1em 0.5em; */
}

.logo img {
    /* width: 80%; */
    height: calc(100% - 1em);
    margin-block: 0.5em;
}

#primary-nav-btn {
    position: relative;
    /* display: flex; */
    /* flex-direction: column; */
    /* gap: 0.5em; */
    width: 40px;
    height: 30px;
    z-index: 11;
}

#primary-nav-btn > * {
    position: absolute;
    height: 5px;
    width: 100%;
    background-color: var(--clr-primary-200);
    border-radius: 5px;
    transition: all 200ms ease;
}

#primary-nav-btn > *:nth-child(2) {top: calc(50% - 2.5px);}
#primary-nav-btn > *:nth-child(3) {bottom: 0;}



#primary-nav {
    display: flex;
    width: 100%;
    background-color: var(--clr-secondary-1000);
}

#primary-nav > ul,
#nav--topics__menu.open {display: flex;}

.fa-xmark {
    display: none;
    font-size: 4rem;
    aspect-ratio: 1;
    align-self: flex-end;
    color: var(--clr-primary-200);
    margin: 1rem;
}

.fa-xmark:hover {cursor: pointer;}

#primary-nav > ul > li {
    white-space: nowrap;
    font-size: var(--fs-copy);
    font-family: var(--ff-primary);
} 

#primary-nav ul * {color: var(--clr-primary-200);}

.navbar input {
    background-color: var(--clr-primary-700);
    border: 2px solid var(--clr-primary-200);
    border-radius: var(--rounded-200);
    padding-left: calc(36px + 1em);
    color: white;
    width: 100%;
    font-size: 1rem;
}

#nav--topics__menu {
    flex-direction: column;
    gap: 0.5rem;
    display: none;
}

#nav--topics__menu li {
    display: flex;
    width: fit-content;
    font-size: 16px;
    font-weight: var(--fw-300);
    position: relative;
}

#nav--topics__menu li::before {
    content: url(../assets/coffee-bean-for-a-coffee-break.svg);
    height: var(--fs-300);
    aspect-ratio: 1;
    margin-right: 0.25em;
}

#nav--topics__menu li:hover::after {
    content: "";
    position: absolute;
    bottom: 0;
    height: 2px;
    width: 100%;
    background-color: var(--clr-primary-200);
    border-radius: 50%;
}


    /* nav search */
    .nav-search {
        order: 3;
        width: calc(100% - 4rem);
        display: flex;
        max-width: 40ch;
    }

    .navbar .btn--search {
        font-size: 20px; 
        aspect-ratio: 1;
        padding-inline: 0.5em;
        border-radius: var(--rounded-200);
        background-color: var(--clr-primary-400);
        border: 2px solid var(--clr-primary-200);
        z-index: 2;
        margin-right: -40px;
    }

    .fa-magnifying-glass {
        color: var(--clr-primary-200);
    }

/* nav media */
@media only screen and (max-width: 1000px) {

    #primary-nav {
        position: absolute;
        top: calc(var(--height-header) - 5px);
        left: 0;
        flex-direction: column;
        height: 0vh;
        overflow: hidden;
        z-index: 10;
        transition: height 350ms ease-in-out;
        transform-origin: top;
    }

    .fa-xmark {display: block;}
    .nav-search {order: 0;}

    #primary-nav > ul {
        flex-direction: column;
        row-gap: 30px;
    }
    
    #primary-nav ul li {
        font-size: var(--fs-500);
        margin-left: clamp(1em, 10%, 2.5em);
    } 
    
    #primary-nav ul > *:hover {cursor: pointer;}
    #primary-nav ul .fa-chevron-down {margin-left: 0.5em;}
    #nav--topics__menu {margin-top: 1em;}
    
    #nav--topics__menu li {
        --fs-500: smaller;
        font-size: var(--fs-500);
    }
    
    #nav--topics__menu li::before {
        content: url(../assets/coffee-bean-for-a-coffee-break.svg);
        height: var(--fs-300);
        aspect-ratio: 1;
        fill: var(--clr-primary-200);
        margin-right: 0.25em;
    }
    
    .show-nav {height: 100vh!important;}
    
    .nav-search {
        margin-block: 2rem;
        margin-inline: 2rem;
        max-width: none;
    }

    [aria-expanded="true"] > .bar {
        position: absolute;
        top: 50%;
        left: 0;
        transition: all 200ms ease;
    }

    [aria-expanded="true"] > .bar:nth-child(1) {rotate: 45deg}
    [aria-expanded="true"] > .bar:nth-child(3) {rotate: -45deg;}
    [aria-expanded="true"] > .bar:nth-child(2) {opacity: 0;}

}

@media only screen and (min-width: 1001px) {
    #primary-nav {
        align-items: center;
        justify-content: center;
        height: calc( var(--height-header) - 3px);
    }

    #primary-nav > ul {
        flex: 1;
        justify-content: center;
        /* margin-inline: auto; */
        height: 100%;
    }


    #primary-nav > ul > li {
        font-size: var(--fs-300);
        display: flex;
        align-items: center;
        height: 100%;
        
    }

    #primary-nav > ul > li > a {
        width: 100%;
        padding: 1em;
    }

    #primary-nav > ul > li:hover {background-color: var(--clr-primary-700);}

    #nav--topics {
        position: relative;
        padding-inline: 1em;
    }

    #nav--topics__menu {
        position: absolute;
        width: 100%;
        top: 100%;
        left: 0;
        background-color: var(--clr-primary-700);
        padding: 1em;
    }
    
    #nav--topics__menu li::before, 
    #primary-nav-btn  {
        display: none;
    }
}

/* modal for clicked images */
.modal {
    position: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    overflow: hidden;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    opacity: 0;
    transition: all 250ms ease-in;
}

.modal > *, .modal img {
    background-color: var(--clr-primary-200);
    max-width: min(100%, 75vw);
    max-height: min(100%, 75vh);
    width: auto;
    height: auto;
}

.modal p {
    padding-inline: clamp(10px, 2em, 30px);
    padding-bottom: 1em;
    width: 100%;
    background-color: var(--clr-primary-200);
    margin-top: -5px;
}

.modal img{
    font-size: 2vw;
    object-fit: contain;
    border: clamp(10px, 2em, 30px) solid var(--clr-primary-200);
    padding: clamp(5px, 1em, 20px);
    background-color: var(--clr-primary-700);
}


.loading {
    width: clamp(50px, 20% ,200px);
    font-size: clamp(10px, 1vw ,100px);
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: transparent;
    border: 1.5em solid white;
    border-top: 1.5em solid var(--clr-accent-200);
    animation: loading 1250ms infinite linear ;
    margin-inline: auto;
}

@keyframes loading {100% {rotate: 360deg}}

.loading--text {
    font-size: var(--fs-400);
    width: fit-content;
    margin-inline: auto;
}