@import url('_global.css');

/* Base */
body {
    font-family: "Barlow", sans-serif;
}

header {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 8%;
    position: fixed;
    z-index: 4;
    background-color: transparent;
    box-shadow: none;
    transition: background-color 0.4s ease;
}

header.scrolled {
    background-color: #212121;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header.scrolled .hiperlink,
header.scrolled .hiperlink-dropdown {
    color: #fff;
    padding: 0.5rem;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 80%;
}

#logo-header {
    width: 8dvw;
    height: auto;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1140px;
    width: 80%;
}

.navbar-size {
    width: 50%;
}

header .hiperlink,
header .hiperlink-dropdown {
    color: white;
    transition: 0.4s ease;
}

.hiperlink,
.hiperlink-dropdown {
    text-decoration: none;
    color: var(--secondary-text);
    font-size: var(--font-header);
    font-weight: var(--hero-subtitle-font-weight);
    cursor: pointer;
    display: flex;
    gap: 1rem;
}

.hiperlink {
    padding: 2%;
}

.hiperlink-dropdown {
    padding: 0.5rem;
}

.arrow-down {
    width: var(--font-header);
    height: auto;
}

.hiperlink:hover,
.hiperlink-dropdown:hover {
    color: #1e594b !important;
    transition: 0.2s ease;
}

.title-dropdown {
    font-weight: 500;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-decoration: underline;
    text-decoration-color: #1E594B;
    text-underline-offset: 10px;
    width: 100%;
}

.title-dropdown:hover {
    color: #578E73;
    transition: 0.2s ease;
}

.title-dropdown:not(:hover) {
    color: #ffffffff;
    transition: 0.2s ease;
}

#dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: #212121;
    width: 92vw;
    padding: 2% 4%;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 10rem;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
    border-top: 0.2px solid #050505;
    transition: background-color 0.4s ease;
}

#dropdown-content.active {
    display: flex;
}

#dropdown-content > div {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

#dropdown-content > .hiperlink {
    padding-right: 10px;
}

/* Dropdown container for mobile */
.dropdown-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80vw !important;
    font-size: 2rem;
    gap: 10rem;
}

/* Toggle (hamburguer) */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: none;
}

.menu-toggle img {
    width: 2.5rem;
    height: auto;
}

/* Nav wrapper default */
.nav-wrapper {
    display: block;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .header-wrapper.active {
        flex-direction: column;
        justify-content: start;
    }

    .header-top {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }

    .nav-wrapper {
        display: none;
        width: 100%;
        height: 100vh;
        align-items: center;
        padding: 1rem 0;
        flex-direction: column;
    }

    .nav-wrapper.active {
        display: flex;
        align-items: center;
    }

    header.active {
        background-color: #212121;
        height: 100vh;
        overflow-y: auto;
    }

    .navbar-size.show {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        background-color: #212121;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100vw;
        z-index: 3;
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 10px 0;
        width: 80%;
        height: 60%;
    }

    #logo-header {
        width: 10em;
    }

    #dropdown-content {
        flex-direction: column;
        position: static;
        border: none;
        box-shadow: none;
        width: 80%;
    }

    #dropdown-content.active {
        gap: 3rem;
    }

    #dropdown-content > div {
        width: 100%;
    }

    .hiperlink {
        font-size: 2rem;
        padding: 2rem !important;
    }

    .hiperlink-dropdown {
        font-size: 1.5rem !important;
        padding: 10px 2rem;
        width: 100%;
        color: #333;
    }

    .arrow-down {
        width: 2rem;
    }

    .title-dropdown {
        font-size: 1.8rem;
        text-underline-offset: 5px;
    }
}

/* Font scaling - grouped media queries */
@media (max-width: 1350px) {
    :root { --font-header: 1.4rem !important; }
}
@media (max-width: 1260px) {
    :root { --font-header: 1.3rem !important; }
}
@media (max-width: 1168px) {
    :root { --font-header: 1.2rem !important; }
}
@media (max-width: 1090px) {
    :root { --font-header: 1.1rem !important; }
}
@media (max-width: 990px) {
    :root { --font-header: 1rem !important; }
}
@media (max-width: 900px) {
    :root { --font-header: 0.9rem !important; }
}
@media (max-width: 810px) {
    :root { --font-header: 0.8rem !important; }
}
