/*
Theme Name: dds_booksplim.ru
Author: Анна Соболева
Description: Информационная тема для образовательной платформы по делопроизводству, кадровому учёту и архивному делу.
Version: 1.1
Text Domain: booksplim
*/

:root {
    --navy: #1f3a5f;
    --navy-2: #2d5080;
    --gold: #c69a3a;
    --ink: #2a3344;
    --muted: #5d6b80;
    --light: #eef2f7;
    --line: #d8dfe8;
    --paper: #ffffff;
    --footer-bg: #182a42;
    --footer-text: #cdd7e6;
    --maxw: 1180px;
    --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.65;
    overflow-x: hidden;
}

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

a { color: var(--navy-2); }
a:hover { color: var(--gold); }

h1, h2, h3 { color: var(--navy); line-height: 1.25; }

p { margin: 0 0 1em; }

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

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

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary {
    background: var(--gold);
    color: #ffffff;
}
.btn-primary:hover {
    background: #b1842b;
    color: #ffffff;
}

/* ---------- Шапка ---------- */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-link { display: flex; flex: 0 0 auto; }
.brand-logo { display: block; width: 48px; height: 48px; }
.brand-text { min-width: 0; }
.site-title {
    display: block;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    font-size: 1.02rem;
    line-height: 1.3;
}
.site-description {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.primary-nav { flex: 0 0 auto; }
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-list a {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    color: var(--ink);
    border-radius: 6px;
    font-weight: 500;
}
.nav-list a:hover { background: var(--light); color: var(--navy); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    width: 24px; height: 2px;
    background: var(--navy);
    display: block;
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--light), #ffffff);
    border-bottom: 1px solid var(--line);
}
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    padding: 56px 0;
}
.hero-title { font-size: 2.1rem; margin: 0 0 16px; }
.hero-lead { font-size: 1.08rem; color: var(--muted); margin-bottom: 24px; }
.hero-media img { display: block; width: 100%; height: auto; border-radius: var(--radius); }

/* ---------- Секции ---------- */
.section { padding: 56px 0; }
.section:nth-child(even) { background: var(--light); }
.section-title { font-size: 1.7rem; margin: 0 0 28px; }
.section-title.center { text-align: center; }

/* Текст + иллюстрация */
.split-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
.split-media img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }

/* Сетка направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}
.feature-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 20px;
    min-width: 0;
}
.feature-icon { display: block; width: 56px; height: 56px; margin-bottom: 14px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.12rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Шаги */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 20px;
    min-width: 0;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}
.step h3 { margin: 0 0 8px; font-size: 1.08rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 4px 20px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--navy);
    padding: 14px 0;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--gold); font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-body { padding-bottom: 14px; }
.faq-body p { margin: 0; color: var(--muted); }

/* ---------- Карточки записей ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.layout-with-sidebar .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
}
.card-thumb-wrap { overflow: hidden; }
.card-thumb-wrap img,
.card-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-width: 0;
}
.card-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; }
.card-title { font-size: 1.14rem; margin: 0 0 10px; }
.card-title a { color: var(--navy); text-decoration: none; }
.card-title a:hover { color: var(--gold); }
.card-excerpt { color: var(--ink); font-size: 0.95rem; flex: 1; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--navy-2);
}
.card-more:hover { color: var(--gold); }

/* ---------- Раскладки страниц ---------- */
.page-wrap { padding: 28px 0 56px; }
.layout-single { display: block; }
.layout-single .content-area { width: 85%; margin-left: auto; margin-right: auto; }

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

.page-heading { font-size: 1.9rem; margin: 0 0 24px; }

/* Контент записи */
.single-thumb img { display: block; width: 100%; height: auto; border-radius: var(--radius); margin-bottom: 20px; }
.single-meta { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }
.single-content { font-size: 1.02rem; }
.single-content img { border-radius: 8px; }
.single-content h2 { margin-top: 1.6em; }
.single-tags { margin-top: 24px; }
.single-tags a {
    display: inline-block;
    background: var(--light);
    padding: 4px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 6px 6px 0;
}

/* Таблицы в контенте */
.single-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.4em 0;
}
.single-content table,
.single-content th,
.single-content td {
    border: 1px solid var(--line);
}
.single-content th,
.single-content td { padding: 10px 12px; }
.single-content th { background: var(--light); }

/* ---------- Сайдбар ---------- */
.sidebar {
    background: var(--light);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 24px; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title { color: var(--navy); font-size: 1.1rem; margin: 0 0 12px; }
.sidebar a { color: var(--navy-2); text-decoration: none; }
.sidebar a:hover { color: var(--gold); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.sidebar li:last-child { border-bottom: none; }
.sidebar .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.breadcrumbs a { color: var(--navy-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line); }

/* ---------- Пагинация ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--navy-2);
    background: var(--paper);
}
.pagination a.page-numbers:hover { border-color: var(--gold); color: var(--gold); }
.pagination .page-numbers.current {
    background: var(--navy);
    border-color: var(--navy);
    color: #ffffff;
}
.pagination .page-numbers.dots { border: none; background: none; }

/* ---------- Поиск ---------- */
.search-form {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
}
.search-submit {
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}
.search-submit:hover { background: var(--navy-2); }

/* ---------- Комментарии ---------- */
.comments-area { margin-top: 40px; }
.comments-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0 0 30px; padding: 0; }
.comment-list .children { list-style: none; margin: 0; padding-left: 28px; }
.comment-inner {
    background: var(--light);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.comment-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.comment-author { font-weight: 600; color: var(--navy); }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-respond {
    background: var(--light);
    border-radius: 10px;
    padding: 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: 8px;
    font-size: 1rem;
    margin-bottom: 12px;
}

.empty-note { color: var(--muted); }
.error-404 .search-form { max-width: 520px; }

/* ---------- Подвал ---------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 48px 0 32px;
}
.footer-col { min-width: 0; }
.site-footer .widget-title { color: #ffffff; font-size: 1.08rem; margin: 0 0 14px; }
.site-footer .widget { color: var(--footer-text); }
.site-footer p { color: var(--footer-text); }
.site-footer a { color: #ffffff; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 6px 0; }
.site-footer .post-date { display: block; font-size: 0.78rem; color: #9fb0c8; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 20px 0;
}
.copyright { margin: 0; font-size: 0.86rem; color: #9fb0c8; }

/* ---------- Cookie-баннер ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--navy);
    color: #fff;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; flex: 1; min-width: 0; font-size: 0.9rem; color: #e6edf6; }
.cookie-accept {
    flex: 0 0 auto;
    padding: 10px 26px;
    border: none;
    border-radius: 8px;
    background: var(--gold);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.cookie-accept:hover { background: #b1842b; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; gap: 28px; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards-grid,
    .layout-with-sidebar .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
}

@media (max-width: 600px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .nav-list { flex-direction: column; }
    .feature-grid,
    .steps,
    .cards-grid,
    .layout-with-sidebar .cards-grid { grid-template-columns: 1fr; }
    .split-inner { grid-template-columns: 1fr; gap: 24px; }
    .footer-cols { grid-template-columns: 1fr; gap: 28px; }
    .hero-title { font-size: 1.6rem; }
    .section { padding: 40px 0; }
}
