/*
Theme Name: dds_pedagogik-a.ru
Author: Елена Смирнова
Description: Информационная тема для образовательного путеводителя по цифровой грамотности и академическому поиску: руководства, инструменты и обзоры научных баз данных.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: pedagogika
*/

:root {
    --navy: #21386b;
    --navy-2: #2b4684;
    --navy-3: #3a5aa0;
    --amber: #e8a33d;
    --amber-d: #cf8c22;
    --ink: #23304f;
    --muted: #5f6c88;
    --line: #e3e9f6;
    --bg: #f5f7fc;
    --bg-soft: #eef2fb;
    --white: #ffffff;
    --footer-bg: #1b2c54;
    --footer-text: #c7d2ec;
    --maxw: 1180px;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(33, 56, 107, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; font-weight: 700; }
h1 { font-size: 2.1rem; margin: 0 0 .6em; }
h2 { font-size: 1.6rem; margin: 0 0 .6em; }
h3 { font-size: 1.25rem; margin: 0 0 .5em; }

p { margin: 0 0 1.1em; }

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

/* ---- Шапка ---- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { flex: 0 0 auto; display: block; border-radius: 11px; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 700;
    color: var(--navy);
    font-size: 1.05rem;
    line-height: 1.3;
}
.brand-desc {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
    margin-top: 3px;
}
.main-nav { margin-left: auto; min-width: 0; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}
.main-nav a {
    color: var(--ink);
    font-weight: 600;
    padding: 6px 4px;
    display: inline-block;
}
.main-nav a:hover { color: var(--amber-d); text-decoration: none; }
.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 1rem;
    cursor: pointer;
}

/* ---- Раскладки ---- */
.site-main { padding: 34px 0 48px; }
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 38px;
    align-items: start;
}
.layout-single .content-area,
.content-narrow {
    width: 100%;
}
.content-area { min-width: 0; }

/* ---- Хлебные крошки ---- */
.breadcrumbs {
    font-size: .9rem;
    color: var(--muted);
    margin-bottom: 22px;
    word-break: break-word;
}
.breadcrumbs a { color: var(--navy-2); }
.breadcrumbs .sep { margin: 0 6px; color: #9aa6c4; }

/* ---- Карточки записей ---- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-thumb-wrap {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-soft);
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 24px;
    min-width: 0;
}
.card-title { font-size: 1.2rem; margin: 0 0 .4em; }
.card-title a { color: var(--navy); }
.card-meta {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: .7em;
}
.card-excerpt { color: var(--ink); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    color: var(--amber-d);
}
.card-more:hover { text-decoration: none; }

/* ---- Записи / страницы (single, page) ---- */
.entry {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
    box-shadow: var(--shadow);
}
.entry-thumb { margin: 0 0 22px; border-radius: 10px; overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-meta { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content h2, .entry-content h3 { margin-top: 1.3em; }

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

/* ---- Сайдбар / виджеты ---- */
.sidebar { min-width: 0; }
.widget {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--amber);
    color: var(--navy);
}
.sidebar .widget,
.sidebar .widget a,
.sidebar .widget li { color: var(--ink); }
.sidebar .widget a:hover { color: var(--amber-d); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget .post-date { color: var(--muted); font-size: .8rem; }

/* ---- Главная ---- */
.front-section { padding: 30px 0; }
.section-head { margin-bottom: 26px; }
.section-head h2 { margin-bottom: .25em; }
.section-head .lead { color: var(--muted); margin: 0; max-width: 760px; }

/* hero / текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-text { min-width: 0; }
.split-media { min-width: 0; }
.split-media img,
.split-media svg { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.hero { background: var(--bg-soft); border-radius: 20px; padding: 46px 40px; }
.btn {
    display: inline-block;
    background: var(--amber);
    color: #fff;
    font-weight: 700;
    padding: 13px 26px;
    border-radius: 24px;
    margin-top: 8px;
}
.btn:hover { background: var(--amber-d); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--navy);
    border: 2px solid var(--navy);
}
.btn-ghost:hover { background: var(--navy); color: #fff; }

/* сетка иконок-направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 24px;
}
.feature {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature-ic {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}
.feature-ic svg { width: 28px; height: 28px; }
.feature h3 { margin: 0 0 .35em; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

/* шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 26px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 .35em; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* FAQ */
.faq { max-width: 860px; }
.faq details {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.faq summary {
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 600;
    color: var(--navy);
    list-style: none;
    position: relative;
    padding-right: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    position: absolute;
    right: 22px; top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--amber-d);
}
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 22px 18px; color: var(--ink); }
.faq .faq-body p { margin: 0; }

.latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---- Пагинация (type => plain ↔ .page-numbers) ---- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 34px 0 8px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--white);
    color: var(--navy-2);
    font-weight: 600;
    text-decoration: none;
}
.pagination a.page-numbers:hover {
    border-color: var(--navy-2);
    color: var(--navy);
}
.pagination .page-numbers.current {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: transparent;
}

/* ---- Форма поиска ---- */
.search-form {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
}
.search-form .search-submit {
    border: 0;
    background: var(--navy);
    color: #fff;
    padding: 0 20px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--navy-2); }

/* ---- Комментарии ---- */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-body {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; color: var(--navy); }
.comment-date { font-size: .8rem; color: var(--muted); }
.comment-awaiting { color: var(--amber-d); font-size: .9rem; }
.comment-respond {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 22px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 1rem;
    margin-top: 4px;
    background: #fff;
    color: var(--ink);
}
.comment-form .form-submit input {
    background: var(--amber);
    color: #fff;
    border: 0;
    padding: 12px 26px;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
}

/* ---- 404 ---- */
.error-404 {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 34px;
    box-shadow: var(--shadow);
    text-align: center;
}
.error-404 .code { font-size: 4rem; color: var(--amber); font-weight: 800; line-height: 1; }
.error-404 .search-form { max-width: 480px; margin: 22px auto 0; }

/* ---- Подвал ---- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 32px;
    padding: 46px 0 30px;
}
.site-footer .widget {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    color: var(--footer-text);
}
.site-footer .widget-title { color: #fff; border-bottom-color: var(--amber); }
.site-footer .widget,
.site-footer .widget p,
.site-footer .widget li,
.site-footer .widget .post-date { color: var(--footer-text); }
.site-footer .widget a { color: #eaf0ff; }
.site-footer .widget a:hover { color: var(--amber); }
.site-footer .widget li { border-bottom: 1px solid rgba(255,255,255,0.12); }
.site-footer .widget li:last-child { border-bottom: 0; }
.site-copyright {
    border-top: 1px solid rgba(255,255,255,0.14);
    padding: 18px 0;
    font-size: .9rem;
    color: var(--footer-text);
}

/* ---- Cookie-баннер ---- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: .92rem; }
.cookie-banner a { color: var(--amber); }
.cookie-accept {
    background: var(--amber);
    color: #fff;
    border: 0;
    padding: 11px 24px;
    border-radius: 22px;
    font-weight: 700;
    cursor: pointer;
}
.cookie-accept:hover { background: var(--amber-d); }

/* ---- Адаптив ---- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-media { order: 0; }
    .hero { padding: 34px 26px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .nav-toggle { display: inline-block; }
    .entry { padding: 22px 18px; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
