@charset "UTF-8";

@import url('_hamburger.css');

/* ========================================
   HEADER
   ======================================== */
header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: var(--min-w);
    max-width: var(--max-w);
    height: 110px;
    margin: auto;
    padding: 20px;
}

/* Tamanho/distancia do header ate o conteudo — unica fonte de verdade pra
   TODA pagina do site (era duplicado, com valores DIFERENTES (36/49/75px),
   em 8 arquivos: _home_page.css, _tools.css, _about.css, errors.css,
   catalogos.css, agregadores/posts.css, agregadores/agregadores.css,
   catalogos/capacitacao/style.css — cada familia de pagina com uma distancia
   proxima diferente fazia o layout "pular" ao trocar de pagina. 36px = valor
   da home, escolhido como padrao pro site inteiro. Mobile (32px) ja
   centralizado aqui embaixo, no breakpoint de 800px. */
.home-header {
    align-items: flex-start;
    box-sizing: border-box;
    gap: 0;
    height: auto;
    justify-content: flex-start;
    min-height: 128px;
    margin: 0 auto 36px;
    padding: 24px 40px;
}

.logo {
    display: flex;
    max-height: 80px;
    max-width: 240px;
    background: var(--c_blue3);
    border-radius: 10px;
    padding: 9px 51px 10px 51px;
    flex-shrink: 0;
}

.logo img {
    width: 138px;
}

header > nav {
    display: flex;
    max-width: 295px;
    font-family: var(--fonte-destaque);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    font-style: normal;
    line-height: 114.929%;
    margin: 0px auto;
    border-radius: 10px;
    background-color: var(--c_blue3);
    color: var(--c_white);
    align-items: center;

}

#nav {
    flex-grow: 0;
    width: 295px;
    max-width: 295px;
    box-sizing: border-box;
    padding: 14.5px 0;
    gap: 0;
    justify-content: space-between;
}

.home-header > #nav {
    /* > 800px: só o espaço logo<->nav é flexível (absorve o espaço livre);
       nav<->header-cta fica fixo em 19px; header-cta fica a 40px da borda
       (padding do .home-header), sem lógica extra.
       O `header{gap:20px}` já soma 20px entre nav e header-cta, então aqui
       só compensa a diferença pra fechar em 19px (20 - 1 = 19). */
    margin-left: auto;
    margin-right: 19px;
}

@media only screen and (max-width: 980px) and (min-width: 801px) {
    header.home-header {
        padding-left: 24px;
        padding-right: 24px;
    }

    .home-header {
        padding-left: 24px;
        padding-right: 24px;
    }

    .home-header > #nav {
        width: 253px;
        max-width: 253px;
    }

    .home-header nav > a {
        padding-left: 10px;
        padding-right: 10px;
    }

    .home-header .header-cta {
        min-width: 138px;
    }
}

nav > a {
    color: var(--c_white);
    padding: 2px 18px;
    text-decoration: none;
    border-radius: 10px;
    display: inline-block;
    transition: all 0.3s ease;
    white-space: nowrap;
}
nav > a:hover {
    /*background: var(--c_blue1); linear-gradient(0deg, var(--c_blue1) 0%, var(--c_blue3) 100%);*/
    color: var(--c_yellow);
    transform: translateY(-2px);
}
nav > a.active {
    color: var(--c_yellow);
    /*background: var(--c_blue1); linear-gradient(0deg, var(--c_blue1) 0%, var(--c_blue3) 100%);*/
    font-weight: 600;
}
nav > a.active:hover {
    transform: translateY(-3px);
}

/* ========================================
   CTA - PLATAFORMA DE CURSOS
   ======================================== */
.header-cta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 173px;
    height: 49px;
    box-sizing: border-box;
    background-color: var(--c_red);
    color: var(--c_white);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.42px;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    padding: 0;
    border-radius: 10px;
    white-space: normal;
    transition: all 0.3s ease;
}

.header-cta:hover {
    background-color: #c72d10;
}

/* ========================================
   SELETOR DE IDIOMA
   ======================================== */
.language-selector {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 53px;
    background-color: var(--c_red);
    color: var(--c_white);
    border-radius: 0 0 10px 10px;
    cursor: pointer;
    overflow: hidden;
    transition: height 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;
}
.language-selector:hover {
    height: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.current-lang {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 53px;
    font-size: 15px;
    font-weight: 700;
    background-color: var(--c_red);
    transition: background-color 0.3s ease;
}
.current-lang i {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 11px;
    opacity: 0.8;
}
.language-selector:hover .current-lang {
    background-color: #c72d10;
}
.lang-options {
    display: none;
}
.language-selector:hover .lang-options {
    display: block;
}
.lang-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 53px;
    font-size: 15px;
    font-weight: 700;
    background-color: var(--c_red);
    transition: background-color 0.3s ease;
    cursor: pointer;
}
.lang-option:hover {
    background-color: #c72d10;
}
.lang-option.active {
    background-color: #a82610;
    border-left: 3px solid var(--c_yellow);
}
/* ========================================
   HEADER - RESPONSIVIDADE 1250px
   ======================================== */
@media only screen and (max-width: 1200px) {
    .language-selector {
        top: 0;
        right: 0;
        width: 55px;
        height: 45px;
    }
    .current-lang {
        height: 45px;
        font-size: 14px;
    }
    .lang-option {
        height: 45px;
        font-size: 14px;
    }
}
/* ========================================
   HEADER - RESPONSIVIDADE 1100px
   ======================================== */
@media only screen and (max-width: 1100px) {
    header > #nav {
        display: flex;
        flex-wrap: nowrap;
        padding: 14.5px 0;
    }
}
/* ========================================
   HEADER - RESPONSIVIDADE 900px
   ======================================== */
@media only screen and (max-width: 900px) {
    header > nav {
        display: flex;
    }
}

/* ========================================
   HEADER - MENU HAMBÚRGUER < 800px
   ======================================== */
@media only screen and (max-width: 800px) {
    header.home-header {
        --mobile-header-box: 98px;
        align-items: flex-start;
        gap: 24px;
        height: auto;
        min-height: 0;
        padding: 40px;
        justify-content: space-between;
        /* Distancia header->conteudo em mobile: unica fonte de verdade (era
           duplicado igual em 7 arquivos de pagina - _home_page.css,
           _tools.css, _about.css, errors.css, catalogos.css, agregadores/
           posts.css, agregadores/agregadores.css). Desktop continua variando
           por pagina (36/49/75px), so o mobile e' o mesmo em todo o site. */
        margin-bottom: 32px;
    }

    .header-cta {
        display: none;
    }

    header > #nav {
        position: fixed;
        top: 0;
        right: -50vw;
        width: 50vw;
        max-width: 50vw;
        height: 100vh;
        background-color: var(--c_blue3);
        flex-direction: column;
        justify-content: flex-start;
        /* "center" (nao "stretch") - cada link vira largura auto (ver "nav >
           a" abaixo), a borda precisa parar de esticar full-width pra
           acompanhar so o tamanho da palavra. */
        align-items: center;
        padding: 80px 20px 20px;
        margin: 0;
        border-radius: 0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        z-index: 1003;
        overflow-y: auto;
        overflow-x: hidden; /* ← ADICIONAR: Previne scroll horizontal */
    }

    .logo {
        align-items: center;
        justify-content: flex-start;
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        height: var(--mobile-header-box);
        max-height: none;
        box-sizing: border-box;
        margin: 0;
        padding: 0 20px;
        border-radius: 16px;
    }

    .logo img {
        width: 200px;
        max-width: 100%;
        height: auto;
    }

    .home-header > #nav {
        margin: 0;
    }
    
    header > #nav.active {
        right: 0;
    }
    
    nav > a {
        box-sizing: border-box;
        width: auto;
        max-width: 100%;
        padding: 15px 20px;
        margin: 5px 0;
        text-align: center;
        border: 1px solid transparent;
        border-radius: 8px;
        white-space: normal; /* ← ADICIONAR: Permite quebra de linha */
        word-wrap: break-word; /* ← ADICIONAR: Força quebra em palavras longas */
        overflow-wrap: break-word; /* ← ADICIONAR: Compatibilidade adicional */
        line-height: 1.4; /* ← ADICIONAR: Melhora legibilidade em múltiplas linhas */
    }

    nav > a:hover {
        border-color: var(--c_yellow);
        transform: translateX(5px);
    }

    nav > a.active {
        border-color: var(--c_yellow);
    }
    
    .language-selector {
        position: absolute;
        top: 0;
        left: 0;
    }
}

/* ========================================
   HEADER - RESPONSIVIDADE 720px
   ======================================== */
@media only screen and (max-width: 720px) {
    header.home-header {
        --mobile-header-box: 88px;
        gap: 18px;
        height: auto;
        padding: 36px;
        justify-content: space-between;
    }
    
    .logo {
        height: var(--mobile-header-box);
        margin: 0;
        padding: 0 20px;
    }

    .logo img {
        width: 150px;
    }
    
    .language-selector {
        position: absolute;
        top: 0;
        left: 0;
    }
    
    header > #nav {
        width: 50vw;
        max-width: 50vw;
        padding: 70px 15px 15px;
    }
}

/* ========================================
   HEADER - RESPONSIVIDADE 600px
   ======================================== */
@media only screen and (max-width: 600px) {
    header.home-header {
        --mobile-header-box: 78px;
        gap: 12px;
        height: auto;
        padding: 30px;
        justify-content: space-between;
    }
    
    .logo {
        height: var(--mobile-header-box);
        margin: 0;
        padding: 0 20px;
    }

    .logo img {
        width: 110px;
    }
    
    .language-selector {
        position: absolute;
        top: 0;
        left: 0;
    }
    
    header > #nav {
        width: 50vw;
        max-width: 50vw;
    }
    
    nav > a {
        padding: 12px 15px;
        font-size: 15px;
    }
}

@media only screen and (max-width: 350px) {
    header.home-header {
        --mobile-header-box: 68px;
        gap: 8px;
        padding: 20px;
    }

    .logo {
        height: var(--mobile-header-box);
        padding: 0 20px;
    }

    .logo img {
        width: 130px;
    }
}
