/*
Theme Name: Детский сад
Theme URI: https://example.com/kindergarten
Author: MultiTool
Description: Яркая адаптивная тема для сайта детского сада. Меню слева, контент по центру, виджеты справа. Работает на экранах 4:3 и 16:9, оптимизирована под плагин «Версия для слабовидящих» (Button visually impaired).
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kindergarten
Tags: education, custom-menu, responsive-layout, custom-logo, featured-images
*/

/* ============================================================
   1. ПЕРЕМЕННЫЕ / ПАЛИТРА (из картинки шапки)
   ============================================================ */
:root {
    --green:        #4CAF50;  /* трава, стены */
    --green-dark:   #2E7D32;  /* тёмно-зелёный */
    --blue:         #2196F3;  /* небо, детали */
    --blue-dark:    #1565C0;  /* глубокий синий */
    --sky:          #E3F2FD;  /* светло-голубой фон */
    --red:          #F44336;  /* важное, CTA, горка */
    --yellow:       #FFC107;  /* солнце, акценты */
    --orange:       #FB8C00;
    --ink:          #212121;  /* основной текст = высокий контраст */
    --ink-soft:     #37474F;
    --white:        #FFFFFF;
    --round:        12px;
    --shadow:       0 2px 8px rgba(33, 33, 33, 0.12);

    /* Запас под плавающую кнопку плагина «Версия для слабовидящих» */
    --bvi-offset: 56px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background-color: var(--sky);
    background-image:
        radial-gradient(circle at 8% 12%, rgba(33, 150, 243, 0.15) 0, transparent 38%),
        radial-gradient(circle at 92% 6%, rgba(255, 193, 7, 0.18) 0, transparent 42%),
        radial-gradient(circle at 60% 90%, rgba(76, 175, 80, 0.14) 0, transparent 44%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ============================================================
   2. ОБЩАЯ СЕТКА СТРАНИЦЫ
   Меню слева | контент | виджеты справа.
   Три колонки на широких экранах, две на средних,
   одна колонка на узких (меню и виджеты стекаются).
   ============================================================ */
.site {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px clamp(8px, 2vw, 24px) 40px;
}

.site-header    { width: 100%; }
.site-content   { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }

/* Левая колонка — меню */
.layout-sidebar-left {
    width: calc(22% - 8px);
    order: 1;
    min-width: 200px;
}

/* Центр — контент */
.layout-main {
    width: calc(52% - 8px);
    order: 2;
    flex: 1 1 380px;
    min-width: 280px;
}

/* Правая колонка — виджеты */
.layout-sidebar-right {
    width: calc(23% - 8px);
    order: 3;
    min-width: 230px;
}

/* ============================================================
   3. ШАПКА
   ============================================================ */
.site-header {
    margin-bottom: 16px;
}

/* Картинка-баннер в шапке */
.site-header-banner {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--round);
    display: block;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.site-header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    background: var(--white);
    border-radius: var(--round);
    box-shadow: var(--shadow);
    padding: 14px 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    min-width: 0;
}

.site-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.1;
    font-weight: 800;
}

.site-title a {
    color: var(--blue-dark);
    text-decoration: none;
}

.site-branding .custom-logo {
    max-height: 64px;
    width: auto;
}

/* Контрастные чёткие шрифты для всего сайта */
body,
button,
input,
select,
optgroup,
textarea {
    font-family: "Rubik", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Контактное меню в шапке */
.header-contacts {
    margin-left: auto;
}

.header-contacts ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.header-contacts li a {
    display: inline-block;
    padding: 8px 14px;
    background: var(--yellow);
    color: var(--ink);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.header-contacts li a:hover {
    background: var(--orange);
    color: var(--white);
}

/* Форма поиска в шапке */
.search-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.search-form .search-field {
    padding: 9px 14px;
    border: 2px solid var(--blue);
    border-radius: 20px;
    font-size: 1rem;
    min-width: 180px;
}

.search-form .search-submit {
    padding: 9px 16px;
    background: var(--blue-dark);
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
}

.search-form .search-submit:hover {
    background: var(--green-dark);
}

/* Кнопка BVI: фиксированная группа, чтобы кнопка «Версия для
   слабовидящих» не перекрывала контент и виджеты */
.bvi-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(33, 33, 33, 0.1);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Компромисс: если тема плагина крепит кнопку к верхнему краю,
   добавим отступ шапке и под ней — чтобы ни контент, ни меню не
   наезжали на кнопку. */
.admin-bar .bvi-top-bar { top: 32px; }

/* ============================================================
   4. МЕНЮ (слева)
   ============================================================ */
.widget-area-left {
    background: var(--green);
    border-radius: var(--round);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 8px;
}

.widget-area-left .widget-title {
    color: var(--white);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 6px 6px 10px;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.nav-menu-menu-left ul,
.widget-area-left ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget-area-left ul li a {
    display: block;
    padding: 8px 14px;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    border-radius: 8px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.widget-area-left ul li a:hover,
.widget-area-left ul li.current-menu-item > a,
.widget-area-left ul li.current_page_item > a {
    background: var(--white);
    color: var(--green-dark);
    transform: translateX(2px);
}

.widget-area-left ul.sub-menu,
.widget-area-left ul.children {
    background: var(--green-dark);
    border-radius: 8px;
    margin: 2px 2px 6px;
    overflow: hidden;
}

.widget-area-left ul.sub-menu a,
.widget-area-left ul.children a {
    font-weight: 400;
    padding-left: 22px;
}

.menu-empty {
    margin: 0;
    padding: 10px 14px;
    color: var(--white);
}

.menu-empty a {
    color: var(--yellow);
    font-weight: 600;
}

/* Виджеты ниже меню в левой колонке */
.sidebar-left-extra {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: 10px;
}

.sidebar-left-extra .widget-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 8px;
    background: transparent;
    padding: 0;
}

.sidebar-left-extra p,
.sidebar-left-extra li {
    font-size: 12px;
    color: var(--white);
}

.sidebar-left-extra a:not(.widget-title a) {
    color: var(--white);
    font-size: 12px;
}

/* ============================================================
   5. КОНТЕНТ — КАРТОЧКИ
   ============================================================ */
.site-main {
    background: var(--white);
    border-radius: var(--round);
    box-shadow: var(--shadow);
    padding: clamp(16px, 3vw, 28px);
}

.entry-title,
.page-title,
.fp-section-title {
    color: var(--blue-dark);
    line-height: 1.2;
}

.entry-title::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--yellow);
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.entry-content h2,
.entry-content h3 {
    color: var(--green-dark);
}

a { color: var(--blue-dark); }
a:hover { color: var(--red); }

/* ============================================================
   6. ВИДЖЕТЫ (справа)
   ============================================================ */
.widget-area-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.widget-area-right .widget,
.widget-area-right .widget_block {
    background: var(--white);
    border-radius: var(--round);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    border-top: 5px solid var(--yellow);
}

.widget-area-right .widget:nth-child(2n) { border-top-color: var(--green); }
.widget-area-right .widget:nth-child(3n) { border-top-color: var(--blue); }

.widget-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 10px;
}

/* Более компактный шрифт в правых виджетах */
.widget-area-right {
    font-size: 12px;
    line-height: 1.55;
}

.widget-area-right .widget-title {
    font-size: 1rem;
    margin-bottom: 8px;
}

.widget-area-right ul,
.widget-area-right li {
    margin: 0;
    padding: 0;
}

.widget-area-right li {
    list-style: none;
    margin: 6px 0;
}

.widget-area-right a {
    text-decoration: none;
}

/* Плавающая кнопка BVI не должна перекрывать карточки —
   запас снизу под фиксированную кнопку */
@media (min-width: 901px) {
    .widget-area-right .widget:last-child {
        margin-bottom: var(--bvi-offset);
    }
}

/* ============================================================
   7. ГЛАВНАЯ СТРАНИЦА (front-page)
   ============================================================ */
.fp-hero {
    background: linear-gradient(120deg, var(--green), var(--blue));
    color: var(--white);
    border-radius: var(--round);
    padding: clamp(18px, 4vw, 34px);
    margin-bottom: 20px;
}

.fp-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    color: var(--white);
}

.fp-hero p {
    margin: 0;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    opacity: 0.96;
}

.fp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.fp-card {
    background: var(--white);
    border-radius: var(--round);
    box-shadow: var(--shadow);
    padding: 18px;
    border-top: 6px solid var(--yellow);
}

.fp-card:nth-child(2n) { border-top-color: var(--green); }
.fp-card:nth-child(3n) { border-top-color: var(--red); }
.fp-card:nth-child(4n) { border-top-color: var(--blue); }

.fp-card h3 {
    margin: 0 0 6px;
    color: var(--blue-dark);
    font-size: 1.2rem;
}

.fp-card .icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 6px;
}

.btn-cta {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-cta:hover {
    background: #c62828;
    color: var(--white);
    transform: translateY(-2px);
}

.fp-intro {
    background: var(--white);
    border-radius: var(--round);
    box-shadow: var(--shadow);
    padding: clamp(16px, 3vw, 28px);
}

/* ============================================================
   8. ПОДВАЛ
   ============================================================ */
.site-footer {
    margin-top: 24px;
    background: var(--blue-dark);
    color: var(--white);
    border-radius: var(--round);
    padding: 20px 24px;
    text-align: center;
}

.site-footer a { color: var(--yellow); }
.site-footer a:hover { color: var(--white); }

.site-footer .footer-widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    text-align: left;
    max-width: 900px;
    margin: 0 auto 12px;
}

.site-footer .footer-widgets .widget {
    flex: 1 1 220px;
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 12px;
    margin: 0;
    font-size: 0.9rem;
}

/* ============================================================
   9. ПОСТЫ / АРХИВ
   ============================================================ */
article.hentry {
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #CFD8DC;
}

article.hentry:last-child { border-bottom: none; }

.post-thumbnail img,
.entry-content img,
.aligncenter {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.comment-reply-title,
.widget a { text-decoration-color: currentColor; }

/* ============================================================
   10. АДАПТИВ
   ============================================================ */

/* 16:9 и близкие к нему широкие экраны (>1100px): 3 колонки */
@media (min-width: 1101px) {
    .layout-sidebar-left  { width: calc(20% - 8px); }
    .layout-main          { width: calc(56% - 8px); }
    .layout-sidebar-right { width: calc(20% - 8px); }
}

/* Средние экраны (~4:3 и планшеты, 600–1100px): 2 колонки.
   Меню сворачивается горизонтально над контентом, виджеты справа. */
@media (max-width: 1100px) and (min-width: 601px) {
    .layout-sidebar-left {
        width: 100%;
        order: 1;
    }
    .layout-sidebar-left .widget-area-left {
        padding: 6px;
    }
    .widget-area-left ul.widget-menu-horizontal li {
        display: inline-block;
    }
    .layout-main {
        width: calc(70% - 8px);
        order: 2;
    }
    .layout-sidebar-right {
        width: calc(30% - 8px);
        order: 3;
    }
}

/* Узкие экраны (мобильные, <600px): всё в одну колонку */
@media (max-width: 600px) {
    .layout-sidebar-left,
    .layout-main,
    .layout-sidebar-right {
        width: 100%;
        min-width: 0;
    }
    .layout-sidebar-left { order: 1; }
    .layout-main         { order: 2; }
    .layout-sidebar-right{ order: 3; }

    .site-header-inner {
        flex-direction: column;
        text-align: center;
    }

    /* Мобильное меню: компактные кнопки */
    .widget-area-left ul li a {
        padding: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        font-size: 12px;
    }
}

/* Небольшой сдвиг, чтобы шапка умещала плавающую кнопку BVI вверху */
@media (min-width: 401px) {
    .site { padding-top: 8px; }
}