/* =========================================================
   MAPAQUALI - HEADER
   assets/css/header.css
========================================================= */


/* ---------------------------------------------------------
   1. HEADER
--------------------------------------------------------- */

.mq-site-header {
    position: relative;
    z-index: 1000;

    width: 100%;
    max-width: none;

    margin: 0;
    padding: 0;

    background: var(--mq-header-bg);
    border-bottom: 1px solid var(--mq-header-border);

    color: var(--mq-header-text);

    font-family:
        "Inter",
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    box-sizing: border-box;

    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}


.mq-site-header *,
.mq-site-header *::before,
.mq-site-header *::after {
    box-sizing: border-box;
}


/* ---------------------------------------------------------
   2. CONTAINER
--------------------------------------------------------- */

.mq-site-header__inner {
    width: min(100% - 48px, 1400px);
    min-height: 90px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 26px;
}


/* ---------------------------------------------------------
   3. LOGO MAPAQUALI
--------------------------------------------------------- */

.mq-site-header__logo {
    display: flex;
    align-items: center;

    flex-shrink: 0;

    text-decoration: none;
}


.mq-site-header__logo img {
    display: block;

    width: auto;
    height: 64px;
    max-width: 190px;

    object-fit: contain;
}


/* Mapaquali - tema claro */

.mq-logo--light {
    display: block !important;
}

.mq-logo--dark {
    display: none !important;
}


/* Mapaquali - tema escuro */

html[data-theme="dark"] .mq-logo--light {
    display: none !important;
}

html[data-theme="dark"] .mq-logo--dark {
    display: block !important;
}


/* ---------------------------------------------------------
   4. INPE + BIG
--------------------------------------------------------- */

.mq-big-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    flex-shrink: 0;

    margin-right: 4px;

    text-decoration: none;
}


/* Link INPE */

.mq-big-brand__inpe-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    text-decoration: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


.mq-big-brand__inpe-link:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}


/* Logo INPE */

.mq-big-brand__inpe {
    width: auto;
    height: 50px;
    max-width: 82px;

    object-fit: contain;
}


/* INPE - tema claro */

.mq-big-brand__inpe--light {
    display: block;
}

.mq-big-brand__inpe--dark {
    display: none;
}


/* INPE - tema escuro */

html[data-theme="dark"] .mq-big-brand__inpe--light {
    display: none;
}

html[data-theme="dark"] .mq-big-brand__inpe--dark {
    display: block;
}


/* Selo BIG */

.mq-big-brand__badge {
    display: inline-flex;

    min-width: 54px;
    height: 30px;

    padding: 0 10px;

    align-items: center;
    justify-content: center;

    color: #ffffff;

    background: #2468a5;

    border-radius: 3px;

    font-size: 16px;
    font-style: italic;
    font-weight: 800;
    line-height: 1;

    letter-spacing: -0.03em;

    text-decoration: none;
    cursor: pointer;

    transform: skew(-8deg);

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

    transition:
        background-color 0.25s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* BIG verde no modo escuro */

html[data-theme="dark"] .mq-big-brand__badge {
    background: #2aa876;
}


/* Leve destaque ao passar o mouse sobre a área da marca */

.mq-big-brand:hover .mq-big-brand__badge {
    transform: skew(-8deg) translateY(-1px);
}


/* ---------------------------------------------------------
   5. ÁREA DIREITA
--------------------------------------------------------- */

.mq-site-header__content {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 34px;

    margin-left: auto;
}


/* ---------------------------------------------------------
   6. NAVEGAÇÃO
--------------------------------------------------------- */

.mq-main-nav {
    display: flex;
    align-items: center;

    gap: 32px;
}


.mq-main-nav a,
.mq-project-menu__toggle {
    color: var(--mq-header-text);

    font-size: 14px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}


.mq-main-nav a:hover,
.mq-project-menu__toggle:hover {
    color: var(--mq-primary);
}


/* ---------------------------------------------------------
   7. MENU PROJETO
--------------------------------------------------------- */

.mq-project-menu {
    position: relative;
}


.mq-project-menu__toggle {
    appearance: none;

    display: flex;
    align-items: center;

    gap: 6px;

    margin: 0;
    padding: 12px 0;

    background: transparent;
    border: 0;

    cursor: pointer;
}


.mq-project-menu__toggle svg {
    width: 14px;
    height: 14px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;

    transition:
        transform 0.2s ease;
}


/* ---------------------------------------------------------
   DROPDOWN PROJETO
--------------------------------------------------------- */

.mq-project-menu__dropdown {
    position: absolute;

    top: calc(100% + 8px);
    left: 50%;

    width: 210px;

    padding: 8px;

    background: var(--mq-surface);

    border: 1px solid var(--mq-border);
    border-radius: 10px;

    box-shadow: var(--mq-shadow-strong);

    opacity: 0;
    visibility: hidden;

    transform:
        translateX(-50%)
        translateY(-8px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease,
        background-color 0.25s ease,
        border-color 0.25s ease;

    z-index: 1100;
}


.mq-project-menu__dropdown a {
    display: block;

    width: 100%;

    padding: 12px 14px;

    border-radius: 7px;

    color: var(--mq-text);

    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}


.mq-project-menu__dropdown a:hover {
    background: var(--mq-surface-soft);
    color: var(--mq-primary);
}


/* Projeto aberto */

.mq-project-menu.is-open
.mq-project-menu__dropdown {
    opacity: 1;
    visibility: visible;

    transform:
        translateX(-50%)
        translateY(0);
}


.mq-project-menu.is-open
.mq-project-menu__toggle svg {
    transform: rotate(180deg);
}


/* ---------------------------------------------------------
   8. AÇÕES DO HEADER
--------------------------------------------------------- */

.mq-header-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


/* ---------------------------------------------------------
   9. BOTÃO CLARO / ESCURO
--------------------------------------------------------- */

.mq-theme-toggle {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: var(--mq-surface-soft);

    border: 1px solid var(--mq-border);
    border-radius: 9px;

    color: var(--mq-header-text);

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.mq-theme-toggle:hover {
    background: var(--mq-surface);

    border-color: var(--mq-primary);

    color: var(--mq-primary);

    transform: translateY(-1px);
}


.mq-theme-toggle svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Lua no tema claro */

.mq-theme-toggle__moon {
    display: block;
}

.mq-theme-toggle__sun {
    display: none;
}


/* Sol no tema escuro */

html[data-theme="dark"]
.mq-theme-toggle__moon {
    display: none;
}

html[data-theme="dark"]
.mq-theme-toggle__sun {
    display: block;
}


/* ---------------------------------------------------------
   10. ACESSE O PORTAL
--------------------------------------------------------- */

.mq-portal-login {
    min-height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 0 20px;

    background:
        linear-gradient(
            135deg,
            var(--mq-button-start) 0%,
            var(--mq-button-end) 100%
        );

    border: 1px solid transparent;
    border-radius: 8px;

    color: #ffffff !important;

    font-size: 14px;
    font-weight: 700;
    line-height: 1;

    text-decoration: none !important;

    white-space: nowrap;

    box-shadow:
        0 7px 18px
        color-mix(
            in srgb,
            var(--mq-primary) 22%,
            transparent
        );

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.mq-portal-login:hover {
    background:
        linear-gradient(
            135deg,
            var(--mq-button-hover-start) 0%,
            var(--mq-button-hover-end) 100%
        );

    border-color: transparent;

    color: #ffffff !important;

    transform: translateY(-1px);

    box-shadow:
        0 9px 22px
        color-mix(
            in srgb,
            var(--mq-primary) 30%,
            transparent
        );
}


.mq-portal-login svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ---------------------------------------------------------
   11. BOTÃO MOBILE
--------------------------------------------------------- */

.mq-mobile-toggle {
    display: none;

    width: 44px;
    height: 44px;

    padding: 10px;

    background: transparent;

    border: 1px solid var(--mq-border);
    border-radius: 8px;

    color: var(--mq-header-text);

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


.mq-mobile-toggle:hover {
    background: var(--mq-surface-soft);

    border-color: var(--mq-primary);

    color: var(--mq-primary);
}


.mq-mobile-toggle span {
    display: block;

    width: 100%;
    height: 2px;

    margin: 5px 0;

    background: currentColor;

    border-radius: 10px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}


/* ---------------------------------------------------------
   12. ESTADO DO MENU MOBILE
--------------------------------------------------------- */

.mq-mobile-toggle.is-open
span:nth-child(1) {
    transform:
        translateY(7px)
        rotate(45deg);
}


.mq-mobile-toggle.is-open
span:nth-child(2) {
    opacity: 0;
}


.mq-mobile-toggle.is-open
span:nth-child(3) {
    transform:
        translateY(-7px)
        rotate(-45deg);
}


/* ---------------------------------------------------------
   13. TABLET
--------------------------------------------------------- */

@media (max-width: 1050px) {

    .mq-site-header__inner {
        width:
            min(100% - 32px, 1400px);

        gap: 20px;
    }


    .mq-site-header__content {
        gap: 20px;
    }


    .mq-main-nav {
        gap: 20px;
    }


    .mq-site-header__logo img {
        height: 55px;
        max-width: 165px;
    }


    .mq-portal-login {
        padding-left: 15px;
        padding-right: 15px;
    }


    .mq-big-brand {
        gap: 7px;
    }


    .mq-big-brand__inpe {
        height: 44px;
        max-width: 72px;
    }


    .mq-big-brand__badge {
        min-width: 48px;
        height: 28px;

        padding: 0 8px;

        font-size: 14px;
    }

}


/* ---------------------------------------------------------
   14. MOBILE
--------------------------------------------------------- */

@media (max-width: 850px) {

    .mq-site-header__inner {
        width:
            calc(100% - 30px);

        min-height: 76px;

        position: relative;
    }


    .mq-site-header__logo img {
        height: 52px;
        max-width: 155px;
    }


    .mq-big-brand {
        gap: 5px;
        margin-left: auto;
        margin-right: 6px;
    }


    .mq-big-brand__inpe {
        height: 36px;
        max-width: 58px;
    }


    .mq-big-brand__badge {
        min-width: 40px;
        height: 24px;

        padding: 0 6px;

        font-size: 12px;
    }


    .mq-mobile-toggle {
        display: block;

        margin-left: 0;
    }


    .mq-site-header__content {
        position: absolute;

        top: calc(100% + 1px);
        left: 0;
        right: 0;

        width: 100%;

        display: none;

        flex-direction: column;
        align-items: stretch;

        gap: 18px;

        padding: 20px;

        background: var(--mq-surface);

        border: 1px solid var(--mq-border);
        border-radius: 0 0 12px 12px;

        box-shadow: var(--mq-shadow-strong);

        transition:
            background-color 0.25s ease,
            border-color 0.25s ease;
    }


    .mq-site-header__content.is-open {
        display: flex;
    }


    .mq-main-nav {
        width: 100%;

        flex-direction: column;
        align-items: stretch;

        gap: 4px;
    }


    .mq-main-nav__link,
    .mq-project-menu__toggle {
        width: 100%;

        min-height: 44px;

        display: flex;
        align-items: center;

        padding: 0 10px;
    }


    .mq-main-nav__link:hover,
    .mq-project-menu__toggle:hover {
        background: var(--mq-surface-soft);
    }


    .mq-project-menu__toggle {
        justify-content: space-between;
    }


    /* Dropdown projeto no mobile */

    .mq-project-menu__dropdown {
        position: static;

        width: 100%;

        margin-top: 2px;
        padding: 4px 0 4px 12px;

        border: 0;
        border-radius: 0;

        box-shadow: none;

        display: none;

        opacity: 1;
        visibility: visible;

        transform: none;
    }


    .mq-project-menu.is-open
    .mq-project-menu__dropdown {
        display: block;

        transform: none;
    }


    /* Ações */

    .mq-header-actions {
        width: 100%;

        display: grid;

        grid-template-columns:
            44px 1fr;

        gap: 10px;
    }


    .mq-portal-login {
        width: 100%;
    }
}


/* ---------------------------------------------------------
   15. CELULARES PEQUENOS
--------------------------------------------------------- */

@media (max-width: 480px) {

    .mq-site-header__inner {
        width:
            calc(100% - 24px);
    }


    .mq-site-header__logo img {
        height: 46px;
        max-width: 140px;
    }


    .mq-big-brand {
        gap: 4px;
        margin-right: 4px;
    }


    .mq-big-brand__inpe {
        height: 32px;
        max-width: 50px;
    }


    .mq-big-brand__badge {
        min-width: 36px;
        height: 22px;

        padding: 0 5px;

        font-size: 11px;
    }


    .mq-header-actions {
        grid-template-columns:
            44px 1fr;
    }


    .mq-theme-toggle {
        width: 44px;
    }


    .mq-portal-login {
        grid-column: auto;
    }
}


/* =========================================================
   LUA / SOL PADRONIZADOS EM TODAS AS PÁGINAS
========================================================= */

/* Esconde os SVGs originais */

.mq-theme-toggle svg {
    display: none !important;
}


/* Cria o ícone padrão */

.mq-theme-toggle::before {
    content: "";

    display: block;

    width: 19px;
    height: 19px;

    background-color: currentColor;

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: contain;
    mask-size: contain;
}


/* TEMA CLARO -> LUA */

.mq-theme-toggle[data-theme-state="light"]::before,
html:not([data-theme="dark"])
.mq-theme-toggle:not([data-theme-state])::before {

    -webkit-mask-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79Z'/></svg>");

    mask-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79Z'/></svg>");
}


/* TEMA ESCURO -> SOL */

.mq-theme-toggle[data-theme-state="dark"]::before,
html[data-theme="dark"]
.mq-theme-toggle:not([data-theme-state])::before {

    -webkit-mask-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='4' fill='black'/><g stroke='black' stroke-width='2' stroke-linecap='round' fill='none'><path d='M12 2v2'/><path d='M12 20v2'/><path d='M4.93 4.93l1.42 1.42'/><path d='M17.66 17.66l1.41 1.41'/><path d='M2 12h2'/><path d='M20 12h2'/><path d='M4.93 19.07l1.42-1.41'/><path d='M17.66 6.34l1.41-1.41'/></g></svg>");

    mask-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='4' fill='black'/><g stroke='black' stroke-width='2' stroke-linecap='round' fill='none'><path d='M12 2v2'/><path d='M12 20v2'/><path d='M4.93 4.93l1.42 1.42'/><path d='M17.66 17.66l1.41 1.41'/><path d='M2 12h2'/><path d='M20 12h2'/><path d='M4.93 19.07l1.42-1.41'/><path d='M17.66 6.34l1.41-1.41'/></g></svg>");
}


/* =========================================================
   SELETOR DE IDIOMA DESATIVADO
========================================================= */

.mq-language-menu,
.mq-language-menu__toggle,
.mq-language-menu__dropdown,
.mq-language-menu__flag {
    display: none !important;
}


/* =========================================================
   SETA DO DROPDOWN PROJETO
========================================================= */

/* Esconde o SVG original para evitar inconsistências entre páginas */

.mq-project-menu__toggle svg {
    display: none !important;
}


/* Cria a seta do dropdown via CSS */

.mq-project-menu__toggle::after {
    content: "";

    display: block;

    width: 8px;
    height: 8px;

    margin-left: 2px;

    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;

    transform: rotate(45deg) translateY(-2px);
    transform-origin: center;

    transition: transform 0.2s ease;
}


/* Gira a seta quando o menu Projeto estiver aberto */

.mq-project-menu.is-open
.mq-project-menu__toggle::after {
    transform:
        rotate(225deg)
        translate(-1px, -1px);
}