/*
Theme Name: dds_igramseiucim.com
Theme URI: https://igramseiucim.com/
Author: Дмитриев Иван
Author URI: https://igramseiucim.com/
Description: НейроГармония — спокойная, тёплая тема для информационного сайта о развитии детей и работе с детьми с особенностями. Мягкая палитра, крупный шрифт, удобные карточки материалов и заботливая навигация.
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nharm
*/

/* ============== Базовые переменные ============== */
:root {
    --bg-base: #F9F6F0;
    --bg-soft: #FFFCF6;
    --accent: #2F5E6B;
    --accent-dark: #244853;
    --warm: #C27A5E;
    --warm-dark: #A86347;
    --ink: #2E2E2C;
    --ink-soft: #7A7A78;
    --line: #E5E0D5;
    --focus-glow: #A3C9B7;
    --shadow-soft: 0 6px 18px rgba(47, 94, 107, 0.08);
    --shadow-hover: 0 10px 28px rgba(47, 94, 107, 0.16);
    --radius: 24px;
    --radius-sm: 14px;
}

/* ============== Сброс ============== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg-base);
    color: var(--ink);
    font-family: 'Nunito', 'Ubuntu', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 600px) {
    body { font-size: 17px; }
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--accent);
    font-weight: 700;
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(47, 94, 107, 0.25);
    transition: color .2s, border-color .2s;
}

a:hover {
    color: var(--warm-dark);
    border-bottom-color: var(--warm-dark);
}

ul, ol { padding-left: 1.4em; }
li { margin-bottom: .35em; }

blockquote {
    margin: 1.2em 0;
    padding: 1em 1.2em;
    background: var(--bg-soft);
    border-left: 4px solid var(--warm);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-style: italic;
}

code, pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    background: #F0EBDF;
    border-radius: 6px;
}

code { padding: .1em .35em; font-size: .92em; }

pre {
    padding: 1em;
    overflow-x: auto;
    line-height: 1.45;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

th, td {
    border: 1px solid var(--line);
    padding: .55em .75em;
    text-align: left;
}

th {
    background: rgba(47, 94, 107, 0.08);
    color: var(--accent);
    font-weight: 700;
}

hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2em 0;
}

/* ============== Контейнер ============== */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 600px) {
    .wrap { padding: 0 16px; }
}

/* ============== Кнопки ============== */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff !important;
    border: 2px solid var(--accent);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .25s, border-color .25s, box-shadow .25s, transform .15s;
}

.btn:hover {
    background: var(--warm-dark);
    border-color: var(--warm-dark);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--accent) !important;
    border-color: var(--accent);
}

.btn-ghost:hover {
    background: rgba(47, 94, 107, 0.08);
    color: var(--accent) !important;
    border-color: var(--accent);
}

.pill {
    display: inline-block;
    padding: 8px 18px;
    margin: 4px 6px 4px 0;
    border-radius: 999px;
    background: rgba(47, 94, 107, 0.1);
    color: var(--accent);
    font-size: .9rem;
    text-decoration: none;
    border: none;
    transition: background .2s;
}

.pill:hover {
    background: rgba(194, 122, 94, 0.18);
    color: var(--warm-dark);
    border: none;
}

.tag-easy   { background: rgba(105, 158, 109, 0.18); color: #486F4B; }
.tag-medium { background: rgba(214, 175, 84, 0.22);  color: #8A6913; }
.tag-pro    { background: rgba(194, 122, 94, 0.22);  color: var(--warm-dark); }

/* ============== Шапка ============== */
.site-header {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: none;
}

.brand:hover { border-bottom: none; }

.brand-logo,
.brand-svg {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent);
}

.brand-tagline {
    font-size: .85rem;
    color: var(--ink-soft);
    margin-top: 2px;
}

.primary-nav {
    margin-left: auto;
}

.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.primary-nav li { margin: 0; }

.primary-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 600;
    border-bottom: none;
    transition: background .2s, color .2s;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
    background: rgba(47, 94, 107, 0.1);
    color: var(--accent);
    border-bottom: none;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent);
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: auto;
}

@media (max-width: 960px) {
    .menu-toggle { display: inline-block; }
    .primary-nav {
        flex-basis: 100%;
        margin-left: 0;
        margin-top: 12px;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav ul { flex-direction: column; gap: 4px; }
}

/* ============== Хлебные крошки ============== */
.crumbs {
    padding: 14px 0;
    color: var(--ink-soft);
    font-size: .92rem;
}

.crumbs a {
    color: var(--ink-soft);
    border-bottom-color: rgba(122, 122, 120, 0.25);
}

.crumbs a:hover { color: var(--accent); }

.crumbs span[aria-current] { color: var(--ink); }

.crumbs .sep { margin: 0 8px; opacity: .55; }

/* ============== Layout ============== */
.layout {
    display: grid;
    gap: 36px;
    margin: 24px 0 60px;
}

.layout.has-sidebar {
    grid-template-columns: 67% 27%;
    justify-content: space-between;
}

.layout.no-sidebar {
    grid-template-columns: 85%;
    justify-content: center;
}

.layout.full-width {
    grid-template-columns: 1fr;
}

@media (max-width: 960px) {
    .layout.has-sidebar,
    .layout.no-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ============== Карточки записей (правило A8, A10) ============== */
.cards {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    margin: 16px 0 32px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow .25s, transform .2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: none;
}

.card-body {
    flex: 1;
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
}

.card-title {
    margin: 0 0 .35em;
    font-size: 1.18rem;
    line-height: 1.3;
}

.card-title a {
    color: var(--accent);
    border-bottom: none;
}

.card-title a:hover {
    color: var(--warm-dark);
    border-bottom: none;
}

.card-meta {
    color: var(--ink-soft);
    font-size: .85rem;
    margin: 0 0 .7em;
}

.card-excerpt {
    color: var(--ink);
    font-size: .96rem;
    margin-bottom: 1em;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    margin-top: auto;
    align-self: flex-start;
}

/* Горизонтальная карточка (на главной — рекомендации) */
.card-row {
    flex-direction: row;
}

.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}

.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: none;
}

.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 600px) {
    .card-row {
        flex-direction: column;
    }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a {
        position: static;
    }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ============== Сайдбар ============== */
.sidebar { padding-top: 8px; }

.widget {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    margin-bottom: 24px;
}

.widget-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: var(--accent);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
}

.widget ul li:last-child { border-bottom: none; }

/* Пазл-навигатор */
.puzzle-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.puzzle-piece {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: rgba(47, 94, 107, 0.08);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
    padding: 4px;
    border: none;
    transition: background .2s, transform .15s;
}

.puzzle-piece:hover {
    background: rgba(194, 122, 94, 0.2);
    color: var(--warm-dark);
    transform: scale(1.04);
    border: none;
}

/* ============== Главная ============== */
.hero {
    background: linear-gradient(135deg, rgba(47, 94, 107, 0.08), rgba(194, 122, 94, 0.08));
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 48px 40px;
    margin: 24px 0 36px;
    text-align: center;
}

.hero h1 {
    margin-top: 0;
    font-size: 2.4rem;
}

.hero p {
    max-width: 720px;
    margin: 0 auto 20px;
    color: var(--ink);
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    .hero { padding: 32px 22px; }
    .hero h1 { font-size: 1.7rem; }
}

.section {
    margin: 36px 0;
    padding: 32px 30px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.section h2 {
    margin-top: 0;
}

.section-lede {
    color: var(--ink);
    font-size: 1.05rem;
    margin-bottom: 1.4em;
    max-width: 760px;
}

.feature-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 18px;
}

.feature {
    background: var(--bg-base);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 22px;
}

.feature .icon {
    width: 48px;
    height: 48px;
    color: var(--warm);
    margin-bottom: 12px;
    display: block;
}

.feature h3 {
    margin: 0 0 .4em;
    font-size: 1.1rem;
}

.feature p {
    margin: 0;
    color: var(--ink);
    font-size: .96rem;
}

.steps {
    counter-reset: step;
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.step {
    background: var(--bg-base);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 24px 20px 70px;
    position: relative;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--warm);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step h3 {
    margin: 0 0 .25em;
    font-size: 1.05rem;
}

.step p { margin: 0; color: var(--ink); }

/* ============== Запись / страница ============== */
.entry {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 30px 36px;
}

.entry-title {
    margin-top: 0;
}

.entry-meta {
    color: var(--ink-soft);
    font-size: .92rem;
    margin-bottom: 1.4em;
}

.entry-content img {
    border-radius: var(--radius-sm);
    margin: 1em 0;
}

.entry-content > * { max-width: 100%; }

.post-tags {
    margin-top: 1.6em;
    padding-top: 1.2em;
    border-top: 1px solid var(--line);
}

.post-tags .label {
    color: var(--ink-soft);
    margin-right: 6px;
}

@media (max-width: 600px) {
    .entry { padding: 22px 18px; }
}

/* ============== Пагинация ============== */
.pagination {
    margin: 28px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: background .2s, color .2s, border-color .2s;
}

.pagination a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination .current {
    background: var(--warm);
    color: #fff;
    border-color: var(--warm);
}

.pagination .dots {
    background: transparent;
    border: none;
}

/* ============== Комментарии ============== */
.comments-block {
    margin-top: 36px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 26px 30px;
}

.comments-block .comments-title {
    margin-top: 0;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.comment-list li {
    margin-bottom: 16px;
    padding: 16px 18px;
    background: var(--bg-base);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.comment-list .children {
    list-style: none;
    padding: 12px 0 0 18px;
    margin: 12px 0 0;
    border-left: 2px solid var(--line);
}

.comment-author {
    font-weight: 700;
    color: var(--accent);
}

.comment-date {
    color: var(--ink-soft);
    font-size: .85rem;
    margin-left: 8px;
}

.comment-body { margin-top: 6px; }

.comment-form label {
    display: block;
    margin: 12px 0 4px;
    font-weight: 600;
    color: var(--accent);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.searchform input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}

.comment-form input:focus,
.comment-form textarea:focus,
.searchform input[type="search"]:focus {
    outline: none;
    border-color: var(--focus-glow);
    box-shadow: 0 0 0 4px rgba(163, 201, 183, 0.4);
}

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

.comment-form .form-submit { margin-top: 16px; }

.comment-form .submit {
    display: inline-block;
    padding: 12px 26px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: background .25s, border-color .25s;
}

.comment-form .submit:hover {
    background: var(--warm-dark);
    border-color: var(--warm-dark);
}

/* ============== Форма поиска ============== */
.searchform {
    display: flex;
    gap: 8px;
    margin: 14px 0;
}

.searchform input[type="search"] {
    flex: 1;
}

.searchform .submit-search {
    padding: 12px 22px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--accent);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .25s;
}

.searchform .submit-search:hover {
    background: var(--warm-dark);
    border-color: var(--warm-dark);
}

/* ============== Подвал ============== */
.site-footer {
    background: var(--accent);
    color: #E9E4D6;
    padding: 44px 0 20px;
    margin-top: 48px;
}

.site-footer a {
    color: #F2EAD8;
    border-bottom-color: rgba(242, 234, 216, 0.3);
}

.site-footer a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

@media (max-width: 960px) {
    .footer-cols { grid-template-columns: 1fr; gap: 24px; }
}

.site-footer .widget {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: #F2EAD8;
    margin-bottom: 0;
}

.site-footer .widget-title {
    color: #fff;
}

.site-footer .widget ul li {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.copyright {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    font-size: .9rem;
    color: #DCD4BD;
}

.quiet-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 8px 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    color: #F2EAD8;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    font: inherit;
}

.quiet-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.quiet-toggle .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warm);
}

/* ============== Cookie-баннер (правило A11) ============== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    padding: 18px 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.cookie-banner p {
    margin: 0;
    flex: 1 1 280px;
    font-size: .95rem;
    color: var(--ink);
}

.cookie-banner .cookie-accept {
    padding: 10px 22px;
    border-radius: var(--radius);
    background: var(--warm);
    color: #fff;
    border: 2px solid var(--warm);
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.cookie-banner .cookie-accept:hover {
    background: var(--warm-dark);
    border-color: var(--warm-dark);
}

/* ============== 404 ============== */
.notfound {
    text-align: center;
    padding: 60px 20px;
}

.notfound .code {
    font-size: 5rem;
    color: var(--warm);
    margin: 0;
    line-height: 1;
    font-weight: 800;
}

.notfound h1 {
    margin: 12px 0 12px;
}

/* ============== Режим «Тихий экран» ============== */
body.quiet-mode * {
    animation: none !important;
    transition: none !important;
}

body.quiet-mode {
    line-height: 1.8;
}

body.quiet-mode .ink-soft,
body.quiet-mode .card-meta,
body.quiet-mode .crumbs {
    color: #9A9A98;
}

/* ============== Выравнивания WP ============== */
.alignleft  { float: left;  margin: .4em 1.2em .8em 0; }
.alignright { float: right; margin: .4em 0 .8em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide  { max-width: 100%; }
.alignfull  { width: 100%; }

.wp-caption {
    max-width: 100%;
    margin: 1em 0;
}

.wp-caption-text,
figcaption {
    font-size: .9rem;
    color: var(--ink-soft);
    text-align: center;
    margin-top: .4em;
}

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============== Утилиты ============== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
