/*
Theme Name: advokatyhmao.ru
Theme URI: https://advokatyhmao.ru
Author: Алексей Воронов
Author URI: https://advokatyhmao.ru
Description: Независимый юридический портал, созданный практикующими экспертами. Мы собираем, систематизируем и объясняем сложные правовые нормы, помогая юристам и предпринимателям защищать интеллектуальную собственность и выигрывать арбитражные споры.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
Text Domain: advhmao
*/

/* ============ Сброс и базовая типографика ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1A2A3A;
    background: #F8F9FC;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a {
    color: #0A5C8E;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
a:hover { color: #043B54; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: #0A5C8E;
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
    font-weight: 700;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
code, pre {
    font-family: 'Fira Code', Consolas, 'Courier New', monospace;
    background: #F4F2EB;
    color: #1A2A3A;
}
code { padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.9em; }
pre {
    padding: 1em 1.2em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
    border-left: 3px solid #0A5C8E;
}
blockquote {
    margin: 1.4em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid #C68B2C;
    background: #F4F2EB;
    color: #1A2A3A;
    font-style: italic;
    line-height: 1.5;
}
hr { border: none; border-top: 1px solid #DDE3EC; margin: 2em 0; }
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid #C9D1DC;
}
th, td {
    border: 1px solid #C9D1DC;
    padding: 0.6em 0.9em;
    text-align: left;
    vertical-align: top;
}
th { background: #E9ECF3; color: #1A2A3A; font-weight: 600; }
::selection { background: #C68B2C; color: #fff; }

/* ============ Контейнер ============ */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ============ Скип-линк ============ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0A5C8E;
    color: #fff;
    padding: 8px 14px;
    z-index: 999;
}
.skip-link:focus { top: 0; color: #fff; }

/* ============ Шапка ============ */
.site-header {
    background: #fff;
    border-bottom: 1px solid #DDE3EC;
    padding: 18px 0;
}
.header-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}
.brand a.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
}
.brand-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0A5C8E;
    line-height: 1.3;
    margin: 0;
    display: block;
    max-width: 560px;
}
.brand-tagline {
    font-size: 0.78rem;
    color: #5A6776;
    line-height: 1.4;
    margin-top: 3px;
    display: block;
    max-width: 560px;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #0A5C8E;
    color: #0A5C8E;
    width: 42px;
    height: 42px;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #0A5C8E;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.main-nav li a {
    display: block;
    padding: 9px 14px;
    color: #1A2A3A;
    font-weight: 500;
    border-radius: 4px;
    font-size: 0.95rem;
}
.main-nav li a:hover,
.main-nav li.current-menu-item > a,
.main-nav li.current_page_item > a {
    color: #0A5C8E;
    border-bottom: 2px dashed #C68B2C;
    border-radius: 0;
}

/* ============ Поисковая строка под шапкой ============ */
.search-bar {
    background: #fff;
    border-bottom: 1px solid #DDE3EC;
    padding: 14px 0;
}
.search-bar-inner { display: flex; align-items: center; gap: 12px; }
.search-bar form {
    display: flex;
    width: 100%;
    border: 1px solid #C9D1DC;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.search-bar input[type="search"] {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 10px 14px;
    font-size: 0.95rem;
    background: transparent;
    color: #1A2A3A;
    font-family: inherit;
}
.search-bar button {
    background: #C68B2C;
    color: #fff;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: inherit;
}
.search-bar button:hover { background: #A26F1F; }

/* ============ Хлебные крошки ============ */
.breadcrumbs {
    background: #F4F2EB;
    padding: 10px 0;
    font-size: 0.86rem;
    color: #5A6776;
}
.breadcrumbs .shell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumbs a { color: #0A5C8E; }
.breadcrumbs a:hover { text-decoration: underline; text-decoration-color: #C68B2C; }
.breadcrumbs .sep { color: #99A2AE; padding: 0 2px; }

/* ============ Основная разметка контента ============ */
.site-main { padding: 32px 0 48px; }
.content-area { min-width: 0; }
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 36px;
}
.layout-no-sidebar { display: block; }
.layout-no-sidebar .content-area {
    width: 85%;
    margin-inline: auto;
}

/* ============ Карточки записей ============ */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #DDE3EC;
    border-left: 4px solid #0A5C8E;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 4px 16px rgba(10, 92, 142, 0.08); }
.card.card-row { flex-direction: row; }
.card img { display: block; }

.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: #E9ECF3;
}
.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-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #99A2AE;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #E9ECF3 0%, #F4F2EB 100%);
}

.card-body {
    flex: 1;
    min-width: 0;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}
.card-meta {
    font-size: 0.82rem;
    color: #5A6776;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.card-meta a { color: #5A6776; }
.card-meta a:hover { color: #0A5C8E; }
.card-title {
    font-size: 1.2rem;
    margin: 0 0 10px;
    line-height: 1.35;
}
.card-title a { color: #0A5C8E; }
.card-title a:hover {
    color: #043B54;
    border-bottom: 1px dashed #C68B2C;
}
.card-excerpt {
    color: #1A2A3A;
    margin-bottom: 14px;
    flex: 1;
    font-size: 0.95rem;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-actions { margin-top: auto; }

/* ============ Кнопки ============ */
.btn {
    display: inline-block;
    padding: 9px 18px;
    background: #0A5C8E;
    color: #fff;
    border-radius: 6px;
    border-left: 3px solid #C68B2C;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    border-top: none;
    border-right: none;
    border-bottom: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover {
    background: #043B54;
    color: #fff;
    box-shadow: 0 4px 12px rgba(10, 92, 142, 0.22);
}
.btn-outline {
    background: transparent;
    color: #0A5C8E;
    border: 1px solid #0A5C8E;
}
.btn-outline:hover {
    background: #0A5C8E;
    color: #fff;
}

/* ============ Чипы фильтрации ============ */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}
.chip {
    display: inline-block;
    padding: 7px 16px;
    background: #E9ECF3;
    color: #1A2A3A;
    border-radius: 40px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}
.chip:hover { background: #DDE3EC; }
.chip.is-active {
    background: #0A5C8E;
    color: #fff;
}

/* ============ Сайдбар и виджеты ============ */
.site-sidebar { min-width: 0; }
.widget {
    background: #fff;
    border: 1px solid #DDE3EC;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 22px;
    color: #1A2A3A;
}
.widget-title {
    font-size: 1.02rem;
    color: #0A5C8E;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #DDE3EC;
    font-weight: 700;
}
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget ul li {
    padding: 7px 0;
    border-bottom: 1px solid #F0F2F6;
    color: #1A2A3A;
    font-size: 0.92rem;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a {
    color: #0A5C8E;
    display: inline;
}
.widget ul li a:hover {
    color: #043B54;
    border-bottom: 1px dashed #C68B2C;
}
.widget .post-date,
.widget .rss-date {
    display: block;
    color: #5A6776;
    font-size: 0.78rem;
    margin-top: 2px;
}

/* ============ Заголовок страницы / архива ============ */
.page-header {
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid #C68B2C;
}
.page-header h1 {
    margin: 0;
    color: #0A5C8E;
}
.page-header .archive-description {
    color: #5A6776;
    margin-top: 8px;
}

/* ============ Главная: тематические секции ============ */
.section {
    padding: 36px 0;
}
.section + .section { border-top: 1px solid #DDE3EC; }
.section h2 {
    margin-top: 0;
    margin-bottom: 8px;
}
.section .lead {
    font-size: 1.05rem;
    color: #1A2A3A;
    max-width: 820px;
    margin-bottom: 22px;
}
.section-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.section-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
.feature {
    background: #fff;
    border: 1px solid #DDE3EC;
    border-top: 3px solid #0A5C8E;
    border-radius: 6px;
    padding: 22px;
    min-width: 0;
}
.feature.is-ochre { border-top-color: #C68B2C; }
.feature h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: #0A5C8E;
}
.feature p {
    margin: 0;
    color: #1A2A3A;
    font-size: 0.95rem;
}
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    counter-reset: step;
}
.step {
    background: #F4F2EB;
    border-radius: 6px;
    padding: 22px 20px;
    position: relative;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 2.2rem;
    font-weight: 700;
    color: #C68B2C;
    opacity: 0.6;
    line-height: 1;
}
.step h4 {
    margin: 0 0 8px;
    color: #0A5C8E;
    font-size: 1rem;
}
.step p {
    margin: 0;
    font-size: 0.9rem;
    color: #1A2A3A;
}

.section-callout {
    background: #0A5C8E;
    color: #fff;
    padding: 30px 28px;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}
.section-callout h2 { color: #fff; margin: 0; }
.section-callout p { color: #DDE3EC; margin: 6px 0 0; max-width: 720px; }
.section-callout .btn {
    background: #C68B2C;
    border-left-color: #fff;
    color: #fff;
}
.section-callout .btn:hover {
    background: #A26F1F;
}

/* ============ Категории-чипы для главной ============ */
.cats-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    margin: 0 0 12px;
    list-style: none;
}
.cats-list li {
    background: #E9ECF3;
    color: #1A2A3A;
    border-radius: 40px;
    padding: 8px 18px;
    font-size: 0.88rem;
}

/* ============ Контент записи ============ */
.entry-content {
    color: #1A2A3A;
    font-size: 1rem;
}
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin: 0.3em 0; }
.entry-content img { border-radius: 4px; margin: 1em 0; }
.entry-content a {
    color: #0A5C8E;
    border-bottom: 1px dashed transparent;
}
.entry-content a:hover { border-bottom-color: #C68B2C; }
.entry-meta {
    color: #5A6776;
    font-size: 0.88rem;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #DDE3EC;
}
.entry-meta a { color: #5A6776; }
.entry-meta a:hover { color: #0A5C8E; }
.entry-thumb {
    margin: 0 0 22px;
    border-radius: 6px;
    overflow: hidden;
}
.entry-thumb img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* ============ Пагинация ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 32px 0 0;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    color: #0A5C8E;
    border: 1px solid #C9D1DC;
    border-radius: 4px;
    font-size: 0.92rem;
    font-weight: 500;
}
.pagination .page-numbers:hover {
    background: #E9ECF3;
    border-color: #0A5C8E;
}
.pagination .page-numbers.current {
    background: #0A5C8E;
    color: #fff;
    border-color: #0A5C8E;
}
.pagination .page-numbers.dots {
    background: transparent;
    border: none;
}

/* ============ Комментарии ============ */
.comments-area { margin-top: 40px; }
.comments-title {
    font-size: 1.3rem;
    color: #0A5C8E;
    padding-bottom: 10px;
    border-bottom: 2px solid #C68B2C;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-list li {
    padding: 16px 0;
    border-bottom: 1px solid #DDE3EC;
}
.comment-list .children {
    list-style: none;
    padding-left: 20px;
    margin-top: 12px;
    border-left: 2px solid #DDE3EC;
}
.comment-meta {
    font-size: 0.88rem;
    color: #5A6776;
    margin-bottom: 6px;
}
.comment-author { font-weight: 600; color: #1A2A3A; }
.comment-respond {
    margin-top: 24px;
    background: #F4F2EB;
    border-radius: 6px;
    padding: 20px 22px;
}
.comment-respond .comment-reply-title {
    margin-top: 0;
    color: #0A5C8E;
}
.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 #C9D1DC;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #1A2A3A;
    margin-top: 4px;
}
.comment-form textarea { min-height: 110px; resize: vertical; }
.comment-form .form-submit input[type="submit"] {
    display: inline-block;
    padding: 10px 22px;
    background: #0A5C8E;
    color: #fff;
    border-radius: 6px;
    border: none;
    border-left: 3px solid #C68B2C;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.comment-form .form-submit input[type="submit"]:hover { background: #043B54; }

/* ============ Формы поиска и 404 ============ */
.searchform-inline {
    max-width: 540px;
    margin: 18px 0;
}
.searchform-inline form {
    display: flex;
    border: 1px solid #C9D1DC;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.searchform-inline input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    color: #1A2A3A;
}
.searchform-inline button {
    background: #0A5C8E;
    color: #fff;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
}
.searchform-inline button:hover { background: #043B54; }

.error-404 { padding: 22px 0; }
.error-404 .err-code {
    font-size: 5rem;
    font-weight: 700;
    color: #C68B2C;
    line-height: 1;
    margin: 0 0 10px;
}

/* ============ Подвал ============ */
.site-footer {
    background: #1A2A3A;
    color: #C9D1DC;
    margin-top: 40px;
}
.footer-widgets {
    padding: 40px 0 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
.footer-col { min-width: 0; }
.site-footer .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #C9D1DC;
}
.site-footer .widget-title {
    color: #fff;
    border-bottom-color: #354553;
}
.site-footer .widget a {
    color: #DDE3EC;
}
.site-footer .widget a:hover {
    color: #C68B2C;
}
.site-footer .widget ul li {
    border-bottom-color: #2A3A4A;
    color: #DDE3EC;
}
.site-footer .widget ul li .post-date,
.site-footer .widget .post-date,
.site-footer .widget .rss-date {
    color: #99A2AE;
}
.site-footer p { color: #C9D1DC; margin: 0 0 0.6em; }
.site-info {
    border-top: 1px solid #2A3A4A;
    padding: 18px 0;
    font-size: 0.85rem;
    color: #99A2AE;
    text-align: center;
}

/* ============ Cookie-баннер ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 1000;
    background: #1A2A3A;
    color: #fff;
    border-left: 4px solid #C68B2C;
    border-radius: 6px;
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.cookie-banner p {
    margin: 0;
    color: #DDE3EC;
    font-size: 0.92rem;
    flex: 1;
    min-width: 0;
}
.cookie-banner .cookie-accept {
    background: #C68B2C;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.92rem;
    font-family: inherit;
    font-weight: 500;
    flex-shrink: 0;
}
.cookie-banner .cookie-accept:hover { background: #A26F1F; }

/* ============ Адаптив: 960px ============ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    .section-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-widgets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
    }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.45rem; }
}

/* ============ Адаптив: 600px ============ */
@media (max-width: 600px) {
    .nav-toggle { display: flex; }
    .main-nav {
        order: 3;
        flex-basis: 100%;
        margin-left: 0;
    }
    .main-nav[hidden] { display: none !important; }
    .main-nav ul {
        flex-direction: column;
        gap: 2px;
        margin-top: 14px;
    }
    .main-nav li a {
        padding: 10px 12px;
        border-bottom: 1px solid #DDE3EC;
        border-radius: 0;
    }
    .header-row { gap: 14px; }
    .brand-title { font-size: 0.98rem; }
    .brand-tagline { font-size: 0.74rem; }

    .card.card-row { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .section-grid-3, .section-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .steps { grid-template-columns: minmax(0, 1fr); }
    .footer-widgets { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .layout-no-sidebar .content-area { width: 100%; }
    .site-main { padding: 22px 0 32px; }
    h1 { font-size: 1.55rem; }
    h2 { font-size: 1.3rem; }
    .section { padding: 28px 0; }
    .section-callout { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
    .cookie-banner { flex-direction: column; align-items: stretch; }
    .cookie-banner .cookie-accept { width: 100%; }
}
