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

/* ============================================================ *
 * Переменные
 * ============================================================ */
:root {
    --maxw: 1180px;
    --ink: #1f2733;
    --ink-soft: #4a5568;
    --brand: #2f5d8a;
    --brand-dark: #234666;
    --accent: #e08a3c;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --line: #d9e2ec;
    --footer-bg: #1c2c3f;
    --footer-ink: #d7e0ec;
    --footer-soft: #9fb1c7;
}

/* ============================================================ *
 * База
 * ============================================================ */
* { 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(--bg);
    line-height: 1.65;
    overflow-x: hidden;
}

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

a { color: var(--brand); 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.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

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

/* ============================================================ *
 * Шапка
 * ============================================================ */
.site-header {
    background: var(--surface);
    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;
    flex: 1;
}
.brand-logo, .brand-svg { flex: 0 0 auto; display: block; }
.brand-text { min-width: 0; }
.brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    display: block;
    line-height: 1.3;
}
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: block;
    margin-top: 2px;
}

.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 2px;
    display: inline-block;
}
.main-nav a:hover { color: var(--brand); text-decoration: none; }

.nav-toggle {
    display: none;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* ============================================================ *
 * Раскладки
 * ============================================================ */
.site-main { padding: 32px 0 48px; }

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

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

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
}

/* ============================================================ *
 * Хлебные крошки
 * ============================================================ */
.crumbs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 20px;
}
.crumbs a { color: var(--brand); }
.crumbs .sep { color: #9aa7b8; margin: 0 4px; }

/* ============================================================ *
 * Карточки записей (A8, A10)
 * ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-svg { display: block; width: 100%; aspect-ratio: 16 / 9; }
.card-body {
    flex: 1;
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.15rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); text-decoration: none; }
.card-meta {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-bottom: 10px;
}
.card-excerpt { color: var(--ink-soft); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
}

/* ============================================================ *
 * Записи / страницы
 * ============================================================ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 28px 30px;
}
.entry-title { margin-bottom: 10px; }
.entry-meta { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 18px; }
.entry-content { word-wrap: break-word; }
.entry-content img { border-radius: 8px; }
.entry-thumb { border-radius: 10px; margin-bottom: 20px; width: 100%; object-fit: cover; }

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

/* ============================================================ *
 * Сайдбар / виджеты
 * ============================================================ */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 22px;
    color: var(--ink);
}
.widget .widget-title {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: var(--ink);
    border-bottom: 2px solid var(--brand);
    padding-bottom: 8px;
}
.widget a { color: var(--brand); }
.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 { display: block; font-size: 0.78rem; color: var(--ink-soft); }

/* ============================================================ *
 * Главная
 * ============================================================ */
.home-wrap { width: 85%; margin-inline: auto; }
@media (max-width: 960px) { .home-wrap { width: 100%; } }

.section { margin: 0 0 56px; }
.section-head { margin-bottom: 24px; }
.section-head h2 { margin-bottom: 6px; }
.section-head .lead { color: var(--ink-soft); max-width: 720px; }

/* блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media svg, .split-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
}

/* блок: сетка преимуществ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px 22px;
    min-width: 0;
}
.feature-icon { width: 52px; height: 52px; margin-bottom: 14px; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 26px 22px 22px;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.05rem; }
.step p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* блок: цитата / акцент */
.quote-block {
    background: var(--brand-dark);
    color: #fff;
    border-radius: 16px;
    padding: 44px 40px;
    text-align: center;
}
.quote-block p {
    font-size: 1.45rem;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 820px;
    font-weight: 600;
}
.quote-block cite {
    display: block;
    margin-top: 16px;
    font-style: normal;
    font-size: 0.95rem;
    color: #b9cde2;
}

/* блок: факты / статистика */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 22px;
    text-align: center;
}
.fact {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 28px 18px;
    min-width: 0;
}
.fact .num { font-size: 2.1rem; font-weight: 800; color: var(--brand); display: block; }
.fact .label { color: var(--ink-soft); font-size: 0.95rem; }

/* блок: галерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.gallery figure { margin: 0; }
.gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
}
.gallery figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 6px; }

/* блок: FAQ */
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 4px 20px;
    margin-bottom: 12px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 14px 0;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { color: var(--brand); }
.faq details p { color: var(--ink-soft); margin: 0 0 14px; }

/* CTA */
.cta {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    border-radius: 16px;
    padding: 44px 40px;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #dce8f4; max-width: 640px; margin: 0 auto 22px; }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 13px 28px;
    border-radius: 10px;
    font-weight: 700;
}
.btn:hover { background: #c9762e; text-decoration: none; color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.24); }

/* последние записи на главной */
.home-latest .cards-grid { margin-top: 4px; }

/* ============================================================ *
 * Пагинация (D5)
 * ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 36px 0 8px;
}
.pager .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;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
}
.pager a.page-numbers:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pager .page-numbers.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.pager .page-numbers.dots { border: 0; background: none; }

/* ============================================================ *
 * Комментарии
 * ============================================================ */
.comments-area {
    margin-top: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px 28px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 24px; padding: 0; }
.comment-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.comment-head { display: flex; gap: 14px; align-items: baseline; margin-bottom: 6px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--ink-soft); }
.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: inherit;
    margin-top: 4px;
}
.comment-form .submit,
.comment-form input[type="submit"] {
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 24px;
    font-weight: 700;
    cursor: pointer;
}

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

/* ============================================================ *
 * 404
 * ============================================================ */
.notfound {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 40px 32px;
    text-align: center;
}
.notfound .big { font-size: 4rem; font-weight: 800; color: var(--brand); line-height: 1; }
.notfound .search-form { max-width: 460px; margin: 22px auto 0; }

/* ============================================================ *
 * Подвал
 * ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding: 46px 0 30px;
}
.footer-cols .widget {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.footer-cols .widget .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.22);
}
.footer-cols .widget a { color: var(--footer-ink); }
.footer-cols .widget a:hover { color: #fff; }
.footer-cols .widget li { border-bottom-color: rgba(255,255,255,0.12); }
.footer-cols .widget .post-date { color: var(--footer-soft); }
.footer-cols .widget,
.footer-cols .widget p { color: var(--footer-ink); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 18px 0;
    font-size: 0.85rem;
    color: var(--footer-soft);
}
.footer-contacts a { color: var(--footer-ink); }

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

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

/* ============================================================ *
 * Адаптив навигации
 * ============================================================ */
@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        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: 12px 0; }
    .header-inner { gap: 14px; }
}
