/*
Theme Name: dds_zompa-zitu.com
Author: Максим Зомпа
Description: Тёмная аналитическая тема для медиа-портала о влиянии графического дизайна на кассовый успех игр. Модульная сетка, моноширинные цифры, карточный интерфейс дашборда.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: zzitu
*/

/* ===== Переменные ===== */
:root {
    --bg: #0F1115;
    --bg-deep: #0B0D10;
    --text: #F0F3F8;
    --text-dim: #C7CDD6;
    --text-mute: #8A92A0;
    --accent: #E86A2C;
    --accent-2: #1FA8A3;
    --card: #1A1D24;
    --line: #2A2F3A;
    --font-head: 'Geometria', 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'Fira Code', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

/* ===== Сброс / база ===== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0 0 0.6em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

code, pre, .num {
    font-family: var(--font-mono);
}

pre {
    background: var(--bg-deep);
    border: 1px solid var(--line);
    padding: 16px;
    overflow-x: auto;
    min-width: 0;
}

blockquote {
    margin: 1.4em 0;
    padding: 0.6em 1.2em;
    border-left: 3px solid var(--accent);
    color: var(--text-dim);
}

/* ===== Контейнер ширины (единственное место) ===== */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 0;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #FFFFFF;
    border-bottom: 2px solid var(--accent);
}
.btn-primary:hover {
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(232, 106, 44, 0.28);
    border-bottom-color: #ffb083;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}
.btn-secondary:hover {
    background: var(--accent);
    color: #FFFFFF;
    transform: translateY(-2px);
    border-color: var(--accent);
}

/* ===== Шапка ===== */
.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--bg-deep);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo,
.brand-svg {
    width: 52px;
    height: 52px;
    flex: none;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    display: block;
    line-height: 1.3;
}
.brand-desc {
    font-size: 0.78rem;
    color: var(--text-mute);
    display: block;
    margin-top: 3px;
}

/* ===== Навигация ===== */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text-dim);
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    min-height: 44px;
    padding: 0 16px;
    font-family: var(--font-head);
    cursor: pointer;
}

/* ===== Раскладки ===== */
.site-main { padding: 38px 0 56px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-mute);
    margin-bottom: 22px;
    font-family: var(--font-mono);
}
.breadcrumbs a { color: var(--accent-2); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--line); margin: 0 4px; }

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

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(26, 29, 36, 0.85);
    border: 1px solid var(--line);
    overflow: hidden;
}

.card-thumb-wrap {
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.card:hover .card-thumb-wrap img { transform: scale(1.04); }

.card-thumb-fallback {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-linear-gradient(90deg, transparent 0 38px, var(--line) 38px 39px),
        var(--bg-deep);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 24px;
}
.card-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-mute);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}
.card-title {
    font-size: 1.15rem;
    margin: 0 0 10px;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; align-self: flex-start; }

.card-spark {
    display: block;
    width: 100%;
    height: 34px;
    margin-bottom: 14px;
}

/* ===== Запись / страница ===== */
.entry { margin-bottom: 30px; }
.entry-header { margin-bottom: 22px; }
.entry-title { font-size: 2rem; }
.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-mute);
    margin-top: 6px;
}
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--line);
}
.entry-content { word-wrap: break-word; overflow-wrap: break-word; }
.entry-content img { display: block; height: auto; }
.entry-content h2 { margin-top: 1.5em; }
.entry-content ul,
.entry-content ol { padding-left: 1.4em; }

/* ===== Таблицы ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--line);
    font-size: 0.92rem;
}
th, td {
    border: 1px solid var(--line);
    padding: 10px 14px;
    text-align: left;
}
th {
    background: var(--bg-deep);
    font-family: var(--font-head);
    color: var(--text);
}

/* ===== Сайдбар + виджеты ===== */
.sidebar { min-width: 0; }

.widget {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--text-dim);
}
.widget-title {
    font-size: 1rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    letter-spacing: 0.02em;
}
.widget a { color: var(--accent-2); }
.widget a:hover { color: var(--accent); }
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget li {
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.92rem;
}
.widget li:last-child { border-bottom: none; }
.widget .post-date,
.widget .rss-date {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-mute);
    margin-top: 3px;
}

/* ===== Главная ===== */
.front section { margin-bottom: 56px; }

.block {
    background: rgba(26, 29, 36, 0.85);
    border: 1px solid var(--line);
    padding: 40px;
}
.block-head {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.hero {
    text-align: center;
    background:
        repeating-linear-gradient(0deg, transparent 0 47px, var(--line) 47px 48px),
        var(--bg-deep);
}
.hero h1 { font-size: 2.5rem; max-width: 18ch; margin-inline: auto; }
.hero p { color: var(--text-dim); max-width: 60ch; margin-inline: auto; }
.metric {
    font-family: var(--font-mono);
    font-size: clamp(2.6rem, 8vw, 5rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin: 26px 0 6px;
}
.metric-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    color: var(--text-mute);
    text-transform: uppercase;
}
.hero-cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
}
.tile {
    border: 1px solid var(--line);
    background: var(--bg-deep);
    padding: 24px;
    min-width: 0;
}
.tile .step {
    font-family: var(--font-mono);
    color: var(--accent-2);
    font-size: 0.85rem;
}
.tile h3 { margin: 8px 0 8px; }
.tile p { color: var(--text-dim); font-size: 0.93rem; margin: 0; }

/* Сравнительный слайдер было/стало */
.compare {
    position: relative;
    user-select: none;
    border: 1px solid var(--line);
    overflow: hidden;
    margin-top: 22px;
    background: var(--bg-deep);
}
.compare-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-weight: 700;
    height: 320px;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}
.compare-before {
    background:
        repeating-linear-gradient(45deg, #15171c 0 20px, #1b1e25 20px 40px);
    color: var(--text-mute);
}
.compare-after {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 50%;
    overflow: hidden;
}
.compare-after .compare-pane {
    background:
        repeating-linear-gradient(45deg, #2a1a10 0 20px, #3a2415 20px 40px);
    color: var(--accent);
}
.compare-after-inner { width: 1100px; max-width: none; }
.compare-handle {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 3px;
    background: var(--accent);
    cursor: ew-resize;
}
.compare-handle::after {
    content: '◂ ▸';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    padding: 6px 8px;
    white-space: nowrap;
}
.compare-range {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

.cta-block {
    text-align: center;
    border-color: var(--accent);
}
.contacts-static {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.contacts-static a { color: var(--accent-2); }

.section-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 22px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ===== Пагинация ===== */
.pager { margin-top: 36px; }
.pager-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
}
.pager-list a,
.pager-list span {
    display: block;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    line-height: 44px;
    text-align: center;
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
}
.pager-list a:hover { border-color: var(--accent); color: var(--accent); }
.pager-list .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== Комментарии ===== */
.comments-area { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 28px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list ul.children { list-style: none; padding-left: 26px; }
.comment-body {
    border: 1px solid var(--line);
    background: var(--card);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comment-author { font-family: var(--font-head); font-weight: 600; }
.comment-metadata { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-mute); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 12px;
    font-family: var(--font-body);
    margin-top: 4px;
}
.comment-form label { font-size: 0.88rem; color: var(--text-dim); }
.comment-form p { margin-bottom: 14px; }
.comment-form .submit,
.comment-form input[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: 0;
    min-height: 48px;
    padding: 0 26px;
    font-family: var(--font-head);
    font-weight: 600;
    cursor: pointer;
}

/* ===== Форма поиска ===== */
.search-form {
    display: flex;
    gap: 0;
    max-width: 420px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 0 14px;
    min-height: 48px;
    font-family: var(--font-body);
}
.search-form button {
    background: var(--accent);
    color: #fff;
    border: 0;
    min-height: 48px;
    padding: 0 22px;
    font-family: var(--font-head);
    font-weight: 600;
    cursor: pointer;
}

/* ===== 404 ===== */
.error-404 { text-align: center; padding: 30px 0; }
.error-404 .code {
    font-family: var(--font-mono);
    font-size: clamp(4rem, 16vw, 9rem);
    color: var(--accent);
    line-height: 1;
}
.error-404 .search-form { margin: 24px auto; }

/* ===== Подвал ===== */
.site-footer {
    background: var(--bg-deep);
    border-top: 1px solid var(--line);
    padding: 46px 0 24px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
.footer-col { min-width: 0; color: var(--text-dim); }
.footer-col .widget {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--text-dim);
}
.footer-col .widget-title { color: var(--text); }
.footer-col .widget a { color: var(--accent-2); }
.footer-col .widget a:hover { color: var(--accent); }
.footer-col .widget li { border-bottom-color: var(--line); }
.footer-col .widget .post-date { color: var(--text-mute); }
.site-copyright {
    margin-top: 38px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-mute);
    text-align: center;
}

/* ===== Cookie-баннер (правило [hidden] — до основного блока) ===== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--bg-deep);
    border-top: 1px solid var(--accent);
    padding: 16px 0;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-text { font-size: 0.86rem; color: var(--text-dim); margin: 0; min-width: 0; flex: 1; }
.cookie-banner .btn { white-space: nowrap; }

/* ===== Лоадер (пульсирующий график) ===== */
.zzitu-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}
.zzitu-loader.hidden { opacity: 0; pointer-events: none; }
.zzitu-loader svg { width: 130px; height: 60px; }
.zzitu-loader polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: zzitu-pulse 1.6s ease-in-out infinite;
}
@keyframes zzitu-pulse {
    0%   { stroke-dashoffset: 320; opacity: 0.3; }
    55%  { stroke-dashoffset: 0;   opacity: 1; }
    100% { stroke-dashoffset: -320; opacity: 0.3; }
}

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 2rem; }
    .block { padding: 30px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .header-inner { gap: 16px; }
    .layout-single .content-area { width: 100%; }
    .grid-3 { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; }
    .block { padding: 22px; }
    .hero h1 { font-size: 1.7rem; }
    .compare-pane { height: 220px; font-size: 1.1rem; }
    .cookie-inner { justify-content: stretch; }
    .cookie-banner .btn { width: 100%; }
}
