/**
 * Dusty Rose — Theme Toggle Button
 * Кнопка переключения светлой/тёмной темы
 */

.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9999;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--wp--preset--color--accent-primary);
    background: var(--wp--preset--color--bg-secondary);
    color: var(--wp--preset--color--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    opacity: 0.4;
    font-family: var(--wp--preset--font-family--literata);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.theme-toggle:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Скрываем обе иконки по умолчанию */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
    line-height: 1;
}

/* Ручной режим: показываем нужную иконку */
body.dark-mode .theme-toggle .icon-sun { display: inline; }
body.light-mode .theme-toggle .icon-moon { display: inline; }

/* Авто-режим: иконка зависит от системных настроек */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode):not(.dark-mode) .theme-toggle .icon-sun { display: inline; }
}
@media (prefers-color-scheme: light) {
    body:not(.light-mode):not(.dark-mode) .theme-toggle .icon-moon { display: inline; }
}

/* Полупрозрачность при прокрутке */
.theme-toggle.scrolling {
    opacity: 0.2 !important;
}
