/*
Theme Name: dds_so-agence.com
Author: Илья Корнеев
Description: Редакционный журнал о hi-tech новинках с фокусом на устройства, цифровые сервисы, AI, пользовательский опыт и технологические тренды.
Version: 1.1
Text Domain: dds-so-agence
*/

/* ============================================================
   1. ОСНОВА: РЕСЕТ, ТИПОГРАФИКА, ПЕРЕМЕННЫЕ
   ============================================================ */

:root {
    --bg-deep:        #14181f;
    --bg-card:        #0d1117;
    --bg-elevated:    #1a1f28;
    --text-main:      #e8ecf2;
    --text-muted:     #9ba6b4;
    --accent-neon:    #4d9fff;
    --accent-bright:  #21f0ff;
    --accent-silver:  #8a94a3;
    --border-soft:    rgba(138, 148, 163, 0.18);
    --shadow-card:    0 6px 26px rgba(0, 0, 0, 0.35);

    --font-head: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-body: "Source Serif Pro", "Charter", "Georgia", serif;
    --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden; /* A12.5 — страховка */
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent-neon);
    text-decoration: none;
    transition: color 0.18s ease;
}
a:hover { color: var(--accent-bright); }

p { margin: 0 0 1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
    color: var(--text-main);
    letter-spacing: -0.01em;
    text-align: left;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

/* Контейнер ширины — единая точка истины (A12.7) */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ============================================================
   2. ШАПКА
   ============================================================ */

.site-header {
    background: linear-gradient(180deg, rgba(20, 24, 31, 0.98) 0%, rgba(20, 24, 31, 0.92) 100%);
    border-bottom: 1px solid var(--border-soft);
    padding: 18px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    min-width: 0;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
    min-width: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: block;
    flex-shrink: 0;
}

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

.brand-name {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

.brand-desc {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    max-width: 420px;
}

.header-nav {
    margin-left: auto;
    min-width: 0;
}

.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.header-nav a {
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 0.92rem;
    text-transform: lowercase;
    letter-spacing: 0.01em;
    position: relative;
    padding-bottom: 6px;
}

.header-nav a:hover { color: var(--text-main); }

.header-nav .current-menu-item > a,
.header-nav .current_page_item > a {
    color: var(--text-main);
}

.header-nav .current-menu-item > a::after,
.header-nav .current_page_item > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-neon);
    box-shadow: 0 0 8px var(--accent-neon);
}

/* Бургер */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: auto;
}

/* ============================================================
   3. ОСНОВНОЙ КОНТЕНТ И РАСКЛАДКА
   ============================================================ */

.site-main { padding: 36px 0 64px; }

/* С сайдбаром — 67% / 27% */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 36px;
    align-items: start;
}

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

.content-area { min-width: 0; }

/* ============================================================
   4. ХЛЕБНЫЕ КРОШКИ
   ============================================================ */

.breadcrumbs {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-radius: 6px;
    border-left: 2px solid var(--accent-neon);
}

.breadcrumbs a { color: var(--accent-neon); }
.breadcrumbs a:hover { color: var(--accent-bright); }
.breadcrumbs .sep { margin: 0 6px; color: var(--accent-silver); }
.breadcrumbs span:last-child { color: var(--text-main); }

/* ============================================================
   5. КАРТОЧКИ ЗАПИСЕЙ (A8, A10)
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, border-color 0.22s ease;
    min-width: 0;
}

.card:hover {
    transform: scale(1.01);
    border-color: var(--accent-neon);
}

/* Вертикальная карточка (сетка) */
.card-grid .card-thumb-wrap {
    width: 100%;
    overflow: hidden;
}
.card-grid .card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

/* Горизонтальная карточка (лента) */
.card-row {
    flex-direction: row;
}
.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-tone-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-neon);
    box-shadow: 0 0 6px currentColor;
}

.card-tone-warm .card-tone-dot { background: #ff9a4d; color: #ff9a4d; }
.card-tone-cool .card-tone-dot { background: var(--accent-neon); color: var(--accent-neon); }

.card-title {
    font-family: var(--font-head);
    font-size: 1.25rem;
    margin: 0 0 4px;
    line-height: 1.3;
}
.card-title a {
    color: var(--text-main);
}
.card-title a:hover { color: var(--accent-bright); }

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-excerpt a { color: var(--accent-neon); }

.card-more {
    margin-top: auto;
    align-self: flex-start;
    padding: 8px 18px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--accent-neon);
    color: var(--text-main);
    font-family: var(--font-head);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}
.card-more:hover {
    background: var(--accent-neon);
    color: #0b0e13;
}

/* Сетка карточек на странице блога */
.posts-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   6. ГРАДИЕНТНЫЕ РАЗДЕЛИТЕЛИ
   ============================================================ */

.grad-sep {
    height: 2px;
    width: 80px;
    background: linear-gradient(90deg, var(--accent-neon) 0%, transparent 100%);
    margin: 28px 0;
    border: none;
}

/* ============================================================
   7. ГЛАВНАЯ СТРАНИЦА
   ============================================================ */

.hero-block {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 44px 36px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-block::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 60%;
    background: linear-gradient(180deg, var(--accent-neon), transparent);
}

.hero-block h2 { margin-top: 0; }

.hero-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(77, 159, 255, 0.12);
    border: 1px solid var(--accent-neon);
    color: var(--accent-neon);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 24px;
}
@media (min-width: 720px) {
    .feature-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.feature-cell {
    padding: 22px;
    background: var(--bg-elevated);
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    min-width: 0;
}
.feature-cell h3 { margin-top: 0; font-size: 1.1rem; }
.feature-cell p { color: var(--text-muted); font-size: 0.95rem; }

.section-title {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin: 36px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
    position: relative;
}
.section-title::after {
    content: "";
    position: absolute;
    bottom: -1px; left: 0;
    width: 80px; height: 2px;
    background: var(--accent-neon);
}

/* ============================================================
   8. САЙДБАР И ВИДЖЕТЫ
   ============================================================ */

.site-sidebar {
    background: var(--bg-card);
    padding: 22px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    min-width: 0;
}

.site-sidebar .widget { margin-bottom: 28px; }
.site-sidebar .widget:last-child { margin-bottom: 0; }

.site-sidebar .widget-title,
.site-sidebar h2,
.site-sidebar h3 {
    font-family: var(--font-head);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}

.site-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-sidebar ul li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-soft);
    color: var(--text-main);
}
.site-sidebar ul li:last-child { border-bottom: none; }
.site-sidebar a { color: var(--accent-neon); }
.site-sidebar a:hover { color: var(--accent-bright); }
.site-sidebar .post-date,
.site-sidebar time {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   9. ОДИНОЧНАЯ ЗАПИСЬ / СТРАНИЦА
   ============================================================ */

.entry {
    background: var(--bg-card);
    padding: 32px 36px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
}

.entry-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}
.entry-title {
    font-size: 2rem;
    margin: 0 0 12px;
    text-align: left;
}
.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entry-content { font-size: 1.05rem; line-height: 1.7; }
.entry-content img { border-radius: 8px; margin: 16px 0; }
.entry-content blockquote {
    background: #f4f6fa;
    color: #14181f;
    padding: 22px 26px;
    border-left: 4px solid var(--accent-neon);
    margin: 24px 0;
    border-radius: 6px;
    font-style: italic;
}
.entry-content blockquote p { background: none; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--border-soft);
}
.entry-content th,
.entry-content td {
    padding: 10px 14px;
    text-align: left;
}
.entry-content th {
    background: var(--bg-elevated);
    font-family: var(--font-head);
}

/* ============================================================
   10. ПАГИНАЦИЯ
   ============================================================ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 36px 0;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--bg-card);
    text-decoration: none;
}
.pagination a:hover {
    border-color: var(--accent-neon);
    color: var(--accent-bright);
}
.pagination .current {
    background: var(--accent-neon);
    color: #0b0e13;
    border-color: var(--accent-neon);
}

/* ============================================================
   11. КОММЕНТАРИИ
   ============================================================ */

.comments-area {
    margin-top: 36px;
    background: var(--bg-card);
    padding: 28px 32px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
}
.comments-title {
    font-family: var(--font-head);
    font-size: 1.3rem;
    margin: 0 0 20px;
}
.comments-area .comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
}
.comments-area .comment {
    padding: 14px 0;
    border-bottom: 1px dashed var(--border-soft);
}
.comments-area .comment:last-child { border-bottom: none; }
.comments-area .comment-author {
    font-family: var(--font-head);
    font-weight: 600;
}
.comments-area .comment-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    margin-top: 4px;
}
.comment-form label {
    display: block;
    margin: 14px 0 4px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.comment-form .form-submit {
    margin-top: 16px;
}
.comment-form input[type="submit"] {
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--accent-neon);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-head);
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}
.comment-form input[type="submit"]:hover {
    background: var(--accent-neon);
    color: #0b0e13;
}

/* ============================================================
   12. ФОРМА ПОИСКА
   ============================================================ */

.search-form {
    display: flex;
    gap: 8px;
    margin: 18px 0;
}
.search-form label { flex: 1; min-width: 0; }
.search-form .search-field {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}
.search-form .search-submit {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--accent-neon);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-head);
    font-size: 0.9rem;
    cursor: pointer;
}
.search-form .search-submit:hover {
    background: var(--accent-neon);
    color: #0b0e13;
}

/* ============================================================
   13. ПОДВАЛ
   ============================================================ */

.site-footer {
    background: #0a0d12;
    border-top: 1px solid var(--border-soft);
    padding: 48px 0 24px;
    margin-top: 64px;
    color: var(--text-main);
}

.footer-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
@media (min-width: 720px) {
    .footer-cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.footer-col { min-width: 0; }

.footer-col .widget-title,
.footer-col h2,
.footer-col h3 {
    font-family: var(--font-head);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li {
    padding: 6px 0;
}
.footer-col a {
    color: #bdc6d2;
    font-size: 0.92rem;
}
.footer-col a:hover { color: var(--accent-bright); }
.footer-col p,
.footer-col .textwidget {
    color: #bdc6d2;
    font-size: 0.92rem;
    line-height: 1.55;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #8a94a3;
    text-align: center;
}

/* ============================================================
   14. COOKIE-БАННЕР (A11)
   ============================================================ */

.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #0a0d12;
    border-top: 1px solid var(--accent-neon);
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
}
.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 220px;
    color: #d6dde6;
    font-size: 0.9rem;
}
.cookie-banner button {
    padding: 9px 20px;
    background: var(--accent-neon);
    border: none;
    border-radius: 6px;
    color: #0a0d12;
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
}
.cookie-banner button:hover {
    background: var(--accent-bright);
}

/* ============================================================
   15. 404
   ============================================================ */

.not-found-block {
    background: var(--bg-card);
    padding: 48px 32px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    text-align: center;
}
.not-found-block h1 {
    font-size: 3rem;
    text-align: center;
    color: var(--accent-neon);
    margin: 0 0 12px;
}

/* ============================================================
   16. АДАПТИВ
   ============================================================ */

@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
    }
    .header-nav {
        flex-basis: 100%;
        order: 3;
        display: none;
    }
    .header-nav.is-open { display: block; }
    .header-nav ul {
        flex-direction: column;
        gap: 14px;
    }
    .nav-toggle { display: inline-block; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }
    .entry { padding: 22px; }
    .hero-block { padding: 28px 22px; }
    .layout-no-sidebar .content-area { width: 100%; }

    /* Сброс абсолютного позиционирования миниатюр на мобильных (A10) */
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a {
        position: static;
    }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .card-body { padding: 18px 20px; }
}
