/* ——— ОБЁРТКА МЕНЮ ——— */
.top_menu_wrapper {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%;
  padding: 10px 0;
  box-sizing: border-box;
  z-index: 100;
  background: linear-gradient(to bottom, #8D6E63, #A1887F);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.8s ease 0.3s;
  transition:
    transform 0.5s ease,
    opacity   0.5s ease,
    background 0.5s ease;
}

.top_menu_wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.top_menu_wrapper.scroll-hidden {
  opacity: 0;
  transform: translateY(-100%);
}

/* ——— БЛОК МЕНЮ ——— */
.top_menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* ——— КНОПКИ МЕНЮ ——— */
.menu_button {
  position: relative;
  background: none;
  border: none;
  padding: 8px 15px;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  cursor: none;
  color: #FFF8E1;
  opacity: 0;
  transform: translateY(20px);
  transition:
    transform 0.4s ease,
    opacity   0.4s ease,
    color     0.3s ease;
  margin-right: 0;
}

.menu-buttons-group {
  display: flex;
  gap: 10px; /* Расстояние между кнопками "Главная" и "Блог" */
}

.top_menu_wrapper.visible .menu_button {
  opacity: 1;
  transform: translateY(0);
}

.menu_button::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background-color: #ffffff;
  transition: 
    left 0.3s ease,
    right 0.3s ease;
}

.menu_button:hover::before {
  left: 0;
  right: 0;
}

.menu_button:hover {
  transform: translateY(-2px) scale(1.05);
  color: #FFF;
}

/* ——— СМЕНА ТЕМЫ САЙТА ——— */
.theme-toggle-container {
    position: relative;
    margin-left: auto;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Иконки темы */
.theme-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: opacity 0.3s ease, transform 0.5s ease;
    position: absolute;
    left: 0;
}

.sun-icon, .moon-icon, .auto-icon {
    opacity: 0;
}

/* Светлая тема */
[data-theme="light"] .sun-icon {
    opacity: 1;
    fill: #8D6E63;
    transform: rotate(0deg);
}

/* Темная тема */
[data-theme="dark"] .moon-icon {
    opacity: 1;
    fill: #D7A16B;
    transform: rotate(0deg);
}

/* Автоматическая тема */
[data-theme="auto"] .auto-icon {
    opacity: 1;
    fill: #A1887F;
    animation: pulse 2s infinite;
}

.theme-toggle {
    position: relative;
    padding-left: 28px;
}

.theme-toggle svg {
    pointer-events: none;
}

/* Анимация для автоматической темы */
[data-theme="auto"] .theme-icon {
    fill: #A1887F;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}
 

/* ——— АДАПТАЦИЯ ——— */
@media (max-width: 768px) {
  .top_menu_wrapper {
    padding: 8px 0;
  }
  
  .top_menu {
    gap: 10px;
    padding: 0 10px;
  }
  
  .menu_button {
    font-size: 0.9rem;
    padding: 6px 10px;
  }

  .theme-toggle {
    padding: 6px 10px;
  }
}

@media (min-width: 1200px) {
  .top_menu_wrapper {
    padding: 15px 0;
  }
  
  .menu_button {
    font-size: 1.1rem;
    padding: 10px 20px;
  }
}