/*
Theme Name: dds_blogi24.ru
Author: Анна Лебедева
Description: Информационно-аналитический портал о цифровых профессиях и удалённой работе. Тема для blogi24.ru.
Version: 1.1
Text Domain: blogi24
*/

/* ============ Базовые переменные и сброс ============ */
:root {
    --bg: #ffffff;
    --bg-soft: #f5f6fb;
    --bg-tint: #eef0fa;
    --ink: #1b1f2a;
    --ink-soft: #525a6b;
    --line: #e3e6ef;
    --accent: #4338ca;
    --accent-dark: #322a9e;
    --accent-2: #e8651a;
    --footer-bg: #181b27;
    --footer-ink: #c4c8d6;
    --footer-head: #ffffff;
    --radius: 12px;
    --shell: min(92%, 1180px);
}

* { box-sizing: border-box; }

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

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; }

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

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

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 .6em;
    font-weight: 700;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

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

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: .7rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    line-height: 1.2;
    border: none;
    cursor: pointer;
    transition: background .18s ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn--ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.btn--ghost:hover { background: var(--accent); color: #fff; }
.btn--light {
    background: #fff;
    color: var(--accent);
}
.btn--light:hover { background: var(--bg-tint); color: var(--accent-dark); }

/* ============ Шапка ============ */
.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    padding: 1.1rem 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
    flex: 1 1 auto;
}
.brand-logo, .brand .brand-mark {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--ink);
    line-height: 1.15;
    display: block;
    text-decoration: none;
}
.brand-name:hover { text-decoration: none; color: var(--accent); }
.brand-desc {
    display: block;
    color: var(--ink-soft);
    font-size: .82rem;
    margin-top: .15rem;
    max-width: 46ch;
}

.main-nav {
    flex: 0 0 auto;
}
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin: 0;
    padding: 0;
}
.main-nav a {
    display: block;
    padding: .45rem .85rem;
    color: var(--ink);
    border-radius: 8px;
    font-weight: 500;
}
.main-nav a:hover { background: var(--bg-tint); text-decoration: none; color: var(--accent-dark); }
.main-nav .current-menu-item > a { color: var(--accent); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .5rem .75rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--ink);
}

/* ============ Раскладки ============ */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    gap: 6%;
    align-items: start;
    padding: 2.4rem 0 3rem;
}
.layout-single {
    display: block;
    padding: 2.4rem 0 3rem;
}
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

/* ============ Хлебные крошки ============ */
.breadcrumbs {
    font-size: .85rem;
    color: var(--ink-soft);
    padding: .9rem 0;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 .35rem; color: #aab; }

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
}
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--bg-tint), var(--accent) 320%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.card-body {
    flex: 1;
    padding: 1.2rem 1.3rem 1.4rem;
    display: flex;
    flex-direction: column;
}
.card-meta {
    font-size: .78rem;
    color: var(--ink-soft);
    margin-bottom: .5rem;
}
.card-title { font-size: 1.2rem; margin: 0 0 .55rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: .94rem; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: .8rem;
    font-weight: 600;
    font-size: .9rem;
}

/* Горизонтальная карточка (лента блога) */
.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--row .card-thumb-ph {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

/* ============ Запись / страница ============ */
.entry-header { margin-bottom: 1.4rem; }
.entry-title { margin: 0 0 .5rem; }
.entry-meta { color: var(--ink-soft); font-size: .88rem; }
.entry-featured {
    width: 100%;
    border-radius: var(--radius);
    margin: 0 0 1.6rem;
    display: block;
}
.entry-content { font-size: 1.04rem; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content h2 { margin-top: 1.8rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.4rem;
    border-left: 4px solid var(--accent);
    background: var(--bg-soft);
    border-radius: 0 8px 8px 0;
    color: var(--ink);
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}
.entry-content table, .entry-content th, .entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: .55rem .7rem; text-align: left; }
.entry-content th { background: var(--bg-soft); }

/* ============ Сайдбар ============ */
.sidebar { min-width: 0; }
.widget {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.4rem;
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 .9rem;
    color: var(--ink);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--accent-dark); }
.widget a:hover { color: var(--accent); }
.widget .post-date { display: block; color: var(--ink-soft); font-size: .78rem; }

/* ============ Пагинация ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin: 2.2rem 0 .5rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--bg);
    font-weight: 600;
    font-size: .92rem;
}
.pagination a.page-numbers:hover { background: var(--bg-tint); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ============ Главная ============ */
.front {
    padding-bottom: 3rem;
}
.front-section {
    padding: 3rem 0;
}
.section-head { margin-bottom: 1.6rem; }
.section-head .eyebrow {
    display: inline-block;
    font-family: -apple-system, sans-serif;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .74rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .5rem;
}
.section-head h2 { margin: 0; }
.section-head p { color: var(--ink-soft); margin: .6rem 0 0; max-width: 62ch; }

/* блок: текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.6rem;
    align-items: center;
}
.fs-split--rev .fs-split-media { order: -1; }
.fs-split-media img {
    width: 100%;
    border-radius: var(--radius);
    display: block;
}
.fs-split-text h2 { margin-top: 0; }

/* блок: сетка рубрик */
.fs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.4rem;
}
.topic-card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    min-width: 0;
}
.topic-card .topic-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-tint);
    color: var(--accent);
    margin-bottom: 1rem;
}
.topic-card h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.topic-card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* блок: шаги */
.fs-steps {
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.6rem;
}
.step {
    position: relative;
    padding: 1.5rem 1.5rem 1.5rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-family: Georgia, serif;
    margin-bottom: .9rem;
}
.step h3 { margin: 0 0 .45rem; font-size: 1.12rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* блок: последние записи (на главной) */
.fs-latest { background: var(--bg-soft); }

/* блок: CTA */
.fs-cta {
    background: linear-gradient(120deg, var(--accent-dark), var(--accent));
    color: #fff;
    border-radius: var(--radius);
    padding: 2.8rem 2.4rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; margin-top: 0; }
.fs-cta p { color: #e7e9ff; max-width: 56ch; margin-left: auto; margin-right: auto; }
.fs-cta .btn { margin-top: .6rem; }

/* ============ Поиск ============ */
.search-form {
    display: flex;
    gap: .5rem;
    max-width: 420px;
}
.search-form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: .6rem .9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .95rem;
}
.search-form button {
    flex: 0 0 auto;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 1.1rem;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover { background: var(--accent-dark); }

/* ============ 404 ============ */
.error-404 {
    text-align: center;
    padding: 3rem 0;
}
.error-404 .code {
    font-family: Georgia, serif;
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: .5rem;
}
.error-404 .search-form { margin: 1.6rem auto 0; }

/* ============ Комментарии ============ */
.comments-area { margin-top: 2.6rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-list .children { list-style: none; margin: 0 0 0 1.6rem; padding: 0; }
.comment-meta { font-size: .85rem; color: var(--ink-soft); margin-bottom: .35rem; }
.comment-author { font-weight: 600; color: var(--ink); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: .95rem;
    margin-top: .25rem;
}
.comment-form p { margin-bottom: .9rem; }

/* ============ Подвал ============ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 2.8rem 0 1.4rem;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 2rem;
}
.footer-cols .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.footer-cols .widget-title { color: var(--footer-head); }
.footer-cols .widget a { color: var(--footer-ink); }
.footer-cols .widget a:hover { color: #fff; }
.footer-cols .widget li { border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-cols .widget .post-date { color: #8b91a6; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 2rem;
    padding-top: 1.3rem;
    font-size: .85rem;
    color: #8b91a6;
}

/* ============ Cookie-баннер ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 999;
    max-width: 720px;
    margin-inline: auto;
    background: var(--ink);
    color: #eef0f6;
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.cookie-banner p { margin: 0; font-size: .9rem; flex: 1 1 240px; }
.cookie-banner a { color: #c7cdfa; }
.cookie-banner .btn { flex: 0 0 auto; }

/* ============ Адаптив ============ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 2.2rem;
    }
    .fs-split { grid-template-columns: 1fr; gap: 1.6rem; }
    .fs-split--rev .fs-split-media { order: 0; }
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: block; }
    .main-nav { flex-basis: 100%; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: .15rem;
        margin-top: .8rem;
    }
    .main-nav.is-open ul { display: flex; }
    .brand-desc { display: none; }
    .layout-single .content-area { width: 100%; }
    .front-section { padding: 2.2rem 0; }
    .fs-cta { padding: 1.9rem 1.4rem; }
    .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--row .card-thumb-ph { aspect-ratio: 16 / 9; }
}
