/* --- Кнопка включения (Фиксированная) --- */
#svi-toggle-fixed {
    position: fixed;
    top: 20px;
    left: 20px; /* Слева, чтобы не мешать админ-бару, если он есть */
    z-index: 999999;
    width: 50px;
    height: 50px;
    background-color: #0073aa;
    color: #fff;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

#svi-toggle-fixed:hover {
    transform: scale(1.1);
    background-color: #005177;
}

#svi-toggle-fixed .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

/* --- Кнопка включения (Инлайн - шорткод) --- */
.svi-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
    line-height: 1.2;
    text-decoration: none;
}

.svi-btn-inline:hover {
    background-color: #005177;
    color: #fff;
}

.svi-btn-inline .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Скрываем кнопки открытия, когда панель активна */
body.svi-active #svi-toggle-fixed,
body.svi-active .svi-btn-inline {
    display: none !important;
}

/* --- Панель настроек --- */
#svi-panel {
    display: none; /* Скрыта по умолчанию */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #f1f1f1;
    border-bottom: 2px solid #ccc;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1000000;
    padding: 15px 0;
    font-family: Arial, sans-serif;
}

body.svi-active #svi-panel {
    display: block;
}

.svi-panel-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.svi-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.svi-label {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.svi-btn {
    padding: 8px 15px;
    font-size: 16px;
    cursor: pointer;
    border: 2px solid #333;
    background: #fff;
    color: #333;
    font-weight: bold;
    transition: all 0.2s;
}

.svi-btn:hover, .svi-btn.active {
    background: #333;
    color: #fff;
}

#svi-close-btn {
    background: #d63638;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
}

#svi-close-btn:hover {
    background: #a02022;
}


/* ========================================= */
/* === РЕЖИМ ДЛЯ СЛАБОВИДЯЩИХ (CSS Mode) === */
/* ========================================= */

body.svi-active {
    padding-top: 80px !important; /* Отступ под панель */
}

/* 1. Шрифты и читабельность - применяем к body и текстовым блокам */
body.svi-active {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.5px !important;
}
/* Не трогаем иконки, чтобы не ломались */
body.svi-active *:not(.dashicons):not([class*="icon"]):not(i):not(svg):not(path) {
    font-family: inherit !important; 
}

/* 2. Размер шрифта */

/* Увеличенный (Large) */
body.svi-active.svi-size-large {
    font-size: 110% !important; /* Уменьшил базовый скейл, чтобы не рвало верстку */
}
/* Применяем размер точечно к контенту, а не ко всему подряд */
body.svi-active.svi-size-large .wp-site-blocks *, 
body.svi-active.svi-size-large p, 
body.svi-active.svi-size-large li,
body.svi-active.svi-size-large a {
    font-size: 1.1em !important; 
    line-height: 1.6 !important;
}
body.svi-active.svi-size-large h1 { font-size: 2em !important; }
body.svi-active.svi-size-large h2 { font-size: 1.5em !important; }


/* Экстра (Extra) */
body.svi-active.svi-size-extra {
    font-size: 125% !important;
}
body.svi-active.svi-size-extra .wp-site-blocks *,
body.svi-active.svi-size-extra p,
body.svi-active.svi-size-extra li,
body.svi-active.svi-size-extra a {
    font-size: 1.3em !important;
    line-height: 1.8 !important;
    font-weight: bold !important;
}

/* Фикс для FSE (Twenty Twenty-Four) тем */
body.svi-active .wp-site-blocks {
    background: inherit !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    display: block !important; /* Часто grid/flex ломаются при зуме */
}


/* 3. Цветовая схема: Черный на Белом (просто сбрасываем всё цветное) */
body.svi-active.svi-theme-white {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
}
/* Красим только текстовые и блочные элементы внутри контента */
body.svi-active.svi-theme-white .wp-site-blocks,
body.svi-active.svi-theme-white .site-main,
body.svi-active.svi-theme-white article,
body.svi-active.svi-theme-white p,
body.svi-active.svi-theme-white div:not(.svi-panel-inner),
body.svi-active.svi-theme-white span:not(.dashicons),
body.svi-active.svi-theme-white li,
body.svi-active.svi-theme-white h1, 
body.svi-active.svi-theme-white h2, 
body.svi-active.svi-theme-white h3 {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border-color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Ссылки */
body.svi-active.svi-theme-white a,
body.svi-active.svi-theme-white a * {
    color: #000055 !important; /* Темно-синий для ссылок, чтобы отличались */
    text-decoration: underline !important;
}


/* 4. Цветовая схема: Белый на Черном (Контраст) */
body.svi-active.svi-theme-black {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
}

body.svi-active.svi-theme-black *:not(.svi-btn):not(#svi-toggle-btn):not(.svi-panel-inner *):not(script):not(style) {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
    text-shadow: none !important;
    fill: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.svi-active.svi-theme-black #svi-panel {
    background: #333 !important;
    border-bottom: 2px solid #fff;
}
body.svi-active.svi-theme-black .svi-label {
    color: #fff !important;
}
body.svi-active.svi-theme-black a {
    color: #ffff00 !important; /* Желтые ссылки для контраста */
    text-decoration: underline !important;
}


/* 5. Управление изображениями */
body.svi-active.svi-img-hide img:not(.dashicons) {
    display: none !important;
}
body.svi-active.svi-img-hide svg:not(.dashicons) {
    display: none !important;
}
/* Делаем картинки черно-белыми в обычной теме */
body.svi-active.svi-theme-black img {
    filter: grayscale(100%) invert(100%);
}
body.svi-active.svi-theme-white img {
    filter: grayscale(100%);
}


/* Убираем лишнее, что может мешать (слайдеры, фоновые картинки блоков) */
body.svi-active .slider, body.svi-active .revolution-slider, body.svi-active .hero-section {
    background-image: none !important;
}

/* --- ���� ��������� --- */

/* ������ (Letter Spacing) */
body.svi-active.svi-spacing-normal { letter-spacing: normal !important; }
body.svi-active.svi-spacing-medium { letter-spacing: 2px !important; }
body.svi-active.svi-spacing-big { letter-spacing: 4px !important; }

/* �����: �����-����� �� ������� (Comfort) */
body.svi-active.svi-theme-blue {
    background-color: #9DD1FF !important;
    background-image: none !important;
    color: #063462 !important;
}
body.svi-active.svi-theme-blue .wp-site-blocks,
body.svi-active.svi-theme-blue .site-main,
body.svi-active.svi-theme-blue article,
body.svi-active.svi-theme-blue p,
body.svi-active.svi-theme-blue div:not(.svi-panel-inner),
body.svi-active.svi-theme-blue span:not(.dashicons),
body.svi-active.svi-theme-blue li,
body.svi-active.svi-theme-blue h1,
body.svi-active.svi-theme-blue h2,
body.svi-active.svi-theme-blue h3 {
    background-color: #9DD1FF !important;
    background-image: none !important;
    color: #063462 !important;
    border-color: #063462 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
body.svi-active.svi-theme-blue a {
    color: #000000 !important;
    text-decoration: underline !important;
}
body.svi-active.svi-theme-blue #svi-panel {
    background: #9DD1FF !important;
    border-bottom: 2px solid #063462;
}


/* �����: ��������� �� ������� (Sepia) */
body.svi-active.svi-theme-beige {
    background-color: #F7F3D6 !important;
    background-image: none !important;
    color: #4D4B43 !important;
}
body.svi-active.svi-theme-beige .wp-site-blocks,
body.svi-active.svi-theme-beige .site-main,
body.svi-active.svi-theme-beige article,
body.svi-active.svi-theme-beige p,
body.svi-active.svi-theme-beige div:not(.svi-panel-inner),
body.svi-active.svi-theme-beige span:not(.dashicons),
body.svi-active.svi-theme-beige li,
body.svi-active.svi-theme-beige h1,
body.svi-active.svi-theme-beige h2,
body.svi-active.svi-theme-beige h3 {
    background-color: #F7F3D6 !important;
    background-image: none !important;
    color: #4D4B43 !important;
    border-color: #4D4B43 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
body.svi-active.svi-theme-beige a {
    color: #8B4513 !important;
    text-decoration: underline !important;
}
body.svi-active.svi-theme-beige #svi-panel {
    background: #F7F3D6 !important;
    border-bottom: 2px solid #4D4B43;
}


/* ��������� ������ ��� ���������� � ���� */
.svi-img-btn[data-img='hide'].active {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}
.svi-voice-btn.active {
    background: #00a32a; /* ������ ��� ��������� */
    color: #fff;
    border-color: #00a32a;
}

