/*
Theme Name: dds_ul-legal.ru
Author: Кира Назарова
Description: Информационная тема о юридических услугах: договоры, претензии, споры, оценка документов и подготовка к разговору с юристом.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: ullegal
*/

/* ============================================================
   Токены
   ============================================================ */
:root {
    --navy:        #1f3a5f;
    --navy-deep:   #16263f;
    --navy-soft:   #2c4d78;
    --gold:        #c8a45c;
    --gold-deep:   #a9863f;
    --ink:         #23282f;
    --muted:       #5c6672;
    --line:        #dfe4ea;
    --paper:       #ffffff;
    --paper-2:     #f4f6f9;
    --paper-3:     #eaeef3;
    --radius:      10px;
    --shell:       min(92%, 1180px);
    --shadow:      0 6px 22px rgba(24, 45, 74, 0.08);
}

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

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", "PT Serif", serif;
    line-height: 1.25;
    color: var(--navy-deep);
    margin: 0 0 0.6em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a {
    color: var(--navy-soft);
    text-decoration: none;
}
a:hover { color: var(--gold-deep); text-decoration: underline; }

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

.shell {
    width: var(--shell);
    margin-inline: auto;
}

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

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo { display: block; max-height: 54px; width: auto; }
.brand-mark { display: block; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.16rem;
    font-weight: 700;
    color: var(--navy-deep);
    line-height: 1.25;
    display: block;
}
.brand-title a { color: inherit; text-decoration: none; }
.brand-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 2px;
}

/* Навигация */
.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    color: var(--navy-deep);
    border-radius: 8px;
    font-size: 0.98rem;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--paper-3);
    color: var(--navy-deep);
    text-decoration: none;
}

/* ============================================================
   Каркас страницы
   ============================================================ */
.site-main { padding: 30px 0 48px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
}
.layout-single {
    display: block;
}
.layout-single > .content-area {
    width: 85%;
    max-width: 900px;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* Хлебные крошки */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--muted);
    margin: 0 0 22px;
    line-height: 1.5;
}
.breadcrumbs a { color: var(--navy-soft); }
.breadcrumbs .sep { color: var(--gold-deep); margin: 0 4px; }

/* ============================================================
   Карточки записей (A8, A10)
   ============================================================ */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
@media (min-width: 720px) {
    .card.card-h {
        flex-direction: row;
    }
}

.card-thumb-wrap {
    position: relative;
    overflow: hidden;
    background: var(--paper-3);
}
.card.card-h .card-thumb-wrap {
    flex: 0 0 260px;
}
.card.card-h .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card.card-h .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Вертикальный вариант миниатюры */
.card:not(.card-h) .card-thumb-wrap a { display: block; }
.card:not(.card-h) .card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.card-body {
    flex: 1;
    min-width: 0;
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 1.24rem;
    margin: 0 0 8px;
}
.card-title a { color: var(--navy-deep); }
.card-meta {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 10px;
}
.card-excerpt { color: var(--ink); }
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-more {
    margin-top: auto;
    padding-top: 12px;
}
.card-more a {
    display: inline-block;
    font-weight: 600;
    color: var(--gold-deep);
}

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

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.entry {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 32px;
    box-shadow: var(--shadow);
}
.entry-header { margin-bottom: 18px; }
.entry-title { font-size: 1.9rem; margin: 0 0 8px; }
.entry-meta { font-size: 0.85rem; color: var(--muted); }
.entry-thumb {
    margin: 0 0 22px;
    border-radius: var(--radius);
    overflow: hidden;
}
.entry-thumb img { width: 100%; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content h3 { margin-top: 1.2em; }
.entry-content ul,
.entry-content ol { padding-left: 1.4em; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 16px 22px;
    background: var(--paper-2);
    border-left: 4px solid var(--gold);
    border-radius: 0 8px 8px 0;
    color: var(--navy-deep);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--line);
}
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
.entry-content th { background: var(--paper-2); }

.entry-tags {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
}
.entry-tags a {
    display: inline-block;
    padding: 3px 10px;
    background: var(--paper-2);
    border-radius: 20px;
    margin: 0 4px 6px 0;
}

/* ============================================================
   Сайдбар / виджеты
   ============================================================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    color: var(--navy-deep);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--navy-soft); }
.sidebar a:hover { color: var(--gold-deep); }
.sidebar .post-date { color: var(--muted); }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--navy-deep);
    color: #c7d2e0;
    padding: 44px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
}
.footer-col .widget { margin-bottom: 20px; }
.footer-col .widget-title {
    font-size: 1.05rem;
    color: #ffffff;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.footer-col,
.footer-col p,
.footer-col li { color: #c7d2e0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 6px 0; }
.footer-col a { color: #e6ecf4; }
.footer-col a:hover { color: var(--gold); text-decoration: none; }
.footer-contacts a { color: var(--gold); }

.footer-bottom {
    margin-top: 34px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding: 18px 0 22px;
    font-size: 0.85rem;
    color: #9fb0c4;
}

/* ============================================================
   Главная
   ============================================================ */
.front { }
.front-section { padding: 46px 0; }
.front-section:nth-child(even) { background: var(--paper); }
.section-head { margin-bottom: 26px; }
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-deep);
    font-weight: 700;
    margin-bottom: 6px;
}
.section-head h2 { margin: 0; }

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

/* Блок: сетка направлений */
.tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
.tile {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    min-width: 0;
}
.front-section:nth-child(even) .tile { background: var(--paper-2); }
.tile-ico {
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    color: var(--navy);
}
.tile h3 { margin: 0 0 8px; font-size: 1.14rem; }
.tile p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 22px 22px 66px;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 18px;
    top: 20px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-family: Georgia, serif;
}
.step h3 { margin: 0 0 6px; font-size: 1.08rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Блок: последние записи на главной */
.front-latest .card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Блок: CTA */
.fs-cta {
    background: var(--navy);
    color: #eaf0f8;
    border-radius: 14px;
    padding: 40px 44px;
    text-align: center;
}
.fs-cta h2 { color: #fff; margin-bottom: 10px; }
.fs-cta p { color: #c7d5e6; margin: 0 auto 22px; max-width: 640px; }
.btn {
    display: inline-block;
    background: var(--gold);
    color: var(--navy-deep);
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 8px;
    text-decoration: none;
}
.btn:hover { background: #d8b76e; color: var(--navy-deep); text-decoration: none; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}
.btn-ghost:hover { background: rgba(200, 164, 92, 0.14); color: var(--gold); }

/* ============================================================
   Пагинация (D5)
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 34px 0 6px;
}
.pager .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(--paper);
    color: var(--navy-deep);
    font-size: 0.95rem;
    text-decoration: none;
}
.pager a.page-numbers:hover {
    border-color: var(--navy-soft);
    color: var(--navy-soft);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.pager .page-numbers.dots {
    border: 0;
    background: transparent;
}

/* ============================================================
   Формы поиска / комментарии
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--paper);
}
.search-form .search-submit {
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 18px;
    font: inherit;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--navy-soft); }

.comments-area {
    margin-top: 30px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 30px;
    box-shadow: var(--shadow);
}
.comments-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-item { margin: 0 0 18px; }
.comment-inner {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 18px;
    background: var(--paper-2);
}
.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; color: var(--navy-deep); }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-await { font-size: 0.85rem; color: var(--gold-deep); }
.comment-reply a {
    font-size: 0.85rem;
    font-weight: 600;
}
.comment-respond {
    margin-top: 24px;
}
.comment-form label { display: block; font-size: 0.9rem; margin-bottom: 4px; font-weight: 600; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-bottom: 14px;
    background: var(--paper);
}
.comment-form .submit {
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 12px 24px;
    font: inherit;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--navy-soft); }

/* ============================================================
   404
   ============================================================ */
.err {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 34px;
    text-align: center;
    box-shadow: var(--shadow);
}
.err-code {
    font-family: Georgia, serif;
    font-size: 4rem;
    color: var(--gold);
    line-height: 1;
    margin: 0 0 8px;
}
.err .search-form { max-width: 420px; margin: 20px auto 0; }

/* ============================================================
   FAQ на записи/странице (details)
   ============================================================ */
.faq-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 22px;
    margin-bottom: 14px;
    min-width: 0;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    font-family: Georgia, serif;
    color: var(--navy-deep);
    padding: 16px 0;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    float: right;
    color: var(--gold-deep);
    font-size: 1.3rem;
    line-height: 1;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item .faq-a { padding: 0 0 16px; margin: 0; color: var(--muted); }

/* ============================================================
   Cookie-баннер (D6, A11)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    background: var(--navy-deep);
    color: #dfe7f1;
    border-top: 3px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 16px 22px;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 760px; }
.cookie-banner a { color: var(--gold); }
.cookie-accept {
    background: var(--gold);
    color: var(--navy-deep);
    border: 0;
    border-radius: 8px;
    padding: 11px 24px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #d8b76e; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .front-latest .card-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .entry-title { font-size: 1.5rem; }
    .entry { padding: 22px 20px; }

    .nav-toggle { display: inline-flex; }
    .main-nav {
        width: 100%;
        display: none;
        margin-top: 12px;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .main-nav a { padding: 12px 14px; border-radius: 8px; }

    .layout-single > .content-area { width: 100%; max-width: 100%; }

    .split { grid-template-columns: 1fr; gap: 24px; }
    .split.reverse .split-media { order: 0; }
    .tiles { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .front-latest .card-list { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 26px; }

    .front-section { padding: 34px 0; }
    .fs-cta { padding: 30px 22px; }
    .entry { padding: 20px 18px; }
}
