/* Стили, которые на основном сайте выводит тема из настроек (inc/dynamic-styles.php, header.php, responsive-tables.php),
   сняты с education-center-petergof.ru 22.10.2026; цвета — переменными из «Настроек» CMS. */

    /* Стили для таблиц TablePress и стандартных WordPress таблиц */
    .tablepress, 
    .wp-block-table table,
    article table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        margin: 1.5rem 0;
    }
    
    .tablepress thead th,
    .wp-block-table thead th,
    article table thead th {
        background: var(--color-slate-900);
        color: white;
        padding: 1rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.875rem;
    }
    
    .tablepress tbody td,
    .wp-block-table tbody td,
    article table tbody td {
        padding: 1rem;
        font-size: 0.875rem;
        color: var(--color-slate-700);
        border-bottom: 1px solid var(--color-slate-100);
    }
    
    .tablepress tbody tr:hover,
    .wp-block-table tbody tr:hover,
    article table tbody tr:hover {
        background: var(--color-slate-50);
    }
    
    .tablepress tbody tr:last-child td,
    .wp-block-table tbody tr:last-child td,
    article table tbody tr:last-child td {
        border-bottom: none;
    }
    

    
    /* Ссылки в тексте отличаются не только цветом (ПП № 102, пп. «и») */
    .entry-content a:not(.btn):not([class*="su-button"]):not(.social-btn),
    .post-body a:not(.btn):not([class*="su-button"]):not(.social-btn) {
        text-decoration: underline;
        text-underline-offset: 2px;
    }
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА МЕНЮ (header navigation)
       ═══════════════════════════════════════════════════════ */
    .site-nav .menu-item > a,
    .site-nav > .menu-item > a {
        color: var(--ph-menu-text) !important;
    }
    .site-nav .menu-item > a:hover,
    .site-nav > .menu-item > a:hover {
        color: #ffffff !important;
        background-color: rgba(255,255,255,0.1) !important;
    }
    .site-nav .menu-item.current-menu-item > a,
    .site-nav .menu-item.current-page-ancestor > a,
    .site-nav .menu-item.current_page_item > a {
        color: #ffffff !important;
        background-color: var(--ph-menu-active) !important;
    }
    /* Подменю (десктоп) */
    .site-nav .sub-menu {
        background: var(--ph-submenu-bg) !important;
    }
    .site-nav .sub-menu .menu-item > a {
        color: var(--ph-menu-text) !important;
    }
    .site-nav .sub-menu .menu-item > a:hover {
        color: #ffffff !important;
        background-color: rgba(255,255,255,0.1) !important;
    }
    .site-nav .sub-menu .menu-item.current-menu-item > a {
        color: #ffffff !important;
        background-color: var(--ph-menu-active) !important;
    }
    
    /* Стрелка раскрытия подменю */
    .submenu-toggle,
    .site-nav .submenu-toggle {
        color: #9dafbc !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       МОБИЛЬНОЕ МЕНЮ (бургер) - синхронизация с ГЛАВНЫМ меню
       ═══════════════════════════════════════════════════════ */
    @media (max-width: 1023px) {
        /* Фон мобильного меню - своя настройка */
        nav.site-nav {
            background: var(--ph-header-bg) !important;
        }
        
        /* Шапка мобильного меню */
        .mobile-nav-header {
            background: var(--ph-header-bg) !important;
        }
        
        /* Название сайта в шапке мобильного меню */
        .mobile-nav-logo {
            color: #ffffff !important;
        }
        
        /* Пункты мобильного меню = ГЛАВНОЕ МЕНЮ */
        nav.site-nav .menu-item > a,
        nav.site-nav > ul > .menu-item > a {
            color: var(--ph-menu-text) !important;
        }
        
        /* Ховер в мобильном меню = ГЛАВНОЕ МЕНЮ */
        nav.site-nav .menu-item > a:hover,
        nav.site-nav > ul > .menu-item > a:hover {
            color: #ffffff !important;
            background-color: rgba(255,255,255,0.1) !important;
        }
        
        /* Активный пункт в мобильном меню = ГЛАВНОЕ МЕНЮ */
        nav.site-nav .menu-item.current-menu-item > a,
        nav.site-nav .menu-item.current-page-ancestor > a,
        nav.site-nav .menu-item.current_page_item > a,
        nav.site-nav > ul > .menu-item.current-menu-item > a,
        nav.site-nav > ul > .menu-item.current-page-ancestor > a {
            color: #ffffff !important;
            background: var(--ph-menu-active) !important;
        }
        
        /* Подпункты в мобильном меню = ПОДМЕНЮ */
        nav.site-nav .sub-menu .menu-item > a {
            color: var(--ph-menu-text) !important;
        }
        
        nav.site-nav .sub-menu .menu-item > a:hover {
            color: #ffffff !important;
            background-color: rgba(255,255,255,0.1) !important;
        }
        
        /* Активный подпункт в мобильном = ПОДМЕНЮ стили */
        nav.site-nav .sub-menu .menu-item.current-menu-item > a {
            color: #ffffff !important;
            background: var(--ph-menu-active) !important;
        }
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА ТЕКСТОВ И ССЫЛОК
       ═══════════════════════════════════════════════════════ */
    /* Основной цвет текста */
    body,
    p,
    .card-description {
        color: #2f4050;
    }
    
    /* Фон страницы */
    body {
        background-color: #f6f7fb;
    }
    
    /* Цвет заголовков */
    h1, h2, h3, h4, h5, h6,
    .section-title,
    .card-title {
        color: var(--ph-header-bg) !important;
    }
    
    /* Цвет подзаголовков/меток (section-subtitle, hero-badge) */
    .section-subtitle,
    .hero-badge {
        color: #3672b3 !important;
    }
    
    /* Цвет ссылок */
    a:not(.btn):not(.site-logo):not(.menu-item a):not(.nav-link):not(.card):not([style*="text-decoration: none"]):not(.footer-links a):not(.widget-sidebar a) {
        color: #3672b3;
    }
    a:not(.btn):not(.site-logo):not(.menu-item a):not(.nav-link):not(.card):not(.footer-links a):not(.widget-sidebar a):hover {
        color: #3074b8;
    }
    
    /* Цвет вторичного текста (даты, мета-информация) */
    time,
    .meta-text,
    .meta-date {
        color: #62727f !important;
    }
    
    /* Фон карточек */
    .card {
        background-color: #ffffff;
        border-color: #dbe4ec;
    }
    
    /* Цвет рамок и разделителей */
    hr, .border {
        border-color: #dbe4ec;
    }
    
    /* Кнопка "Вернуться" с динамическими цветами */
    .btn-outline-light {
        border-color: #3672b3;
        color: #3672b3;
    }
    .btn-outline-light:hover {
        background-color: #3672b315;
        color: #3074b8;
    }
    
    /* ═══════════════════════════════════════════════════════
       АКТИВНЫЕ РУБРИКИ (используют цвет активного меню)
       ═══════════════════════════════════════════════════════ */
    .category-filter-active,
    [data-active-category="true"] {
        background-color: var(--ph-menu-active) !important;
        color: #ffffff !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА ГЛАВНОЙ СТРАНИЦЫ - HERO СЕКЦИЯ
       ═══════════════════════════════════════════════════════ */
    .hero-section .hero-title {
        color: #ffffff !important;
    }
    .hero-section .hero-title .highlight {
        color: #4da3ff !important;
    }
    .hero-section .hero-description {
        color: #c3d1dc !important;
    }
    .hero-section .hero-badge {
        color: #9fd3ff !important;
    }
    .hero-section .btn-primary {
        background-color: var(--ph-menu-active) !important;
        color: #ffffff !important;
    }
    .hero-section .btn-outline {
        border-color: #ffffff !important;
        color: #ffffff !important;
    }
    .hero-section .btn-outline:hover {
        background-color: #ffffff !important;
        color: var(--ph-header-bg) !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА ГЛАВНОЙ СТРАНИЦЫ - STATS + HERO SLIDER
       ═══════════════════════════════════════════════════════ */
    .stats-section {
        background: #4da3ff !important;
        border-top-color: #3b8ee0 !important;
    }
    .stats-section .stat-value {
        color: #000000 !important;
    }
    .stats-section .stat-label {
        color: #000000 !important;
    }
    .hero-slider {
        background: #4da3ff !important;
    }
    .hero-slider .section-title {
        color: #000000 !important;
    }
    .hero-slider .section-subtitle {
        color: #000000 !important;
    }
    .hero-slider .hero-slide-title {
        color: #000000 !important;
    }
    .hero-slider .hero-slide-caption {
        color: #000000 !important;
    }
    
    /* Вертикальная полоска заголовков секций */
    .hero-slider .section-header {
        border-left-color: var(--ph-header-bg) !important;
    }
    
    /* Полоска для всех секций на главной */
    .home .section-header,
    .front-page .section-header,
    .content-area .section-header {
        border-left-color: var(--ph-header-bg) !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА ГЛАВНОЙ СТРАНИЦЫ - СЕКЦИЯ НАПРАВЛЕНИЙ
       ═══════════════════════════════════════════════════════ */
    .section.section-directions {
        background: #ffffff !important;
    }
    .section.section-directions .section-subtitle {
        color: var(--ph-menu-active) !important;
    }
    .section.section-directions .section-title {
        color: var(--ph-header-bg) !important;
    }
    .section.section-directions .section-description {
        color: #677784 !important;
    }
    .section.section-directions .section-header a {
        color: var(--ph-menu-active) !important;
    }
    .section.section-directions .card-title {
        color: var(--ph-header-bg) !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА ГЛАВНОЙ СТРАНИЦЫ - СЕКЦИЯ НОВОСТЕЙ
       ═══════════════════════════════════════════════════════ */
    .section.section-news {
        background: #f6f7fb !important;
    }
    .section.section-news .section-subtitle {
        color: #3672b3 !important;
    }
    .section.section-news .section-title {
        color: var(--ph-header-bg) !important;
    }
    .section.section-news .meta-date {
        color: #62727f !important;
    }
    .section.section-news .card-title {
        color: var(--ph-header-bg) !important;
    }
    .section.section-news .card-description {
        color: #62727f !important;
    }
    .section.section-news .section-header a {
        color: #3672b3 !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА ГЛАВНОЙ СТРАНИЦЫ - БЫСТРЫЕ ССЫЛКИ
       ═══════════════════════════════════════════════════════ */
    .section.section-quicklinks {
        background: #ffffff !important;
    }
    .section.section-quicklinks .card-title {
        color: var(--ph-header-bg) !important;
    }
    .section.section-quicklinks .card p,
    .section.section-quicklinks p[style*="font-size: 0.875rem"] {
        color: #677784 !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА ФУТЕРА
       ═══════════════════════════════════════════════════════ */
    .site-footer {
        background: var(--ph-header-bg) !important;
        border-top-color: var(--ph-submenu-bg) !important;
    }
    .site-footer h3,
    .site-footer .footer-section h3 {
        color: #ffffff !important;
    }
    .site-footer p,
    .site-footer .footer-section p {
        color: #a7d7ff !important;
    }
    .footer-links a {
        color: #a7d7ff !important;
    }
    .footer-links a:hover {
        color: #ffffff !important;
    }
    .footer-bottom {
        border-top-color: var(--ph-submenu-bg) !important;
    }
    .footer-bottom p {
        color: #a7d7ff !important;
    }
    
    /* Кнопка "Вернуться наверх" */
    .scroll-to-top {
        background: #4da3ff !important;
        color: #000000 !important;
    }
    .scroll-to-top:hover {
        background: var(--ph-submenu-bg) !important;
    }
    .scroll-to-top svg {
        stroke: #000000 !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА САЙДБАРА
       ═══════════════════════════════════════════════════════ */
    .widget-sidebar {
        background: transparent;
    }
    .widget-sidebar .widget {
        border-bottom-color: #dbe4ec !important;
    }
    .widget-sidebar .widget-title {
        color: #62727f !important;
    }
    .widget-sidebar p,
    .widget-sidebar span:not(.sidebar-link-icon):not(.sidebar-link-arrow),
    .widget-sidebar label {
        color: #2f4050;
    }
    /* Ссылки сайдбара (исключаем кнопки соцсетей - у них свои цвета) */
    .widget-sidebar a:not(.btn):not(.social-btn),
    .widget-sidebar .sidebar-link {
        color: #3672b3 !important;
    }
    .widget-sidebar a:not(.btn):not(.social-btn):hover,
    .widget-sidebar .sidebar-link:hover {
        color: #3074b8 !important;
        background: #3074b810;
    }
    /* Иконки в ссылках сайдбара */
    .widget-sidebar .sidebar-link-icon {
        color: #3672b3 !important;
    }
    .widget-sidebar .sidebar-link:hover .sidebar-link-icon {
        color: #3074b8 !important;
    }
    .widget-sidebar .sidebar-link-arrow {
        color: #2f4050;
        opacity: 0.5;
    }
    .widget-sidebar .sidebar-link:hover .sidebar-link-arrow {
        color: #3074b8 !important;
        opacity: 1;
    }
    /* Мобильный сайдбар тоже использует эти цвета (исключаем соцсети) */
    .mobile-sidebar-content a:not(.btn):not(.social-btn),
    .mobile-sidebar-content .sidebar-link {
        color: #3672b3 !important;
    }
    .mobile-sidebar-content a:not(.btn):not(.social-btn):hover,
    .mobile-sidebar-content .sidebar-link:hover {
        color: #3074b8 !important;
    }
    
    /* ═══════════════════════════════════════════════════════
       ЦВЕТА КНОПОК СОЦСЕТЕЙ
       ═══════════════════════════════════════════════════════ */
    .social-btn,
    a.social-btn,
    .widget .social-btn,
    .widget a.social-btn,
    .social-buttons-grid .social-btn,
    .social-buttons-grid a.social-btn {
        transition: all 0.2s ease;
        font-weight: 500;
    }
    .social-btn:hover,
    a.social-btn:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }
    .social-btn-vk,
    a.social-btn-vk,
    .widget .social-btn-vk,
    .widget a.social-btn-vk,
    .social-buttons-grid .social-btn-vk,
    .social-buttons-grid a.social-btn-vk {
        background-color: #4C75A3 !important;
        color: #ffffff !important;
    }
    .social-btn-tg,
    a.social-btn-tg,
    .widget .social-btn-tg,
    .widget a.social-btn-tg,
    .social-buttons-grid .social-btn-tg,
    .social-buttons-grid a.social-btn-tg {
        background-color: #007dbc !important;
        color: #ffffff !important;
    }
    .social-btn-wa,
    a.social-btn-wa,
    .widget .social-btn-wa,
    .widget a.social-btn-wa,
    .social-buttons-grid .social-btn-wa,
    .social-buttons-grid a.social-btn-wa {
        background-color: #188741 !important;
        color: #ffffff !important;
    }
    .social-btn-max,
    a.social-btn-max,
    .widget .social-btn-max,
    .widget a.social-btn-max,
    .social-buttons-grid .social-btn-max,
    .social-buttons-grid a.social-btn-max {
        background-color: #d1471c !important;
        color: #ffffff !important;
    }
    

        .site-header {
            background: var(--ph-header-bg) !important;
        }
        .site-logo {
            color: #ffffff !important;
            transition: none !important;
        }
        .logo-icon {
            background: #4da3ff !important;
            transition: none !important;
        }
        .site-logo span,
        .site-logo .logo-title,
        .site-logo .logo-subtitle {
            transition: none !important;
        }
        a.site-logo:hover,
        a.site-logo:focus {
            background: rgba(255,255,255,0.1) !important;
            color: #ffffff !important;
            transition: none !important;
        }
        a.site-logo:hover span,
        a.site-logo:focus span {
            color: #ffffff !important;
        }
        a.site-logo:hover .logo-icon,
        a.site-logo:focus .logo-icon {
            transform: rotate(-5deg) scale(1.05) !important;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
        }
    

.rt-clone { display: none; }
/* words are never broken letter by letter (style.css sets word-break: break-word on cells) */
.content-area table th, .content-area table td { word-break: normal !important; }
/* table view: widths by content, overrides table-layout: fixed and the scroll mode from style.css */
.content-area table.rt-stack:not(.rt-cards) { display: table !important; width: 100% !important; max-width: none !important; table-layout: auto !important; overflow: visible !important; }
.content-area table.rt-stack:not(.rt-cards) th, .content-area table.rt-stack:not(.rt-cards) td { min-width: 0 !important; overflow-wrap: break-word !important; }
/* card view */
.content-area table.rt-cards { display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; table-layout: auto !important; overflow: visible !important; border: 0 !important; background: none !important; }
.content-area table.rt-cards colgroup, .content-area table.rt-cards thead { display: none !important; }
.content-area table.rt-cards tbody { display: block; width: 100%; }
.content-area table.rt-cards tr { display: block; width: 100%; margin: 0 0 12px; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fff; }
.content-area table.rt-cards td, .content-area table.rt-cards th { display: block; width: 100% !important; min-width: 0 !important; box-sizing: border-box; border: 0 !important; border-bottom: 1px solid #f1f5f9 !important; padding: 8px 12px !important; text-align: left !important; white-space: normal !important; overflow-wrap: break-word !important; }
.content-area table.rt-cards td:last-child { border-bottom: 0 !important; }
.content-area table.rt-cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: #64748b; text-transform: none; }
.content-area table.rt-cards td.rt-empty { display: none !important; }
.content-area table.rt-cards td.rt-clone { display: block; }
.content-area table.rt-cards tr.rt-band { border: 0; background: none; margin: 18px 0 8px; }
.content-area table.rt-cards tr.rt-band td { padding: 8px 12px !important; border-radius: 8px; font-weight: 600; }
.content-area table.rt-cards.rt-kv td:first-child { font-weight: 600; background: #f8fafc; }
.content-area table.rt-cards img { max-width: 160px; height: auto; }
.content-area .ddut-schedule:has(table.rt-cards) { overflow: visible !important; }
/* frontend editor: the raw tables are not converted to cards, they get the same widths-by-content and scroll if too wide */
.content-area .peterhof-fe-active table { table-layout: auto !important; }
.content-area .peterhof-fe-active { overflow-x: auto; }
