/**         Styles Guide       **/

/*  
    Hero Heading Text:
        Italiana, Regular (400), 162px (8.1rem)
        Right, Line height: 140.4px (7.02);
    
    Hand Crafted, Latest Collection:
        Italiana, Regular(400), 51px (2.55rem)

    Hero Sub-heading ('Jewelers'):
        Lato, Light (300), 45px (2.25rem)
        Right, Line height: 46px (2.3)

    Catalogue, Events, Collaborations:
        Italiana, Regular(400), 30px (1.5rem)
        Center

    Read More:
        Italiana, Regular (400), 25px (1.25rem)
        Center, Line height: 29px (1.45)

    Foot Headings (Stay Updated, Contact)
        Italiana, Regular (400), 25px (1.25rem)
        Right

    Footer Navigation Items:
        Italiana, Regular (400), 20px (1rem)
        Line height: 29px (1.45)
    
    Top Navigation Items:
        Lato, Regular (400), 20px (1rem)
        Line height: 29px (1.45)

    Body Text:
        Lato, Light (300), 20px (1rem)
        Line height: 29px (1.45)

*/

/**********************************/
/**         Variables             */
/**********************************/

:root {
    /*  Fonts  */
    --italiana: "Italiana", serif;
    --lato: "Lato", sans-serif;
    /*  Colors  */
    --text-color: #fff;
    --accent-color: #faba63;
    --dark-brown: #201e21;
    --dark-blue: #14171f;
    /*  layout  */
    --body-wrapper: 90%;
    /* Section padding same as body margin total*/
    --section-padding-top-and-bottom: calc(100% - var(--body-wrapper));
    /* Articles top/bottom padding half of section padding */
    --article-padding-sides: calc(var(--section-padding-top-and-bottom) / 2);
}

/**     Global Styles      **/

html {
    font-size: 125%;
}

body {
    color: var(--text-color);
    background-color: var(--dark-brown);
    font-size: 1rem;
    line-height: 1.45;
}

body,
h2 {
    font-family: var(--lato);
    font-weight: 300;
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
}

h1,
h3,
h4,
h5 {
    font-family: var(--italiana);
    font-weight: 400;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.8rem, 15vw, 8.1rem);
    line-height: 0.86;
}

h2 {
    color: var(--accent-color);
    font-size: clamp(0.8rem, 4vw, 2.25rem);
    line-height: 1.02;
    text-transform: capitalize;
}

h3 {
    font-size: clamp(1.5rem, 5vw, 2.55rem);
    line-height: 1;
}

h4 {
    font-size: clamp(1.3rem, 3.5vw, 1.5rem);
}

h5 {
    font-size: 1.25rem;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

a:link,
a:visited {
    color: inherit;
}

.wrapper {
    max-width: 1200px;
    width: var(--body-wrapper);
    margin: 0 auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.about-section,
.latest-collection-section,
.links-banner-section,
.footer-info-section {
    padding: var(--section-padding-top-and-bottom) 0;
}

.about-section,
.links-banner-section,
.footer {
    background-color: var(--dark-blue);
}

.top-nav,
.social-nav,
.menu-button-container,
.about-section .content,
.gallery,
.links-banner-section .links-menu,
.articles-section .content,
.footer-nav .menu {
    display: flex;
}

/*******************************************/
/*****  Individual Section Styling   *******/
/*****        Mobile First           *******/
/*******************************************/

/*******           Header         **********/

.main-header {
    height: 100vh;
}

/* navigation bar and button */

.top-nav {
    flex-direction: row-reverse;
    align-items: center;
    height: 60px;
}

.top-nav .menu {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
}

.menu-button-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /*Center the menu button inside its container*/
    width: 44px;
    height: 44px;
    cursor: pointer;
}

/* Menu button lines */
.menu-button,
.menu-button::before,
.menu-button::after {
    background-color: var(--text-color);
    position: absolute;
    /*https://chenhuijing.com/blog/flexbox-and-absolute-positioning/*/
    height: 3px;
    width: 44px;
    transition: all 400ms ease-in-out;
    border-radius: 2px;
}

.menu-button::before {
    content: "";
    top: -12px;
}

.menu-button::after {
    content: "";
    top: 12px;
}

#menu-toggle:checked+.menu-button-container .menu-button::before {
    top: 0px;
    transform: rotate(225deg);
}

#menu-toggle:checked+.menu-button-container .menu-button {
    background: transparent;
    /* mid line dissapears*/
}

#menu-toggle:checked+.menu-button-container .menu-button::after {
    top: 0px;
    transform: rotate(-225deg);
}

/* Top nav menu list */

.menu-toggle-button~.menu li {
    background-color: var(--dark-brown);
    max-height: 0;
    overflow: hidden;
    transition: max-height 400ms ease-out;
    /* same duration as button rotation*/
}

.menu-toggle-button:checked~.menu li {
    max-height: 10em;
    /*https://stackoverflow.com/questions/3508605/how-can-i-transition-height-0-to-height-auto-using-css*/
    transition: max-height 400ms ease-out;
}

.menu-toggle-button:checked~.menu>li {
    border: 1px solid #333;
}

.top-nav a {
    display: inline-block;
    width: 100%;
    padding: 0.7em;
    color: var(--accent-color);
    font-family: var(--lato);
    font-weight: 400;
    font-size: clamp(1.5rem, 5vw, 2rem);
    text-align: center;
    /* avoids pushing content when hovered*/
    border: 1px solid transparent;
}

/* Top nav behaviour */

.top-nav a:hover,
.top-nav a:focus {
    color: var(--accent-color);
    /* background-color: transparent; */
}

.top-nav a:active {
    color: var(--dark-brown);
    background-color: var(--accent-color);
}

/*  social media links */

.direction-switchable>li:not(:last-child) a:hover,
.direction-switchable>li:not(:last-child) a:focus {
    /* Not borders on social links when hovered*/
    border: 1px solid var(--accent-color);
}

.social-nav {
    justify-content: space-evenly;
}

.social-nav a:hover,
.social-nav a:focus {
    color: #fff;
}

.top-nav .social-nav a:active {
    color: var(--dark-blue);
}

/*  Hero Heading  */

.main-heading {
    margin-top: 18vh;
    display: inline-block;
    text-align: right;
}

.main-heading span {
    display: block;
}

.main-heading span::before,
.main-heading span::after {
    content: "-";
}

/*  Hero Image  */

.hero-image {
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*******          About Section          **********/

.about-section .content {
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--section-padding-top-and-bottom);
}

.read-more-links {
    color: var(--text-color);
    background-color: transparent;
    font-family: var(--italiana);
    font-size: 1.25rem;
    line-height: 1.45;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--accent-color);
    padding: 0.3em 0.6em;
    margin-top: 1em;
}

.read-more-links:hover {
    border-color: var(--dark-brown);
    background-color: #7a4800;
}

.read-more-links:active {
    border-color: var(--accent-color);
    background-color: #482a00;
}

/*******          Latest Collection Section          **********/

.latest-collection-section {
    text-align: center;
}

.gallery {
    /* to center header*/
    padding-top: var(--section-padding-top-and-bottom);
    margin: -1%;
    /* to align with wrapper*/
    overflow: hidden;
}

.gallery li {
    margin: 1%;
    flex: 1 0 48%;
}

/*******       Links Banner  Section      **********/

.links-banner-section .links-menu {
    flex-direction: column;
    align-items: center;
}

.links-banner-section li {
    text-align: center;
}

.links-banner-section li:not(:last-of-type) {
    margin-bottom: 2rem;
}

.links-banner-section i {
    color: var(--accent-color);
    font-size: clamp(2.5rem, 5vw, 3.2rem);
    margin-bottom: 0.2em;
}

.links-banner-section i:hover {
    color: #7a4800;
}

/*******          Articles Section          **********/

.articles-section .content {
    flex-direction: column;
    align-items: center;
    /* same padding as the body wrapper*/
    padding: var(--section-padding-top-and-bottom) var(--article-padding-sides);
}

.article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*******          Footer Section          **********/

.footer {
    text-align: center;
}

.footer-nav .menu {
    justify-content: space-between;
    line-height: 1.45;
}

.form-container,
.contact-info {
    margin-top: var(--section-padding-top-and-bottom);
}

.footer p,
.contact-info {
    font-size: 0.8rem;
    font-weight: 400;
}

.form-container p {
    margin: 0.8em 0;
}

.email-input,
.submit-btn {
    text-align: center;
    border: none;
    width: 100%;
    max-width: 22rem;
    height: 2.5rem;
}

.email-input {
    font-family: inherit;
    margin-bottom: 0.6em;
}

.submit-btn {
    color: #fff;
    background-color: #000;
    font-family: var(--italiana);
    font-size: 1.25rem;
    text-transform: uppercase;
    /* avoids pushing content when hovered*/
    border: 1px solid #000;
}

.contact-info {
    font-style: normal;
}

.contact-info span {
    display: block;
}

.contact-info a:first-of-type::after {
    content: " |";
}

.footer>p {
    background-color: #000;
    margin: 0;
    padding: 1em;
}

.footer a:hover {
    border-bottom: 1px solid;
}

.footer button:hover,
.footer button:focus {
    background-color: var(--dark-brown);
    border: 1px solid;
    cursor: pointer;
}

.footer button:active {
    color: #000;
    background-color: var(--accent-color);
}

/****************************************************/
/*****************Media Queries**********************/
/****************************************************/

/************     Medium Size Devices  **************/

@media screen and (min-width: 768px) {
    /**     Global Styles      **/

    :root {
        --body-wrapper: 85%;
        /* same as wrapper margin for balance*/
        --section-padding-top-and-bottom: 7.5%;
        --article-padding-sides: 7.5%;
    }

    /*******           Header         **********/

    /* navigation bar and button */

    .menu-button-container {
        display: none;
    }

    .top-nav {
        /*40px taller than mobile*/
        height: 100px;
    }

    .top-nav .menu {
        display: flex;
        flex-direction: row;
        align-items: center;
        /* Return to position */
        position: initial;
    }

    .menu-toggle-button~.menu.direction-switchable li {
        /* more specific than initial rule to override */
        /* Reset */
        max-height: 4em;
        background-color: initial;
        border: none;
        margin: 2%;
    }

    .menu-toggle-button~.menu.direction-switchable>li:first-child {
        /* line up left anchor and wrapper (padding .5em)*/
        margin-left: -0.5em;
    }

    .top-nav a {
        /* Reset */
        font-size: 1rem;
        width: auto;
        padding: 0.5em;
    }

    /*      floating Side Nav    */

    .social-nav {
        flex-direction: column;
        align-items: center;
        position: fixed;
        bottom: 4em;
        right: 0;
        /*width is same as body margin to center icons inside the right side margin*/
        width: var(--section-padding-top-and-bottom);
    }

    .social-nav a {
        padding: 0.3em;
        font-size: clamp(1.1rem, 2.15vw, 1.5rem);
        color: #fff;
    }

    .social-nav a:hover,
    .social-nav a:focus {
        color: var(--accent-color);
        border-color: transparent;
    }

    /*******       Links Banner  Section      **********/

    .links-banner-section .links-menu {
        flex-direction: row;
        justify-content: center;
    }

    .links-banner-section li {
        width: calc(100% / 3);
    }

    .links-banner-section li:not(:last-of-type) {
        margin-bottom: 0;
    }

    /*******          Footer Section          **********/

    .footer .wrapper {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .footer-nav {
        width: 100%;
    }

    .footer-nav .menu {
        justify-content: space-evenly;
    }

    .form-container {
        flex: 1;
        text-align: left;
        padding-right: 3em;
        margin-bottom: 0;
    }

    .form-container p {
        margin-top: 0;
    }

    .email-input,
    .submit-btn {
        font-size: 1rem;
        padding: 0 1em;
    }

    .email-input {
        text-align: left;
    }

    .contact-info {
        text-align: right;
    }
}

/**************  Desktop Size Devices  *******************/

@media screen and (min-width: 992px) {
    /*******          About Section          **********/

    .about-section .wrapper {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 3%;
    }

    .about-section img {
        height: 100%;
        object-fit: cover;
    }

    .about-section .content {
        align-items: flex-start;
        margin-top: 0;
    }

    /*******          Latest Collection Section          **********/

    .gallery li {
        flex: 1;
    }

    /*******          Articles Section          **********/

    .article {
        display: flex;
        /*lock the width for ultra wide screens*/
        max-width: 1380px;
        margin: 0 auto;
    }

    .article:nth-of-type(odd) {
        /*if more articles are added this still works*/
        flex-direction: row-reverse;
    }

    .article .image-container,
    .article .content {
        width: 50%;
    }

    .article .content {
        justify-content: space-between;
        align-items: flex-start;
    }

    /*******          Footer Section          **********/

    .footer-nav,
    .email-input,
    .contact-info {
        flex: 1;
    }

    .footer-nav .menu {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-container {
        flex: 3;
        text-align: center;
        padding-right: 0;
        margin: 0;
    }

    .form-container form {
        display: flex;
    }

    .email-input {
        /* allow it to stretch again*/
        max-width: none;
    }

    .submit-btn {
        /*reset*/
        width: auto;
    }

    .contact-info {
        /* Do not break the information text*/
        min-width: max-content;
        padding-left: 1em;
        margin-top: 0;
    }
}

/************ Ultra Wide Devices  *******************/

@media screen and (min-width: 1200px) {
    /**     Global Styles      **/

    :root {
        /* Lock section spacing for ultra wide screens*/
        --section-padding-top-and-bottom: 90px;
    }
}