/* =========================================================
   MENU PRINCIPAL - MESTRE DE OBRA
   Arquivo único utilizado em todas as páginas
   ========================================================= */

.site-header {
  position: relative;
  z-index: 1000;
  width: 100%;
}

.site-header .header-inner {
  width: 100%;
}

.site-header .header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-left: 20px;
  padding-right: 20px;
}

/* Título das páginas internas */
.site-header .menu-page-title {
  width: 100%;
  margin: 0;
  padding: 0 20px 18px;
  box-sizing: border-box;
}

.site-header .menu-page-title h1 {
  margin: 0 !important;
  color: #ff8c00 !important;
  font-size: 1.8rem;
  line-height: 1.25;
  text-align: left;
}

.site-header .menu-page-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
}

.site-header .menu-page-title-row h1 {
  flex: 1 1 320px;
  min-width: 0;
}

.site-header .header-logo {
  display: block;
  width: auto;
  max-width: 190px;
  height: auto;
  margin-left: clamp(14px, 2vw, 28px);
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: clamp(14px, 2vw, 28px);
}

.site-header .menu-wrapper,
.site-header .favorite-wrapper {
  position: relative;
  z-index: 1010;
}

/* Botão e aviso de favoritos */

.site-header .favorite-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 4px;
  border: 0;
  color: #f2f2f2;
  background: transparent;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.site-header .favorite-button:hover,
.site-header .favorite-button:focus {
  color: #ff8c00;
  background: transparent;
}

.site-header .favorite-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1110;
  width: 300px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #3a4149;
  border-radius: 10px;
  color: #f2f2f2;
  background: #171b20;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  font-size: 0.92rem;
  line-height: 1.4;
}

.site-header .favorite-popover[hidden] {
  display: none !important;
}

.site-header .favorite-popover strong,
.site-header .favorite-popover span {
  display: block;
}

.site-header .favorite-popover strong {
  margin-bottom: 5px;
  color: #ff8c00;
  font-weight: 600;
}

/* Botão sanduíche */

.site-header .menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.site-header .menu-button:hover,
.site-header .menu-button:focus {
  background: transparent;
}

.site-header .menu-icon {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* Menu fechado */

.site-header .menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1100;

  display: none !important;

  min-width: 280px;
  max-width: calc(100vw - 24px);

  /* Impede que o menu ultrapasse a altura da janela */
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overflow-x: hidden;

  padding: 8px 0;

  border: 1px solid #3a4149;
  border-radius: 10px;

  background: #171b20;

  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);

  /* Rolagem suave em celular */
  -webkit-overflow-scrolling: touch;
}

@media (max-height: 700px) {
  .site-header .menu-dropdown {
    max-height: calc(100vh - 90px);
  }

  .site-header .menu-dropdown a {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

/* Menu aberto pelo JavaScript */

.site-header .menu-dropdown.is-open {
  display: block !important;
}

/* Neutraliza regras antigas que abriam o menu apenas com hover */
.site-header .menu-wrapper:hover .menu-dropdown:not(.is-open) {
  display: none !important;
}

/* Lista */

.site-header .menu-dropdown ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header .menu-dropdown li {
  margin: 0;
  padding: 0;
}

/* Links */

.site-header .menu-dropdown a,
.site-header .menu-dropdown a:link,
.site-header .menu-dropdown a:visited {
  display: block;

  padding: 11px 18px;

  color: #f2f2f2;
  background: transparent;

  font-size: 0.96rem;
  line-height: 1.3;

  text-decoration: none !important;

  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.site-header .menu-dropdown a:hover,
.site-header .menu-dropdown a:focus {
  color: #ff8c00;
  background: #222830;

  text-decoration: none !important;
}

.site-header .menu-dropdown li.menu-destaque a,
.site-header .menu-dropdown li.menu-destaque a:link,
.site-header .menu-dropdown li.menu-destaque a:visited {
  color: #ff8c00;
  font-weight: 600;
}

.site-header .menu-dropdown li.menu-destaque a:hover,
.site-header .menu-dropdown li.menu-destaque a:focus {
  color: #ffb347;
}

/* Acessibilidade por teclado */

.site-header .menu-button:focus-visible,
.site-header .favorite-button:focus-visible,
.site-header .menu-dropdown a:focus-visible {
  outline: 2px solid #ff8c00;
  outline-offset: 2px;
}

/* Mobile */

@media (max-width: 620px) {
  .site-header .menu-page-title-row {
    align-items: flex-start;
  }

  .site-header .menu-page-title-row h1 {
    flex-basis: 100%;
  }

  .site-header .header-logo {
    max-width: 165px;
  }

  .site-header .menu-dropdown {
    min-width: min(280px, calc(100vw - 24px));
    right: 0;
  }

  .site-header .menu-dropdown a {
    padding: 12px 16px;
  }

  .site-header .header-actions {
    gap: 2px;
  }

  .site-header .favorite-popover {
    position: fixed;
    top: var(--favorite-mobile-top, 100px);
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    padding-top: 11px;
    padding-bottom: 11px;
  }
}

@media (min-width: 390px) and (max-width: 620px) {
  .site-header .favorite-popover {
    top: calc(var(--favorite-mobile-top, 100px) - 14px);
  }
}

/* =========================================================
   Normalização do cabeçalho
   Evita interferência de base.css e geral.css
   ========================================================= */

.site-header {
  margin: 0 !important;
  padding: 0 !important;
}

.site-header .container {
  width: min(1180px, calc(100% - 32px));
  max-width: none;
  margin: 0 auto !important;
  padding: 0 !important;
}

.site-header .header-inner {
  width: 100%;
  max-width: none;
  margin: 0 !important;
  padding: 0 !important;
}

.site-header .header-top {
  min-height: 92px;
  margin: 0 !important;
  padding: 12px 0 !important;
}

/* =========================================================
   PÁGINAS CURTAS DO FÓRUM
   Garante espaço para exibição integral do menu
   ========================================================= */

body.forum-short-page {
  min-height: max(100vh, 900px);
}

body.forum-short-page .site-header .menu-dropdown {
  max-height: none;
  overflow-y: visible;
  overflow-x: visible;
}

/* =========================================================
   HIERARQUIA VISUAL DO MENU
   ========================================================= */

/* Subitens específicos do Fórum */
.site-header .menu-dropdown li.menu-subitem a {
  position: relative;
  padding-left: 34px;
  color: rgba(242, 242, 242, 0.72);
  font-size: 0.91rem;
}

/* Bullet discreto */
.site-header .menu-dropdown li.menu-subitem a::before {
  content: "•";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 140, 0, 0.55);
  font-size: 0.9rem;
}

/* Hover dos subitens */
.site-header .menu-dropdown li.menu-subitem a:hover,
.site-header .menu-dropdown li.menu-subitem a:focus {
  color: #ffb347;
  background: rgba(255, 255, 255, 0.045);
}

/* Links institucionais */
.site-header .menu-dropdown li.menu-institucional a {
  color: rgba(242, 242, 242, 0.58);
  font-size: 0.9rem;
}

/* Hover institucional */
.site-header .menu-dropdown li.menu-institucional a:hover,
.site-header .menu-dropdown li.menu-institucional a:focus {
  color: rgba(255, 200, 117, 0.9);
  background: rgba(255, 255, 255, 0.035);
}

/* Separação visual antes da área institucional */
.site-header .menu-dropdown li.menu-institucional-inicio {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
