/******************************************
*                  HEADER                 *
******************************************/

/*
* Contact bar 1em = 16px ; height: 2em = 32px
* Nav bar 1em = 1.3em = 20.8px ; height: 4em = 83.2px
* Spacer = 83.2px + 32px = 115.2px
*/

/* Header flex*/
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-bottom: 0.1em solid var(--primary);
    position: fixed;
    font-size: 1.3em;
}

.header-spacer {
    /* Match the height of the header (contact bar + nav bar) */
    height: 115.2px;
}

@media screen and (max-width: 1241px) {
    .header-spacer {
        /* Match the height of the header (nav bar) */
        height: 83.2px;
    }
}

/******************************************
*               CONTACT BAR               *
******************************************/

#header-contact-bar {
    border-bottom: 2px solid var(--color-beige);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    height: 2em;
}

#header-contact-bar a {
    color: var(--color-blue);
    text-decoration: none;
    margin: 0 1em;
}


/* Responsive contact bar */

@media screen and (max-width: 1241px) {
    #header-contact-bar {
        display: none;
    }
}

/************************************************
*                     NAVBAR                    *
************************************************/

/* Logo */
#nav-accueil {
    padding: 0 1em;
    margin: 0;
    display: flex;
    align-items: center;
    height: 4em;
    /* Fill navbar height */
    background-color: var(--color-beige);
}

#nav-accueil img {
    height: 100%;
    /* Take full navbar height */
    max-height: 3em;
    /* Prevent from being too tall */
    width: auto;
    display: block;
    object-fit: contain;
}

/* Navigation bar */
.resp-sub-nav {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-width: 1500px;
}

/* Navigation links */
.resp-sub-nav a {
    float: left;
    display: block;
}

.resp-sub-nav .icon {
    display: none;
}

.dropdown {
    float: left;
    overflow: hidden;
}

.dropdown .drop-btn {
    border: none;
    outline: none;

    background-color: inherit;
    font-family: inherit;
}

/* Navbar elements, no matter if anchor or dropdown */
.dropdown .drop-btn,
.resp-sub-nav a {
    cursor: pointer;
    text-align: center;
    color: var(--color-blue);
    padding: 1em;
    font-size: 1em;
}

.active {
    background-color: var(--primary);
    color: var(--color-white);
}


.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    min-width: 10em;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dropdown-content a {
    float: none;
    color: var(--color-blue);
    padding: 1em;
    text-decoration: none;
    display: block;
    text-align: left;
}

/* Hover effects */

.dropdown-content a,
.resp-sub-nav a {
    text-decoration: underline 0.1em rgba(0, 0, 0, 0);
    transition: text-decoration-color 0.5s;
}

.dropdown-content a:hover,
.resp-sub-nav a:hover {
    text-decoration-color: var(--primary);
}

.dropdown:hover .dropdown-content {
    display: block;
}


/************************************************
*               RESPONSIVE NAVBAR               *
************************************************/

/*  */
@media screen and (max-width: 1241px) {

    .resp-sub-nav a:not(:first-child),
    .dropdown .drop-btn {
        display: none;
    }

    .resp-sub-nav a.icon {
        float: right;
        display: block;
        font-size: 1em;
        font-weight: bold;
        text-decoration: none;
        height: 2em;
        padding: 1em;
    }

    .resp-sub-nav a.icon:hover {
        background-color: var(--light-highlight);
    }

    .resp-sub-nav.responsive {
        position: relative;
    }

    .resp-sub-nav.responsive .icon {
        position: absolute;
        right: 0;
        top: 0;
        background-color: var(--color-white);
    }

    .resp-sub-nav.responsive a {
        float: none;
        display: block;
        text-align: left;
    }

    .resp-sub-nav.responsive .dropdown {
        float: none;
    }

    .resp-sub-nav.responsive .dropdown-content {
        position: relative;
    }

    .resp-sub-nav.responsive .dropdown .drop-btn {
        display: block;
        width: 100%;
        text-align: left;
    }
}