/*
Theme Name: dds_hillaryattacks.com
Author: Дмитрий Кравцов
Description: Информационно-образовательная тема для портала о кибербезопасности: разборы атак, руководства по защите данных и инструменты повышения киберграмотности.
Version: 1.1
Text Domain: hatk
*/

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --ink: #16222e;
    --muted: #5a6b7b;
    --brand-dark: #0f2740;
    --brand-deep: #0a1c2e;
    --accent: #11a085;
    --accent-bright: #16c79a;
    --line: #e1e8f0;
    --radius: 14px;
    --shadow: 0 8px 28px rgba(15, 39, 64, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
    -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 { line-height: 1.25; color: var(--ink); }
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.4em; }
p { margin: 0 0 1em; }

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px; overflow: hidden;
}

/* ---------- Контейнеры ширины (единый источник) ---------- */
.shell { width: min(92%, 1180px); margin-inline: auto; }
.page-band { width: min(92%, 1180px); margin-inline: auto; padding: 30px 0 70px; }
.page-band--single { width: min(85%, 1180px); }

/* ---------- Раскладки ---------- */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.45fr) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}
.layout-single { display: block; }
.content-area { min-width: 0; }

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* ---------- Шапка ---------- */
.site-header {
    background: var(--brand-dark);
    color: #eaf3f4;
    border-bottom: 3px solid var(--accent-bright);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { display: block; max-height: 56px; width: auto; }
.brand-mark { display: block; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.3;
    max-width: 620px;
}
.brand-name:hover { text-decoration: none; color: var(--accent-bright); }
.brand-desc {
    margin: 4px 0 0;
    color: #a9c2cf;
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 620px;
}

/* ---------- Навигация (не липкая) ---------- */
.main-nav { display: flex; align-items: center; }
.nav-list {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.nav-list a {
    display: block;
    color: #eaf3f4;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
}
.nav-list a:hover { background: rgba(255,255,255,0.1); text-decoration: none; color: #fff; }
.nav-list .current-menu-item > a { background: var(--accent); color: #fff; }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #eaf3f4;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.95rem;
}
.nav-toggle-bar {
    width: 18px; height: 2px; background: currentColor;
    position: relative; display: inline-block;
}
.nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

@media (max-width: 960px) {
    .header-inner { flex-wrap: wrap; }
    .nav-toggle { display: inline-flex; }
    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 12px;
    }
    .nav-list.is-open { display: flex; }
    .main-nav { flex-direction: column; align-items: stretch; width: 100%; }
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs .sep { margin: 0 6px; color: #aab6c2; }

/* ---------- Заголовки страниц ---------- */
.page-title { margin-bottom: 24px; }

/* ---------- Главная: блоки ---------- */
.block { margin: 0 0 64px; }
.block-lead { color: var(--muted); max-width: 760px; margin-bottom: 24px; }

.block-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}
.split-media img { display: block; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 760px) {
    .block-split { grid-template-columns: 1fr; gap: 28px; }
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 22px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature-icon { color: var(--accent); display: inline-flex; margin-bottom: 12px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted); margin: 0; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.step {
    display: flex;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px 24px;
    min-width: 0;
}
.step-num {
    flex: 0 0 auto;
    width: 40px; height: 40px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.step-body { min-width: 0; }
.step-body h3 { margin-bottom: 4px; }
.step-body p { color: var(--muted); margin: 0; }

.faq { display: grid; gap: 12px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 22px;
    box-shadow: var(--shadow);
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 0;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 0 0 16px; }

/* ---------- Списки записей ---------- */
.post-list, .blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 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);
    min-width: 0;
}
.card-thumb-wrap { display: block; overflow: hidden; }
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img,
.card-thumb-wrap svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.card-title { font-size: 1.15rem; margin-bottom: 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); margin-bottom: 16px; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; font-weight: 600; align-self: flex-start; }

/* ---------- Пагинация (type => plain, стили на .page-numbers) ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
}
.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: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ---------- Запись / страница ---------- */
.single-head { margin-bottom: 20px; }
.single-title { margin-bottom: 10px; }
.single-meta { font-size: 0.85rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.meta-cat { background: #e6f4f0; color: var(--accent); padding: 2px 10px; border-radius: 20px; }
.single-thumb { margin: 0 0 24px; }
.single-thumb img { display: block; width: 100%; border-radius: var(--radius); }
.single-content { font-size: 1.03rem; }
.single-content img { border-radius: 10px; }
.single-content h2, .single-content h3 { margin-top: 1.4em; }
.single-tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { background: #eef2f6; color: var(--muted); padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; }
.tag-chip:hover { color: var(--accent); text-decoration: none; }
.page-links { margin-top: 20px; font-weight: 600; }
.empty-note { color: var(--muted); }
.error-lead { color: var(--muted); max-width: 600px; }
.error-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Таблицы ---------- */
.single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}
.single-content table,
.single-content th,
.single-content td {
    border: 1px solid var(--line);
}
.single-content th, .single-content td { padding: 10px 12px; text-align: left; }
.single-content th { background: #eef3f7; }

/* ---------- Сайдбар (светлый фон -> тёмный текст) ---------- */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--ink); }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ---------- Форма поиска ---------- */
.search-form { display: flex; gap: 8px; margin: 16px 0; max-width: 480px; }
.search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
}
.search-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}
.search-submit:hover { background: var(--brand-dark); }

/* ---------- Комментарии ---------- */
.comments-area { margin-top: 48px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .children { list-style: none; margin: 0; padding-left: 28px; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.comment-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-pending { color: var(--muted); font-style: italic; }
.comment-respond { margin-top: 24px; }
.comment-form-comment textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 4px;
}
.comment-form p { margin-bottom: 14px; }

/* ---------- Cookie-баннер (правило [hidden] до основных стилей, см. A11) ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--brand-deep);
    color: #eaf3f4;
    border: 1px solid #1d4a72;
    border-radius: var(--radius);
    padding: 16px 22px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.cookie-text { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; }
.cookie-accept {
    background: var(--accent-bright);
    color: var(--brand-deep);
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 700;
    cursor: pointer;
}
.cookie-accept:hover { background: #fff; }

/* ---------- Подвал (тёмный фон -> светлый текст виджетов) ---------- */
.site-footer {
    background: var(--brand-dark);
    color: #c7d6e0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 48px 0;
}
.site-footer .widget { margin-bottom: 0; color: #c7d6e0; }
.site-footer .widget-title { color: #ffffff; font-size: 1.05rem; margin-bottom: 14px; }
.site-footer .widget p { color: #c7d6e0; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 6px 0; }
.site-footer .widget a { color: #9fd9cb; }
.site-footer .widget a:hover { color: #ffffff; }
.footer-bottom {
    border-top: 1px solid #1d4a72;
    padding: 18px 0;
    background: var(--brand-deep);
}
.copyright { margin: 0; font-size: 0.85rem; color: #9fb3c1; }

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

@media (max-width: 600px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    .page-band, .page-band--single { width: 90%; }
    .step { flex-direction: row; }
    .cookie-banner { flex-direction: column; align-items: stretch; }
    .cookie-accept { width: 100%; }
}
