/* ==========================================================================
   СТРАНИЦА РЕКЛАМЫ - СТИЛИ
   Версия: 3.1
   ========================================================================== */

/* БАЗОВЫЕ СТИЛИ */
.page-template-page-reklama .site-main,
.page-slug-reklama .site-main {
    padding: 60px 0;
    background: #fdfdf9;
}

.reklama-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Типография */
.reklama-content h1,
.reklama-content h2,
.reklama-content h3,
.reklama-content h4,
.reklama-content h5,
.reklama-content h6 {
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.reklama-content h1 { 
    font-size: 2.5rem; 
    color: #ff6600;
}

.reklama-content h2 { 
    font-size: 2rem; 
}

.reklama-content h3 { 
    font-size: 1.5rem; 
}

.reklama-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Таблицы */
.reklama-content table {
    width: 100%;
    margin: 30px 0;
    border-collapse: collapse;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.reklama-content th,
.reklama-content td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e8e5d5;
}

.reklama-content th {
    font-weight: 600;
    background: #f9f8f4;
    color: #2d2d2d;
}

.reklama-content tr:hover td {
    background: #fdfdf9;
}

/* ==========================================================================
   ТЕМНАЯ ТЕМА
   ========================================================================== */

/* Основные стили для темной темы */
body.dark-theme .page-template-page-reklama .site-main,
body.dark-theme .page-slug-reklama .site-main,
body.reklama-dark-active .page-template-page-reklama .site-main,
body.reklama-dark-active .page-slug-reklama .site-main,
html[style*="filter: invert"] .page-template-page-reklama .site-main,
html[style*="filter: invert"] .page-slug-reklama .site-main {
    background: #0f1419 !important;
}

body.dark-theme .reklama-content,
body.reklama-dark-active .reklama-content,
html[style*="filter: invert"] .reklama-content {
    background: #1a2027 !important;
    color: #e7e9ea !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Текст в темной теме */
body.dark-theme .reklama-content *,
body.reklama-dark-active .reklama-content *,
html[style*="filter: invert"] .reklama-content * {
    color: #e7e9ea !important;
}

/* Заголовки */
body.dark-theme .reklama-content h1,
body.dark-theme .reklama-content h2,
body.dark-theme .reklama-content h3,
body.dark-theme .reklama-content h4,
body.dark-theme .reklama-content h5,
body.dark-theme .reklama-content h6,
body.reklama-dark-active .reklama-content h1,
body.reklama-dark-active .reklama-content h2,
body.reklama-dark-active .reklama-content h3,
body.reklama-dark-active .reklama-content h4,
body.reklama-dark-active .reklama-content h5,
body.reklama-dark-active .reklama-content h6,
html[style*="filter: invert"] .reklama-content h1,
html[style*="filter: invert"] .reklama-content h2,
html[style*="filter: invert"] .reklama-content h3,
html[style*="filter: invert"] .reklama-content h4,
html[style*="filter: invert"] .reklama-content h5,
html[style*="filter: invert"] .reklama-content h6 {
    color: #ffffff !important;
}

/* Сохраняем оранжевый для h1 */
body.dark-theme .reklama-content h1,
body.reklama-dark-active .reklama-content h1,
html[style*="filter: invert"] .reklama-content h1 {
    color: #ff6600 !important;
}

/* Таблицы в темной теме */
body.dark-theme .reklama-content table,
body.reklama-dark-active .reklama-content table,
html[style*="filter: invert"] .reklama-content table {
    background: #1e252d !important;
}

body.dark-theme .reklama-content th,
body.reklama-dark-active .reklama-content th,
html[style*="filter: invert"] .reklama-content th {
    background: #252d38 !important;
    color: #ffffff !important;
    border-bottom-color: #3a4553 !important;
}

body.dark-theme .reklama-content td,
body.reklama-dark-active .reklama-content td,
html[style*="filter: invert"] .reklama-content td {
    border-bottom-color: #2a3541 !important;
    color: #e7e9ea !important;
}

body.dark-theme .reklama-content tr:hover td,
body.reklama-dark-active .reklama-content tr:hover td,
html[style*="filter: invert"] .reklama-content tr:hover td {
    background: #252d38 !important;
}

/* Ссылки */
body.dark-theme .reklama-content a,
body.reklama-dark-active .reklama-content a,
html[style*="filter: invert"] .reklama-content a {
    color: #ff6600 !important;
}

/* Сохранение оранжевого цвета */
body.dark-theme .reklama-content [style*="#ff6600"],
body.dark-theme .reklama-content [style*="orange"],
body.reklama-dark-active .reklama-content [style*="#ff6600"],
body.reklama-dark-active .reklama-content [style*="orange"],
html[style*="filter: invert"] .reklama-content [style*="#ff6600"],
html[style*="filter: invert"] .reklama-content [style*="orange"] {
    color: #ff6600 !important;
}

/* МАКСИМАЛЬНО АГРЕССИВНОЕ переопределение всех стилей */
body.dark-theme .reklama-content *,
body.reklama-dark-active .reklama-content *,
html[style*="filter: invert"] .reklama-content * {
    color: #e7e9ea !important;
    background-color: transparent !important;
}

/* Особенно агрессивно для элементов с inline стилями */
body.dark-theme .reklama-content [style],
body.reklama-dark-active .reklama-content [style],
html[style*="filter: invert"] .reklama-content [style] {
    color: #e7e9ea !important;
    background-color: transparent !important;
    border-color: #3a4553 !important;
}

/* Переопределяем все возможные inline цвета */
body.dark-theme .reklama-content [style*="color"],
body.reklama-dark-active .reklama-content [style*="color"],
html[style*="filter: invert"] .reklama-content [style*="color"] {
    color: #e7e9ea !important;
}

/* Переопределяем все возможные inline фоны */
body.dark-theme .reklama-content [style*="background"],
body.reklama-dark-active .reklama-content [style*="background"],
html[style*="filter: invert"] .reklama-content [style*="background"] {
    background-color: transparent !important;
    background-image: none !important;
}

/* Переопределение inline стилей */
body.dark-theme .reklama-content [style*="color: #000"],
body.dark-theme .reklama-content [style*="color:#000"],
body.dark-theme .reklama-content [style*="color: black"],
body.reklama-dark-active .reklama-content [style*="color: #000"],
body.reklama-dark-active .reklama-content [style*="color:#000"],
body.reklama-dark-active .reklama-content [style*="color: black"],
html[style*="filter: invert"] .reklama-content [style*="color: #000"],
html[style*="filter: invert"] .reklama-content [style*="color:#000"],
html[style*="filter: invert"] .reklama-content [style*="color: black"] {
    color: #e7e9ea !important;
}

body.dark-theme .reklama-content [style*="color: #333"],
body.dark-theme .reklama-content [style*="color:#333"],
body.dark-theme .reklama-content [style*="color: #666"],
body.dark-theme .reklama-content [style*="color:#666"],
body.reklama-dark-active .reklama-content [style*="color: #333"],
body.reklama-dark-active .reklama-content [style*="color:#333"],
body.reklama-dark-active .reklama-content [style*="color: #666"],
body.reklama-dark-active .reklama-content [style*="color:#666"],
html[style*="filter: invert"] .reklama-content [style*="color: #333"],
html[style*="filter: invert"] .reklama-content [style*="color:#333"],
html[style*="filter: invert"] .reklama-content [style*="color: #666"],
html[style*="filter: invert"] .reklama-content [style*="color:#666"] {
    color: #e7e9ea !important;
}

/* Белый фон -> темный */
body.dark-theme .reklama-content [style*="background: #fff"],
body.dark-theme .reklama-content [style*="background:#fff"],
body.dark-theme .reklama-content [style*="background: white"],
body.reklama-dark-active .reklama-content [style*="background: #fff"],
body.reklama-dark-active .reklama-content [style*="background:#fff"],
body.reklama-dark-active .reklama-content [style*="background: white"],
html[style*="filter: invert"] .reklama-content [style*="background: #fff"],
html[style*="filter: invert"] .reklama-content [style*="background:#fff"],
html[style*="filter: invert"] .reklama-content [style*="background: white"] {
    background-color: #1e252d !important;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .page-template-page-reklama .site-main,
    .page-slug-reklama .site-main {
        padding: 30px 0;
    }
    
    .reklama-content {
        padding: 20px;
        margin: 0 15px;
    }
    
    .reklama-content table {
        font-size: 14px;
    }
    
    .reklama-content th,
    .reklama-content td {
        padding: 10px;
    }
}

/* Дополнительные селекторы для проблемных элементов */
body.dark-theme .reklama-content p,
body.dark-theme .reklama-content div,
body.dark-theme .reklama-content span,
body.dark-theme .reklama-content td,
body.dark-theme .reklama-content th,
body.dark-theme .reklama-content li,
body.reklama-dark-active .reklama-content p,
body.reklama-dark-active .reklama-content div,
body.reklama-dark-active .reklama-content span,
body.reklama-dark-active .reklama-content td,
body.reklama-dark-active .reklama-content th,
body.reklama-dark-active .reklama-content li,
html[style*="filter: invert"] .reklama-content p,
html[style*="filter: invert"] .reklama-content div,
html[style*="filter: invert"] .reklama-content span,
html[style*="filter: invert"] .reklama-content td,
html[style*="filter: invert"] .reklama-content th,
html[style*="filter: invert"] .reklama-content li {
    color: #e7e9ea !important;
    background-color: transparent !important;
}

/* Анимации */
.reklama-content,
.reklama-content * {
    transition: color 0.1s ease, background-color 0.1s ease;
}