:root {
  --toggle-gold: #E0A96D;
  --toggle-gold-light: #C8894D;
  --toggle-border: #2a2a2a;
  --toggle-border-light: #E6D9CC;
}

.theme-toggle {
  border: 1px solid var(--toggle-border);
  color: var(--toggle-gold);
  background: transparent;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
  position: relative;
}
.theme-toggle:active { transform: translateY(1px); }
.site-header-section .theme-toggle { margin-left: 12px; }

/* Стили для кнопки переключения темы в мобильном меню */
.ast-mobile-menu-theme-toggle {
  padding: 16px 20px;
  border-top: 1px solid rgba(224,169,109,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
html[data-theme="light"] .ast-mobile-menu-theme-toggle {
  border-top-color: rgba(200,137,77,0.2);
}
.ast-mobile-menu-theme-toggle .theme-toggle {
  margin: 0;
  width: 48px;
  height: 48px;
}

.theme-toggle__icon {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.theme-toggle__icon svg { display: block; }

.theme-toggle__icon--sun { opacity: 1; transform: scale(1); }
html[data-theme="light"] .theme-toggle__icon--sun { opacity: 0; transform: scale(0.9); }
html[data-theme="light"] .theme-toggle__icon--moon { opacity: 1; transform: scale(1); }

html[data-theme="light"] .theme-toggle {
  color: var(--toggle-gold-light);
  border-color: var(--toggle-border-light);
  background: #ffffffb3;
}

/* Light theme background overrides */
html[data-theme="light"] {
  background:
    radial-gradient(ellipse 800px 100% at left center, rgba(200,137,77,0.12), transparent 70%),
    radial-gradient(ellipse 800px 100% at right center, rgba(200,137,77,0.12), transparent 70%),
    radial-gradient(900px 500px at 15% 0%, rgba(200,137,77,0.22), transparent 60%),
    radial-gradient(700px 400px at 85% 10%, rgba(200,137,77,0.18), transparent 55%),
    radial-gradient(600px 300px at 50% 100%, rgba(200,137,77,0.12), transparent 60%),
    linear-gradient(180deg, #F8F4EF 0%, #F2ECE5 45%, #F8F4EF 100%);
}
html[data-theme="light"] body::before { opacity: 0.32; }

html[data-theme="light"] .ast-primary-header-bar,
html[data-theme="light"] .site-below-footer-wrap[data-section="section-below-footer-builder"] {
  background-color: #ffffff2b !important;
}

html[data-theme="light"] .ast-primary-header-bar {
  border-bottom-color: #E6D9CC;
}

html[data-theme="light"] .site-below-footer-wrap[data-section="section-below-footer-builder"] {
  border-top-color: #E6D9CC;
}

html[data-theme="light"] .ast-separate-container .ast-article-single:not(.ast-related-post),
html[data-theme="light"] .ast-separate-container .error-404,
html[data-theme="light"] .ast-separate-container .no-results,
html[data-theme="light"] .single.ast-separate-container .site-main .ast-author-meta,
html[data-theme="light"] .ast-separate-container .related-posts-title-wrapper,
html[data-theme="light"] .ast-separate-container .comments-count-wrapper,
html[data-theme="light"] .ast-box-layout.ast-plain-container .site-content,
html[data-theme="light"] .ast-padded-layout.ast-plain-container .site-content,
html[data-theme="light"] .ast-separate-container .ast-archive-description,
html[data-theme="light"] .ast-separate-container .comments-area {
  background-color: #ffffffb3 !important;
}

html[data-theme="light"] .ast-separate-container .ast-article-inner {
  background-color: #0f0f100d;
}

html[data-theme="light"] .intro__title,
html[data-theme="light"] .intro__subtitle,
html[data-theme="light"] .intro__cta-text {
  color: #1A1512;
}

html[data-theme="light"] .intro .categories-scroll-wrapper::before {
  background: linear-gradient(to right, #F8F4EF, transparent);
}
html[data-theme="light"] .intro .categories-scroll-wrapper::after {
  background: linear-gradient(to left, #F8F4EF, transparent);
}

html[data-theme="light"] .intro .hero-card {
  background-image: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(0,0,0,0.1)), var(--image);
  color: rgba(255,255,255,0.95);
  box-shadow: inset 0 0 0 1px rgba(200,137,77,0.25);
}

/* Dark text for light theme */
html[data-theme="light"] body,
html[data-theme="light"] .site-title a,
html[data-theme="light"] .site-description,
html[data-theme="light"] .main-header-menu a,
html[data-theme="light"] .ast-primary-header-bar a,
html[data-theme="light"] .ast-footer-menu a,
html[data-theme="light"] .site-footer,
html[data-theme="light"] .entry-title,
html[data-theme="light"] .entry-title a,
html[data-theme="light"] .entry-content,
html[data-theme="light"] .entry-summary,
html[data-theme="light"] .ast-meta,
html[data-theme="light"] .ast-archive-description,
html[data-theme="light"] .menu-link {
  color: #1A1512;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6,
html[data-theme="light"] .entry-content :where(h1,h2,h3,h4,h5,h6) {
  color: #1A1512;
}

html[data-theme="light"] a:hover { color: #7a4f2a; }

/* Стили для мобильного меню в зависимости от темы */
/* Темная тема (по умолчанию) */
.ast-mobile-header-wrap .ast-mobile-header-content,
.ast-desktop-header-content {
  background-color: #151412f7;
}
.ast-mobile-header-content {
  background-color: rgba(11, 12, 14, 0.95);
  color: #ededed;
}
.ast-mobile-header-content a,
.ast-mobile-header-content .main-header-menu a,
.ast-mobile-header-content .menu-link {
  color: #ededed;
}
.ast-mobile-header-content a:hover,
.ast-mobile-header-content .main-header-menu a:hover,
.ast-mobile-header-content .menu-link:hover {
  color: #E0A96D;
}

/* Светлая тема */
html[data-theme="light"] .ast-mobile-header-content {
  background-color: rgb(243 236 229 / 95%) !important;
  color: #1A1512 !important;
}
html[data-theme="light"] .ast-mobile-header-content a:hover,
html[data-theme="light"] .ast-mobile-header-content .main-header-menu a:hover,
html[data-theme="light"] .ast-mobile-header-content .main-header-menu li a:hover,
html[data-theme="light"] .ast-mobile-header-content .ast-nav-menu a:hover,
html[data-theme="light"] .ast-mobile-header-content .menu-link:hover {
  color: #7a4f2a !important;
}
/* Стили для подменю в светлой теме */
html[data-theme="light"] .ast-mobile-header-content .sub-menu a,
html[data-theme="light"] .ast-mobile-header-content .main-header-menu .sub-menu a {
  color: #1A1512 !important;
}
html[data-theme="light"] .ast-mobile-header-content .sub-menu a:hover,
html[data-theme="light"] .ast-mobile-header-content .main-header-menu .sub-menu a:hover {
  color: #7a4f2a !important;
}
/* Стили для кнопок меню (toggle buttons) в светлой теме */
html[data-theme="light"] .ast-mobile-header-content button,
html[data-theme="light"] .ast-mobile-header-content .ast-menu-toggle,
html[data-theme="light"] .ast-mobile-header-content button[aria-expanded],
html[data-theme="light"] .ast-mobile-header-content .main-header-menu button,
html[data-theme="light"] .ast-mobile-header-content .ast-nav-menu button {
  color: #1A1512 !important;
  background-color: transparent !important;
  border-color: rgba(200, 137, 77, 0.3) !important;
}
html[data-theme="light"] .ast-mobile-header-content button:hover,
html[data-theme="light"] .ast-mobile-header-content .ast-menu-toggle:hover,
html[data-theme="light"] .ast-mobile-header-content button[aria-expanded]:hover,
html[data-theme="light"] .ast-mobile-header-content .main-header-menu button:hover,
html[data-theme="light"] .ast-mobile-header-content .ast-nav-menu button:hover {
  color: #7a4f2a !important;
  border-color: rgba(200, 137, 77, 0.5) !important;
}
/* SVG иконки в кнопках меню */
html[data-theme="light"] .ast-mobile-header-content button svg,
html[data-theme="light"] .ast-mobile-header-content .ast-menu-toggle svg,
html[data-theme="light"] .ast-mobile-header-content button[aria-expanded] svg {
  fill: #1A1512 !important;
  stroke: #1A1512 !important;
}
html[data-theme="light"] .ast-mobile-header-content button:hover svg,
html[data-theme="light"] .ast-mobile-header-content .ast-menu-toggle:hover svg {
  fill: #7a4f2a !important;
  stroke: #7a4f2a !important;
}
