/* =========================================
   Header
   ========================================= */

.site-header {
  border-bottom: 1px solid var(--color-border-secondary);
}

.top-bar {
  background-color: var(--color-accent);
  padding: 4px;
}

.top-bar .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

#current-datetime {
  justify-self: start;

  color: #111111;
  font-size: 1.4rem;
}

.top-bar__slogan {
  justify-self: center;
  text-align: center;

  color: #111111;
  font-size: 1.4rem;
}

.theme-toggle {
  justify-self: end;
}

/* Toggle wrapper */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-self: end;
}

/* Toggle container */
.theme-toggle {
  position: relative;
  width: 57px;
  height: 24px;
  border-radius: 20px;
  background-color: var(--color-ui-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  padding: 0 5px;
  box-sizing: border-box;
}

/* Ícones dentro do toggle */
.toggle-icon {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toggle-icon.sun {
  left: 5px;
}

.toggle-icon.moon {
  right: 5px;
}

/* Botão do toggle */
.toggle-button {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 18px;
  border-radius: 50px;
  background-color: var(--color-accent);
  transition: left 0.3s ease;
  z-index: 2;
}

/* Estado dark ativo */
body[data-theme="dark"] .theme-toggle {
  background-color: var(--color-bg);
  /* Borda branca para o toggle não sumir no fundo escuro */
  box-shadow: inset 0 0 0 1px #ffffff;
}

body[data-theme="dark"] .toggle-button {
  left: 24px; /* move o botão para direita */
}

body[data-theme="dark"] .toggle-icon.moon {
  opacity: 0; /* esconde a lua */
}

body[data-theme="dark"] .toggle-icon.sun {
  opacity: 1; /* mostra o sol */
}

body[data-theme="light"] .toggle-icon.sun {
  opacity: 0; /* esconde o sol no modo light */
}

body[data-theme="light"] .toggle-icon.moon {
  opacity: 1; /* mostra a lua no modo light */
}

.menu-container {
  max-width: 1280px;
  padding: 1.4rem 2.4rem;
  margin: 0 auto;

  display: flex;
  align-items: center;
  gap: 2rem;
}

.menu-bars img {
  width: 25px;
  cursor: pointer;
}

/* Overlay side-bar*/
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

/* Quando ativo */
.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  width: 85%;
  max-width: 360px;
  height: 100vh; /* altura da tela (navegadores antigos) */
  height: 100dvh; /* altura visível real, inclusive no celular */
  bottom: 0;
  overflow-y: auto;
  background: var(--color-bg);
  position: fixed;
  top: 0;
  left: -100%;
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: 0.3s ease;
  padding: 20px;
}

.side-menu.active {
  left: 0;
}

.side-menu::-webkit-scrollbar {
  width: 6px;
}

.side-menu::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

/* Header */
.side-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;

  border-bottom: solid 1px var(--color-border-login);
  padding: 20px 0;
  margin-bottom: 12px;
}

.login-link {
  position: relative;
  padding-bottom: 3px;

  text-decoration: none;
  color: var(--color-title);
  font-size: 1.4rem;
  font-weight: 500;
}

/* linha animada */
.login-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;

  width: 0;
  height: 2px;
  background-color: var(--color-title);

  transition: width 0.25s ease;
}

.login-link:hover::after {
  width: 100%;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;

  text-decoration: none;
  color: var(--color-title);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
}

.user-info img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
}

.user-info span {
  white-space: nowrap;
}

.close-menu {
  width: 16px;
  cursor: pointer;

  margin-bottom: 0;
  margin-left: auto;
}

/* Menu dropdown */
.menu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* fundo no hover (como nas sugestões da busca) sem deslocar o texto */
  width: calc(100% + 20px);
  margin: 0 -10px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
  text-align: left;
  padding: 12px 10px;
  color: var(--color-title);
  font-family: var(--font-title);
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* seta dos grupos: a mesma seta fina do item Jogos */
.menu-toggle .angle-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-toggle:hover {
  background-color: rgba(127, 127, 127, 0.12);
}

/* Jogos: item próprio na sidebar, com o mesmo hover dos títulos dos grupos */
.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% + 20px);
  margin: 0 -10px;
  padding: 12px 10px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-title);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.menu-link span {
  font-weight: inherit;
}

.menu-link__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-link:hover {
  background-color: rgba(127, 127, 127, 0.12);
}

/* Revista Severina: item em destaque, abre em nova aba */
.menu-external {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% + 20px);
  margin: 0 -10px;
  padding: 12px 10px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-title);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* o tema define "span { font-weight: 500 }"; aqui o texto herda o 600 do item */
.menu-external span {
  font-weight: inherit;
}

.menu-external__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* mesmo visual nos dois temas */
.menu-external:hover,
.menu-external:focus-visible {
  color: #ffffff;
  background-color: #ba8138;
}

.angle-icon {
  transition: transform 0.3s ease;
}

.menu-group.active .angle-icon {
  transform: rotate(180deg);
}

/* Submenu */
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: 0.3s ease;
}

.menu-group.active .submenu {
  max-height: 1000px;
}

.submenu-list {
  list-style: none;
  padding-left: 10px;
  font-size: 1.4rem;
  color: var(--color-text);
}

.submenu-list li {
  margin: 10px 0;
}

/* Links dos dropdowns: a linha inteira é clicável; o sublinhado animado
   (o mesmo das categorias do header) acompanha só o texto */
.submenu-list a {
  display: block;
  text-decoration: none;
  color: var(--color-text);
}

.submenu-list .link-text {
  position: relative;
  font-weight: inherit; /* o tema define "span { font-weight: 500 }" */
  padding-bottom: 3px;
}

.submenu-list .link-text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-title);
  transition: width 0.25s ease;
}

.submenu-list a:hover .link-text::after,
.submenu-list a:focus-visible .link-text::after {
  width: 100%;
}

/* Tema claro / escuro */
.side-menu-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  margin-top: 1.2rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--color-border-login);
  border-bottom: 1px solid var(--color-border-login);
}

.side-menu-theme__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.side-menu-theme__label {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-title);
}

.side-menu-theme__hint {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-text);
}

.side-menu-theme .theme-toggle {
  flex-shrink: 0;
}

/* Social */
.side-menu-social {
  margin-top: 30px;
  color: var(--color-title);
}

/* Títulos da sidebar com o mesmo tamanho e peso:
   grupos de menu (Recentes, Brasil, Editorial, Institucional), Tema e redes sociais */
.menu-toggle,
.side-menu-theme__label,
.side-menu-social > p {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-title);
}

.side-menu-social > p {
  margin: 0;
}

.social-icons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Mesmo estilo dos ícones de compartilhar da página de post:
   caixa de 34px, ícone de 18px, borda 1px, cantos de 6px */
.social-icon {
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  padding: 7px; /* (34 - 2 de borda - 18 do ícone) / 2 */
  object-fit: contain;
  border: 1px solid var(--color-border-secondary);
  border-radius: 6px;

  cursor: pointer;

  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icon:hover {
  transform: scale(1.05);
}

/* Footer */
.side-menu-footer {
  margin-top: auto; /* fica sempre no pé da barra lateral */
  padding-top: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;

  font-size: 1.2rem;
  color: var(--color-text);
  font-weight: 400;
  opacity: 0.6;
}

/* Menu Principal */
.logo-container img {
  width: 179px;
  cursor: pointer;
  margin-bottom: -5px;
}

.container-categorias {
  flex: 1;
}

.menu-categorias {
  display: flex;
  gap: 1.6rem;

  list-style: none;
  margin: 0;
  padding: 0;

  color: var(--color-title);
  font-size: 1.4rem;
}

.menu-categorias a {
  position: relative;
  padding-bottom: 3px;
  text-decoration: none;
  color: var(--color-text);
}

.menu-categorias a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;

  width: 0;
  height: 2px;
  background-color: var(--color-title);

  transition: width 0.25s ease;
}

.menu-categorias a:hover::after {
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-toggle {
  display: flex;
  align-items: center;
  padding: 0;
}

#buscar-icon {
  width: 25px;
}

#buscar-icon:hover {
  cursor: pointer;
}

.login-buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  position: relative;
}

#btn-assinar {
  margin-left: 16px;
}

#user-btn,
.side-menu-login {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  font-weight: 500;
}

.btn-icon {
  width: 14px;
  margin-bottom: -5px;
}

#user-icon-mobile {
  display: none;
}

.user-icon-mobile-link {
  display: flex;
  align-items: center;
}

.menu-bars,
.logo-container,
.search-container,
.login-buttons-container {
  display: flex;
  align-items: center;
}

/* usuário logado (desktop) */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;

  text-decoration: none;
  color: var(--color-title);
  font-size: 1.4rem;
  font-weight: 500;
}

.header-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
}

/* mobile (só avatar) */
.header-user-mobile {
  display: none;
}

.header-user-mobile img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* barra quando usuário está logado */
.login-buttons-container.is-logged {
  position: relative;
  padding-left: 14px;
  margin-left: 10px;
}

.login-buttons-container.is-logged::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);

  width: 1px;
  height: 18px;
  background-color: var(--color-border-secondary);
}

/* =========================================
   BUSCA (painel da direita — espelho do menu lateral)
   ========================================= */

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-panel {
  width: 85%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: var(--color-bg);
  position: fixed;
  top: 0;
  bottom: 0;
  right: -100%;
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: 0.3s ease;
  padding: 20px;
}

.search-panel.active {
  right: 0;
}

.search-panel::-webkit-scrollbar {
  width: 6px;
}

.search-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.search-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: solid 1px var(--color-border-login);
  padding: 20px 0;
  margin-bottom: 20px;
}

.search-panel-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-title);
}

.close-search {
  width: 16px;
  margin-left: auto;
  cursor: pointer;
}

/* Campo com sugestão "fantasma" para completar */

.search-field {
  position: relative;
  border: 1px solid var(--color-border-secondary);
  border-radius: 8px;
  background: var(--color-bg);
  transition: border-color 0.2s ease;
}

.search-field:focus-within {
  border-color: var(--color-title);
}

.search-input,
.search-ghost {
  width: 100%;
  padding: 1.2rem 1.4rem;
  font-family: var(--font-text);
  font-size: 1.6rem;
  line-height: 1.4;
  letter-spacing: normal;
}

.search-input {
  position: relative;
  z-index: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-title);
  -webkit-appearance: none;
  appearance: none;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-input::placeholder {
  color: var(--color-text);
  opacity: 0.7;
}

.search-ghost {
  position: absolute;
  inset: 0;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
}

.search-ghost__typed {
  color: transparent;
}

.search-ghost__rest {
  color: var(--color-text);
  opacity: 0.45;
}

.search-hint {
  margin-top: 0.8rem;
  font-size: 1.2rem;
  color: var(--color-text);
}

/* Resultados */

.search-panel__results {
  margin-top: 1.6rem;
  transition: opacity 0.2s ease;
}

.search-panel.is-loading .search-panel__results {
  opacity: 0.5;
}

.search-group {
  margin-bottom: 1.6rem;
}

.search-group__label {
  margin-bottom: 0.6rem;
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.8rem;
  margin: 0 -0.8rem;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.search-result:hover,
.search-result.is-active {
  background-color: rgba(127, 127, 127, 0.12);
}

.search-result__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--color-border-login);
}

.search-result--author .search-result__thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.search-result__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.search-result__title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-title);
}

.search-result__title mark {
  background: none;
  color: inherit;
  box-shadow: inset 0 -0.45em 0 var(--color-accent);
}

.search-result__meta {
  font-family: var(--font-text);
  font-size: 1.2rem;
  color: var(--color-text);
}

.search-empty {
  font-size: 1.4rem;
  color: var(--color-text);
}

.search-all {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-title);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================
   MOBILE / TABLET
   ========================================= */

@media (max-width: 768px) {
  .top-bar .container {
    grid-template-columns: 1fr auto 1fr;
  }

  #current-datetime {
    display: none;
  }

  .top-bar__slogan {
    grid-column: 2;
    justify-self: center;
    font-size: 1.1rem;
  }


  .menu-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.6rem;
    position: relative;
  }

  .container-categorias,
  .login-buttons-container .btn-outline,
  .login-buttons-container .btn-solid {
    display: none;
  }

  .logo-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .logo-container img {
    width: 170px;
  }

  /* Container direito */
  .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* busca */
  #buscar-icon {
    width: 25px;
    display: block;
    margin-right: 0;
  }

  /* container do user (mobile) */
  .login-buttons-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 12px; /* espaço para a barra */
  }

  /* barra ENTRE busca e user */
  .login-buttons-container::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 18px;
    background-color: var(--color-border-secondary);
  }

  /* barra quando usuário está logado */
  .login-buttons-container.is-logged {
    margin-left: -5px;
  }

  /* ícone do user mobile */
  #user-icon-mobile {
    display: block;
    width: 20px;
    margin-bottom: -5px;
  }

  #user-btn {
    display: none;
  }

  .header-user {
    display: none;
  }

  .header-user-mobile {
    display: flex;
    align-items: center;
    margin-left: -2px;
  }
}

/* Aviso rápido (ex.: conta excluída) */
.account-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10000;
  max-width: calc(100vw - 40px);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1.4rem;
  color: #ffffff;
  background-color: #111111;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  animation: account-toast 6s ease forwards;
  pointer-events: none;
}

.account-toast strong {
  color: var(--color-accent);
}

@keyframes account-toast {
  0%, 85% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* ---------- contador de notificações sobre a foto ---------- */

.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.avatar-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--color-bg);
  border-radius: 999px;
  box-sizing: border-box;
  background-color: #e0393e;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  animation: avatar-badge-pop 0.35s ease-out;
}

@keyframes avatar-badge-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-badge {
    animation: none;
  }
}

