/*
Theme Name: dds_webitscure.com
Author: Борис Ларионов
Description: Информационная тема о кибербезопасности: доступы, пароли, резервные копии, фишинг и уязвимости. Адаптивный дизайн, без сбора данных.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: webitscure
*/

/* ============================ Переменные ============================ */
:root {
    --bg: #eef2f6;
    --surface: #ffffff;
    --ink: #16232e;
    --muted: #566674;
    --navy: #0f2436;
    --navy-2: #14344c;
    --accent: #0f766e;
    --accent-dark: #0b5a54;
    --accent-bright: #2dd4bf;
    --border: #dce3ea;
    --radius: 12px;
    --shadow: 0 6px 20px rgba(15, 36, 54, 0.06);
    --maxw: 1180px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); }

p { margin: 0 0 1em; }

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

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 1000;
    background: var(--navy); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

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

.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .2s ease;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }

.empty-note { color: var(--muted); }

/* ============================ Шапка ============================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo-link { display: inline-flex; flex: none; }
.brand-logo { display: block; height: 48px; width: auto; }
.brand-logo-svg { display: block; }
.brand-text { min-width: 0; }
.brand-name {
    display: block; font-size: 1.15rem; font-weight: 700; color: var(--ink);
    line-height: 1.25;
}
.brand-name:hover { color: var(--accent); text-decoration: none; }
.brand-desc {
    margin: 4px 0 0; font-size: .82rem; color: var(--muted);
    max-width: 640px;
}

.primary-nav { margin-left: auto; }
.primary-menu {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 6px; flex-wrap: wrap;
}
.primary-menu a {
    display: block; padding: 8px 14px; border-radius: 7px;
    color: var(--ink); font-weight: 500;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    background: rgba(15, 118, 110, .1); color: var(--accent-dark); text-decoration: none;
}

.nav-toggle {
    display: none; margin-left: auto;
    width: 44px; height: 40px; background: none;
    border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
    padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle-bar { width: 22px; height: 2px; background: var(--ink); display: block; }

/* ============================ Основная область / раскладки ============================ */
.site-main { padding: 30px 0 50px; }

.breadcrumbs {
    font-size: .85rem; color: var(--muted); margin: 0 0 20px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs .sep { color: #9aa8b4; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.layout-single { max-width: 880px; margin-inline: auto; }

.content-area { min-width: 0; }

.page-head { margin-bottom: 26px; }
.page-title { font-size: 1.9rem; margin: 0 0 10px; }
.page-intro, .archive-desc { color: var(--muted); }

/* ============================ Карточки записей ============================ */
.cards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 26px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-thumb-wrap { overflow: hidden; }
.card-thumb-wrap a { display: block; }
.card-thumb {
    display: block;
    width: 100%;
    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 {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    font-size: .8rem; color: var(--muted); margin-bottom: 10px;
}
.card-cat a { color: var(--accent); font-weight: 600; }
.card-title { font-size: 1.2rem; margin: 0 0 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--muted); font-size: .95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto; padding-top: 12px;
    font-weight: 600; align-self: flex-start;
}

/* ============================ Главная ============================ */
.front-page { width: min(90%, 1120px); margin-inline: auto; }

.fs { margin: 0 0 56px; }
.fs-heading { font-size: 1.6rem; margin: 0 0 24px; }

/* Блок 1: интро */
.fs-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
    align-items: center;
    margin-top: 12px;
}
.fs-title { font-size: 2.05rem; margin: 0 0 16px; }
.fs-intro-text p { color: var(--muted); }
.fs-intro-text .btn-primary { margin-top: 10px; }
.fs-intro-media img {
    display: block; width: 100%; height: auto;
    border-radius: var(--radius);
}

/* Блок 2: рубрики */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}
.topic-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.topic-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 12px;
    background: rgba(15, 118, 110, .1); color: var(--accent);
    margin-bottom: 14px;
}
.topic-card h3 { font-size: 1.12rem; margin: 0 0 8px; }
.topic-card p { margin: 0; color: var(--muted); font-size: .93rem; }

/* Блок 3: шаги */
.steps-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px;
}
.step {
    display: flex; gap: 18px; align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.step-num {
    flex: none;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.05rem;
}
.step-body { min-width: 0; }
.step-body h3 { font-size: 1.08rem; margin: 0 0 6px; }
.step-body p { margin: 0; color: var(--muted); font-size: .93rem; }

/* Блок 4: FAQ */
.faq { display: grid; gap: 14px; }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 22px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.faq-item summary {
    cursor: pointer; font-weight: 600; padding: 14px 0;
    list-style: none; position: relative; padding-right: 30px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+"; position: absolute; right: 4px; top: 50%;
    transform: translateY(-50%); font-size: 1.4rem; color: var(--accent);
    font-weight: 400; line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 0 14px; color: var(--muted); }
.faq-answer p { margin: 0; }

/* ============================ Сайдбар / виджеты ============================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.05rem; margin: 0 0 14px; color: var(--ink);
    padding-bottom: 10px; border-bottom: 2px solid rgba(15, 118, 110, .2);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.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,
.sidebar .widget .rss-date { color: var(--muted); font-size: .82rem; display: block; }

/* ============================ Подвал ============================ */
.site-footer { background: var(--navy); color: #cbd6df; margin-top: 40px; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
    padding: 46px 0 40px;
}
.footer-col { min-width: 0; }
.site-footer .widget { margin: 0; color: #cbd6df; }
.site-footer .widget-title {
    color: #ffffff; font-size: 1.05rem; margin: 0 0 14px;
}
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 6px 0; }
.site-footer .widget a { color: #8fe4d8; }
.site-footer .widget a:hover { color: #ffffff; }
.site-footer .widget p { color: #cbd6df; }

.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 18px 0; }
.copyright { margin: 0; font-size: .85rem; color: #9fb0bd; }

/* ============================ Cookie-баннер ============================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 900;
    background: var(--navy-2);
    color: #e3ebf1;
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .3);
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    max-width: 920px; margin-inline: auto;
}
.cookie-text { margin: 0; font-size: .9rem; flex: 1; min-width: 220px; }
.cookie-accept {
    flex: none; background: var(--accent-bright); color: #06231f;
    border: none; padding: 11px 24px; border-radius: 8px;
    font-weight: 700; cursor: pointer;
}
.cookie-accept:hover { background: #4fe0cf; }

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

/* ============================ Контент записи / страницы ============================ */
.single-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 36px;
    box-shadow: var(--shadow);
}
.single-title { font-size: 2rem; margin: 0 0 12px; }
.single-meta {
    display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted);
    font-size: .85rem; margin-bottom: 20px;
}
.single-cat a { color: var(--accent); font-weight: 600; }
.single-thumb { margin: 0 0 24px; }
.single-thumb img { display: block; width: 100%; border-radius: var(--radius); }

.entry { font-size: 1.02rem; }
.entry p { margin: 0 0 1.1em; }
.entry h2 { font-size: 1.5rem; margin: 1.6em 0 .6em; }
.entry h3 { font-size: 1.25rem; margin: 1.4em 0 .5em; }
.entry ul, .entry ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.entry li { margin-bottom: .4em; }
.entry img { border-radius: 8px; display: block; height: auto; }
.entry a { text-decoration: underline; }
.entry blockquote {
    margin: 1.4em 0; padding: 18px 24px;
    background: rgba(15, 118, 110, .07);
    border-left: 4px solid var(--accent);
    border-radius: 8px; color: var(--ink);
}
.entry blockquote p:last-child { margin-bottom: 0; }
.entry code {
    background: #eef2f6; padding: 2px 6px; border-radius: 5px;
    font-size: .9em;
}
.entry pre {
    background: var(--navy); color: #e3ebf1; padding: 18px 20px;
    border-radius: 10px; overflow-x: auto; min-width: 0;
}
.entry pre code { background: none; color: inherit; padding: 0; }

/* Таблицы */
.entry table {
    width: 100%; border-collapse: collapse; margin: 1.2em 0;
    border: 1px solid var(--border);
}
.entry th, .entry td {
    border: 1px solid var(--border); padding: 10px 14px; text-align: left;
}
.entry th { background: #f1f5f8; font-weight: 700; }

.single-tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
    font-size: .82rem; background: #eef2f6; color: var(--muted);
    padding: 5px 12px; border-radius: 20px;
}
.tag-link:hover { background: rgba(15, 118, 110, .12); color: var(--accent); text-decoration: none; }

/* ============================ Комментарии ============================ */
.comments {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 32px; margin-top: 28px;
    box-shadow: var(--shadow);
}
.comments-title { font-size: 1.3rem; margin: 0 0 20px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .children { list-style: none; margin: 14px 0 0; padding-left: 24px; }
.comment-item { margin-bottom: 18px; }
.comment-inner {
    background: #f7f9fb; border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 20px;
}
.comment-head { display: flex; gap: 14px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { color: var(--muted); font-size: .8rem; }
.comment-hold { color: var(--accent); font-size: .85rem; }
.comment-reply a { font-size: .85rem; font-weight: 600; }

.comment-form {
    display: grid; gap: 14px;
}
.comment-form p { margin: 0; }
.comment-form label { display: block; font-size: .88rem; margin-bottom: 5px; color: var(--muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-family: inherit; font-size: .95rem; background: #fff;
}
.comment-form textarea { min-height: 130px; resize: vertical; }

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

/* ============================ 404 ============================ */
.error-404 {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 40px 36px;
    box-shadow: var(--shadow); text-align: center;
}
.error-404 .search-form { margin-inline: auto; }
.error-404 .back-home { margin-top: 20px; }

/* ============================ Адаптив ============================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { margin-top: 10px; }
    .fs-intro { grid-template-columns: 1fr; }
    .fs-intro-media { order: -1; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: flex; }
    .primary-nav { flex-basis: 100%; margin-left: 0; }
    .primary-nav .primary-menu { display: none; flex-direction: column; gap: 2px; padding-top: 10px; }
    .primary-nav.is-open .primary-menu { display: flex; }
    .primary-menu a { padding: 10px 12px; }

    .fs-title { font-size: 1.6rem; }
    .fs-heading { font-size: 1.35rem; }
    .single-post { padding: 24px 20px; }
    .single-title { font-size: 1.5rem; }
    .comments { padding: 22px 18px; }
    .footer-cols { grid-template-columns: 1fr; gap: 28px; padding: 34px 0 30px; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: left; padding: 16px 18px; }
    .cookie-accept { width: 100%; }
    .search-form { flex-wrap: wrap; }
}
