/*
Theme Name: dds_semprimo.ru
Theme URI: https://semprimo.ru
Author: Анна Соколова
Author URI: https://semprimo.ru
Description: Информационная тема для блога о непрерывном самообразовании, цифровых профессиях и инструментах продуктивности.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: semprimo
*/

/* ============================ Базовое ============================ */
:root {
    --ink: #1d2435;
    --ink-soft: #4a5468;
    --muted: #6b7488;
    --bg: #f6f5f1;
    --surface: #ffffff;
    --line: #e3e0d8;
    --primary: #234e70;
    --primary-dark: #1a3a55;
    --accent: #c6803a;
    --accent-soft: #f3e7d6;
    --teal: #2f8a82;
    --footer-bg: #1b2230;
    --footer-ink: #c7cdda;
    --footer-head: #ffffff;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(29, 36, 53, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "PT Serif", Georgia, "Times New Roman", serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    font-size: 18px;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand-name, .nav-menu, .btn, .breadcrumbs, .pager, .meta, .widget-title {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 0.6em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

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

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

.shell {
    width: min(90%, 1180px);
    margin-inline: auto;
}

.section-pad { padding: 4rem 0; }

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.7em 1.5em;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn--ghost {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: calc(0.7em - 2px) calc(1.5em - 2px);
}
.btn--ghost:hover { background: var(--primary); color: #fff; }

/* ============================ Шапка ============================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    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-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: block;
    line-height: 1.3;
    /* длинное название сайта аккуратно ограничиваем по высоте */
    max-width: 46ch;
}
.brand-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.2rem;
    max-width: 60ch;
}

/* ============================ Навигация ============================ */
.main-nav { flex: 0 0 auto; }
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5em 0.7em;
    font-size: 1rem;
    cursor: pointer;
    color: var(--ink);
}
.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
}
.nav-menu a {
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.97rem;
    padding: 0.3em 0;
    border-bottom: 2px solid transparent;
}
.nav-menu a:hover,
.nav-menu .current-menu-item > a {
    color: var(--primary);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* ============================ Хлебные крошки ============================ */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 1rem 0 0;
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs .sep { color: var(--line); margin: 0 0.15rem; }

/* ============================ Макеты ============================ */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 30fr);
    gap: 2.6rem;
    padding: 2.5rem 0 3.5rem;
    align-items: start;
}
.layout-single {
    display: block;
    padding: 2.5rem 0 3.5rem;
}
.content-area { min-width: 0; }

/* ============================ Карточки записей ============================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-thumb--placeholder {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb--placeholder span {
    color: rgba(255,255,255,0.85);
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.04em;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.4rem 1.5rem;
}
.card-title { font-size: 1.2rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-meta {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.7rem;
}
.card-excerpt { color: var(--ink-soft); font-size: 0.97rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 0.8rem;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
}

/* лента списком (архивы / поиск / блог) */
.post-list { display: grid; gap: 1.6rem; }

/* ============================ Одиночная запись / страница ============================ */
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.2rem 2.4rem; box-shadow: var(--shadow); }
.entry-header { margin-bottom: 1.4rem; }
.entry-title { margin-bottom: 0.5rem; }
.entry-meta { font-family: "Segoe UI", Arial, sans-serif; font-size: 0.85rem; color: var(--muted); }
.entry-thumb { margin: 0 0 1.6rem; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; object-fit: cover; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: 10px; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content blockquote {
    margin: 1.5em 0;
    padding: 0.6em 1.4em;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    color: var(--ink-soft);
    border-radius: 0 10px 10px 0;
}
.entry-tags { margin-top: 1.8rem; font-family: "Segoe UI", Arial, sans-serif; font-size: 0.88rem; }
.entry-tags a { display: inline-block; background: var(--bg); border: 1px solid var(--line); padding: 0.25em 0.8em; border-radius: 999px; margin: 0 0.3em 0.4em 0; }

/* таблицы в контенте */
.entry-content table { border-collapse: collapse; width: 100%; margin: 1.4em 0; }
.entry-content table, .entry-content th, .entry-content td { border: 1px solid var(--line); }
.entry-content th, .entry-content td { padding: 0.6em 0.9em; text-align: left; }
.entry-content th { background: var(--bg); }

/* ============================ Сайдбар ============================ */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.6rem;
    color: var(--ink);
}
.widget:last-child { margin-bottom: 0; }
.widget-title {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin: 0 0 0.9rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget a { color: var(--primary); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); font-family: "Segoe UI", Arial, sans-serif; }

/* ============================ Подвал ============================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 3rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.2rem;
    padding: 3.2rem 0 2.4rem;
}
.footer-col .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.footer-col .widget-title {
    color: var(--footer-head);
    border-bottom-color: var(--accent);
}
.footer-col .widget,
.footer-col .widget p,
.footer-col .widget li { color: var(--footer-ink); }
.footer-col .widget a { color: #ecd8bd; }
.footer-col .widget a:hover { color: #fff; }
.footer-col .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-col .widget li { padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-col .widget li:last-child { border-bottom: none; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.4rem 0;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 0.85rem;
    color: rgba(199, 205, 218, 0.8);
}

/* ============================ Главная ============================ */
.front-wrap { padding-bottom: 1rem; }

.block { padding: 3.6rem 0; }
.block:nth-child(even) { background: var(--surface); }
.block-head { text-align: center; max-width: 70ch; margin: 0 auto 2.4rem; }
.block-head .eyebrow {
    font-family: "Segoe UI", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 0.6rem;
}
.block-head p { color: var(--ink-soft); }

/* текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}
.split--reverse .split-media { order: -1; }
.split-text h2 { font-size: 1.9rem; }
.split-text p { color: var(--ink-soft); }
.split-media img { display: block; width: 100%; border-radius: var(--radius); }

/* сетка иконок-направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6rem;
}
.feature {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem 1.6rem;
}
.block:nth-child(even) .feature { background: var(--surface); }
.feature-ico {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.feature-ico svg { width: 28px; height: 28px; }
.feature h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.feature p { color: var(--ink-soft); font-size: 0.96rem; margin: 0; }

/* шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.8rem;
    counter-reset: step;
}
.step { position: relative; padding-left: 0.4rem; }
.step-num {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.9rem;
}
.step h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.step p { color: var(--ink-soft); font-size: 0.96rem; margin: 0; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 0.9rem;
    overflow: hidden;
}
.block:nth-child(even) .faq details { background: var(--bg); }
.faq summary {
    cursor: pointer;
    padding: 1.1rem 1.3rem;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
    position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    position: absolute;
    right: 1.3rem;
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq .faq-body { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }
.faq .faq-body p { margin: 0; }

/* CTA */
.cta-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: 18px;
    padding: 3rem 2.4rem;
    text-align: center;
}
.cta-box h2 { color: #fff; }
.cta-box p { color: rgba(255,255,255,0.85); max-width: 60ch; margin: 0 auto 1.6rem; }
.cta-box .btn { background: var(--accent); }
.cta-box .btn:hover { background: #ad6c2c; }

/* блок последних записей на главной */
.latest { background: var(--bg) !important; }

/* ============================ Пагинация ============================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2.6rem;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover { border-color: var(--primary); color: var(--primary); }
.pager .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pager .page-numbers.dots { border: none; background: none; }

/* ============================ Комментарии ============================ */
.comments-area { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 2.2rem; box-shadow: var(--shadow); margin-top: 2rem; }
.comments-title { margin-bottom: 1.4rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.6rem; padding: 0; }
.comment-item { margin-bottom: 1.4rem; }
.comment-body { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.4rem; }
.comment-meta { display: flex; justify-content: space-between; gap: 1rem; font-family: "Segoe UI", Arial, sans-serif; font-size: 0.85rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-date { color: var(--muted); }
.comment-reply a { font-family: "Segoe UI", Arial, sans-serif; font-size: 0.85rem; font-weight: 600; }
.comment-awaiting { color: var(--accent); font-size: 0.9rem; }
.comment-respond { margin-top: 1.8rem; }
.comment-form label { display: block; font-family: "Segoe UI", Arial, sans-serif; font-weight: 600; font-size: 0.9rem; 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.7em 0.9em;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.97rem;
    margin-bottom: 1rem;
    background: #fff;
}
.comment-form .form-submit input { cursor: pointer; }

/* ============================ Форма поиска ============================ */
.search-form { display: flex; gap: 0.5rem; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.65em 0.9em;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.97rem;
    background: #fff;
}
.search-form .search-submit {
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    padding: 0 1.2em;
    cursor: pointer;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 600;
}
.search-form .search-submit:hover { background: var(--primary-dark); }

/* ============================ 404 ============================ */
.error-404 { text-align: center; padding: 4rem 0; }
.error-404 .big { font-size: 5rem; color: var(--accent); font-family: "Segoe UI", Arial, sans-serif; font-weight: 800; margin: 0; }
.error-404 .search-form { max-width: 460px; margin: 1.8rem auto 0; }

/* ============================ Cookie-баннер ============================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--footer-bg);
    color: var(--footer-ink);
    border-top: 2px solid var(--accent);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; font-size: 0.92rem; flex: 1; min-width: 240px; }
.cookie-inner a { color: #ecd8bd; }
.cookie-accept {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 0.65em 1.6em;
    border-radius: 999px;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #ad6c2c; }

/* ============================ Адаптив ============================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; gap: 2rem; }
    .split--reverse .split-media { order: 0; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.45rem; }
    .nav-toggle { display: inline-block; }
    .main-nav { width: 100%; }
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        margin-top: 0.8rem;
        border-top: 1px solid var(--line);
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu li { border-bottom: 1px solid var(--line); }
    .nav-menu a { display: block; padding: 0.8em 0; }
    .footer-cols { grid-template-columns: 1fr; gap: 1.8rem; }
    .entry { padding: 1.6rem 1.4rem; }
    .block { padding: 2.6rem 0; }
}
