/* Header principal do site (aberto em header.php) */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background-color: var(--color-bg);
    transition: background-color 300ms ease-in-out 0s;
	border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.fixed .site-header {
    background-color: var(--color-bg-transp);
}

.site-header:hover {
    background-color: var(--color-bg);
}

/* Container interno do header para alinhamento */
.site-header-inner {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}


/* Container principal: coluna */
.site-header-inner {
    display: flex;
    flex-direction: row;
}

.header-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.title-section {
    white-space: nowrap;
    font-weight: 900;
    font-size: 1.4em;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-section a {
    color: var(--color-dark-grey);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.title-section a:hover {
    color: var(--color-text);
}

.title-section img {
    width: 120px;
    height: auto;
    margin-right: 0.5rem;
    object-fit: contain;
    transition: width 300ms ease-in 0s;
}

.fixed .title-section img {
    width: 80px;
}

.header-line1,
.header-line2 {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    padding: 4px;
    min-width: 0;
    justify-content: flex-end;
    min-height: 30px;
}

.header-line1 {
    max-height: 40px;
    min-height: 0px;
    transition: all 300ms ease-in 0s;
}

.fixed .header-line1 {
    max-height: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.today-temperature {
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 2.5rem;
    color: var(--color-primary-dark);
}

.today-temperature .msg {
    margin-right: 1rem;
}

.today-temperature .weather {
    margin-right: 1rem;
    text-transform: lowercase;
}

.today-temperature .temperature {
    margin-right: 1rem;
    text-transform: lowercase;
}


.main-navigation {
    min-height: 60px;
}

.main-navigation .open-menu,
.main-navigation .close-menu {
    display: none;
    color: var(--color-dark-grey);
    text-decoration: none;
    cursor: pointer;
    height: 60px;
    width: 40px;
    align-items: center;
}

.main-navigation .open-menu .bi,
.main-navigation .close-menu .bi {
    font-size: 32px;
    display: inline-block;
}

.nav-menu {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	column-gap: 1.5rem;
    row-gap: 0;
}

.nav-menu li a {
	display: block;
	padding: 1rem 0;
	text-decoration: none;
	color: var(--color-text, #111);
	font-weight: 700;
    font-size: 1.2em;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a {
	color: var(--color-primary, #0066cc);
}

/* =========================================
   SUBMENU - Desktop (hover)
   ========================================= */

/* 1. Pai precisa de position: relative para o submenu absoluto */
.nav-menu li.menu-item-has-children {
    position: relative;
}
.nav-menu li.menu-item-has-children > a[href="#"] {
    pointer-events: none;
    cursor: default;
}

/* 2. Submenu: escondido, posicionado abaixo do pai */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-bg, #fff);
    min-width: 220px;
    padding: 0.25rem 0;
    border: 1px solid var(--color-border, #e0e0e0);
    border-width: 0 1px 1px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0px 12px 16px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    z-index: 1000;
    margin: 0;
    list-style: none;
}

/* 3. Mostrar no hover do li pai */
.nav-menu li.menu-item-has-children:hover > .sub-menu {
    display: flex;
}

/* 4. Itens do submenu */
.nav-menu .sub-menu li {
    margin: 0;
    width: 100%;
}

.nav-menu .sub-menu a {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text, #111);
    text-decoration: none;
    display: block;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-menu .sub-menu a:hover {
    color: var(--color-primary, #0066cc);
    background: rgba(0,0,0,0.03);
}

/* 5. Indicador sutil de submenu (seta) - opcional */
.nav-menu li.menu-item-has-children > a {
    position: relative;
    padding-right: 1.25rem;
}

.nav-menu li.menu-item-has-children > a::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.nav-menu li.menu-item-has-children:hover > a::after {
    opacity: 1;
}

/* =========================================
   MOBILE: não interferir no JS existente
   ========================================= */
@media (max-width: 960px) {
    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding-left: 1rem;
        background: transparent;
        display: none; /* JS controla a exibição no mobile */
    }
    
    .nav-menu .sub-menu a {
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }
    
    .nav-menu li.menu-item-has-children > a::after {
        display: none;
    }
    
    /* Se quiser submenu aberto por clique no mobile, 
       adicione esta classe via JS ou use um plugin */
    .nav-menu li.menu-item-has-children.submenu-open > .sub-menu {
        display: flex;
    }
}

@media (max-width: 590px) {
    .search-form {
        display: none;
    }
}

@media (max-width: 1100px) {

    .header-content {
        flex-direction: row;
        align-items: center;
    }
    .title-section img {
        width: 80px;
    }
    .header-line1 {
        justify-content: flex-end;
        flex-grow: 4;
        flex-shrink: 0;
        flex-basis: 85%;
    }
    .header-line2 {
        justify-content: flex-end;
        flex-grow: 0;
        flex-shrink: 4;
    }
    .fixed .header-line1 {
        overflow: visible;
    }

    .today-temperature {
        display: none;
    }
    .nav-menu {
        display: none;
    }

    .main-navigation .open-menu {
        display: inline-flex;
    }
    .main-navigation .close-menu {
        display: none;
    }

    .menu-open,
    .fixed .menu-open {
        background-color: var(--color-bg);
    }

    .menu-open .nav-menu {
        display: block;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--color-bg);
	    border-bottom: 1px solid var(--color-border, #e0e0e0);
        padding-bottom: 1rem;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .nav-menu .sub-menu {
        display: block;
    }

    .menu-open .nav-menu li a {
        padding: 0.5rem 1rem;
    }
    .menu-open .open-menu {
        display: none;
    }
    .menu-open .close-menu {
        display: inline-flex;
    }
}