/*
Theme Name: dds_fatholahi.com
Author: Артём Северов
Description: Информационный технологический блог: инновации, ИИ, роботизация и устройства, меняющие повседневную жизнь.
Version: 1.1
Text Domain: fath
*/

/* ---------- Базовые переменные ---------- */
:root {
    --bg: #0e1726;
    --bg-soft: #14203a;
    --surface: #ffffff;
    --surface-alt: #f3f6fb;
    --ink: #18222f;
    --ink-soft: #4a5a6e;
    --line: #dde4ee;
    --accent: #1d8cf2;
    --accent-deep: #0f5fb8;
    --cyan: #21d4c4;
    --footer-bg: #0e1726;
    --footer-ink: #c4d0e0;
    --footer-head: #ffffff;
    --radius: 14px;
    --shell: min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--surface-alt);
    line-height: 1.65;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 .6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

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

/* ---------- Шапка ---------- */
.site-head {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.site-head__inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo, .brand-logo svg { display: block; width: 52px; height: 52px; flex: none; }
.brand-text { min-width: 0; }
.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    display: block;
    max-width: 640px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-desc {
    font-size: .82rem;
    color: var(--ink-soft);
    display: block;
    max-width: 640px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 600;
    font-size: .95rem;
}
.main-nav a:hover { background: var(--surface-alt); text-decoration: none; color: var(--accent-deep); }

.nav-toggle {
    display: none;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: .95rem;
    cursor: pointer;
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    width: var(--shell);
    margin: 18px auto 0;
    font-size: .85rem;
    color: var(--ink-soft);
}
.breadcrumbs a { color: var(--accent-deep); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line); }

/* ---------- Раскладка ---------- */
.page-wrap { padding: 28px 0 50px; }

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

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

/* ---------- Карточки записей ---------- */
.cards-feed { display: grid; gap: 22px; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 14px 34px rgba(20,40,80,.12); transform: translateY(-3px); }

.card-thumb-wrap { display: block; }
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.25rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-deep); text-decoration: none; }
.card-meta { font-size: .8rem; color: var(--ink-soft); margin-bottom: 10px; }
.card-excerpt { color: var(--ink-soft); }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: 14px;
    font-weight: 600;
    color: var(--accent-deep);
}

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

/* ---------- Запись / страница ---------- */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px clamp(20px, 4vw, 40px);
}
.entry-title { font-size: 2rem; margin-bottom: 6px; }
.entry-meta { font-size: .85rem; color: var(--ink-soft); margin-bottom: 18px; }
.entry-thumb { margin: 0 0 22px; }
.entry-thumb img { width: 100%; border-radius: 10px; display: block; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

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

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

/* ---------- Главная ---------- */
.hero {
    background: linear-gradient(135deg, #0e1726 0%, #16315c 60%, #0f5fb8 100%);
    color: #eaf2ff;
}
.section { padding: 56px 0; }
.section--tight { padding: 44px 0; }
.section-head { max-width: 760px; margin: 0 0 30px; }
.section-head h2 { color: inherit; }
.section-head p { color: var(--ink-soft); margin: 0; }
.hero .section-head p { color: #c6d6f2; }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 60px);
    align-items: center;
}
.split--rev .split-media { order: -1; }
.split-media img { width: 100%; border-radius: var(--radius); display: block; }
.split-text h2 { color: #fff; }
.split-text p { color: #d2e0f6; }
.btn {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 22px;
    background: var(--cyan);
    color: #062a3a;
    border-radius: 10px;
    font-weight: 700;
}
.btn:hover { text-decoration: none; background: #3fe6d6; }
.btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn--ghost:hover { background: rgba(255,255,255,.12); }

/* Блок: сетка рубрик */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.tile {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
}
.tile-ico { width: 46px; height: 46px; display: block; margin-bottom: 14px; }
.tile h3 { margin: 0 0 8px; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    min-width: 0;
    position: relative;
    background: var(--surface-alt);
    border-radius: var(--radius);
    padding: 28px 24px 24px;
}
.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;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Блок: FAQ */
.faq { max-width: 820px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 20px;
    margin-bottom: 12px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 14px 0;
    list-style: none;
    position: relative;
    padding-right: 28px;
}
.faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 12px;
    font-size: 1.3rem;
    color: var(--accent);
}
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 0 0 14px; color: var(--ink-soft); }

/* Лента последних записей на главной */
.home-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* CTA-секция */
.cta {
    background: linear-gradient(120deg, #0f5fb8, #21d4c4);
    color: #fff;
    border-radius: var(--radius);
    padding: clamp(30px, 5vw, 54px);
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.9); max-width: 620px; margin: 0 auto 22px; }

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

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

/* ---------- Комментарии ---------- */
.comments { margin-top: 34px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.comment-meta { font-size: .82rem; color: var(--ink-soft); margin-bottom: 6px; }
.comment-respond { margin-top: 24px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-bottom: 12px;
    font-family: inherit;
}
.comment-form input[type="submit"] {
    padding: 12px 22px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- Подвал ---------- */
.site-foot {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 48px 0 26px;
    margin-top: 40px;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}
.foot-col { min-width: 0; }
.foot-col .widget-title,
.foot-col h2 { color: var(--footer-head); font-size: 1.05rem; margin: 0 0 14px; }
.foot-col, .foot-col p, .foot-col li { color: var(--footer-ink); }
.foot-col a { color: var(--footer-ink); }
.foot-col a:hover { color: #fff; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: 9px; }
.foot-col .post-date { display: block; font-size: .78rem; color: #8ea3c0; }
.foot-contacts a { color: var(--cyan); }
.copyright {
    border-top: 1px solid rgba(255,255,255,.12);
    margin-top: 36px;
    padding-top: 20px;
    font-size: .85rem;
    color: #8ea3c0;
}

/* ---------- Cookie-баннер ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: #0b1422;
    color: #e7eefb;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    box-shadow: 0 -6px 24px rgba(0,0,0,.35);
}
.cookie-banner p { margin: 0; font-size: .9rem; max-width: 760px; }
.cookie-banner a { color: var(--cyan); }
.cookie-banner button {
    border: 0;
    background: var(--cyan);
    color: #062a3a;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: 9px;
    cursor: pointer;
    flex: none;
}

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

@media (max-width: 600px) {
    .nav-toggle { display: inline-block; }
    .main-nav { width: 100%; }
    .main-nav ul { display: none; flex-direction: column; }
    .main-nav.is-open ul { display: flex; }
    .brand-name, .brand-desc { white-space: normal; }

    .cards-feed--rows .card { flex-direction: column; }
    .cards-feed--rows .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .cards-feed--rows .card-thumb-wrap a { position: static; }
    .cards-feed--rows .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .section { padding: 40px 0; }
}
