/*
Theme Name: dds_ajwatalk.com
Author: Дмитрий Кравцов
Description: Информационная тема для проекта о дистанционном управлении жильём: IP-видеонаблюдение, умные замки и сетевые системы безопасности.
Version: 1.2
Text Domain: ajwatalk
*/

/* ============ Переменные ============ */
:root {
    --bg: #eef2f6;
    --surface: #ffffff;
    --fg: #1b2733;
    --muted: #5a6b7b;
    --accent: #0e93b0;
    --accent-dark: #0a6f85;
    --header-bg: #12233b;
    --header-fg: #f2f6fa;
    --footer-bg: #0e1b2e;
    --footer-fg: #cdd7e2;
    --footer-title: #ffffff;
    --border: #d7dfe7;
    --shadow: 0 4px 18px rgba(18, 35, 59, 0.08);
    --radius: 10px;
}

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

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--fg); }
h1 { font-size: 2rem; margin: 0 0 0.6em; }
h2 { font-size: 1.55rem; margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.5em; }

p { margin: 0 0 1em; }

.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

.site-main { padding: 2.2rem 0 3rem; }

/* ============ Шапка ============ */
.site-header {
    background: var(--header-bg);
    color: var(--header-fg);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.brand-logo, .brand-logo-svg { display: block; max-height: 48px; width: auto; }
.brand-meta { min-width: 0; }
.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--header-fg);
    display: block;
    line-height: 1.3;
}
.brand-name a { color: inherit; }
.brand-desc {
    font-size: 0.8rem;
    color: #aebccd;
    display: block;
    margin-top: 2px;
}

/* ============ Навигация ============ */
.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.5rem 0.9rem;
    color: var(--header-fg);
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.15s;
}
.main-nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--accent); color: #fff; }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: var(--header-fg);
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

/* ============ Хлебные крошки ============ */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.9rem 0 0.2rem;
}
.breadcrumbs a { color: var(--accent-dark); }
.breadcrumbs .sep { margin: 0 0.35rem; color: #9aa8b6; }

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

/* ============ Сайдбар ============ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.4rem;
    color: var(--fg);
}
.sidebar .widget-title {
    color: var(--fg);
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget a { color: var(--accent-dark); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ============ Статьи ============ */
.entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    box-shadow: var(--shadow);
}
.entry-title { margin-top: 0; }
.entry-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; }
.entry-thumb { margin: 0 0 1.4rem; border-radius: 8px; overflow: hidden; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2, .entry-content h3 { margin-top: 1.6rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}
.entry-content th, .entry-content td {
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    text-align: left;
}
.entry-content th { background: #f0f4f8; }

/* ============ Карточки записей (A8, A10) ============ */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.4rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
@media (min-width: 700px) {
    .card {
        flex-direction: row;
    }
}
.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: #dfe7ee;
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    min-width: 0;
    padding: 1.3rem 1.5rem;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.2rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--fg); }
.card-title a:hover { color: var(--accent-dark); }
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.6rem; }
.card-excerpt { color: var(--muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    padding-top: 0.6rem;
    font-weight: 600;
    color: var(--accent-dark);
}

@media (max-width: 600px) {
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
        aspect-ratio: 16 / 9;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: 100%;
        aspect-ratio: 16 / 9;
    }
}

/* ============ Пагинация (D5) ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 2rem 0 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--fg);
    font-weight: 500;
    line-height: 1;
}
.pagination a.page-numbers:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ============ Главная ============ */
.front-wrap { padding: 2.4rem 0 3rem; }
.front-section { margin-bottom: 2.8rem; }
.front-section:last-child { margin-bottom: 0; }
.section-lead { color: var(--muted); max-width: 60ch; }

/* Блок текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}
.fs-split .fs-figure { min-width: 0; }
.fs-split .fs-figure img { width: 100%; border-radius: var(--radius); display: block; }
.fs-split .fs-text { min-width: 0; }
.fs-split.reverse .fs-figure { order: 2; }

/* Сетка карточек-направлений */
.fs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
}
.fs-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.fs-card .ic {
    width: 48px;
    height: 48px;
    margin-bottom: 0.9rem;
    color: var(--accent);
}
.fs-card h3 { margin: 0 0 0.4rem; }
.fs-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Пошаговый блок */
.fs-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
    counter-reset: step;
}
.fs-step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem 1.6rem 1.5rem;
    position: relative;
    min-width: 0;
}
.fs-step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.fs-step h3 { margin: 0 0 0.4rem; }
.fs-step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* CTA-секция (A14 — свои отступы) */
.fs-cta {
    background: var(--header-bg);
    color: var(--header-fg);
    border-radius: var(--radius);
    padding: 2.6rem 2.4rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; }
.fs-cta p { color: #b9c6d6; max-width: 60ch; margin-inline: auto; }
.btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.8rem;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }

/* Блок последних записей на главной */
.front-latest .front-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.mini-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.mini-card .mini-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #dfe7ee; }
.mini-card .mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-body { flex: 1; min-width: 0; padding: 1.2rem 1.3rem; display: flex; flex-direction: column; }
.mini-body h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.mini-body h3 a { color: var(--fg); }
.mini-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.5rem; }
.mini-excerpt { color: var(--muted); font-size: 0.92rem; }
.mini-excerpt p { margin: 0 0 0.4em; background: none; }

/* ============ Комментарии ============ */
.comments-area { margin-top: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 2rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-item { margin: 0 0 1rem; }
.comment-inner { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; }
.comment-head { display: flex; gap: 1rem; align-items: baseline; margin-bottom: 0.4rem; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.78rem; color: var(--muted); }

/* ============ Формы (поиск, комментарии) ============ */
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}
.search-form button, .search-submit {
    padding: 0.6rem 1.1rem;
    border: none;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover, .search-submit:hover { background: var(--accent-dark); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-family: inherit;
}
.comment-form .submit {
    padding: 0.7rem 1.6rem;
    border: none;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* ============ Контакты (статичные) ============ */
.contact-block { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; }
.contact-block a { font-weight: 600; }

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

/* ============ Подвал ============ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-fg);
    margin-top: 3rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    padding: 2.6rem 0 1.8rem;
}
.footer-cols .widget { min-width: 0; color: var(--footer-fg); }
.footer-cols .widget-title { color: var(--footer-title); font-size: 1.05rem; margin-bottom: 0.9rem; }
.footer-cols .widget a { color: #9ec9d8; }
.footer-cols .widget a:hover { color: #fff; }
.footer-cols .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-cols .widget li { padding: 0.35rem 0; }
.footer-cols .widget .post-date { color: #8595a6; font-size: 0.78rem; display: block; }
.footer-cols .widget p { color: var(--footer-fg); }
.site-copyright {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.2rem 0;
    font-size: 0.85rem;
    color: #8595a6;
    text-align: center;
}

/* ============ Cookie-баннер (D6, A11) ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: rgba(14, 27, 46, 0.97);
    color: #e6edf4;
    padding: 1rem 0;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.25);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; min-width: 0; flex: 1; }
.cookie-inner a { color: #9ec9d8; }
.cookie-accept {
    padding: 0.6rem 1.4rem;
    border: none;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--accent-dark); }

/* ============ Адаптив ============ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .fs-split { grid-template-columns: 1fr; gap: 1.6rem; }
    .fs-split.reverse .fs-figure { order: 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    .site-main { padding: 1.4rem 0 2rem; }
    .layout-single { width: 100%; }
    .header-inner { padding: 0.8rem 0; }
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0.15rem; }
    .entry { padding: 1.2rem 1.1rem; }
    .fs-cta { padding: 1.8rem 1.4rem; }
    .comments-area { padding: 1.2rem 1.1rem; }
}
