/*
Theme Name: dds_websitesbyeli.com
Theme URI: https://websitesbyeli.com
Author: Эли Д’Агостино
Author URI: https://websitesbyeli.com
Description: Тёмная техно-тема для независимого онлайн-журнала о цифровом продуктовом дизайне, AI-инструментах и практиках создания SaaS. Антрацитовый фон, неоново-персиковые акценты и аквамариновый подцвет для кода.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: eljournal
*/

/* =========================================================================
   ПЕРЕМЕННЫЕ И СБРОС
   ====================================================================== */
:root {
    --bg:          #121212;
    --surface:     #1E1E1E;
    --surface-2:   #242424;
    --border:      rgba(230, 237, 245, 0.10);
    --border-hi:   rgba(255, 107, 74, 0.55);
    --accent:      #FF6B4A;
    --accent-2:    #FF8A6E;
    --aqua:        #2DD4BF;
    --text:        #E6EDF5;
    --text-muted:  #8A99B4;
    --shell:       1180px;
    --radius-skew: 14px 0 14px 0;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--bg);
    background-image:
        radial-gradient(rgba(230,237,245,0.022) 1px, transparent 1px),
        radial-gradient(rgba(230,237,245,0.018) 1px, transparent 1px);
    background-size: 6px 6px, 11px 11px;
    background-position: 0 0, 3px 5px;
    color: var(--text);
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--text);
    margin: 0 0 0.6em;
    font-weight: 700;
    letter-spacing: -0.01em;
}
h1 { font-size: 2.15rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

code, pre, kbd {
    font-family: "JetBrains Mono", "Consolas", "SF Mono", monospace;
    color: var(--aqua);
}
pre {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-left: 3px solid var(--aqua);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    border-radius: 4px;
}
code { background: rgba(45,212,191,0.10); padding: 0.1em 0.35em; border-radius: 3px; }
pre code { background: none; padding: 0; }

blockquote {
    margin: 1.4rem 0;
    padding: 0.6rem 1.2rem;
    border-left: 3px solid var(--aqua);
    background: rgba(45,212,191,0.06);
    color: var(--text);
}

/* =========================================================================
   КОНТЕЙНЕР ШИРИНЫ (единое место — A12.7)
   ====================================================================== */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

.site-main { padding: 2.6rem 0 3.4rem; }

/* =========================================================================
   ШАПКА
   ====================================================================== */
.site-header {
    background: linear-gradient(180deg, #161616 0%, #121212 100%);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.brand-logo { display: block; flex: 0 0 auto; }
.brand-logo.is-image { width: auto; height: 52px; }
.brand-text { min-width: 0; }
.site-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}
.site-title a { color: var(--text); }
.site-title a:hover { text-decoration: none; color: var(--accent); }
.site-desc {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 52ch;
}

/* Навигация */
.main-nav { min-width: 0; }
.nav-toggle {
    display: none;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-skew);
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 0.45rem 0.85rem;
    color: var(--text);
    border-radius: var(--radius-skew);
    font-size: 0.97rem;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--surface);
    color: var(--accent);
    text-decoration: none;
}

/* =========================================================================
   РАСКЛАДКИ
   ====================================================================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.6rem;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

/* =========================================================================
   САЙДБАР (эффект матового стекла)
   ====================================================================== */
.sidebar {
    min-width: 0;
    background: rgba(30, 30, 30, 0.66);
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.3rem 1.3rem 0.6rem;
}

/* =========================================================================
   ВИДЖЕТЫ — явный контраст текста для каждой области
   ====================================================================== */
.widget { margin-bottom: 1.5rem; }
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 0.7rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.32rem 0; border-bottom: 1px dotted var(--border); }
.widget li:last-child { border-bottom: 0; }

/* Сайдбар — фон тёмный, текст светлый */
.sidebar .widget-title { color: var(--text); }
.sidebar .widget, .sidebar .widget a { color: var(--text); }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .widget .post-date,
.sidebar .widget time { color: var(--text-muted); font-size: 0.82rem; }

/* =========================================================================
   КАРТОЧКИ ЗАПИСЕЙ (A8, A10 — вертикальный паттерн)
   ====================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 1.6rem;
}

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-3px); }

/* Вертикальная цветная метка категории слева */
.card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent);
}
.card.cat-ai::before   { background: var(--aqua); }
.card.cat-saas::before { background: #3B5BA9; }
.card.cat-design::before { background: var(--accent); }
.card:hover::before { box-shadow: 0 0 9px currentColor; }

.card-thumb { display: block; overflow: hidden; }
.card-thumb a { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.05rem 1.15rem 1.2rem;
    min-width: 0;
}
.card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}
.card-title { font-size: 1.18rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--text-muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; align-self: flex-start; }

/* =========================================================================
   КНОПКИ — «скошенный прямоугольник»
   ====================================================================== */
.btn,
button, input[type="submit"], .wp-block-button__link {
    display: inline-block;
    background: var(--accent);
    color: #1a0d09;
    border: 0;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-skew);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover,
button:hover, input[type="submit"]:hover, .wp-block-button__link:hover {
    text-decoration: none;
    color: #1a0d09;
    transform: translateY(-2px);
    box-shadow:
        0 0 0 3px var(--surface),
        0 0 16px 3px rgba(255, 107, 74, 0.55),
        0 8px 18px rgba(0, 0, 0, 0.5);
}
.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border-hi);
}
.btn-ghost:hover { color: var(--accent); }

/* =========================================================================
   ХЛЕБНЫЕ КРОШКИ
   ====================================================================== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--accent); margin: 0 0.15rem; }
.breadcrumbs span:last-child { color: var(--text); }

/* =========================================================================
   ПАГИНАЦИЯ
   ====================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 2.4rem;
}
.pagination .page-numbers {
    display: inline-block;
    min-width: 2.4rem;
    text-align: center;
    padding: 0.45rem 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-skew);
    color: var(--text);
    font-size: 0.92rem;
}
.pagination a.page-numbers:hover {
    border-color: var(--border-hi);
    color: var(--accent);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: #1a0d09;
    border-color: var(--accent);
}

/* =========================================================================
   ЗАПИСЬ / СТРАНИЦА
   ====================================================================== */
.entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.8rem 1.9rem;
}
.entry-header { margin-bottom: 1.2rem; }
.entry-title { font-size: 2rem; margin-bottom: 0.4rem; }
.entry-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.entry-thumb { margin: 0 0 1.4rem; }
.entry-content { min-width: 0; }
.entry-content img {
    display: block;
    border: 1px solid var(--aqua);
    outline: 1px solid rgba(45, 212, 191, 0.3);
    outline-offset: 3px;
    border-radius: 3px;
}
.entry-content figcaption,
.wp-caption-text {
    font-family: "JetBrains Mono", "Consolas", monospace;
    font-size: 0.8rem;
    color: var(--aqua);
    margin-top: 0.6rem;
}
.entry-content h2, .entry-content h3 { margin-top: 1.6rem; }
.entry-footer {
    margin-top: 1.6rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-muted);
}
.entry-footer a { color: var(--aqua); }

.list-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.3rem 1.5rem;
    margin-bottom: 1.4rem;
}
.list-post .card-title { font-size: 1.3rem; }

/* Точечные трассы-разделители между записями */
.dot-trail {
    height: 8px;
    margin: 2rem 0;
    background-image: radial-gradient(var(--text-muted) 1.4px, transparent 1.5px);
    background-size: 16px 8px;
    background-repeat: repeat-x;
    opacity: 0.5;
}

/* =========================================================================
   ГЛАВНАЯ
   ====================================================================== */
.home-section { margin-bottom: 3rem; }
.home-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.6rem 2.4rem;
}
.home-hero h1 { font-size: 2.45rem; }
.home-hero .lead { color: var(--text-muted); font-size: 1.08rem; max-width: 60ch; }
.section-title {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 1.3rem;
}
.section-title .tag {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: var(--aqua);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.4rem;
}
.feature-card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.4rem 1.4rem;
    transition: border-color 0.25s ease;
}
.feature-card:hover { border-color: var(--border-hi); }
.feature-card h3 { color: var(--accent); }
.feature-card.is-aqua h3 { color: var(--aqua); }

/* Паттерн фона для блоков AI-инструментов */
.pattern-grid {
    background-color: var(--surface);
    background-image:
        linear-gradient(rgba(45,212,191,0.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45,212,191,0.10) 1px, transparent 1px);
    background-size: 22px 22px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.4rem;
    counter-reset: step;
}
.step {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.3rem;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem; height: 2.1rem;
    margin-bottom: 0.7rem;
    background: var(--accent);
    color: #1a0d09;
    font-weight: 700;
    border-radius: var(--radius-skew);
}

.contact-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.2rem 2.2rem;
}
.contact-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.6rem;
}
.contact-list a { color: var(--aqua); }

/* Слайдер на главной */
.slider { position: relative; }
.slider-track { position: relative; }
.slide {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--aqua);
    border-radius: 8px;
    padding: 1.5rem 1.7rem;
}
.slide[hidden] { display: none !important; }
.slider-dots {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.9rem;
}
.slider-dots button {
    width: 0.7rem; height: 0.7rem;
    padding: 0;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.slider-dots button.is-active { background: var(--accent); }

/* =========================================================================
   ПОДВАЛ
   ====================================================================== */
.site-footer {
    background: #0e0e0e;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 2rem;
    padding: 2.6rem 0 1.8rem;
}
.footer-col { min-width: 0; }
/* Подвал — фон тёмный, текст светлый, явный контраст */
.footer-col .widget-title { color: var(--text); }
.footer-col .widget,
.footer-col .widget a,
.footer-col .widget li { color: var(--text-muted); }
.footer-col .widget a:hover { color: var(--accent); }
.footer-col .widget li { border-bottom-color: var(--border); }
.footer-col .widget .post-date,
.footer-col .widget time { color: var(--text-muted); }

.site-credit {
    border-top: 1px solid var(--border);
    padding: 1.1rem 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

/* =========================================================================
   ФОРМЫ ПОИСКА И КОММЕНТАРИЕВ
   ====================================================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 420px;
}
.search-form .search-field,
input[type="text"], input[type="search"], input[type="email"], input[type="url"],
textarea {
    background: #0d0d0d;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    font: inherit;
    min-width: 0;
}
.search-form .search-field { flex: 1; }
input:focus, textarea:focus { outline: 1px solid var(--border-hi); }

.comments-area {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.6rem 1.8rem;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol { list-style: none; }
.comment-body {
    padding: 1rem 0;
    border-bottom: 1px dotted var(--border);
}
.comment-author { font-weight: 600; }
.comment-meta { font-size: 0.8rem; color: var(--text-muted); }
.comment-list .children { margin-left: 1.4rem; }

/* =========================================================================
   ТАБЛИЦЫ
   ====================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
    border: 1px solid var(--border);
}
th, td {
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    text-align: left;
}
th { background: var(--surface-2); color: var(--text); }

/* =========================================================================
   COOKIE-БАННЕР  (A11 — правило [hidden] идёт ДО основного блока)
   ====================================================================== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    background: rgba(20, 20, 20, 0.97);
    border-top: 1px solid var(--border-hi);
    color: var(--text);
    font-size: 0.9rem;
}
.cookie-banner p { margin: 0; max-width: 70ch; }
.cookie-banner .cookie-accept { white-space: nowrap; }

/* =========================================================================
   404
   ====================================================================== */
.error-404 {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2.4rem 2rem;
    text-align: center;
}
.error-404 .code {
    font-family: "JetBrains Mono", monospace;
    font-size: 4rem;
    color: var(--accent);
    line-height: 1;
}

/* =========================================================================
   КАСТОМНЫЙ СКРОЛЛБАР
   ====================================================================== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: var(--read-color, #2DD4BF);
}

/* =========================================================================
   АДАПТИВ
   ====================================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .layout-single .content-area { width: 100%; }
    h1 { font-size: 1.9rem; }
    .home-hero h1 { font-size: 2rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .site-main { padding: 1.8rem 0 2.6rem; }

    .header-inner { flex-direction: column; align-items: flex-start; }
    .nav-toggle { display: inline-block; }
    .main-nav { width: 100%; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 0.2rem;
        margin-top: 0.6rem;
    }
    .main-nav.is-open ul { display: flex; }

    .entry, .home-hero, .contact-block, .comments-area { padding: 1.3rem 1.2rem; }
    .card-grid { grid-template-columns: minmax(0, 1fr); }
}
