/*
Theme Name: dds_editionpress.ru
Author: Марина Вишневская
Description: Информационная тема для образовательно-коммуникационной экосистемы о креативном письме и филологии.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: editionpress
*/

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --paper:   #f6f1e7;
    --surface: #fffdf8;
    --surface-2: #f0e8d8;
    --ink:     #26221c;
    --muted:   #6b6055;
    --line:    #ddd2bf;
    --claret:  #8a2f2a;
    --claret-d:#6f231f;
    --gold:    #b3892f;
    --dark:    #211c16;
    --dark-2:  #2c2519;
    --on-dark: #ece3d3;
    --on-dark-muted: #b8ac98;
    --maxw:    1180px;
    --radius:  10px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
    line-height: 1.22;
    color: var(--ink);
    font-weight: 700;
}

h1 { font-size: 2.2rem; margin: 0 0 .6em; }
h2 { font-size: 1.7rem; margin: 0 0 .55em; }
h3 { font-size: 1.25rem; margin: 0 0 .5em; }

p { margin: 0 0 1.1em; }

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

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

.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

.accent { color: var(--claret); }

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--surface);
    border-bottom: 3px double var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 0;
    flex-wrap: wrap;
    min-width: 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 320px;
}
.brand-logo,
.brand-logo svg {
    width: 64px;
    height: 64px;
    display: block;
    flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-title {
    font-family: "Iowan Old Style", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
    display: block;
    max-width: 52ch;
}
.brand-title a { color: inherit; text-decoration: none; }
.brand-desc {
    font-size: .92rem;
    color: var(--muted);
    margin-top: 6px;
    max-width: 60ch;
}

.main-nav {
    flex: 0 0 auto;
    margin-left: auto;
}
.menu-toggle {
    display: none;
    background: var(--claret);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 9px 14px;
    font: inherit;
    font-size: .95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--ink);
    border-radius: 6px;
    font-size: .98rem;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--surface-2);
    color: var(--claret-d);
    text-decoration: none;
}

/* ============================================================
   Макет страниц
   ============================================================ */
.site-main { 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 { display: block; }
.layout-single .content-area { width: 85%; margin-inline: auto; }

.content-area { min-width: 0; }

/* ============================================================
   Хлебные крошки
   ============================================================ */
.crumbs {
    font-size: .88rem;
    color: var(--muted);
    margin: 0 0 24px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--claret); }
.crumbs .sep { margin: 0 7px; color: var(--line); }
.crumbs span:last-child { color: var(--ink); }

/* ============================================================
   Записи / контент
   ============================================================ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px 38px;
    margin-bottom: 30px;
}
.entry-title { margin-top: 0; }
.entry-meta {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 18px;
}
.entry-meta a { color: var(--muted); }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content blockquote {
    border-left: 4px solid var(--gold);
    margin: 1.4em 0;
    padding: .2em 1.2em;
    color: var(--muted);
    font-style: italic;
    background: var(--surface-2);
    border-radius: 0 8px 8px 0;
}
.entry-featured {
    margin: 0 0 22px;
    border-radius: 8px;
    overflow: hidden;
}
.entry-featured img { display: block; width: 100%; height: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid var(--line);
}
th, td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
th { background: var(--surface-2); }

/* ============================================================
   Карточки записей
   ============================================================ */
.card-list { display: grid; gap: 26px; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(135deg, var(--surface-2), var(--paper));
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px 24px 24px;
    min-width: 0;
}
.card-title { font-size: 1.3rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--claret); text-decoration: none; }
.card-meta {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 12px;
}
.card-excerpt { color: #4c4439; font-size: .98rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    display: inline-block;
    padding: 8px 18px;
    background: var(--claret);
    color: #fff;
    border-radius: 6px;
    font-size: .9rem;
}
.card-more:hover { background: var(--claret-d); color: #fff; text-decoration: none; }

/* ============================================================
   Пагинация
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 34px 0 0;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font-size: .95rem;
    line-height: 1;
}
.pager a.page-numbers:hover {
    border-color: var(--claret);
    color: var(--claret);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--claret);
    border-color: var(--claret);
    color: #fff;
}
.pager .page-numbers.dots {
    border: 0;
    background: none;
}

/* ============================================================
   Сайдбар + виджеты
   ============================================================ */
.sidebar { min-width: 0; }

.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 26px;
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
    color: var(--ink);
}
.widget a { color: var(--claret); }
.widget a:hover { color: var(--claret-d); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: .96rem;
    color: var(--ink);
}
.widget ul li:last-child { border-bottom: 0; }
.widget .post-date,
.widget .rss-date { color: var(--muted); font-size: .82rem; }

/* ============================================================
   Главная
   ============================================================ */
.home-wrap { padding: 30px 0 60px; }
.home-section { margin-bottom: 56px; }

/* hero */
.hero {
    background: var(--dark);
    color: var(--on-dark);
    border-radius: 14px;
    overflow: hidden;
    margin: 30px 0 56px;
}
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 0;
}
.hero-text { padding: 50px 48px; min-width: 0; }
.hero-text h1 { color: #fff; font-size: 2.3rem; }
.hero-text p { color: var(--on-dark-muted); font-size: 1.08rem; }
.hero-text .btn {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 26px;
    background: var(--gold);
    color: #231d10;
    border-radius: 7px;
    font-weight: 700;
}
.hero-text .btn:hover { background: #c79a3f; color: #231d10; text-decoration: none; }
.hero-figure { align-self: stretch; min-width: 0; }
.hero-figure img,
.hero-figure svg { width: 100%; height: 100%; object-fit: cover; display: block; }

/* текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img,
.split-media svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}
.split-text { min-width: 0; }
.section-kicker {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .76rem;
    color: var(--gold);
    font-family: Georgia, serif;
    margin-bottom: 8px;
}

/* шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--claret);
    color: #fff;
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 1.1rem; }
.step p { margin: 0; font-size: .95rem; color: var(--muted); }

/* факты */
.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.fact {
    padding: 32px 20px;
    text-align: center;
    border-right: 1px solid var(--line);
    min-width: 0;
}
.fact:last-child { border-right: 0; }
.fact-num {
    font-family: Georgia, serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--claret);
    line-height: 1;
}
.fact-label { font-size: .92rem; color: var(--muted); margin-top: 8px; }

/* галерея */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.gallery-grid figure {
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* цитата */
.pullquote {
    background: var(--dark);
    color: var(--on-dark);
    border-radius: 14px;
    padding: 54px 48px;
    text-align: center;
}
.pullquote blockquote {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.8rem;
    line-height: 1.45;
    font-style: italic;
    color: #fff;
}
.pullquote cite {
    display: block;
    margin-top: 18px;
    font-size: .95rem;
    font-style: normal;
    color: var(--gold);
}

/* FAQ */
.faq { display: grid; gap: 14px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 24px;
}
.faq summary {
    cursor: pointer;
    padding: 18px 0;
    font-weight: 700;
    font-family: Georgia, serif;
    list-style: none;
    position: relative;
    padding-right: 30px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 16px;
    font-size: 1.4rem;
    color: var(--claret);
}
.faq details[open] summary::after { content: '–'; }
.faq details > p { margin: 0 0 18px; color: var(--muted); }

/* CTA */
.cta {
    background: linear-gradient(135deg, var(--claret), var(--claret-d));
    color: #fff;
    border-radius: 14px;
    padding: 46px 40px;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.88); max-width: 60ch; margin-inline: auto; }
.cta .btn {
    display: inline-block;
    margin-top: 8px;
    padding: 13px 30px;
    background: #fff;
    color: var(--claret-d);
    border-radius: 7px;
    font-weight: 700;
}
.cta .btn:hover { background: var(--paper); color: var(--claret-d); text-decoration: none; }

.section-head { margin-bottom: 26px; }
.section-head h2 { margin-bottom: 6px; }
.section-head p { color: var(--muted); margin: 0; }

/* последние записи на главной */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
    margin-top: 30px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-inner {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 18px;
}
.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; }
.comment-date { font-size: .8rem; color: var(--muted); }
.comment-pending { color: var(--claret); font-style: italic; }
.comment-respond {
    margin-top: 24px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}
.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(--line);
    border-radius: 6px;
    font: inherit;
    background: var(--surface);
    margin-top: 4px;
}
.comment-form p { margin-bottom: 14px; }
.comment-form .submit,
.comment-form input[type="submit"] {
    background: var(--claret);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 11px 24px;
    font: inherit;
    cursor: pointer;
}
.comment-form input[type="submit"]:hover { background: var(--claret-d); }

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: var(--surface);
}
.search-form .search-submit {
    background: var(--claret);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 10px 18px;
    font: inherit;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--claret-d); }

/* ============================================================
   404
   ============================================================ */
.notfound { text-align: center; padding: 30px 0; }
.notfound .big { font-family: Georgia, serif; font-size: 6rem; color: var(--claret); line-height: 1; }
.notfound .search-form { max-width: 460px; margin: 24px auto 0; }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--dark);
    color: var(--on-dark);
    padding: 50px 0 26px;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 38px;
}
.site-footer .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--on-dark);
}
.site-footer .widget-title {
    color: #fff;
    border-bottom-color: var(--gold);
}
.site-footer .widget,
.site-footer .widget p,
.site-footer .widget li { color: var(--on-dark); }
.site-footer .widget a { color: var(--on-dark); }
.site-footer .widget a:hover { color: var(--gold); }
.site-footer .widget ul li { border-bottom-color: rgba(255,255,255,.12); }
.site-footer .widget .post-date { color: var(--on-dark-muted); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.14);
    margin-top: 36px;
    padding-top: 22px;
    font-size: .85rem;
    color: var(--on-dark-muted);
    text-align: center;
}

/* ============================================================
   Cookie-баннер  (правило [hidden] — ДО основного блока, см. A11)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: var(--dark-2);
    color: var(--on-dark);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    border-top: 2px solid var(--gold);
}
.cookie-banner p { margin: 0; font-size: .92rem; max-width: 70ch; }
.cookie-banner a { color: var(--gold); }
.cookie-banner button {
    background: var(--gold);
    color: #231d10;
    border: 0;
    border-radius: 6px;
    padding: 10px 22px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-banner button:hover { background: #c79a3f; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 34px; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-figure { order: -1; max-height: 280px; }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fact:nth-child(2) { border-right: 0; }
    .fact { border-bottom: 1px solid var(--line); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    h1 { font-size: 1.8rem; }
    .hero-text { padding: 34px 26px; }
    .hero-text h1 { font-size: 1.9rem; }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
    .steps { grid-template-columns: 1fr; }
    .facts { grid-template-columns: 1fr; }
    .fact { border-right: 0; border-bottom: 1px solid var(--line); }
    .fact:last-child { border-bottom: 0; }
    .latest-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 30px; }
    .layout-single .content-area { width: 100%; }
    .entry { padding: 24px 22px; }
    .pullquote blockquote { font-size: 1.4rem; }

    .main-nav { margin-left: 0; width: 100%; }
    .menu-toggle { display: inline-block; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 2px;
        margin-top: 12px;
    }
    .main-nav ul.is-open { display: flex; }
    .main-nav a { padding: 12px 14px; border-radius: 6px; background: var(--surface-2); }
}
