/*
Theme Name: dds_mrsjohnsontutors.com
Author: Анна Белова
Description: Образовательный информационный портал — статьи, учебные материалы и инструменты для самоподготовки школьников и студентов.
Version: 1.1
Text Domain: mjtutors
*/

/* ===== Базовые переменные ===== */
:root {
    --c-ink: #20283a;
    --c-muted: #5c6677;
    --c-line: #e2e7ef;
    --c-bg: #f6f8fc;
    --c-card: #ffffff;
    --c-primary: #2f5bbf;
    --c-primary-dark: #234a9e;
    --c-accent: #f1a83a;
    --c-accent-soft: #fdf2dd;
    --c-soft: #eef3fb;
    --c-footer: #1d2740;
    --c-footer-ink: #c6cfe0;
    --c-footer-head: #ffffff;
    --radius: 14px;
    --shell: min(92%, 1180px);
    --shadow: 0 6px 24px rgba(31, 42, 68, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--c-ink); margin: 0 0 .6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1em; }

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

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    background: var(--c-primary);
    color: #fff;
    padding: .7em 1.4em;
    border-radius: 9px;
    font-weight: 600;
    transition: background .2s;
}
.btn:hover { background: var(--c-primary-dark); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--c-primary);
    border: 2px solid var(--c-primary);
    padding: calc(.7em - 2px) 1.4em;
}
.btn-ghost:hover { background: var(--c-primary); color: #fff; }

/* ===== Шапка ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--c-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-mark { flex: 0 0 auto; display: block; }
.brand-mark { width: 48px; height: 48px; }
.brand-text { min-width: 0; }
.brand-name {
    font-weight: 700;
    font-size: 1.12rem;
    color: var(--c-ink);
    display: block;
    line-height: 1.3;
}
.brand-desc {
    font-size: .82rem;
    color: var(--c-muted);
    display: block;
    margin-top: 2px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: .5em .9em;
    border-radius: 8px;
    color: var(--c-ink);
    font-weight: 600;
}
.main-nav a:hover { background: var(--c-soft); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--c-primary); }

.nav-toggle {
    display: none;
    background: var(--c-soft);
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--c-ink);
    font-size: 1rem;
}

/* ===== Каркас страницы ===== */
.site-main { padding: 36px 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: 100%; }
.front .content-area { width: 100%; }

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

/* ===== Сайдбар ===== */
.sidebar {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 26px; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 .8em;
    color: var(--c-ink);
    padding-bottom: .4em;
    border-bottom: 2px solid var(--c-accent);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0 0 .55em; }
.sidebar a { color: var(--c-primary); }
.sidebar .post-date { display: block; font-size: .8rem; color: var(--c-muted); }

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    font-size: .88rem;
    color: var(--c-muted);
    margin: 0 0 22px;
}
.breadcrumbs a { color: var(--c-primary); }
.breadcrumbs .sep { margin: 0 .35em; color: #aab2c2; }

/* ===== Карточки записей ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
}
.card-title { font-size: 1.15rem; margin: 0 0 .4em; }
.card-title a { color: var(--c-ink); }
.card-title a:hover { color: var(--c-primary); text-decoration: none; }
.card-meta { font-size: .8rem; color: var(--c-muted); margin-bottom: .7em; }
.card-excerpt { color: var(--c-muted); }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more { margin-top: auto; padding-top: 12px; }
.card-more a { font-weight: 600; }

/* ===== Записи списком (single/index) ===== */
.post-list .card { margin-bottom: 26px; }

.entry {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 34px;
}
.entry-header { margin-bottom: 18px; }
.entry-title { font-size: 1.9rem; margin: 0 0 .3em; }
.entry-meta { font-size: .85rem; color: var(--c-muted); }
.entry-thumb { margin: 0 0 22px; border-radius: 10px; overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}
.entry-content table, .entry-content th, .entry-content td {
    border: 1px solid var(--c-line);
}
.entry-content th, .entry-content td { padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--c-soft); }
.entry-content blockquote {
    margin: 1.2em 0;
    padding: 14px 20px;
    border-left: 4px solid var(--c-accent);
    background: var(--c-accent-soft);
    border-radius: 0 8px 8px 0;
}

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

/* ===== Главная: общие секции ===== */
.section { padding: 46px 0; }
.section-alt { background: var(--c-soft); }
.section-title { font-size: 1.7rem; margin: 0 0 .2em; }
.section-lead { color: var(--c-muted); max-width: 720px; margin: 0 0 30px; }
.section-head-center { text-align: center; }
.section-head-center .section-lead { margin-inline: auto; }

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

/* Блок: сетка иконок-направлений */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.tile {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.tile-ico {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-accent-soft);
    border-radius: 12px;
    margin-bottom: 14px;
}
.tile-ico svg { width: 28px; height: 28px; }
.tile h3 { font-size: 1.12rem; margin: 0 0 .35em; }
.tile p { margin: 0; color: var(--c-muted); font-size: .96rem; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 28px 24px 24px;
    min-width: 0;
}
.step-num {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-primary);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; margin: 0 0 .35em; }
.step p { margin: 0; color: var(--c-muted); font-size: .96rem; }

/* Блок: FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 4px 22px;
    margin-bottom: 14px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    font-size: 1.4rem;
    color: var(--c-primary);
    line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details > p { margin: 0 0 16px; color: var(--c-muted); }

/* Блок: записи на главной */
.home-posts-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}
.home-posts-head .section-title { margin: 0; }

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 56px 28px;
}
.error-404 .big { font-size: 4.5rem; margin: 0; color: var(--c-primary); }

/* ===== Форма поиска ===== */
.search-form {
    display: flex;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: .65em .9em;
    border: 1px solid var(--c-line);
    border-radius: 9px;
    font-size: 1rem;
}
.search-form .search-submit {
    border: 0;
    background: var(--c-primary);
    color: #fff;
    padding: 0 1.2em;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
}

/* ===== Комментарии ===== */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 18px; }
.comment-body {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 18px 20px;
}
.comment-author { font-weight: 600; }
.comment-meta { font-size: .8rem; color: var(--c-muted); margin-bottom: .5em; }
.comment-respond {
    margin-top: 24px;
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 22px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .6em .8em;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 1rem;
}

/* ===== Подвал ===== */
.site-footer {
    background: var(--c-footer);
    color: var(--c-footer-ink);
    padding: 48px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 34px;
}
.footer-col { min-width: 0; }
.footer-col .widget-title {
    color: var(--c-footer-head);
    font-size: 1.05rem;
    margin: 0 0 .8em;
}
.footer-col, .footer-col p, .footer-col li { color: var(--c-footer-ink); }
.footer-col a { color: #fff; }
.footer-col a:hover { color: var(--c-accent); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .5em; }
.footer-col .post-date { color: #93a0bd; font-size: .8rem; display: block; }
.footer-bottom {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,.12);
    font-size: .85rem;
    color: #93a0bd;
    text-align: center;
}

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: #fff;
    border: 1px solid var(--c-line);
    box-shadow: 0 10px 40px rgba(31,42,68,.18);
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 760px;
    margin: 0 auto;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: .92rem; color: var(--c-muted); }
.cookie-accept {
    border: 0;
    background: var(--c-primary);
    color: #fff;
    padding: .65em 1.4em;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
}

/* ===== Адаптив ===== */
@media (max-width: 760px) {
    .header-inner { gap: 14px; }
    .nav-toggle { display: block; order: 3; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    h1 { font-size: 1.6rem; }
    .entry { padding: 22px; }
    .entry-title { font-size: 1.5rem; }
}
