/*
Theme Name: dds_sys-center.ru
Author: Алексей Кравцов
Description: Информационная тема для ресурса о практиках управления IT-инфраструктурой: SRE, DevOps и облачная эксплуатация. Адаптивная вёрстка, без сторонних плагинов.
Version: 1.1
Text Domain: syscenter
*/

/* =========================================================
   Переменные и сброс
   ========================================================= */
:root {
    --ink: #0f172a;
    --ink-2: #1e293b;
    --bg: #f5f8fb;
    --surface: #ffffff;
    --accent: #0891b2;
    --accent-dk: #0e7490;
    --accent-br: #22d3ee;
    --muted: #5b6b7d;
    --line: #e2e8f0;
    --foot-bg: #0f172a;
    --foot-text: #c7d3e0;
    --foot-title: #ffffff;
    --foot-link: #38d6ee;
    --radius: 12px;
    --shell: 1180px;
    --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    color: var(--ink);
    line-height: 1.25;
    font-weight: 700;
}

p {
    margin: 0 0 1em;
}

/* Глобальный p без background-color — фон только на body и блоках */

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    z-index: 1000;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid var(--accent);
    transition: background .18s, border-color .18s;
}

.btn:hover {
    background: var(--accent-dk);
    border-color: var(--accent-dk);
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--accent-dk);
}

.btn-ghost:hover {
    background: var(--accent);
    color: #fff;
}

/* =========================================================
   Шапка
   ========================================================= */
.site-head {
    background: var(--ink);
    color: #e6edf5;
    border-bottom: 3px solid var(--accent);
}

.head-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.brand-link {
    display: inline-flex;
    flex: 0 0 auto;
}

.brand-logo {
    display: block;
    width: 48px;
    height: 48px;
}

.brand-mark svg {
    display: block;
}

.brand-text {
    min-width: 0;
}

.brand-name {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    max-width: 52ch;
}

.brand-name:hover {
    text-decoration: none;
    color: var(--accent-br);
}

.brand-desc {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #9fb2c6;
    line-height: 1.45;
    max-width: 60ch;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-toggle {
    display: none;
    flex: 0 0 auto;
    width: 44px;
    height: 40px;
    background: transparent;
    border: 1px solid #3a4a5e;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #e6edf5;
}

.primary-nav {
    flex: 0 0 auto;
}

.primary-nav .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.primary-nav .menu a {
    display: block;
    color: #d7e0ea;
    padding: 8px 14px;
    border-radius: 7px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.primary-nav .menu a:hover,
.primary-nav .menu .current-menu-item > a {
    background: rgba(34, 211, 238, .14);
    color: #fff;
    text-decoration: none;
}

/* =========================================================
   Раскладки
   ========================================================= */
.site-main {
    display: block;
}

.page-shell {
    padding: 28px 0 56px;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}

.layout-single {
    display: block;
}

.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

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

/* =========================================================
   Хлебные крошки
   ========================================================= */
.crumbs {
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 18px;
}

.crumbs a {
    color: var(--accent-dk);
}

.crumbs .sep {
    margin: 0 7px;
    color: #aab6c4;
}

/* =========================================================
   Заголовок страницы
   ========================================================= */
.page-head {
    margin-bottom: 26px;
}

.page-title {
    font-size: clamp(1.6rem, 3.6vw, 2.3rem);
    margin: 0 0 8px;
}

.page-sub {
    color: var(--muted);
    margin: 0;
    max-width: 70ch;
}

/* =========================================================
   Карточки записей
   ========================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.cards-grid--list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 960px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .cards-grid,
    .cards-grid--list {
        grid-template-columns: 1fr;
    }
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(15, 23, 42, .09);
    transform: translateY(-2px);
}

.card-thumb {
    display: block;
    line-height: 0;
}

.card-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.card-cat a {
    color: var(--accent-dk);
    font-weight: 600;
}

.card-title {
    font-size: 1.15rem;
    margin: 0 0 10px;
    line-height: 1.35;
}

.card-title a {
    color: var(--ink);
}

.card-title a:hover {
    color: var(--accent-dk);
    text-decoration: none;
}

.card-excerpt {
    color: #475569;
    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;
    color: var(--accent-dk);
    align-self: flex-start;
}

/* =========================================================
   Главная — блоки
   ========================================================= */
.block {
    padding: 56px 0;
}

.block-pillars,
.block-steps {
    background: #eef3f8;
}

.block-faq {
    background: var(--ink);
}

.block-title {
    font-size: clamp(1.5rem, 3vw, 2.05rem);
    margin: 0 0 8px;
    text-align: center;
}

.block-lead {
    text-align: center;
    color: var(--muted);
    max-width: 64ch;
    margin: 0 auto 34px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-dk);
    margin: 0 0 10px;
}

/* Блок 1 — текст + иллюстрация */
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 48px;
    align-items: center;
}

.intro-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 18px;
}

.intro-text p {
    color: #3f4d5d;
    font-size: 1.02rem;
}

.intro-text .btn {
    margin-top: 8px;
}

.intro-media {
    min-width: 0;
}

.intro-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

@media (max-width: 860px) {
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .intro-media {
        order: -1;
    }
}

/* Блок 2 — направления */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

@media (max-width: 800px) {
    .pillars-grid {
        grid-template-columns: 1fr;
    }
}

.pillar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
}

.pillar-ico {
    display: inline-flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    background: #e0f3f8;
    border-radius: 12px;
    margin-bottom: 14px;
}

.pillar h3 {
    margin: 0 0 8px;
    font-size: 1.18rem;
}

.pillar p {
    margin: 0;
    color: #475569;
    font-size: 0.96rem;
}

/* Последние записи */
.block-latest {
    padding-top: 60px;
}

.latest-foot {
    text-align: center;
    margin-top: 34px;
}

.empty-note {
    color: var(--muted);
    text-align: center;
    grid-column: 1 / -1;
}

/* Блок 3 — шаги */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    counter-reset: step;
}

@media (max-width: 900px) {
    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .steps {
        grid-template-columns: 1fr;
    }
}

.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    position: relative;
}

.step-num {
    display: inline-block;
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.step h3 {
    margin: 0 0 8px;
    font-size: 1.08rem;
}

.step p {
    margin: 0;
    color: #475569;
    font-size: 0.93rem;
}

/* Блок 4 — FAQ */
.block-faq .block-title {
    color: #fff;
}

.faq-shell {
    max-width: 860px;
}

.faq-list {
    margin-top: 28px;
}

.faq-item {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.faq-item summary {
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 600;
    color: #fff;
    list-style: none;
    position: relative;
    padding-right: 48px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-br);
    font-size: 1.4rem;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: "–";
}

.faq-body {
    padding: 0 22px 18px;
    color: #b9c6d6;
}

.faq-body p {
    margin: 0;
}

/* =========================================================
   Запись / страница
   ========================================================= */
.post-single {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
}

.post-title {
    font-size: clamp(1.6rem, 3.6vw, 2.3rem);
    margin: 0 0 12px;
}

.post-meta {
    display: flex;
    gap: 14px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.post-cat a {
    color: var(--accent-dk);
    font-weight: 600;
}

.post-cover {
    margin: 0 0 22px;
}

.post-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.post-content {
    font-size: 1.04rem;
}

.post-content img {
    height: auto;
    border-radius: 8px;
}

.post-content h2 {
    margin: 1.4em 0 .5em;
    font-size: 1.5rem;
}

.post-content h3 {
    margin: 1.2em 0 .4em;
    font-size: 1.22rem;
}

.post-content pre {
    background: var(--ink);
    color: #e6edf5;
    padding: 16px 18px;
    border-radius: 10px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.9rem;
}

.post-content code {
    font-family: var(--mono);
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.9em;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    margin: 1.2em 0;
    padding: 6px 20px;
    border-left: 4px solid var(--accent);
    background: #f1f6fa;
    color: #3f4d5d;
}

.post-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}

.post-content table,
.post-content th,
.post-content td {
    border: 1px solid #cbd5e1;
}

.post-content th,
.post-content td {
    padding: 10px 12px;
    text-align: left;
}

.post-content th {
    background: #eef2f7;
}

.post-tags {
    margin-top: 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-chip {
    background: #eef2f7;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
}

.tag-chip:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

.page-links {
    margin-top: 18px;
    font-weight: 600;
}

/* =========================================================
   Сайдбар
   ========================================================= */
.sidebar {
    min-width: 0;
}

.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 22px;
    margin-bottom: 24px;
    color: var(--ink-2);
}

.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}

.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar .widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
}

.sidebar .widget li:last-child {
    border-bottom: none;
}

.sidebar .widget a {
    color: var(--ink-2);
}

.sidebar .widget a:hover {
    color: var(--accent-dk);
}

.sidebar .widget .post-date,
.sidebar .widget time {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
}

/* =========================================================
   Пагинация
   ========================================================= */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    justify-content: center;
}

.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-2);
    font-weight: 600;
    text-decoration: none;
}

.pager a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent-dk);
}

.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* =========================================================
   Поиск
   ========================================================= */
.search-form {
    margin: 18px 0;
}

.search-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.search-row {
    display: flex;
    gap: 8px;
}

.search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
}

.search-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}

.search-submit:hover {
    background: var(--accent-dk);
}

/* =========================================================
   Комментарии
   ========================================================= */
.comments {
    margin-top: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 30px;
}

.comments-title {
    font-size: 1.25rem;
    margin: 0 0 18px;
}

.comment-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin-left: 24px;
    padding-left: 0;
}

.comment-body {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.comment-head {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 700;
    color: var(--ink);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--muted);
}

.comment-reply {
    margin-top: 6px;
    font-size: 0.85rem;
}

.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: 8px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 12px;
}

.comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 26px;
    font-weight: 600;
    cursor: pointer;
}

.comment-form .submit:hover {
    background: var(--accent-dk);
}

/* =========================================================
   404
   ========================================================= */
.error-404 {
    text-align: center;
}

.error-code {
    font-family: var(--mono);
    font-size: clamp(4rem, 14vw, 8rem);
    font-weight: 700;
    color: var(--accent);
    margin: 0;
    line-height: 1;
}

.error-404 .search-form {
    max-width: 460px;
    margin: 22px auto;
    text-align: left;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================================
   Подвал
   ========================================================= */
.site-foot {
    background: var(--foot-bg);
    color: var(--foot-text);
    padding-top: 48px;
    margin-top: 0;
}

.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding-bottom: 36px;
}

@media (max-width: 800px) {
    .foot-cols {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

.site-foot .widget {
    margin: 0;
    color: var(--foot-text);
}

.site-foot .widget-title {
    color: var(--foot-title);
    font-size: 1.05rem;
    margin: 0 0 14px;
}

.site-foot .widget p {
    color: var(--foot-text);
    font-size: 0.94rem;
}

.site-foot .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-foot .widget li {
    padding: 6px 0;
}

.site-foot .widget a {
    color: var(--foot-link);
}

.site-foot .widget a:hover {
    color: #fff;
}

.foot-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 20px 0 26px;
}

.copyright {
    margin: 0;
    font-size: 0.86rem;
    color: #93a4b7;
}

/* =========================================================
   Cookie-баннер
   ========================================================= */
.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: rgba(15, 23, 42, .97);
    color: #e6edf5;
    border-top: 2px solid var(--accent);
}

.cookie-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.cookie-text {
    margin: 0;
    flex: 1;
    min-width: 240px;
    font-size: 0.9rem;
    color: #cdd8e4;
}

.cookie-accept {
    flex: 0 0 auto;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 26px;
    font-weight: 600;
    cursor: pointer;
}

.cookie-accept:hover {
    background: var(--accent-dk);
}

/* =========================================================
   Адаптив — меню
   ========================================================= */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        order: 3;
        margin-left: auto;
    }
    .brand {
        order: 1;
    }
    .primary-nav {
        order: 4;
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open {
        display: block;
    }
    .primary-nav .menu {
        flex-direction: column;
        gap: 2px;
    }
    .nav-toggle.is-active {
        border-color: var(--accent);
    }
}
