/*
Theme Name: dds_arskland.ru
Author: Елизавета Климова
Description: Информационная тема для сайта о событиях и сообществах: афиши, новости, локальные инициативы, обсуждения и полезные сервисы.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: arskland
*/

/* ============ Переменные ============ */
:root {
    --bg: #f5f3ed;
    --surface: #ffffff;
    --ink: #22262e;
    --muted: #5f6773;
    --line: #e2ddd2;
    --primary: #34507e;
    --primary-dark: #263c60;
    --accent: #dd6a3d;
    --accent-soft: #f3e2d6;
    --footer-bg: #1c2430;
    --footer-ink: #c7ced9;
    --footer-head: #ffffff;
    --radius: 12px;
    --shell: min(92%, 1180px);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "PT Sans", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.6em;
    font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.shell { width: var(--shell); margin-inline: auto; }

/* ============ Шапка ============ */
.site-header {
    background: var(--surface);
    border-bottom: 3px solid var(--primary);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.brand-logo, .brand-logo svg { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    margin: 0;
}
.brand-title a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.15rem 0 0;
    line-height: 1.35;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0;
    padding: 0;
}
.main-nav a {
    color: var(--ink);
    font-weight: 600;
    padding: 0.35rem 0.2rem;
    display: inline-block;
}
.main-nav a:hover { color: var(--accent); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--accent); }

.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    font-size: 1rem;
    cursor: pointer;
}

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

.layout-with-sidebar {
    display: flex;
    gap: 2.2rem;
    align-items: flex-start;
}
.layout-with-sidebar .content-area { flex: 1 1 auto; min-width: 0; width: 67%; }
.layout-with-sidebar .sidebar { flex: 0 0 27%; min-width: 0; }

.layout-single .content-area { width: 85%; margin-inline: auto; min-width: 0; }

@media (max-width: 960px) {
    .layout-with-sidebar { flex-direction: column; }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar { width: 100%; flex: none; }
    .layout-single .content-area { width: 100%; }
}

/* ============ Хлебные крошки ============ */
.breadcrumbs {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0 0 1.4rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs .sep { color: var(--line); margin: 0 0.35rem; }

/* ============ Карточки записей ============ */
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.6rem;
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
    background: var(--accent-soft);
}
.card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.card-thumb-wrap:hover img { transform: scale(1.03); }
.card-body {
    flex: 1;
    padding: 1.2rem 1.4rem 1.4rem;
    min-width: 0;
}
.card-title { font-size: 1.25rem; margin: 0 0 0.4rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.7rem;
}
.card-excerpt { color: #3a4048; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    display: inline-block;
    margin-top: 0.4rem;
    font-weight: 600;
    color: var(--accent);
}
.card-more:hover { text-decoration: underline; }

/* Горизонтальные карточки для сетки «последние записи» на главной */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}
.post-grid .card { margin-bottom: 0; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

/* ============ Одиночная запись / страница ============ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem 2rem 2.2rem;
}
.entry-title { font-size: 1.9rem; }
.entry-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; display: block; margin: 1rem 0; }
.entry-content h2, .entry-content h3 { margin-top: 1.4rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-thumb { border-radius: 10px; margin-bottom: 1.2rem; display: block; width: 100%; object-fit: cover; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
    border: 1px solid var(--line);
}
th, td {
    border: 1px solid var(--line);
    padding: 0.6rem 0.8rem;
    text-align: left;
}
th { background: var(--accent-soft); }

blockquote {
    margin: 1.2rem 0;
    padding: 1rem 1.4rem;
    border-left: 4px solid var(--accent);
    background: #fbf6f1;
    border-radius: 0 8px 8px 0;
    color: #3a4048;
}

/* ============ Сайдбар / виджеты ============ */
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.4rem;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
.sidebar .widget a { color: var(--primary); }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.4rem 0; border-bottom: 1px dashed var(--line); color: var(--ink); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar .post-date, .sidebar .rss-date { color: var(--muted); font-size: 0.8rem; }

/* ============ Форма поиска ============ */
.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.search-form .search-field {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}
.search-form .search-submit {
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    font-size: 0.95rem;
}
.search-form .search-submit:hover { background: var(--primary-dark); }

/* ============ Пагинация ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 2rem 0 0.5rem;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: none;
}

/* ============ Главная ============ */
.front { padding: 2rem 0 2.6rem; }
.front-section { margin-bottom: 2.6rem; }
.section-head { margin-bottom: 1.3rem; }
.section-head h2 { margin: 0; }
.section-head .lead { color: var(--muted); margin: 0.4rem 0 0; }

/* Блок текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
}
.fs-split.reverse .fs-split-media { order: -1; }
.fs-split-text { min-width: 0; }
.fs-split-text h2 { margin-top: 0; }
.fs-split-media { min-width: 0; }
.fs-split-media img { width: 100%; border-radius: 10px; display: block; }
@media (max-width: 760px) {
    .fs-split { grid-template-columns: 1fr; padding: 1.6rem 1.4rem; }
    .fs-split.reverse .fs-split-media { order: 0; }
}

/* Сетка рубрик */
.fs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
}
.rubric {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.3rem;
    min-width: 0;
}
.rubric-ic {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft);
    border-radius: 10px;
    margin-bottom: 0.8rem;
}
.rubric-ic svg { width: 26px; height: 26px; display: block; }
.rubric h3 { font-size: 1.08rem; margin: 0 0 0.35rem; }
.rubric p { margin: 0; font-size: 0.92rem; color: var(--muted); }
@media (max-width: 960px) { .fs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .fs-grid { grid-template-columns: 1fr; } }

/* Пошаговый блок */
.fs-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.3rem;
}
.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.4rem 1.5rem;
    min-width: 0;
    position: relative;
}
.step-num {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 0.7rem;
}
.step h3 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.step p { margin: 0; font-size: 0.93rem; color: var(--muted); }
@media (max-width: 760px) { .fs-steps { grid-template-columns: 1fr; } }

/* Последние записи заголовок */
.front-latest .section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.front-latest .all-link { font-weight: 600; color: var(--accent); white-space: nowrap; }

/* CTA */
.fs-cta {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.4rem 2.2rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; margin-top: 0; }
.fs-cta p { color: #d7deea; max-width: 640px; margin: 0 auto 1.3rem; }
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.7rem;
    border-radius: 8px;
    font-weight: 700;
}
.btn:hover { background: #c85a30; text-decoration: none; color: #fff; }
@media (max-width: 600px) { .fs-cta { padding: 1.9rem 1.4rem; } }

/* ============ 404 ============ */
.error-404 {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem 2rem;
    text-align: center;
}
.error-404 .code { font-size: 3.4rem; font-weight: 800; color: var(--accent); margin: 0; }
.error-404 .search-form { max-width: 420px; margin: 1.4rem auto 0; }

/* ============ Комментарии ============ */
.comments-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
    margin-top: 1.6rem;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.comment-list .children { list-style: none; padding-left: 1.4rem; }
.comment-meta { font-size: 0.85rem; color: var(--muted); 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.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-top: 0.25rem;
    background: #fff;
}
.comment-form .form-submit input {
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    font-size: 0.95rem;
}

/* ============ Подвал ============ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 2.6rem 0 1.8rem;
}
.footer-col { min-width: 0; }
.footer-col .widget-title,
.footer-col h2 {
    color: var(--footer-head);
    font-size: 1.05rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.footer-col, .footer-col p, .footer-col li { color: var(--footer-ink); }
.footer-col a { color: #e6ebf3; }
.footer-col a:hover { color: var(--accent); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 0.32rem 0; }
.footer-col .post-date, .footer-col .rss-date { color: #9aa4b3; font-size: 0.8rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 1.1rem 0 1.4rem;
    font-size: 0.85rem;
    color: #9aa4b3;
}
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ============ Cookie-баннер ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: rgba(28,36,48,0.97);
    color: #eef1f6;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 780px; }
.cookie-banner a { color: var(--accent); }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 1.3rem;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}
.cookie-accept:hover { background: #c85a30; }

/* ============ Адаптив меню ============ */
@media (max-width: 860px) {
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .main-nav a { display: block; padding: 0.7rem 0; }
}
