/*
Theme Name: universalhealingacademy.com
Author: Алексей Зимин
Description: Информационная тема для блога о ремонте, строительстве и инженерных системах дома. Оформление выполнено в стиле «технической достоверности и уюта» (Technical Warmth): тёплый пергаментный фон, терракотово-кирпичные акценты и хвойно-зелёные ссылки.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: domstroy
*/

/* =========================================================
 * Переменные
 * ========================================================= */
:root {
    --bg:          #F7F5F0;
    --bg-card:     #FFFFFF;
    --bg-dark:     #2B2E2A;
    --on-dark:     #E6E3D8;
    --accent:      #C37A3B;
    --accent-deep: #9B5C2A;
    --link:        #3F6A4A;
    --link-hover:  #2c4d35;
    --text:        #2B2E2A;
    --muted:       #6E6A60;
    --border:      #D8D3C6;
    --steel:       #5C6B73;
    --mono:        "JetBrains Mono", "Roboto Mono", "Consolas", ui-monospace, monospace;
    --sans:        "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* =========================================================
 * База
 * ========================================================= */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a {
    color: var(--link);
    text-decoration: none;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

::selection { background: rgba(195, 122, 59, 0.25); }

h1, h2, h3, h4 {
    font-family: var(--sans);
    line-height: 1.25;
    color: var(--text);
    margin: 0 0 0.6em;
}
h1 { font-size: 2rem; }
h2 {
    font-size: 1.55rem;
    color: var(--accent);
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

/* =========================================================
 * Контейнер ширины (единственное место)
 * ========================================================= */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* =========================================================
 * Раскладки
 * ========================================================= */
.layout {
    padding: 38px 0 60px;
}
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 42px;
    align-items: start;
}
.layout-single .content-area {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

/* =========================================================
 * Шапка
 * ========================================================= */
.site-header {
    background: var(--bg-card);
    border-bottom: 3px solid var(--bg-dark);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 320px;
}
.brand-mark {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    display: block;
}
.brand-logo {
    display: block;
    max-height: 72px;
    width: auto;
}
.brand-text { min-width: 0; }
.site-title {
    font-family: var(--mono);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px;
}
.site-title a { color: var(--text); }
.site-title a:hover { color: var(--accent); text-decoration: none; }
.site-description {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
}

/* =========================================================
 * Меню — индикатор «толщины материала»
 * ========================================================= */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--bg-dark);
    color: var(--on-dark);
    border: none;
    font-size: 0.95rem;
    padding: 10px 16px;
    border-radius: 4px 8px 16px 8px;
    cursor: pointer;
    font-family: var(--sans);
}
.main-nav {
    background: var(--bg-dark);
}
.main-nav ul {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    width: min(92%, 1180px);
}
.main-nav li { position: relative; }
.main-nav a {
    display: block;
    color: var(--on-dark);
    padding: 14px 20px 12px;
    border-top: 3px solid var(--steel);
    font-size: 0.96rem;
}
.main-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: #fff;
}
.main-nav li:nth-child(3n+1) > a { border-top-color: var(--link); }
.main-nav li:nth-child(3n+2) > a { border-top-color: var(--accent); }
.main-nav li:nth-child(3n)   > a { border-top-color: var(--steel); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}
.main-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: var(--bg-dark);
    z-index: 30;
    border: 1px solid #3c4039;
}
.main-nav li:hover > ul { display: block; }
.main-nav ul ul a { border-top: none; padding: 10px 16px; }

/* =========================================================
 * Хлебные крошки
 * ========================================================= */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 16px 0 0;
}
.breadcrumbs .sep { color: var(--accent); margin: 0 2px; }
.breadcrumbs span { color: var(--text); }

/* =========================================================
 * Кнопки
 * ========================================================= */
.btn {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.94rem;
    color: #fff;
    background: var(--accent);
    border: 2px solid var(--accent);
    padding: 11px 22px;
    border-radius: 4px 8px 16px 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-color: var(--bg);
    color: #fff;
    text-decoration: none;
}

/* Вторичные кнопки — только подчёркивание */
.btn-line {
    display: inline-block;
    background: none;
    border: none;
    color: var(--text);
    padding: 4px 2px;
    border-bottom: 2px solid var(--accent);
    font-size: 0.9rem;
}
.btn-line:hover {
    color: var(--accent);
    text-decoration: none;
}

/* =========================================================
 * Карточки записей
 * ========================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px 8px 16px 8px;
    overflow: hidden;
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.card-thumb-wrap:hover img { transform: scale(1.04); }
.card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: var(--bg-dark);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 8px;
}
.card-meta a { color: var(--accent); }
.card-title {
    font-size: 1.15rem;
    margin: 0 0 10px;
    border-left: none;
    padding-left: 0;
    color: var(--text);
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt {
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 14px;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-foot { margin-top: auto; }

/* =========================================================
 * Контент записей и страниц
 * ========================================================= */
.entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px 8px 16px 8px;
    padding: 32px 36px;
    margin-top: 18px;
}
.entry-thumb {
    margin: -32px -36px 24px;
    overflow: hidden;
}
.entry-thumb img { display: block; width: 100%; }
.entry-title { font-size: 2rem; }
.entry-meta {
    font-size: 0.83rem;
    color: var(--muted);
    margin-bottom: 22px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 14px;
}
.entry-meta a { color: var(--accent); }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 4px; }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content li { margin-bottom: 6px; }

/* Цитаты — без кавычек, с вертикальной планкой */
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 4px 0 4px 22px;
    border-left: 4px solid;
    border-image: linear-gradient(var(--accent), var(--link)) 1;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
.entry-content blockquote p { margin: 0 0 0.4em; }

/* Код / выноски на тёмном фоне */
.entry-content pre,
.entry-content code {
    font-family: var(--mono);
    background: var(--bg-dark);
    color: var(--on-dark);
}
.entry-content code { padding: 2px 6px; border-radius: 3px; font-size: 0.88em; }
.entry-content pre {
    padding: 16px 18px;
    border-radius: 4px 8px 16px 8px;
    overflow-x: auto;
}
.entry-content pre code { background: none; padding: 0; }

/* Таблицы сравнения — спецификации */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 0.92rem;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px dashed var(--steel);
}
.entry-content th {
    background: var(--bg-dark);
    color: var(--on-dark);
    padding: 10px 12px;
    text-align: left;
}
.entry-content td { padding: 10px 12px; }
.entry-content tr:nth-child(even) td {
    background: rgba(92, 107, 115, 0.08);
}

/* Метки записи */
.entry-tags {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
    font-size: 0.85rem;
}
.entry-tags a {
    display: inline-block;
    margin: 0 10px 6px 0;
    border-bottom: 2px solid var(--accent);
    color: var(--text);
}
.entry-tags a:hover { color: var(--accent); text-decoration: none; }

/* Шеринг — квадратные кнопки 36x36 */
.share {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    align-items: center;
    flex-wrap: wrap;
}
.share-label { font-size: 0.85rem; color: var(--muted); }
.share a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}
.share a svg { width: 20px; height: 20px; }
.share a svg path,
.share a svg line,
.share a svg polyline,
.share a svg rect,
.share a svg circle { stroke: var(--accent); }
.share a:hover { border-color: var(--link); }

/* =========================================================
 * Журнал решений (сайдбар)
 * ========================================================= */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 16px 0;
    padding: 20px 22px;
    margin-bottom: 26px;
    position: relative;
}
.sidebar .widget::before,
.sidebar .widget::after {
    content: "";
    position: absolute;
    left: -2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg-dark);
}
.sidebar .widget::before { top: 14px; }
.sidebar .widget::after { bottom: 14px; }
.sidebar .widget-title {
    font-family: var(--mono);
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bg-dark);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li,
.sidebar .widget a { color: var(--text); }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 9px 0 9px 16px;
    border-left: 2px solid var(--border);
    position: relative;
    font-size: 0.9rem;
}
.sidebar .widget li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
.sidebar .widget .post-date {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
}

/* =========================================================
 * Подвал
 * ========================================================= */
.site-footer {
    background: var(--bg-dark);
    color: var(--on-dark);
    margin-top: 40px;
}
.footer-emblems {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding: 36px 0 8px;
    text-align: center;
}
.footer-emblem svg {
    width: 46px;
    height: 46px;
    display: block;
    margin: 0 auto 8px;
}
.footer-emblem svg path,
.footer-emblem svg line,
.footer-emblem svg circle,
.footer-emblem svg rect,
.footer-emblem svg polyline { stroke: var(--accent); }
.footer-emblem span {
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--on-dark);
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding: 30px 0 36px;
    border-top: 1px solid #3c4039;
    margin-top: 18px;
}
.footer-cols .widget { margin-bottom: 0; }
.footer-cols .widget-title {
    font-family: var(--mono);
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin: 0 0 14px;
}
.footer-cols .widget,
.footer-cols .widget p,
.footer-cols .widget li,
.footer-cols .widget a { color: var(--on-dark); }
.footer-cols .widget a:hover { color: #fff; }
.footer-cols .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-cols .widget li {
    padding: 6px 0;
    border-bottom: 1px dashed #3c4039;
    font-size: 0.9rem;
}
.site-info {
    border-top: 1px solid #3c4039;
    padding: 18px 0;
    font-size: 0.82rem;
    color: #b5b1a4;
}

/* =========================================================
 * Пагинация «лестницей»
 * ========================================================= */
.pager { margin: 36px 0 0; }
.pager-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px;
}
.pager-item .page-numbers {
    display: block;
    padding: 9px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: 3px solid var(--steel);
    color: var(--text);
    font-size: 0.9rem;
}
.pager-item .page-numbers:hover {
    text-decoration: none;
    border-bottom-color: var(--accent);
}
.pager-item-current .page-numbers {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    border-bottom-color: var(--accent-deep);
    transform: translateY(-7px);
}

/* =========================================================
 * Заголовки секций / архивов
 * ========================================================= */
.page-head {
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; font-size: 0.92rem; }

/* =========================================================
 * Форма поиска
 * ========================================================= */
.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.search-form .search-field {
    flex: 1 1 180px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.92rem;
    font-family: var(--sans);
    background: var(--bg-card);
    color: var(--text);
}
.search-form .search-submit {
    flex: 0 0 auto;
}

/* =========================================================
 * Главная страница
 * ========================================================= */
.home-section { padding: 46px 0; }
.home-section:nth-child(even) { background: rgba(92, 107, 115, 0.06); }
.section-lead {
    max-width: 720px;
    color: var(--muted);
    margin-bottom: 26px;
}
.intro-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}
.intro-figure {
    background: var(--bg-dark);
    border-radius: 4px 8px 16px 8px;
    padding: 28px;
}
.intro-figure svg { width: 100%; height: auto; display: block; }
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 22px;
}
.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 0 0 16px 4px;
    padding: 22px;
    min-width: 0;
}
.topic-card h3 { margin-bottom: 6px; }
.topic-card p { font-size: 0.9rem; color: var(--muted); margin: 0; }
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    background: var(--bg-card);
    border: 1px dashed var(--steel);
    border-radius: 4px 8px 16px 8px;
    padding: 22px;
    min-width: 0;
    position: relative;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
}
.step h3 { margin-bottom: 6px; }
.step p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* =========================================================
 * Слайдер коротких советов
 * ========================================================= */
.tips-slider {
    position: relative;
    overflow: hidden;
    border: 1px dashed var(--steel);
    border-radius: 4px 8px 16px 8px;
    background: var(--bg-card);
}
.tips-track {
    display: flex;
    transition: transform 0.4s ease;
}
.tip-slide {
    flex: 0 0 100%;
    min-width: 0;
    padding: 34px 40px;
}
.tip-slide h3 { color: var(--accent); }
.tip-slide p { margin: 0; color: var(--text); }
.tips-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 0 22px;
}
.tips-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: none;
    cursor: pointer;
    padding: 0;
}
.tips-dot.is-active { background: var(--accent); }

/* =========================================================
 * Комментарии
 * ========================================================= */
.comments-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px 8px 16px 8px;
    padding: 28px 32px;
    margin-top: 24px;
}
.comments-title { font-size: 1.3rem; }
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list ul.children {
    list-style: none;
    margin: 0 0 0 28px;
    padding: 0;
}
.comment-item { margin: 0 0 18px; }
.comment-body {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px 8px 12px 8px;
    padding: 16px 18px;
}
.comment-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.comment-avatar { border-radius: 50%; }
.comment-author { font-weight: 700; display: block; font-size: 0.95rem; }
.comment-date { font-size: 0.76rem; color: var(--muted); }
.comment-await { font-size: 0.82rem; color: var(--accent-deep); }
.comment-content { font-size: 0.95rem; }
.comment-content p { background: none; }
.comment-actions { font-size: 0.84rem; }
.comment-respond { margin-top: 24px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.92rem;
    background: var(--bg);
    color: var(--text);
}
.comment-form p { margin-bottom: 12px; }
.comment-form label { font-size: 0.86rem; color: var(--muted); }

/* =========================================================
 * Рулетка чтения (прогресс)
 * ========================================================= */
.reading-tape {
    position: fixed;
    top: 90px;
    right: 14px;
    width: 14px;
    height: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    z-index: 60;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.reading-tape.is-visible { opacity: 1; }
.reading-tape-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(var(--accent), var(--accent-deep));
}
.reading-tape-label {
    position: fixed;
    top: 96px;
    right: 32px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent-deep);
    z-index: 60;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.reading-tape-label.is-visible { opacity: 1; }

/* =========================================================
 * Cookie-баннер — правило [hidden] идёт ПЕРЕД основным блоком
 * ========================================================= */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    color: var(--on-dark);
    z-index: 80;
    padding: 16px 0;
    border-top: 3px solid var(--accent);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-text {
    flex: 1 1 320px;
    min-width: 0;
    font-size: 0.86rem;
    margin: 0;
}
.cookie-text a { color: var(--accent); }
.cookie-accept { flex: 0 0 auto; }

/* =========================================================
 * 404
 * ========================================================= */
.error-404 {
    text-align: center;
    padding: 50px 0;
}
.error-404 .code {
    font-family: var(--mono);
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
}
.error-404 .search-form {
    max-width: 420px;
    margin: 24px auto 0;
    justify-content: center;
}

/* =========================================================
 * Адаптив
 * ========================================================= */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }
    .layout-single .content-area { width: 100%; }
    .intro-block { grid-template-columns: minmax(0, 1fr); }
    body { font-size: 16px; }
}

@media (max-width: 600px) {
    .nav-toggle { display: block; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    .main-nav.is-open ul { display: flex; }
    .main-nav ul ul {
        position: static;
        width: 100%;
    }
    .main-nav a { border-top: none; border-left: 3px solid var(--steel); }
    .footer-emblems,
    .footer-cols { grid-template-columns: minmax(0, 1fr); }
    .entry { padding: 22px 18px; }
    .entry-thumb { margin: -22px -18px 20px; }
    .reading-tape, .reading-tape-label { display: none; }
    h1, .entry-title { font-size: 1.6rem; }
}
