/*
Theme Name: dds_paulonkt.com
Theme URI: https://paulonkt.com/
Author: Андрей Беляев
Author URI: https://paulonkt.com/
Description: Информационная тема «Инженерный минимализм» для сайта о разработке как системе: архитектура, качество кода, роли и организация процессов.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: dds_paulonkt
*/

/* =========================================================================
   Переменные
   ====================================================================== */
:root {
    --bg-page:    #F7F8FA;
    --bg-alt:     #ECEEF2;
    --bg-dark:    #1A1E24;
    --bg-side:    #FFFFFF;
    --text:       #1F2329;
    --accent:     #E15634;
    --accent-2:   #3A7CA5;
    --muted:      #7A828E;
    --card-border:#DEE1E6;
    --card-shadow:#D1D6DE;
    --mono: "JetBrains Mono", "Courier New", monospace;
    --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
    --shell: min(92%, 1180px);
}

/* =========================================================================
   Базовое
   ====================================================================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg-page);
    /* Паттерн «соты» ~3% — отсылка к кристаллической решётке */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='69.28' viewBox='0 0 40 69.28'%3E%3Cg fill='none' stroke='%231F2329' stroke-opacity='0.03' stroke-width='1'%3E%3Cpath d='M20 0 L40 11.55 L40 34.64 L20 46.19 L0 34.64 L0 11.55 Z'/%3E%3Cpath d='M20 23.09 L40 34.64 L40 57.73 L20 69.28 L0 57.73 L0 34.64 Z'/%3E%3C/svg%3E");
    background-position: center top;
    overflow-x: hidden;
}

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

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
}

p { margin: 0 0 1.1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--mono);
    color: var(--text);
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 0.6em;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.4rem; }

/* Терминальный курсор в конце H1/H2 */
.term-cursor::after {
    content: "|";
    color: var(--accent);
    font-weight: 700;
    margin-left: 4px;
    animation: dds-blink 1.1s step-end infinite;
}
@keyframes dds-blink {
    50% { opacity: 0; }
}

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

/* =========================================================================
   Заголовки секций — левая терракотовая плашка
   ====================================================================== */
.section-head {
    margin-bottom: 1.8rem;
}
.section-head h2 {
    position: relative;
    padding-left: 18px;
    margin-bottom: 0.35em;
}
.section-head h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: -4px;
    bottom: -4px;
    width: 4px;
    background: var(--accent);
}
.section-head .subhead {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    padding-left: 18px;
}

/* Цветные теги-термины */
.code-tag {
    display: inline-block;
    border: 1px solid var(--accent-2);
    color: var(--accent-2);
    border-radius: 2px;
    padding: 0 5px;
    font-family: var(--mono);
    font-size: 0.9em;
    line-height: 1.5;
}

/* =========================================================================
   Кнопки
   ====================================================================== */
.btn {
    display: inline-block;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    background: var(--accent);
    border: 1px solid #b23f22;
    border-radius: 2px;
    padding: 11px 22px;
    cursor: pointer;
    transition: transform .05s linear;
}
.btn:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(1px);
}
.btn--ghost {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn--light {
    background: #fff;
    color: var(--bg-dark);
    border-color: #d7dbe0;
}

/* =========================================================================
   Шапка
   ====================================================================== */
.site-header {
    background: var(--bg-dark);
    color: #fff;
    border-bottom: 3px solid var(--accent);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo { display: block; }
.brand-text { min-width: 0; }
.brand-title {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    line-height: 1.25;
    text-decoration: none;
}
.brand-title:hover { text-decoration: none; color: #fff; }
.brand-desc {
    margin: 3px 0 0;
    font-size: 0.82rem;
    color: #9aa2af;
    max-width: 520px;
}

/* Навигация */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    font-family: var(--mono);
    font-size: 0.92rem;
    color: #cfd4dc;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 2px;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: #fff;
    border-color: #3a4049;
    text-decoration: none;
    background: #23282f;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #3a4049;
    border-radius: 2px;
    color: #fff;
    font-family: var(--mono);
    padding: 8px 12px;
    cursor: pointer;
}

/* =========================================================================
   Разметка контента
   ====================================================================== */
.site-main { padding: 40px 0 64px; }

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

.breadcrumbs {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--accent-2); }
.breadcrumbs .sep { color: var(--muted); margin: 0 2px; }

/* Сайдбар */
.sidebar {
    background: var(--bg-side);
    border: 1px solid var(--card-border);
    border-radius: 0;
    padding: 20px 20px 8px;
    color: var(--text);
}
.sidebar .widget { margin-bottom: 22px; }
.sidebar .widget-title {
    font-size: 1.05rem;
    margin-bottom: 12px;
    padding-left: 12px;
    position: relative;
    color: var(--text);
}
.sidebar .widget-title::before {
    content: "";
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: 3px;
    background: var(--accent);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--card-border);
    font-size: 0.95rem;
}
.sidebar ul li a { color: var(--text); }
.sidebar ul li a:hover { color: var(--accent); }

/* =========================================================================
   Карточки записей
   ====================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0;
    box-shadow: 2px 4px 0 var(--card-shadow);
    overflow: hidden;
    transition: none;
}
.card:hover {
    background: var(--bg-alt);
    box-shadow: 2px 8px 0 var(--card-shadow);
}
.card-thumb {
    display: block;
    border-bottom: 1px solid var(--bg-dark);
    background: var(--bg-alt);
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 3px solid var(--bg-dark);
    border-width: 0;
}
.card-thumb--frame img {
    border: 4px solid var(--bg-dark);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
    min-width: 0;
}
.card-title {
    font-size: 1.2rem;
    margin: 0 0 8px;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-meta {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 10px;
}
.card-excerpt {
    color: #454b54;
    font-size: 0.95rem;
    margin-bottom: 14px;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 700;
}

/* =========================================================================
   Одиночная запись / страница
   ====================================================================== */
.entry-header { margin-bottom: 20px; }
.entry-title { font-size: 2.4rem; }
.entry-meta {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 6px;
}
.entry-thumb {
    margin: 0 0 24px;
    border: 4px solid var(--bg-dark);
}
.entry-thumb img { display: block; width: 100%; }
.entry-content { font-size: 1.05rem; }
.entry-content img { height: auto; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content blockquote {
    margin: 1.5em 0;
    padding: 16px 20px;
    background: var(--bg-alt);
    border-left: 4px solid var(--accent);
    border-radius: 0 2px 2px 0;
}
.entry-content pre {
    background: var(--bg-dark);
    color: #e6e8eb;
    padding: 16px 18px;
    border-radius: 2px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.9rem;
}
.entry-content code {
    font-family: var(--mono);
    background: var(--bg-alt);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.9em;
}
.entry-content pre code { background: none; padding: 0; }

/* Таблицы */
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--card-border);
}
.entry-content th, .entry-content td {
    padding: 9px 12px;
    text-align: left;
}
.entry-content th {
    background: var(--bg-alt);
    font-family: var(--mono);
}

/* =========================================================================
   Пагинация
   ====================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 36px 0 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 2px;
}
.pagination a.page-numbers:hover {
    background: var(--bg-alt);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: #b23f22;
}
.pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* =========================================================================
   Комментарии
   ====================================================================== */
.comments-area { margin-top: 44px; }
.comments-title { font-size: 1.5rem; margin-bottom: 20px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-body {
    border: 1px solid var(--card-border);
    background: #fff;
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 2px 4px 0 var(--card-shadow);
}
.comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--mono);
    font-size: 0.8rem;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; }
.comment-date { color: var(--muted); }
.comment-awaiting-moderation { color: var(--accent); font-size: 0.85rem; }
.comment-reply a {
    font-family: var(--mono);
    font-size: 0.82rem;
}

.comment-respond {
    margin-top: 26px;
    background: var(--bg-side);
    border: 1px solid var(--card-border);
    padding: 22px 24px;
    border-radius: 2px;
}
.comment-form label {
    display: block;
    font-family: var(--mono);
    font-size: 0.85rem;
    margin-bottom: 5px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--card-border);
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 0.95rem;
    margin-bottom: 14px;
    background: #fff;
}
.comment-form textarea { min-height: 130px; }

/* =========================================================================
   Форма поиска
   ====================================================================== */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 460px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 2px;
    font-family: var(--sans);
    background: #fff;
}
.search-form .search-submit {
    font-family: var(--mono);
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border: 1px solid #b23f22;
    border-radius: 2px;
    padding: 0 18px;
    cursor: pointer;
}

/* =========================================================================
   Подвал
   ====================================================================== */
.site-footer {
    background: var(--bg-dark);
    color: #c4cad3;
    border-top: 3px solid var(--accent);
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
    padding: 48px 0 32px;
}
.footer-cols .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 14px;
    padding-left: 12px;
    position: relative;
}
.footer-cols .widget-title::before {
    content: "";
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: 3px;
    background: var(--accent);
}
.footer-cols .widget { color: #b7bec8; font-size: 0.92rem; }
.footer-cols .widget p { color: #b7bec8; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols ul li { padding: 5px 0; }
.footer-cols a { color: #cfd4dc; }
.footer-cols a:hover { color: var(--accent); }
.site-copyright {
    border-top: 1px solid #2b3038;
    padding: 18px 0;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: #8a92a0;
}

/* =========================================================================
   Cookie-баннер
   ====================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--bg-dark);
    color: #dfe3e8;
    border-top: 2px solid var(--accent);
    padding: 14px 0;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; min-width: 0; }
.cookie-inner a { color: var(--accent); }

/* =========================================================================
   ГЛАВНАЯ
   ====================================================================== */
.front-section { padding: 80px 0; }
.front-section--alt { background: var(--bg-alt); }

/* Блок 1 — Hero */
.hero {
    position: relative;
    background: var(--bg-dark);
    color: #fff;
    overflow: hidden;
    padding: 0;
}
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}
.hero-gear {
    position: absolute;
    left: -60px;
    bottom: -60px;
    width: 320px;
    height: 320px;
    opacity: 0.04;
    pointer-events: none;
}
.hero-inner {
    position: relative;
    padding: 96px 0 100px;
}
.hero h1 {
    color: #fff;
    max-width: 900px;
    margin-bottom: 18px;
}
.hero-lead {
    max-width: 640px;
    color: #c4cad3;
    font-size: 1.15rem;
    margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Блок 2 — Сетка карточек 4 колонки (термины) */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}
.feature-card {
    background: #fff;
    border: 1px solid var(--card-border);
    box-shadow: 2px 4px 0 var(--card-shadow);
    padding: 26px 22px 24px;
    border-radius: 0;
    min-width: 0;
}
.feature-card:hover {
    background: var(--bg-alt);
    box-shadow: 2px 8px 0 var(--card-shadow);
}
.feature-icon { color: var(--accent); margin-bottom: 14px; display: block; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature-card p { color: #565c66; font-size: 0.92rem; margin: 0; }

/* Блок 3 — Таймлайн */
.timeline {
    position: relative;
    max-width: 820px;
    margin-inline: auto;
    padding-left: 40px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    border-left: 2px dashed var(--accent);
}
.timeline-item {
    position: relative;
    padding: 0 0 34px 14px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: "";
    position: absolute;
    left: -38px;
    top: 6px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    transform: rotate(45deg);
}
.timeline-stage {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--bg-dark);
    margin-bottom: 4px;
}
.timeline-item h3 { font-size: 1.15rem; margin-bottom: 6px; }
.timeline-item p { color: #565c66; margin: 0; font-size: 0.96rem; }

/* Блок 4 — Цитата */
.quote-block {
    position: relative;
    background: var(--bg-dark);
    background-image: linear-gradient(180deg, #23282f 0%, #1A1E24 60%, #14171c 100%);
    color: #fff;
    padding: 54px 48px 44px;
    border-radius: 2px;
    display: flex;
    gap: 26px;
}
.quote-bar {
    flex: 0 0 6px;
    background: var(--accent);
    align-self: stretch;
}
.quote-body { min-width: 0; }
.quote-text {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.35;
    margin: 0 0 16px;
    color: #fff;
}
.quote-author {
    text-align: right;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.85rem;
    margin: 0;
}

/* Секция «последние записи» на главной */
.latest-head { margin-bottom: 26px; }

/* Контакты (статичные) */
.contact-static a { color: var(--accent-2); }

/* 404 */
.error-404 { text-align: center; padding: 40px 0; }
.error-404 .code {
    font-family: var(--mono);
    font-size: 6rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 10px;
}
.error-404 .search-form { margin: 24px auto 0; }

/* =========================================================================
   Адаптив
   ====================================================================== */
@media (max-width: 960px) {
    h1 { font-size: 2.6rem; }
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-single .content-area { width: 100%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 2.1rem; }
    h2 { font-size: 1.7rem; }
    .front-section { padding: 52px 0; }

    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 4px; }
    .main-nav a { border-color: #2b3038; }

    .feature-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 26px; }

    .quote-block { padding: 32px 22px 26px; flex-direction: column; gap: 16px; }
    .quote-bar { flex: 0 0 4px; width: 60px; align-self: flex-start; }
    .quote-text { font-size: 1.4rem; }

    .hero-inner { padding: 60px 0 64px; }
    .hero-lead { font-size: 1.02rem; }

    .timeline { padding-left: 28px; }
    .timeline-item::before { left: -30px; }

    .search-form { max-width: none; }
}
