/*
Theme Name: dds_synology-forum.ru
Author: Алексей Волков
Description: Образовательно-информационная тема о киберспорте и разработке игр с инженерным подходом.
Version: 1.1
Text Domain: synforum
*/

/* ---------- Переменные ---------- */
:root {
    --bg: #0e1119;
    --bg-2: #151a26;
    --panel: #1b2231;
    --panel-2: #232c40;
    --line: #2c3650;
    --ink: #e7ecf6;
    --ink-soft: #aab4ca;
    --ink-mute: #7f8aa3;
    --accent: #36e2a4;
    --accent-2: #5b8cff;
    --accent-ink: #06120d;
    --maxw: 1180px;
    --radius: 12px;
    --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--ink);
    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.2rem; margin: 0 0 .5em; }

p { margin: 0 0 1.1em; }

.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    padding: .7em 1.4em;
    background: var(--accent);
    color: var(--accent-ink) !important;
    border-radius: 8px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(54, 226, 164, .25);
}
.btn-ghost {
    background: transparent;
    color: var(--accent) !important;
    border: 1px solid var(--line);
}
.btn-ghost:hover { box-shadow: none; border-color: var(--accent); }

/* ---------- Шапка ---------- */
.site-header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    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, .brand svg { width: 46px; height: 46px; flex: 0 0 auto; display: block; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--ink);
    line-height: 1.2;
}
.brand-desc {
    display: block;
    font-size: .8rem;
    color: var(--ink-mute);
    margin-top: 2px;
    max-width: 520px;
}
.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: .5em .85em;
    color: var(--ink-soft);
    border-radius: 7px;
    font-weight: 600;
    font-size: .95rem;
}
.main-nav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--accent); }

.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 8px;
    padding: .5em .7em;
    cursor: pointer;
    font-size: 1.1rem;
}

/* ---------- Раскладки ---------- */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
    padding: 40px 0;
}
.layout-single {
    display: block;
    padding: 40px 0;
}
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

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

/* ---------- Хлебные крошки ---------- */
.crumbs {
    font-size: .85rem;
    color: var(--ink-mute);
    padding: 16px 0 0;
}
.crumbs a { color: var(--ink-soft); }
.crumbs .sep { margin: 0 .4em; color: var(--ink-mute); }

/* ---------- Карточки записей ---------- */
.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(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
    transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--accent-2); transform: translateY(-3px); }
.card-thumb { display: block; overflow: hidden; }
.card-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.card-title { font-size: 1.18rem; margin: 0 0 .4em; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta {
    font-size: .8rem;
    color: var(--ink-mute);
    font-family: var(--mono);
    margin-bottom: .7em;
}
.card-excerpt { color: var(--ink-soft); font-size: .96rem; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 700;
    font-size: .9rem;
}

/* ---------- Запись / страница ---------- */
.entry {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px 34px;
}
.entry-thumb { margin: 0 0 24px; border-radius: 10px; overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-meta {
    font-family: var(--mono);
    font-size: .82rem;
    color: var(--ink-mute);
    margin-bottom: 18px;
}
.entry-content { color: var(--ink-soft); }
.entry-content h2, .entry-content h3 { color: var(--ink); margin-top: 1.4em; }
.entry-content a { color: var(--accent); }
.entry-content img { border-radius: 8px; display: block; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

.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: .6em .8em; text-align: left; }
.entry-content th { background: var(--panel-2); color: var(--ink); }

.entry-content blockquote {
    margin: 1.4em 0;
    padding: .6em 1.2em;
    border-left: 3px solid var(--accent);
    background: var(--bg-2);
    color: var(--ink);
}
.entry-content pre {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    overflow: auto;
    font-family: var(--mono);
    font-size: .9rem;
    min-width: 0;
}

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--ink-soft);
}
.sidebar .widget-title {
    color: var(--ink);
    font-size: 1.05rem;
    margin: 0 0 .8em;
    padding-bottom: .5em;
    border-bottom: 1px solid var(--line);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: .4em 0; border-bottom: 1px solid var(--bg-2); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--ink-soft); }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .widget .post-date { display: block; font-size: .75rem; color: var(--ink-mute); font-family: var(--mono); }

/* ---------- Главная ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 720px; margin-bottom: 34px; }
.section-eyebrow {
    font-family: var(--mono);
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: .6em;
}
.section-lead { color: var(--ink-soft); }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}
.split-media img, .split-media svg { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.split-text { min-width: 0; }
.split-text p { color: var(--ink-soft); }
@media (max-width: 960px) {
    .split { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-media { order: -1; }
}

/* Блок: сетка направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 22px;
}
.feature {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    min-width: 0;
}
.feature-icon {
    width: 46px; height: 46px; display: block; margin-bottom: 16px;
    color: var(--accent);
}
.feature h3 { margin: 0 0 .5em; }
.feature p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    position: relative;
    min-width: 0;
}
.step-num {
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}
.step h3 { margin: 0 0 .4em; }
.step p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Блок: FAQ */
.faq { max-width: 820px; }
.faq details {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    margin-bottom: 14px;
    overflow: hidden;
}
.faq summary {
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    float: right;
    color: var(--accent);
    font-weight: 700;
    font-size: 1.2rem;
}
.faq details[open] summary::after { content: '–'; }
.faq .faq-a { padding: 0 22px 18px; color: var(--ink-soft); }
.faq .faq-a p { margin: 0; }

/* Главная — последние записи */
.home-latest { padding: 56px 0; }

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

/* ---------- Комментарии ---------- */
.comments-area { margin-top: 40px; }
.comments-title { margin-bottom: 20px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-body {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 20px;
}
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-date { font-size: .78rem; color: var(--ink-mute); font-family: var(--mono); }
.comment-content { color: var(--ink-soft); }
.comment-content p { margin: 0 0 .6em; }

.comment-respond {
    margin-top: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 26px;
}
.comment-form label { display: block; font-size: .9rem; color: var(--ink-soft); margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    padding: .6em .8em;
    margin-bottom: 16px;
    font-family: inherit;
    font-size: .95rem;
}
.comment-form textarea { min-height: 120px; }

/* ---------- Форма поиска ---------- */
.search-form { display: flex; gap: 8px; min-width: 0; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    padding: .6em .8em;
    font-size: .95rem;
}
.search-form .search-submit {
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: 8px;
    padding: 0 1.1em;
    font-weight: 700;
    cursor: pointer;
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 60px 0; }
.notfound .code {
    font-family: var(--mono);
    font-size: 4rem;
    color: var(--accent);
    margin: 0;
}
.notfound .search-form { max-width: 440px; margin: 26px auto 0; }

/* ---------- Подвал ---------- */
.site-footer {
    background: #0a0d14;
    border-top: 1px solid var(--line);
    margin-top: 60px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    padding: 50px 0 36px;
}
.footer-cols .widget { color: #b6c0d6; min-width: 0; }
.footer-cols .widget-title {
    color: #ffffff;
    font-size: 1.02rem;
    margin: 0 0 .9em;
}
.footer-cols .widget p { color: #b6c0d6; font-size: .92rem; }
.footer-cols .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-cols .widget li { padding: .35em 0; }
.footer-cols .widget a { color: #cdd6ea; }
.footer-cols .widget a:hover { color: var(--accent); }
.footer-cols .widget .post-date { display: block; font-size: .74rem; color: #7f8aa3; font-family: var(--mono); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 20px 0;
    font-size: .82rem;
    color: #7f8aa3;
}

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

/* ---------- Cookie-баннер ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: .9rem; color: var(--ink-soft); }
.cookie-banner .btn { white-space: nowrap; }

/* ---------- Адаптив ---------- */
@media (max-width: 760px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .brand-desc { display: none; }
    .section { padding: 40px 0; }
}

/* ---------- Служебное ---------- */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
