/* ============================================================================
   app.css — полная замена root/assets/css/style.min.css (171 КБ).
   Покрывает каркас темы: шапку, меню, контент, комментарии, подвал, служебное.
   Токены живут в style.css, который грузится последним, — переменные
   резолвятся в момент применения, поэтому порядок здесь роли не играет.
   Ни одной зависимости: ни jQuery, ни иконочных шрифтов, ни сеточных фреймворков.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. Сброс и база
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* clip, а не hidden: hidden сделал бы html скролл-контейнером
       и сломал position: sticky у шапки */
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
}

img, svg, video, iframe { max-width: 100%; }
img, svg, video { height: auto; }

figure { margin: 0 0 var(--eoc-s3); }

ul, ol { padding-left: 22px; }

hr {
    height: 1px;
    margin: var(--eoc-s4) 0;
    border: 0;
    background: var(--eoc-line);
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; }

:focus-visible {
    outline: 3px solid rgba(27, 77, 255, .35);
    outline-offset: 2px;
}

/* ----------------------------------------------------------------------------
   2. Каркас страницы
   -------------------------------------------------------------------------- */

.site { display: flex; flex-direction: column; min-height: 100vh; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--eoc-s3);
    padding-right: var(--eoc-s3);
}

.site-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--eoc-s4) var(--eoc-s3) var(--eoc-s8);
}

/* Сайдбара на проекте нет — раскладка всегда в одну колонку */
.content-area { width: 100%; min-width: 0; }
.site-main { min-width: 0; }

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 100;
    padding: 12px 20px;
    background: #fff;
    border-radius: 0 0 var(--eoc-r-btn) 0;
}
.skip-link:focus { left: 0; top: 0; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------------------------------------------------------
   3. Шапка
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    max-width: none;
    padding: 0;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--eoc-line);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: var(--eoc-s3);
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px var(--eoc-s3);
    min-height: 64px;
}

.site-branding { margin-right: auto; }

.site-title { margin: 0; font-size: 19px; }
.site-title a { color: var(--eoc-ink); }
.site-description { display: none; }

/* Верхнее меню */
.top-menu ul,
.footer-navigation ul,
.main-navigation ul {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.top-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--eoc-muted);
    font-size: 15px;
}

/* Поиск */
.search-form { position: relative; display: flex; }

.search-form__text {
    min-height: 42px;
    padding: 9px 42px 9px 16px;
    border: 1px solid var(--eoc-line);
    border-radius: var(--eoc-r-btn);
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: var(--eoc-ink);
    width: 100%;
}

.search-form__text:focus {
    border-color: var(--eoc-blue);
    outline: none;
}

.search-form__submit {
    position: absolute;
    right: 0; top: 0;
    width: 42px; height: 100%;
    border: 0;
    background: transparent;
    color: var(--eoc-muted);
    cursor: pointer;
}
.search-form__submit:hover { color: var(--eoc-blue); }

/* Гамбургер */
.mob-hamburger {
    display: none;
    position: relative;
    width: 42px; height: 42px;
    border-radius: var(--eoc-r-btn);
    cursor: pointer;
    flex: none;
}
.mob-hamburger:hover { background: var(--eoc-tint); }

.mob-hamburger span,
.mob-hamburger::before,
.mob-hamburger::after {
    content: "";
    position: absolute;
    left: 11px;
    width: 20px; height: 2px;
    border-radius: 2px;
    background: var(--eoc-ink);
    transition: transform .2s, opacity .2s;
}
.mob-hamburger::before { top: 14px; }
.mob-hamburger span   { top: 20px; }
.mob-hamburger::after { top: 26px; }

.mob-hamburger.is-open::before { top: 20px; transform: rotate(45deg); }
.mob-hamburger.is-open span    { opacity: 0; }
.mob-hamburger.is-open::after  { top: 20px; transform: rotate(-45deg); }

.mob-search { display: none; }

/* ----------------------------------------------------------------------------
   4. Главное меню
   -------------------------------------------------------------------------- */

.main-navigation {
    background: #fff;
    border-bottom: 1px solid var(--eoc-line);
}

.main-navigation-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--eoc-s3);
}

.main-navigation li { position: relative; }

.main-navigation a {
    display: block;
    padding: 12px 14px;
    color: var(--eoc-ink);
    font-size: 15.5px;
    border-radius: 10px;
    transition: background .15s, color .15s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
    background: var(--eoc-tint);
    color: var(--eoc-blue);
    text-decoration: none;
}

/* Выпадающее подменю */
.main-navigation .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    display: block;
    min-width: 260px;
    padding: var(--eoc-s1);
    background: #fff;
    border-radius: var(--eoc-r-md);
    box-shadow: var(--eoc-shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .15s, transform .15s, visibility .15s;
    flex-direction: column;
    flex-wrap: nowrap;
}

.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-navigation .sub-menu .sub-menu { top: 0; left: 100%; }

/* Подменю у правых пунктов уехало бы за край экрана — разворачиваем.
   Класс вешает app.js по фактическим координатам, на любую длину меню. */
.main-navigation li.has-flipped-submenu > .sub-menu { left: auto; right: 0; }
.main-navigation .sub-menu li.has-flipped-submenu > .sub-menu { left: auto; right: 100%; }

.main-navigation .sub-menu a {
    padding: 9px 12px;
    font-size: 15px;
    white-space: normal;
}

/* Стрелка у пунктов с детьми */
.main-navigation .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 7px; height: 7px;
    margin-left: 7px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

/* ----------------------------------------------------------------------------
   5. Заголовок записи и мета
   -------------------------------------------------------------------------- */

.entry-header { margin-bottom: var(--eoc-s3); }

.entry-title {
    margin: 0 0 var(--eoc-s2);
    word-wrap: break-word;
}

.breadcrumb {
    margin-bottom: var(--eoc-s2);
    font-size: 14px;
    color: var(--eoc-muted);
}
.breadcrumb a { color: var(--eoc-muted); }
.breadcrumb a:hover { color: var(--eoc-blue); }

.entry-meta,
.entry-footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eoc-s2);
    align-items: center;
    font-size: 14px;
    color: var(--eoc-muted);
}

.entry-meta a, .entry-footer a { color: var(--eoc-muted); }
.entry-category a { color: var(--eoc-blue); }

.page-separator { display: none; }

/* ----------------------------------------------------------------------------
   6. Контент
   -------------------------------------------------------------------------- */

.entry-content,
.taxonomy-description { max-width: 100%; }

.entry-content > * + * { margin-top: var(--eoc-s3); }

.entry-content h2 { margin: var(--eoc-s6) 0 var(--eoc-s2); }
.entry-content h3 { margin: var(--eoc-s4) 0 var(--eoc-s2); }
.entry-content h4 { margin: var(--eoc-s3) 0 12px; font-size: 17px; }

.entry-content ul,
.entry-content ol { padding-left: 24px; }
.entry-content li { margin-bottom: 10px; }
.entry-content li:last-child { margin-bottom: 0; }

.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.entry-content a:hover { color: var(--eoc-blue-dark); }

.entry-content img { border-radius: var(--eoc-r-sm); }

/* Цитаты */
.entry-content blockquote {
    margin: var(--eoc-s3) 0;
    padding: var(--eoc-s3);
    border: 0;
    border-radius: var(--eoc-r-md);
    background: var(--eoc-tint);
    font-style: normal;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* Контентные плашки темы: .check и .warning.
   Иконки к ним — в icons.css, здесь только коробка.
   Селектор с blockquote нужен, чтобы перебить правило .entry-content blockquote
   выше: плашки размечены именно блоквоутами. */
.check,
.warning,
.entry-content blockquote.check,
.entry-content blockquote.warning {
    position: relative;
    margin: var(--eoc-s3) 0;
    padding: 18px 22px 18px 56px;
    border: 0;
    border-radius: var(--eoc-r-md);
    line-height: 1.55;
}

.check,
.entry-content blockquote.check { background: var(--eoc-green-tint); }

.warning,
.entry-content blockquote.warning { background: var(--eoc-amber-tint); }

.check p:last-child, .warning p:last-child { margin-bottom: 0; }

/* Таблицы */
.table-wrapper,
.table-responsive {
    overflow-x: auto;
    margin: var(--eoc-s3) 0;
    -webkit-overflow-scrolling: touch;
}

.entry-content table { width: 100%; margin: 0; }

/* Скрытая на мобильном служебная разметка темы */
.hidden-xs { display: block; }

/* ----------------------------------------------------------------------------
   7. Оглавление, автор, шаринг
   -------------------------------------------------------------------------- */

.table-of-contents {
    margin: var(--eoc-s3) 0;
    font-size: 15.5px;
}

.table-of-contents__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--eoc-s2);
    margin-bottom: 12px;
}

.table-of-contents__hide {
    cursor: pointer;
    color: var(--eoc-muted);
    font-size: 13px;
}

.table-of-contents__list { margin: 0; padding-left: 20px; }
.table-of-contents__list li { margin-bottom: 8px; }
.table-of-contents__list .level-2 { padding-left: 16px; }

.author-box { display: flex; gap: var(--eoc-s3); align-items: flex-start; }
.author-box__ava { flex: none; border-radius: 50%; overflow: hidden; }
.author-box__ava img { border-radius: 50%; }
.author-box__author { font-weight: 600; }
.author-box__description { color: var(--eoc-muted); font-size: 15px; }

/* Кнопки «Поделиться» отключены в functions.php через опции родителя —
   разметка не генерируется, поэтому и стилей для неё здесь нет. */

/* ----------------------------------------------------------------------------
   8. Архивы и пагинация
   -------------------------------------------------------------------------- */

.site-main > article + article { margin-top: var(--eoc-s3); }

.archive .site-main > article,
.search .site-main > article,
.blog .site-main > article {
    padding: var(--eoc-s3);
    background: var(--eoc-card);
    border-radius: var(--eoc-r-md);
    box-shadow: var(--eoc-shadow);
}

.archive .entry-title,
.search .entry-title,
.blog .entry-title { font-size: 22px; }

.entry-excerpt { color: var(--eoc-muted); font-size: 15.5px; }

.navigation.pagination,
.page-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--eoc-s4);
}

.page-numbers {
    display: grid;
    place-items: center;
    min-width: 42px; height: 42px;
    padding: 0 12px;
    border-radius: var(--eoc-r-btn);
    background: #fff;
    color: var(--eoc-ink);
    box-shadow: var(--eoc-shadow);
    font-size: 15px;
}

.page-numbers:hover { background: var(--eoc-tint); text-decoration: none; }
.page-numbers.current { background: var(--eoc-blue); color: #fff; box-shadow: none; }

/* ----------------------------------------------------------------------------
   9. Комментарии
   -------------------------------------------------------------------------- */

.comments-area {
    margin-top: var(--eoc-s8);
    padding-top: var(--eoc-s6);
    border-top: 1px solid var(--eoc-line);
}

.comments-title,
.comment-reply-title { margin-bottom: var(--eoc-s3); font-size: 24px; }

.comment-list { margin: 0 0 var(--eoc-s4); padding: 0; list-style: none; }

.comment-list li {
    padding: var(--eoc-s3);
    margin-bottom: var(--eoc-s2);
    background: var(--eoc-card);
    border-radius: var(--eoc-r-md);
    box-shadow: var(--eoc-shadow);
}

.comment-list .children { margin: var(--eoc-s2) 0 0 var(--eoc-s3); padding: 0; list-style: none; }

.comment-meta { font-size: 14px; color: var(--eoc-muted); margin-bottom: 10px; }
.comment-author { font-weight: 600; color: var(--eoc-ink); }

.comment-form { display: grid; gap: var(--eoc-s2); }

.comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--eoc-muted);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid var(--eoc-line);
    border-radius: var(--eoc-r-btn);
    background: #fff;
    font: inherit;
    font-size: 16px;
    color: var(--eoc-ink);
}

.comment-form textarea { min-height: 130px; resize: vertical; }

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--eoc-blue);
    outline: none;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--eoc-muted);
}
.comment-form-cookies-consent label { margin: 0; }

.comment-smiles { display: flex; flex-wrap: wrap; gap: 6px; }

/* ----------------------------------------------------------------------------
   10. Подвал
   -------------------------------------------------------------------------- */

.site-footer {
    flex: none;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--eoc-s6) var(--eoc-s3) var(--eoc-s4);
}

.site-footer-inner { display: grid; gap: var(--eoc-s3); }

.footer-navigation ul { gap: 4px; }

.footer-navigation a {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 15px;
}
.footer-navigation a:hover { background: var(--eoc-tint); text-decoration: none; }

.footer-text p { margin: 0 0 12px; }
.footer-text p:last-child { margin-bottom: 0; }

.footer-bottom,
.footer-info {
    padding-top: var(--eoc-s3);
    border-top: 1px solid var(--eoc-line);
    font-size: 13.5px;
}

.footer-counters { display: flex; gap: 12px; align-items: center; }

/* ----------------------------------------------------------------------------
   11. Кнопка наверх
   -------------------------------------------------------------------------- */

.scrolltop {
    position: fixed;
    right: 24px; bottom: 24px;
    z-index: 45;
    display: grid;
    place-items: center;
    width: 48px; height: 48px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--eoc-blue);
    box-shadow: var(--eoc-shadow-hover);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s;
}

.scrolltop.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ----------------------------------------------------------------------------
   12. Блоки редактора WordPress
   -------------------------------------------------------------------------- */

.alignleft  { float: left;  margin: 0 var(--eoc-s3) var(--eoc-s2) 0; }
.alignright { float: right; margin: 0 0 var(--eoc-s2) var(--eoc-s3); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { margin-left: 0; margin-right: 0; }

.wp-caption { max-width: 100%; }
.wp-caption-text,
.wp-block-image figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: var(--eoc-muted);
    text-align: center;
}

.wp-block-image img { border-radius: var(--eoc-r-sm); }

.wp-block-table { overflow-x: auto; }
.wp-block-table table { width: 100%; }

.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: var(--eoc-r-btn);
    background: var(--eoc-blue);
    color: #fff;
    font-weight: 500;
    text-decoration: none;
}
.wp-block-button__link:hover { background: var(--eoc-blue-dark); }

.wp-block-columns { display: flex; gap: var(--eoc-s3); flex-wrap: wrap; }
.wp-block-column { flex: 1 1 260px; min-width: 0; }

.wp-block-embed__wrapper { position: relative; }
.wp-block-embed iframe { width: 100%; border-radius: var(--eoc-r-sm); }

.gallery { display: flex; flex-wrap: wrap; gap: var(--eoc-s2); }
.gallery-item { flex: 1 1 200px; margin: 0; }

/* ----------------------------------------------------------------------------
   13. Адаптив
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .site-header-inner { gap: var(--eoc-s2); }
    .top-menu { display: none; }
}

@media (max-width: 900px) {
    .mob-hamburger { display: block; }
    .hidden-xs { display: none; }

    /* Меню уезжает в выпадающую панель под шапкой */
    .main-navigation {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: 100%;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        box-shadow: var(--eoc-shadow-hover);
    }

    .main-navigation.is-open { display: block; }

    .main-navigation ul { display: block; }
    .main-navigation-inner { padding: var(--eoc-s2) var(--eoc-s3); }
    .main-navigation a { padding: 12px 8px; }

    /* Подменю раскрывается по клику, разворот вешает JS */
    .main-navigation .sub-menu {
        position: static;
        display: none;
        min-width: 0;
        padding: 0 0 0 var(--eoc-s2);
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        border-left: 2px solid var(--eoc-line);
        margin: 4px 0 8px;
    }

    .main-navigation li.is-expanded > .sub-menu { display: block; }
    .main-navigation li:hover > .sub-menu { opacity: 1; visibility: visible; }

    .main-navigation .menu-item-has-children > a::after {
        float: right;
        margin-top: 6px;
        transition: transform .2s;
    }
    .main-navigation li.is-expanded > a::after { transform: translateY(2px) rotate(-135deg); }

    .mob-search { display: block; width: 100%; order: 10; }
}

@media (max-width: 720px) {
    .site-content { padding: var(--eoc-s3) var(--eoc-s2) var(--eoc-s6); }
    .container,
    .site-header-inner,
    .site-footer { padding-left: var(--eoc-s2); padding-right: var(--eoc-s2); }

    .entry-content h2 { margin-top: var(--eoc-s4); }

    .check, .warning { padding: 16px 18px 16px 50px; }

    .comment-list .children { margin-left: 12px; }

    .scrolltop { right: 14px; bottom: 14px; width: 44px; height: 44px; }

    .alignleft, .alignright { float: none; margin: 0 0 var(--eoc-s2); }
}

@media print {
    .site-header, .main-navigation, .scrolltop,
    .comments-area, .footer-navigation { display: none !important; }
    body { background: #fff; font-size: 12pt; }
}
