/*
Theme Name: dds_rajeshshende.com
Theme URI: https://rajeshshende.com
Author: Раджеш Шенде
Author URI: https://rajeshshende.com
Description: Тёмная индустриально-лабораторная тема для образовательно-игрового блога на стыке химической инженерии и Factorio.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: rshende
*/

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --bg:        #12181C;
    --bg2:       #1A2428;
    --bg3:       #202C31;
    --accent:    #E37D2E;
    --accent-d:  #B85F1C;
    --accent2:   #2F9B7A;
    --text:      #D9DDE2;
    --heading:   #F2F4F7;
    --muted:     #8A99A8;
    --mono-bg:   #2A1E1F;
    --line:      #2C3A41;
    --shell:     1180px;
    --font-body: "Segoe UI", "Roboto", "Helvetica Neue", Tahoma, sans-serif;
    --font-head: "Oswald", "Segoe UI", Tahoma, sans-serif;
    --font-mono: "JetBrains Mono", "Consolas", "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 28px);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

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

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--accent2); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--heading);
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: .3px;
    margin: 1.4em 0 .55em;
}
h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.28rem; }

p { margin: 0 0 1.05em; }

code, pre, kbd {
    font-family: var(--font-mono);
    background: var(--mono-bg);
    color: #E9C9A0;
    border: 1px solid #3A2A2B;
}
code { padding: .12em .4em; border-radius: 3px; font-size: .9em; }
pre {
    padding: 16px 18px;
    border-radius: 4px;
    overflow-x: auto;
    line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; }

blockquote {
    margin: 1.4em 0;
    padding: 14px 20px;
    border-left: 3px solid var(--accent);
    background: var(--bg2);
    color: var(--muted);
    font-style: italic;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--line);
    margin: 1.4em 0;
}
th, td {
    border: 1px solid var(--line);
    padding: 9px 12px;
    text-align: left;
}
th { background: var(--bg3); color: var(--heading); }

/* ============================================================
   Контейнер
   ============================================================ */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
    display: inline-block;
    font-family: var(--font-head);
    font-size: .92rem;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: 4px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #1A1206;
    cursor: pointer;
    transition: box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:hover {
    color: #1A1206;
    background: var(--accent);
    box-shadow: inset 0 3px 9px rgba(0,0,0,.45);
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--accent);
}
.btn-ghost:hover {
    background: rgba(227,125,46,.08);
    box-shadow: none;
    color: var(--accent);
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--bg2);
    border-bottom: 1px solid var(--line);
}

/* «Чертёжная линейка» — миллиметровка с метками */
.draft-ruler {
    background:
        repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 11px),
        var(--bg3);
    border-bottom: 1px solid var(--line);
}
.draft-ruler .shell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 26px;
    padding: 5px 0;
}
.draft-ruler span {
    font-family: var(--font-mono);
    font-size: .64rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--muted);
}
.draft-ruler span::before { content: "│ "; color: var(--accent); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 20px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}
.brand-logo,
.brand-logo-svg {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 4px;
}
.brand-text { min-width: 0; }
.site-title {
    margin: 0;
    font-size: 1.04rem;
    line-height: 1.3;
}
.site-title a { color: var(--heading); }
.site-desc {
    margin: 4px 0 0;
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   Навигация
   ============================================================ */
.main-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.main-nav .shell {
    display: flex;
    align-items: center;
    gap: 14px;
}
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--accent);
    font-family: var(--font-head);
    font-size: .85rem;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px 0;
}
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
}
.main-nav li { margin: 0; }
.main-nav a {
    display: block;
    font-family: var(--font-head);
    font-size: .92rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text);
    padding: 14px 16px;
    border-bottom: 3px solid transparent;
}
.main-nav a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.main-nav .current-menu-item > a {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   Каркас страницы
   ============================================================ */
.site-main { padding: 34px 0 50px; }

.layout-with-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 36px;
    align-items: flex-start;
}
.layout-with-sidebar .content-area {
    flex: 1 1 67%;
    min-width: 0;
}
.layout-with-sidebar .sidebar {
    flex: 0 0 27%;
    min-width: 0;
}
.layout-single,
.layout-narrow {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.layout-single .content-area {
    min-width: 0;
}
@media (max-width: 960px) {
    .layout-single,
    .layout-narrow { width: 100%; }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar {
        flex: 1 1 100%;
    }
}

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--muted);
    padding: 11px 14px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 4px;
    margin-bottom: 26px;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs .sep { color: var(--accent2); margin: 0 4px; }

/* ============================================================
   Карточки записей
   ============================================================ */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}
@media (min-width: 601px) {
    .card { flex-direction: row; }
}

.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: var(--bg3);
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(1) contrast(1.05);
}
.card-thumb-ph {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 190px;
}

.card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
}
.card-meta {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 7px;
}
.card-title {
    margin: 0 0 8px;
    font-size: 1.24rem;
}
.card-title a { color: var(--heading); }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
    color: var(--text);
    font-size: .96rem;
    flex: 1;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
}

/* Круговая диаграмма «эффективность» */
.efficiency {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    color: var(--heading);
    background: var(--bg3);
}
.efficiency span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg2);
    display: grid;
    place-items: center;
}

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.entry {
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 30px 34px;
}
.entry-header { margin-bottom: 18px; }
.entry-title { margin-top: 0; }
.entry-meta {
    font-family: var(--font-mono);
    font-size: .76rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.entry-thumb {
    margin: 0 0 22px;
    border-radius: 4px;
    overflow: hidden;
}
.entry-thumb img { display: block; width: 100%; }
.entry-content img { border-radius: 4px; }
.entry-content > *:first-child { margin-top: 0; }

.entry-tags {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: .85rem;
}
.entry-tags a {
    display: inline-block;
    background: var(--bg3);
    border: 1px solid var(--line);
    padding: 3px 11px;
    border-radius: 4px;
    margin: 0 5px 5px 0;
    color: var(--accent);
}

/* Блок «Инженерный уголок» */
.engineer-corner {
    margin: 28px 0;
    padding: 18px 22px 18px 56px;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent2);
    border-radius: 4px;
    position: relative;
}
.engineer-corner::before {
    content: "";
    position: absolute;
    left: 18px; top: 20px;
    width: 24px; height: 24px;
    background: var(--accent2);
    -webkit-mask: radial-gradient(circle at 50% 12%, #000 3px, transparent 3.5px) center/100% 100%;
    border-radius: 2px;
}
.engineer-corner h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--accent2);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.engineer-corner p { margin: 0; font-size: .92rem; color: var(--text); }

/* ============================================================
   Тематические секции главной
   ============================================================ */
.home-section {
    margin-bottom: 40px;
    padding: 30px 32px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 4px;
}
.home-section > h2 {
    margin-top: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}
.home-section .lead { color: var(--muted); }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.feature-card {
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 18px 18px 20px;
    min-width: 0;
}
.feature-card h3 { margin-top: 0; font-size: 1.06rem; }
.feature-card .icon {
    width: 38px; height: 38px;
    margin-bottom: 8px;
    color: var(--accent);
}
.feature-card .icon.green { color: var(--accent2); }

/* Технологические шильды рубрик */
.process-tags {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.process-tag {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 14px 16px;
    color: var(--text);
}
.process-tag:hover { color: var(--heading); border-left-color: var(--accent2); }
.process-tag .badge {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    border-radius: 4px;
    background: var(--mono-bg);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
}
.process-tag .pt-name {
    font-family: var(--font-head);
    letter-spacing: .4px;
    min-width: 0;
}

/* Шаги */
.steps {
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 18px;
}
.step {
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 18px;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: "0" counter(step);
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--accent);
    display: block;
    margin-bottom: 6px;
}
.step h3 { margin: 0 0 6px; font-size: 1.04rem; }
.step p { margin: 0; font-size: .92rem; color: var(--muted); }

/* ============================================================
   Сайдбар и виджеты
   ============================================================ */
.widget {
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 18px 20px;
    margin-bottom: 22px;
    color: var(--text);
}
.widget a { color: var(--accent); }
.widget a:hover { color: var(--accent2); }
.widget-title {
    margin: 0 0 14px;
    font-size: 1.04rem;
    color: var(--heading);
    text-transform: uppercase;
    letter-spacing: .8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget ul li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    font-size: .92rem;
}
.widget ul li:last-child { border-bottom: 0; }
.widget .post-date,
.widget .rss-date {
    display: block;
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--muted);
}
.widget select {
    width: 100%;
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--line);
    padding: 7px;
    border-radius: 4px;
}

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--bg2);
    border-top: 1px solid var(--line);
    padding: 40px 0 0;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}
@media (max-width: 960px) {
    .footer-cols { grid-template-columns: 1fr; }
}
.footer-col .widget {
    background: var(--bg3);
    color: var(--text);
}
.footer-col .widget-title { color: var(--heading); }
.footer-col .widget a { color: var(--accent); }
.footer-col .widget a:hover { color: var(--accent2); }
.footer-col .widget ul li { color: var(--text); }
.footer-col .widget .post-date { color: var(--muted); }

/* Переключатель «Режим инженера / Режим игрока» */
.mode-switch {
    margin: 30px 0 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--muted);
}
.mode-switch button {
    background: var(--bg3);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: .76rem;
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
}
.mode-switch button.active {
    background: var(--accent);
    color: #1A1206;
    border-color: var(--accent);
}
body.mode-player .formula,
body.mode-player .engineer-corner { display: none; }

.site-credit {
    margin-top: 26px;
    border-top: 1px solid var(--line);
    padding: 18px 0 22px;
    font-size: .82rem;
    color: var(--muted);
    text-align: center;
}

/* ============================================================
   Пагинация — «тумблеры»
   ============================================================ */
.rs-pagination {
    margin: 34px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.rs-pagination .page-numbers {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-bottom: 3px solid transparent;
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: .9rem;
}
.rs-pagination a.page-numbers:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.rs-pagination .page-numbers.current {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--bg3);
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    margin-top: 30px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 26px 30px;
}
.comments-title { margin-top: 0; }
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list ul.children {
    list-style: none;
    margin: 0 0 0 26px;
    padding: 0;
}
.comment-body {
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.comment-author {
    font-family: var(--font-head);
    color: var(--heading);
}
.comment-meta {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--muted);
    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(--bg3);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: .95rem;
}
.comment-form label { font-size: .85rem; color: var(--muted); }
.comment-form p { margin-bottom: 12px; }

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    background: var(--bg3);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 4px;
    font-size: .95rem;
}
.search-form .search-submit {
    flex: 0 0 auto;
    font-family: var(--font-head);
    text-transform: uppercase;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #1A1206;
    padding: 9px 18px;
    border-radius: 4px;
    cursor: pointer;
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 40px 34px;
    text-align: center;
}
.error-404 .code {
    font-family: var(--font-mono);
    font-size: 4.5rem;
    color: var(--accent);
    line-height: 1;
}
.error-404 .search-form { max-width: 420px; margin: 22px auto 0; }

/* ============================================================
   Cookie-баннер
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--bg3);
    border-top: 2px solid var(--accent);
    padding: 14px 0;
}
.cookie-banner .shell {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-banner p {
    margin: 0;
    font-size: .86rem;
    color: var(--text);
    flex: 1;
    min-width: 240px;
}
.cookie-banner .btn { flex: 0 0 auto; }

/* ============================================================
   Прочее
   ============================================================ */
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.list-title { margin-top: 0; }
.posts-loop { margin-top: 6px; }
.formula {
    font-family: var(--font-mono);
    background: var(--mono-bg);
    color: #E9C9A0;
    border: 1px solid #3A2A2B;
    padding: 10px 14px;
    border-radius: 4px;
    display: block;
    margin: 1.2em 0;
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .entry { padding: 22px 18px; }
    .home-section { padding: 22px 18px; }
    .nav-toggle { display: block; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-bottom: 8px;
    }
    .main-nav ul.is-open { display: flex; }
    .main-nav .shell { flex-wrap: wrap; }
    .main-nav a { padding: 11px 6px; }

    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .card-thumb-ph { min-height: 0; aspect-ratio: 16 / 9; }
}
