/*
Theme Name: dds_designpremiya.ru
Author: Алексей Руднев
Description: Информационный портал о UX/UI-дизайне и цифровых инструментах. Тема для DesignPremiya.ru.
Version: 1.1
Text Domain: dpr
*/

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --ink:        #161427;
    --ink-soft:   #4b4866;
    --violet:     #5b46e8;
    --violet-dk:  #4631c9;
    --coral:      #ff6a5c;
    --bg:         #f6f6fb;
    --surface:    #ffffff;
    --line:       #e6e4f0;
    --footer-bg:  #14121f;
    --footer-ink: #cfccde;
    --footer-head:#ffffff;
    --shell:      min(92%, 1180px);
    --radius:     16px;
    --shadow:     0 8px 30px rgba(31, 24, 74, .08);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 .6em;
    font-weight: 700;
    letter-spacing: -.01em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

.shell {
    width: var(--shell);
    margin-inline: auto;
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.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; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    display: block;
    line-height: 1.3;
}
.brand-name a { color: inherit; text-decoration: none; }
.brand-desc {
    font-size: .82rem;
    color: var(--ink-soft);
    display: block;
    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;
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: .95rem;
}
.main-nav a:hover { background: var(--bg); text-decoration: none; color: var(--violet-dk); }
.main-nav .current-menu-item > a { background: var(--violet); color: #fff; }

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--ink);
}

/* ============================================================
   Раскладки контента
   ============================================================ */
.site-main { padding: 36px 0 56px; }

.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; }
.front-wrap { width: 85%; margin-inline: auto; }

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 32px; }
    .layout-single .content-area,
    .front-wrap { width: 100%; }
}

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: .85rem;
    color: var(--ink-soft);
    padding: 14px 0 0;
}
.breadcrumbs .shell > & {}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--violet); }
.breadcrumbs .sep { margin: 0 6px; color: #bbb7cf; }
.breadcrumbs span { color: var(--ink); }

/* ============================================================
   Карточки записей
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 38px rgba(31,24,74,.12); }
.card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 24px;
}
.card-meta {
    font-size: .8rem;
    color: var(--ink-soft);
    margin-bottom: 8px;
}
.card-title { font-size: 1.18rem; margin: 0 0 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--violet); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: .95rem; flex: 1; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    margin-top: 14px;
    font-weight: 600;
    color: var(--violet);
    align-self: flex-start;
}

/* ============================================================
   Сайдбар + виджеты
   ============================================================ */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 24px;
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    color: var(--ink);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--violet);
    display: inline-block;
}
.widget a { color: var(--violet); }
.widget a:hover { color: var(--violet-dk); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.widget ul li:last-child { border-bottom: 0; }
.widget .post-date { display: block; font-size: .78rem; color: var(--ink-soft); }

/* ============================================================
   Основной контент записи / страницы
   ============================================================ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px 38px 40px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.entry-header { margin-bottom: 20px; }
.entry-meta { font-size: .85rem; color: var(--ink-soft); margin-bottom: 6px; }
.entry-thumb { border-radius: 12px; overflow: hidden; margin: 0 0 24px; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content img { border-radius: 10px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 10px 14px; text-align: left; }
.entry-content th { background: var(--bg); }

.tags-line { margin-top: 24px; font-size: .9rem; }
.tags-line a {
    display: inline-block;
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 20px;
    margin: 0 6px 6px 0;
}

/* ============================================================
   Пагинация
   ============================================================ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.pagination a.page-numbers:hover { border-color: var(--violet); color: var(--violet); }
.pagination .page-numbers.current {
    background: var(--violet);
    border-color: var(--violet);
    color: #fff;
}
.pagination .page-numbers.dots { border: none; background: none; }

/* ============================================================
   Главная — секции
   ============================================================ */
.section { margin: 56px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 34px; }
.section-head .eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--violet);
    margin-bottom: 8px;
}
.section-head h2 { font-size: 2rem; }
.section-head p { color: var(--ink-soft); }

/* hero / split */
.hero {
    background: linear-gradient(135deg, #efeaff 0%, #fbf2f0 100%);
    border-radius: 24px;
    padding: 56px 0;
    margin-top: 36px;
}
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-text h2 { font-size: 2.1rem; }
.split-text p { color: var(--ink-soft); font-size: 1.05rem; }
.split-media img { width: 100%; border-radius: 18px; display: block; box-shadow: var(--shadow); }

.btn {
    display: inline-block;
    background: var(--violet);
    color: #fff;
    padding: 13px 26px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 10px;
}
.btn:hover { background: var(--violet-dk); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--violet); border: 1px solid var(--violet); }
.btn.ghost:hover { background: var(--violet); color: #fff; }

/* сетка преимуществ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 24px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 26px;
    min-width: 0;
}
.feature .ico {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: #efeaff;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 26px;
    position: relative;
    min-width: 0;
}
.step .num {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--violet);
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    background: var(--ink);
    border-radius: 24px;
    padding: 44px 36px;
}
.stat { text-align: center; min-width: 0; }
.stat .big { font-size: 2.4rem; font-weight: 800; color: #fff; display: block; line-height: 1; }
.stat .lbl { color: #b9b5d6; font-size: .92rem; margin-top: 8px; display: block; }

/* галерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.gallery figure { margin: 0; border-radius: 14px; overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 4px 22px;
    margin-bottom: 14px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--violet); font-size: 1.5rem; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--ink-soft); padding-bottom: 16px; margin: 0; }

/* CTA */
.cta {
    background: linear-gradient(135deg, var(--violet) 0%, var(--violet-dk) 100%);
    border-radius: 24px;
    padding: 54px 40px;
    text-align: center;
    color: #fff;
}
.cta h2 { color: #fff; font-size: 2rem; }
.cta p { color: #e4dffb; max-width: 600px; margin: 0 auto 24px; }
.cta .btn { background: #fff; color: var(--violet); }
.cta .btn:hover { background: #f0edff; color: var(--violet-dk); }

/* блок «последние записи» на главной */
.latest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-media { order: 0; }
    .stats { padding: 32px 22px; }
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area { margin-top: 40px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 16px;
}
.comment-meta { display: flex; gap: 14px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: .8rem; color: var(--ink-soft); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    margin-bottom: 14px;
    background: var(--surface);
}
.comment-form .submit,
.search-submit,
button[type="submit"] {
    background: var(--violet);
    color: #fff;
    border: 0;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form { display: flex; gap: 10px; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
}

/* ============================================================
   404
   ============================================================ */
.notfound { text-align: center; padding: 40px 0; }
.notfound .code { font-size: 5rem; font-weight: 800; color: var(--violet); line-height: 1; }
.notfound .search-form { max-width: 480px; margin: 26px auto 0; }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 54px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}
.footer-cols .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.footer-cols .widget-title {
    color: var(--footer-head);
    border-bottom-color: var(--coral);
}
.footer-cols .widget p,
.footer-cols .widget li,
.footer-cols .widget .post-date { color: var(--footer-ink); }
.footer-cols .widget a { color: #fff; }
.footer-cols .widget a:hover { color: var(--coral); }
.footer-cols .widget ul li { border-bottom-color: rgba(255,255,255,.1); }
.site-copyright {
    text-align: center;
    padding: 26px 0;
    margin-top: 44px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: .88rem;
    color: var(--footer-ink);
}

@media (max-width: 760px) {
    .footer-cols { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   Cookie-баннер
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--ink);
    color: #fff;
    padding: 16px 0;
    box-shadow: 0 -6px 24px rgba(0,0,0,.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: .9rem; color: #e2e0ee; }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-accept {
    background: var(--violet);
    color: #fff;
    border: 0;
    padding: 11px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--violet-dk); }

/* ============================================================
   Мобильное меню
   ============================================================ */
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        width: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .main-nav a { padding: 12px 14px; }
    .brand-desc { display: none; }
    h1 { font-size: 1.7rem; }
    .section-head h2, .cta h2, .split-text h2 { font-size: 1.6rem; }
    .entry { padding: 24px 20px 28px; }
}
