/*
Theme Name: dds_meo.su
Author: Алексей Громов
Description: Информационный хаб о государственном лицензировании IT-продуктов, сертификации специалистов по криптографии и правовых аспектах автоматизации в медицине.
Version: 1.1
Text Domain: dds_meo
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ==========================================================================
   Шрифты
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;600&display=swap');

/* ==========================================================================
   Базовые переменные и сброс
   ========================================================================== */
:root {
    --bg: #F7F9FC;
    --ink: #1E2A3E;
    --accent: #1B4F72;
    --accent2: #1F5E6B;
    --accent2-dark: #0D3B4C;
    --norm-bg: #EFF3F8;
    --warn: #B03A2E;
    --line: #D4DEEA;
    --shell: min(92%, 1180px);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent2-dark);
}

h1, h2, h3, h4 {
    color: var(--accent);
    line-height: 1.25;
    margin: 0 0 0.5em;
}

h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p {
    margin: 0 0 1.05em;
}

code, kbd, pre, .law-quote {
    font-family: "Inconsolata", "SFMono-Regular", Consolas, monospace;
}

/* ==========================================================================
   Контейнер ширины — единая точка
   ========================================================================== */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

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

/* ==========================================================================
   Шапка
   ========================================================================== */
.site-header {
    background: #fff;
    border-bottom: 3px solid var(--accent);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    min-width: 0;
    flex: 1 1 320px;
}

.brand-logo,
.brand-logo-svg {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: block;
}

.brand-text {
    min-width: 0;
}

.brand-name {
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.3;
    display: block;
}

.brand-desc {
    font-size: 0.82rem;
    color: #5a6678;
    display: block;
    margin-top: 2px;
}

/* ==========================================================================
   Основная навигация (не липкая)
   ========================================================================== */
.main-nav {
    background: var(--accent);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px 0;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.96rem;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--accent2-dark);
    color: #fff;
}

/* ==========================================================================
   Раскладка
   ========================================================================== */
.site-main {
    padding: 32px 0 48px;
}

.layout-single {
    display: block;
}

.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: 67fr 27fr;
    gap: 6%;
    align-items: start;
}

.layout-with-sidebar .content-area {
    min-width: 0;
}

.front-wrap .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Хлебные крошки
   ========================================================================== */
.breadcrumbs {
    font-size: 0.86rem;
    color: #5a6678;
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    color: #9aa6b6;
    margin: 0 6px;
}

/* ==========================================================================
   Кнопки
   ========================================================================== */
.btn,
.btn-primary {
    display: inline-block;
    background: var(--accent2);
    color: #fff;
    text-decoration: none;
    padding: 11px 22px;
    border-radius: 6px;
    border: 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.08s ease;
}

.btn:hover,
.btn-primary:hover {
    background: var(--accent2-dark);
    color: #fff;
    transform: translateY(1px);
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    padding: 9.5px 20px;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.18s ease;
}

.btn-outline:hover {
    background: var(--norm-bg);
    color: var(--accent);
}

.btn-doc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--accent2);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 4px 0;
}

.btn-doc:hover {
    text-decoration: underline;
    color: var(--accent2-dark);
}

.btn-doc svg {
    flex: 0 0 18px;
}

/* ==========================================================================
   Тематические секции главной
   ========================================================================== */
.home-section {
    margin-bottom: 44px;
}

.home-section > h2 {
    border-left: 5px solid var(--accent2);
    padding-left: 14px;
}

.section-intro {
    color: #44536a;
    max-width: 720px;
}

/* Шапка-справка */
.hub-hero {
    background: #fff;
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: 8px;
    padding: 30px 32px;
    margin-bottom: 40px;
}

.hub-hero h1 {
    font-size: 1.75rem;
}

.hub-hero p {
    color: #44536a;
}

/* Три карточки-навигатора */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.nav-card {
    background: var(--norm-bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    transition: border-color 0.18s ease;
}

.nav-card:hover {
    border-color: var(--accent2);
    color: var(--ink);
}

.nav-card .ico {
    color: var(--accent2);
    margin-bottom: 10px;
}

.nav-card strong {
    color: var(--accent);
    font-size: 1.05rem;
    display: block;
    margin-bottom: 6px;
}

.nav-card span {
    font-size: 0.88rem;
    color: #5a6678;
}

/* ==========================================================================
   Цепочка регуляторов
   ========================================================================== */
.regulator-chain {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

.reg-step {
    flex: 1 1 0;
    min-width: 150px;
    text-align: center;
    padding: 18px 14px;
    background: #fff;
    border: 1px solid var(--line);
    position: relative;
}

.reg-step:not(:last-child) {
    border-right: 0;
}

.reg-step::after {
    content: "›";
    position: absolute;
    right: -9px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: var(--bg);
    color: var(--accent2);
    font-size: 1.2rem;
    width: 18px;
    text-align: center;
}

.reg-step:last-child::after {
    content: none;
}

.reg-step .reg-ico {
    color: var(--accent2);
    margin-bottom: 8px;
}

.reg-step .reg-name {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.95rem;
}

.reg-step .reg-stage {
    font-size: 0.78rem;
    color: #5a6678;
    margin-top: 4px;
}

/* ==========================================================================
   Режимы просмотра категорий
   ========================================================================== */
.view-modes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.view-mode {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px 16px;
    text-decoration: none;
    color: var(--ink);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.18s ease;
}

.view-mode:hover {
    background: var(--norm-bg);
    color: var(--ink);
}

.view-mode .vm-ico {
    color: var(--accent2);
    margin-bottom: 10px;
}

.view-mode strong {
    color: var(--accent);
    font-size: 0.98rem;
}

/* ==========================================================================
   Карточки записей — вертикальные (шахматная выкладка)
   ========================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.card-grid.single-col {
    grid-template-columns: minmax(0, 1fr);
}

/* шахматное смещение по вертикали */
.card-grid:not(.single-col) .card:nth-child(even) {
    margin-top: 28px;
}

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}

.card-status {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 6px 14px;
    color: #fff;
}

.card-status.is-active { background: #2e7d52; }
.card-status.is-draft  { background: #b58a23; }
.card-status.is-archive { background: #6b7585; }

.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-thumb-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--norm-bg);
}

.card-body {
    flex: 1;
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
}

.card-cat {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent2);
    margin-bottom: 6px;
}

.card-title {
    font-size: 1.18rem;
    margin: 0 0 6px;
}

.card-title a {
    color: var(--accent);
    text-decoration: none;
}

.card-title a:hover {
    text-decoration: underline;
}

/* пунктирное нормативное подчёркивание */
.card-title.normative-mark::after {
    content: "";
    display: block;
    margin-top: 7px;
    border-bottom: 2px dashed var(--accent2);
    width: 64px;
}

.card-meta {
    font-size: 0.8rem;
    color: #6b7585;
    margin-bottom: 8px;
}

.card-excerpt {
    color: #44536a;
    font-size: 0.94rem;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    margin-top: auto;
    padding-top: 12px;
}

/* ==========================================================================
   Контент записи / страницы
   ========================================================================== */
.entry {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px 34px;
}

.entry-title {
    margin-top: 0;
}

.entry-meta {
    font-size: 0.85rem;
    color: #6b7585;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line);
}

.entry-thumb {
    display: block;
    width: 100%;
    border-radius: 6px;
    margin-bottom: 20px;
}

.entry-content img {
    height: auto;
}

.entry-content blockquote,
.case-quote {
    margin: 18px 0;
    padding: 12px 20px;
    border-left: 4px solid var(--accent);
    background: var(--norm-bg);
    color: #2b394f;
}

.law-quote {
    background: var(--norm-bg);
    border: 1px dashed var(--accent);
    padding: 14px 18px;
    font-size: 0.92rem;
    margin: 18px 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
}

.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}

.entry-content th,
.entry-content td {
    padding: 9px 12px;
    text-align: left;
}

.entry-content th {
    background: var(--norm-bg);
    color: var(--accent);
}

/* ==========================================================================
   Пагинация
   ========================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 30px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.pagination .page-numbers.current {
    background: var(--accent2);
    color: #fff;
    border-color: var(--accent2);
}

.pagination a.page-numbers:hover {
    background: var(--norm-bg);
}

/* ==========================================================================
   Сайдбар и виджеты
   ========================================================================== */
.sidebar {
    min-width: 0;
}

.widget {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 22px;
    color: var(--ink);
}

.widget-title {
    font-size: 1.05rem;
    color: var(--accent);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent2);
}

.widget a {
    color: var(--accent);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
    color: var(--ink);
}

.widget li:last-child {
    border-bottom: 0;
}

.widget .post-date {
    display: block;
    font-size: 0.78rem;
    color: #6b7585;
}

/* Блок «Практический опыт» */
.experience-box {
    display: block;
    background: var(--norm-bg);
    border-left: 4px solid var(--accent);
    padding: 14px 18px;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #2b394f;
}

.experience-box .eb-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent2);
    margin-bottom: 6px;
}

/* ==========================================================================
   Подвал
   ========================================================================== */
.site-footer {
    background: #16243a;
    color: #c6d2e2;
    margin-top: 40px;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    padding: 40px 0 30px;
}

.footer-cols .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: #c6d2e2;
}

.footer-cols .widget-title {
    color: #ffffff;
    border-bottom-color: #3a5d8a;
}

.footer-cols .widget a {
    color: #9ec3ee;
}

.footer-cols .widget a:hover {
    color: #ffffff;
}

.footer-cols .widget li {
    border-bottom-color: #2c3c57;
    color: #c6d2e2;
}

.footer-cols .widget .post-date {
    color: #8896ab;
}

.footer-cols .experience-box {
    background: #1f3251;
    color: #c6d2e2;
    border-left-color: #3a5d8a;
}

.footer-cols .experience-box .eb-label {
    color: #9ec3ee;
}

.site-info {
    border-top: 1px solid #2c3c57;
    padding: 16px 0;
    font-size: 0.84rem;
    color: #8896ab;
}

/* ==========================================================================
   Форма поиска
   ========================================================================== */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 420px;
}

.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
}

.search-form .search-submit {
    background: var(--accent2);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 9px 18px;
    font-weight: 600;
    cursor: pointer;
}

.search-form .search-submit:hover {
    background: var(--accent2-dark);
}

/* ==========================================================================
   Комментарии
   ========================================================================== */
.comments-area {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px 30px;
    margin-top: 26px;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list li {
    margin-bottom: 18px;
}

.comment-body {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 18px;
}

.comment-meta {
    font-size: 0.82rem;
    color: #6b7585;
    margin-bottom: 6px;
}

.comment-list .children {
    list-style: none;
    margin: 14px 0 0 26px;
    padding: 0;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
}

.comment-form label {
    display: block;
    font-size: 0.88rem;
    margin: 10px 0 4px;
    font-weight: 600;
}

/* ==========================================================================
   404
   ========================================================================== */
.error-404 {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 36px 34px;
    text-align: center;
}

.error-404 .code {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--accent2);
    line-height: 1;
}

/* ==========================================================================
   Cookie-баннер
   ========================================================================== */
.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: #16243a;
    color: #d5dfee;
    padding: 14px 0;
    border-top: 3px solid var(--accent2);
}

.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.cookie-inner p {
    margin: 0;
    font-size: 0.88rem;
    flex: 1 1 280px;
    min-width: 0;
}

.cookie-inner a {
    color: #9ec3ee;
}

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .layout-single .content-area,
    .front-wrap .content-area {
        width: 100%;
    }

    .nav-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .view-modes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }

    .nav-toggle {
        display: block;
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
    }

    .main-nav ul.is-open {
        display: flex;
    }

    .main-nav a {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .card-grid,
    .nav-cards,
    .view-modes,
    .footer-cols {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-grid:not(.single-col) .card:nth-child(even) {
        margin-top: 0;
    }

    .entry,
    .comments-area,
    .hub-hero,
    .error-404 {
        padding-left: 20px;
        padding-right: 20px;
    }
}
