/* ******************************************** */
/** COMPONENT: HEADER
/* ******************************************** */

/* HEADER */
.c-header {
    width: 100%;
    height: calc(var(--header)*1.2);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    transition: background-color 200ms ease-in-out;
    z-index: 2;
}
.c-header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* NAV */
.c-nav__link {
    font-size: 1.6rem;
    font-weight: 500;
    white-space: nowrap;
    vertical-align: middle;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    color: var(--color-grey-100);
}

/* ********************** de Mobile a TABLET ********************** */

@media (max-width: 61.20rem) { /* 979px */
    .c-header__btn {
        z-index: 1;
    }
    .c-header__btn-bar {
        display: block;
        width: 20px;
        height: 2px;
        margin-top: 0.3rem;
        transition: all .3s ease-in-out;
        background-color: var(--color-secondary);
    }
    .c-header__nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
    }
    .c-nav__holder {
        width: 82%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: calc(var(--header)*1.2) var(--space-x);
        background-color: var(--color-grey-700);
    }
    .c-nav__list {
        --animation-time: 800ms;
        --animation-delay: 400ms;
        --animation-name: fadeIn;
        margin-bottom: 2rem;
        padding-top: calc(var(--header)*.5);
        overflow: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .c-nav__item:first-child {
        margin-top: 0;
    }
    .c-nav__item {
        padding: 0.8em 0;
        font-size: 1.7rem;
    }
    /* CHECKED MENU */

    .c-header__toggle:checked~ .c-header__btn:after {
        content: "";
        width: 4.8rem;
        height: 4.8rem;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        background-color: var(--color-grey-700);
        z-index: -1;
    }

    .c-header__toggle:checked~.c-header__btn .c-header__btn-bar:nth-child(1) {
        transform: translateY(5px) rotate(225deg);
    }
    .c-header__toggle:checked~.c-header__btn .c-header__btn-bar:nth-child(2) {
        opacity: 0;
        transition: all 0.2s ease-in-out;
    }
    .c-header__toggle:checked~.c-header__btn .c-header__btn-bar:nth-child(3) {
        transform: translateY(-5px) rotate(-225deg);
    }
    .c-header__toggle:checked~.c-header__nav {
        display: block;
        animation: animIn 1s forwards;
        transition: opacity 200ms ease-in-out;
    }
    .c-header__toggle:checked~.c-header__nav .c-nav__list {
        animation: var(--animation-name) var(--animation-time) var(--animation-delay) forwards;
        opacity: 0;
    }

    /* Open/Close menu */
    body.is-open {
        overflow: hidden;
    }
    .c-header__nav.is-closing {
        display: flex;
        animation: animOut 1s forwards;
    }
}

/* ********************** de Tablet a DESKTOP ********************** */

@media (hover: hover) {
    .c-nav__link:is(:hover, :focus) {
        color: var(--color-hover);
        border-bottom: 2px solid var(--color-hover);
        transition: color 200ms ease-in-out, border-bottom 200ms ease-in-out;
    }
}

@media (min-width: 61.25rem) { /* 980px */
    .c-header__nav {
        flex-basis: 84%;
    }
    .c-nav__holder {
        display: flex;
        justify-content: space-between;
    }
    .c-header__btn {
        display: none;
    }
    .c-nav__list {
        display: flex;
        gap: 40px;
    }
}

/* ********************** Animations ********************** */

@keyframes animIn {
    0% {
        opacity: 0;
        transform: translateX(-20%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes animOut {
    0% {
        opacity: .8;
    }
    100% {
        opacity: 0;
        transform: translateX(-20%);
    }
}
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}