/*
Theme Name: dds_slovarion.ru
Author: Анна Долинина
Description: Информационная тема для образовательно-практического ресурса о культуре слова, редактуре и стилистике.
Version: 1.1
Text Domain: slovarion
*/

/* ============================== Базовое ============================== */
:root {
    --ink: #20242e;
    --ink-soft: #3a3f4d;
    --paper: #f7f3ea;
    --card: #ffffff;
    --accent: #9b2d20;
    --accent-2: #c08a2d;
    --muted: #5a5750;
    --line: #e0d6c2;
    --footer-bg: #20242e;
    --footer-text: #cabfa9;
    --footer-head: #f3ecdd;
    --maxw: 1180px;
    --font-head: Georgia, "PT Serif", "Times New Roman", serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 0.6em;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.1em; }

blockquote {
    margin: 1.5em 0;
    padding: 0.6em 1.4em;
    border-left: 4px solid var(--accent);
    font-family: var(--font-head);
    font-style: italic;
    color: var(--ink-soft);
}

/* Единственный контейнер ширины (см. A12.7). */
.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    background: var(--ink);
    color: #fff;
    padding: 0.5em 1em;
    z-index: 100;
}

/* ============================== Шапка ============================== */
.site-header {
    background: var(--ink);
    color: var(--paper);
    border-bottom: 3px solid var(--accent);
}
.header-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    padding: 1.1rem 0;
}
.site-branding {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}
.brand-logo { display: block; flex: 0 0 auto; border-radius: 10px; }
.branding-text { min-width: 0; }
.site-title {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.15;
    font-family: var(--font-head);
}
.site-title a { color: var(--paper); }
.site-title a:hover { text-decoration: none; color: var(--accent-2); }
.site-description {
    margin: 0.25rem 0 0;
    font-size: 0.86rem;
    color: var(--accent-2);
    max-width: 46ch;
}

.main-nav { margin-left: auto; min-width: 0; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
}
.main-nav a {
    color: var(--paper);
    font-family: var(--font-head);
    font-size: 1.02rem;
    padding: 0.2rem 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--accent-2);
    color: var(--paper);
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    font-size: 1rem;
    cursor: pointer;
}

/* ============================== Хлебные крошки ============================== */
.breadcrumbs {
    font-size: 0.9rem;
    color: var(--muted);
    padding: 1.1rem 0 0;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs .sep { color: var(--line); margin: 0 0.15rem; }

/* ============================== Раскладки ============================== */
.site-main { padding: 1.5rem 0 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.6rem;
    align-items: start;
}
.layout-single {
    display: block;
}
.layout-single .content-area {
    min-width: 0;
}

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2rem; }
}

/* ============================== Сайдбар + виджеты ============================== */
.sidebar { min-width: 0; }
.widget {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.6rem;
}
.widget-title {
    font-size: 1.15rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
/* Сайдбар — светлый фон, тёмный текст (контраст, см. F). */
.sidebar .widget { color: var(--ink); }
.sidebar .widget a { color: var(--accent); }
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--line);
    font-family: var(--font-head);
}
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget .post-date,
.sidebar .widget time { display: block; font-size: 0.8rem; color: var(--muted); }

/* ============================== Карточки записей (см. A8, A10) ============================== */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.card:hover .card-thumb-wrap img { transform: scale(1.03); }
.card-thumb-placeholder {
    display: block;
    height: 200px;
    background: linear-gradient(135deg, #2b303c, #3a3f4d);
}
.card-body {
    flex: 1;
    padding: 1.3rem 1.4rem 1.5rem;
    min-width: 0;
}
.card-title { font-size: 1.4rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta { font-size: 0.84rem; color: var(--muted); margin-bottom: 0.7rem; }
.card-excerpt { color: var(--ink-soft); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    display: inline-block;
    margin-top: 0.4rem;
    font-family: var(--font-head);
    color: var(--accent);
    border-bottom: 1px solid currentColor;
}
.card-more:hover { text-decoration: none; }

/* Горизонтальная карточка последних записей на главной (position:absolute, см. A10). */
.card-row {
    flex-direction: row;
}
.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
}
.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 600px) {
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ============================== Записи и страницы ============================== */
.entry-header { margin-bottom: 1.4rem; }
.entry-title { font-size: 2.2rem; }
.entry-meta { color: var(--muted); font-size: 0.9rem; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: 8px; display: block; }
.entry-thumb { margin: 1.2rem 0; }
.entry-thumb img { width: 100%; border-radius: 10px; display: block; }

.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.4rem 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th,
.entry-content td { padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: #efe7d6; font-family: var(--font-head); }

/* ============================== Пагинация (type=plain, см. D5) ============================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2.4rem 0 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    font-family: var(--font-head);
    line-height: 1;
}
.pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: transparent;
}

/* ============================== Главная ============================== */
.front-section { padding: 3rem 0; }
.front-section:nth-child(even) { background: #f1e9d8; }

.hero {
    background: var(--ink);
    color: var(--paper);
    padding: 3.6rem 0;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 2.5rem;
    align-items: center;
}
.hero-title {
    color: var(--paper);
    font-size: 3rem;
    margin-bottom: 0.6rem;
}
.hero-title em { color: var(--accent-2); font-style: italic; }
.hero-lead { color: #ddd3c0; font-size: 1.15rem; max-width: 52ch; }
.hero-cta {
    display: inline-block;
    margin-top: 1rem;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.6rem;
    border-radius: 8px;
    font-family: var(--font-head);
}
.hero-cta:hover { background: #b8392a; text-decoration: none; }
.hero-art img { width: 100%; display: block; }

.section-head { margin-bottom: 1.8rem; }
.section-head .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 700;
}

/* Блок текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.6rem;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img { width: 100%; display: block; border-radius: 12px; }

/* Сетка карточек-рубрик */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}
.feature {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem 1.3rem;
    min-width: 0;
}
.feature .mark {
    width: 38px;
    height: 4px;
    background: var(--accent);
    margin-bottom: 0.9rem;
}
.feature h3 { margin-bottom: 0.4rem; }
.feature p { margin: 0; font-size: 0.96rem; color: var(--muted); }

/* Пошаговый блок */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
    counter-reset: step;
}
.step {
    min-width: 0;
    padding-left: 0.4rem;
}
.step .num {
    font-family: var(--font-head);
    font-size: 2.4rem;
    color: var(--accent-2);
    line-height: 1;
}
.step h3 { margin: 0.4rem 0 0.3rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* FAQ-аккордеон */
.faq { max-width: 60rem; }
.faq details {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.4rem 1.2rem;
    margin-bottom: 0.9rem;
}
.faq summary {
    cursor: pointer;
    font-family: var(--font-head);
    font-size: 1.15rem;
    padding: 0.7rem 0;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 0.9rem; color: var(--ink-soft); }

.latest-head { text-align: center; margin-bottom: 2rem; }
.latest-head .eyebrow { display: block; margin-bottom: 0.3rem; }
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}
.latest-grid .card-thumb-wrap img { height: 190px; }
@media (max-width: 960px) {
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .latest-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-art { order: -1; }
    .split, .split.reverse { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.3rem; }
}
@media (max-width: 600px) {
    .feature-grid { grid-template-columns: 1fr; }
}

/* ============================== Комментарии ============================== */
.comments-area { margin-top: 2.6rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.4rem; padding: 0; }
.comment-inner {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.comment-meta { display: flex; gap: 1rem; align-items: baseline; margin-bottom: 0.4rem; }
.comment-author { font-family: var(--font-head); font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-awaiting { color: var(--accent); font-size: 0.9rem; }
.comment-form label { display: block; font-family: var(--font-head); margin-bottom: 0.3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-bottom: 1rem;
    background: #fff;
}
.comment-form .submit,
.search-form button {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-family: var(--font-head);
    cursor: pointer;
}

/* ============================== Форма поиска ============================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 30rem;
}
.search-form label { flex: 1; min-width: 0; }
.search-form input[type="search"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

/* ============================== Карта сайта ============================== */
.sitemap-list { list-style: none; padding: 0; margin: 0 0 1.6rem; }
.sitemap-list li { padding: 0.35rem 0; border-bottom: 1px dashed var(--line); }

/* ============================== Подвал ============================== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 1.5rem;
    border-top: 3px solid var(--accent);
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.2rem;
}
/* Подвал — тёмный фон, светлый текст (контраст, см. F). */
.site-footer .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--footer-text);
}
.site-footer .widget-title { color: var(--footer-head); border-bottom-color: var(--accent-2); }
.site-footer .widget a { color: var(--footer-head); }
.site-footer .widget a:hover { color: var(--accent-2); }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 0.35rem 0; }
.site-footer .widget time,
.site-footer .widget .post-date { color: #9c917c; font-size: 0.8rem; }
.site-copyright {
    text-align: center;
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid #34394629;
    border-top-color: rgba(255,255,255,0.12);
    color: #9c917c;
    font-size: 0.88rem;
}

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

/* ============================== Cookie-баннер (см. D6, A11) ============================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: var(--ink);
    color: var(--paper);
    border-top: 2px solid var(--accent-2);
    padding: 1rem 0;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; flex: 1; min-width: 0; font-size: 0.92rem; color: #ddd3c0; }
.cookie-accept {
    background: var(--accent-2);
    color: var(--ink);
    border: 0;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-head);
    font-weight: 700;
    cursor: pointer;
}
.cookie-accept:hover { background: #d49a3c; }

/* ============================== 404 ============================== */
.error-404 { text-align: center; padding: 2rem 0 3rem; }
.error-404 .big { font-family: var(--font-head); font-size: 5rem; color: var(--accent); margin: 0; }
.error-404 .search-form { margin: 1.6rem auto 0; }

/* ============================== Меню-фоллбэк ============================== */
.menu-fallback { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; }
.menu-fallback a { color: var(--paper); }

@media (max-width: 720px) {
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-top: 1px solid rgba(255,255,255,0.12); }
    .main-nav a { display: block; padding: 0.7rem 0; }
}
