/*
=====================================================
 EF22 FRAMEWORK
 HEADER.CSS
 Version 4.1
=====================================================
*/

/* ==========================================
   HEADER
========================================== */

.header {

    position: sticky;

    top: 0;

    z-index: var(--z-header);

    width: 100%;

    background: var(--color-black);

}

/* ==========================================
   HEADER INNER
========================================== */

.header-inner {

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    width: 100%;

    padding:
        var(--space-md)
        var(--space-md)
        var(--space-lg);

    transition:
        padding .30s ease;

}

/* ==========================================
   LOGO
========================================== */

.header-logo {

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    text-decoration: none;

}

.header-logo img {

    display: block;

    width: auto;

    height: 72px;

    transition:
        height .30s ease;

}

/* ==========================================
   NAVIGATION
========================================== */

.header-navigation {

    margin-top: var(--space-md);

    opacity: 1;

    visibility: visible;

    transition:
        opacity .25s ease,
        visibility .25s ease;

}

.header-navigation ul {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: var(--space-lg);

    margin: 0;

    padding: 0;

    list-style: none;

}

.header-navigation li {

    display: flex;

    align-items: center;

}

.header-navigation a {

    position: relative;

    display: inline-flex;

    align-items: center;

    color: var(--color-white);

    text-decoration: none;

    font-size: var(--font-size-sm);

    font-weight: 600;

    white-space: nowrap;

}

/* ==========================================
   ACTIVE LINK
========================================== */

.header-navigation a.active::after {

    content: "";

    position: absolute;

    left: 0;

    bottom: -7px;

    width: 100%;

    height: 2px;

    border-radius: 999px;

    background: var(--color-primary);

}

/* ==========================================
   BURGER
========================================== */

.header-burger {

    display: none;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    gap: 5px;

    width: 48px;
    height: 48px;

    margin: 0;
    padding: 0;

    border: none;

    background: transparent;

    cursor: pointer;

}

.header-burger span {

    display: block;

    width: 24px;
    height: 3px;

    border-radius: 999px;

    background: var(--color-white);

    transition:
        transform .30s ease,
        opacity .30s ease;

}

/* ==========================================
   OVERLAY
========================================== */

.header-overlay {

    position: fixed;

    inset: 0;

    z-index: -1;

    background: var(--color-black-45);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .30s ease,
        visibility .30s ease;

}

/* ==========================================
   COMPACT
========================================== */

.header.compact .header-inner {

    flex-direction: row;

    justify-content: space-between;

    padding:
        var(--space-sm)
        var(--space-md);

}

.header.compact .header-logo img {

    height: 46px;

}

.header.compact .header-navigation {

    position: absolute;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

}

.header.compact .header-burger {

    display: flex;

}

/* ==========================================
   MENU OPEN
========================================== */

.header.compact.expanded .header-overlay {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

}

.header.compact.expanded .header-navigation {

    position: absolute;

    top: calc(100% + var(--space-sm));

    right: var(--space-md);

    z-index: 20;

    display: block;

    width: min(
        260px,
        calc(100vw - (2 * var(--space-md)))
    );

    margin: 0;

    padding: var(--space-xl);

    background: var(--color-black);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

}

.header.compact.expanded .header-navigation ul {

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: var(--space-lg);

}

/* ==========================================
   BURGER ANIMATION
========================================== */

.header.compact.expanded
.header-burger span:nth-child(1) {

    transform:
        translateY(8px)
        rotate(45deg);

}

.header.compact.expanded
.header-burger span:nth-child(2) {

    opacity: 0;

}

.header.compact.expanded
.header-burger span:nth-child(3) {

    transform:
        translateY(-8px)
        rotate(-45deg);

}

/* ==========================================
   TABLET / DESKTOP
========================================== */

@media (min-width: 769px) {

    .header-inner {

        max-width: var(--container-width);

        margin: 0 auto;

        padding-left: var(--space-xl);
        padding-right: var(--space-xl);

    }

    .header-navigation ul {

        gap: var(--space-xl);

    }

    .header-navigation a {

        font-size: var(--font-size-md);

    }

    .header.compact.expanded
    .header-navigation {

        right: var(--space-xl);

    }

}