/*
Theme Name: dds_f-insur.ru
Theme URI: https://f-insur.ru/
Author: Алексей Громов
Author URI: https://f-insur.ru/
Description: Мультисегментный экспертный портал о страховании. Профессиональные инсайты для агентов, понятные разборы и рекомендации для всех.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: dds_finsur
*/

/* ============================================================
   Базовые переменные и сброс
   ============================================================ */
:root {
    --ink: #0f1d3a;
    --ink-soft: #34425e;
    --ink-mute: #6a7691;
    --paper: #f6f7fb;
    --paper-2: #ffffff;
    --line: #d9dee9;
    --accent: #0f4eaa;
    --accent-soft: #e7eefb;
    --accent-strong: #093777;
    --warm: #e7b04a;
    --warm-soft: #fbf1d9;
    --teal: #20716b;
    --shadow-1: 0 1px 2px rgba(15, 29, 58, 0.06), 0 8px 24px rgba(15, 29, 58, 0.06);
    --shadow-2: 0 2px 8px rgba(15, 29, 58, 0.1);
    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 18px;
    --serif: Georgia, "Times New Roman", serif;
    --sans: -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(--sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--accent-strong); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    color: var(--ink);
    margin: 1.4em 0 .6em;
    line-height: 1.25;
    font-weight: 600;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

blockquote {
    margin: 1.4em 0;
    padding: 1em 1.25em;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    color: var(--ink);
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}
table, th, td { border: 1px solid var(--line); }
th, td { padding: .6em .8em; text-align: left; }
th { background: var(--accent-soft); }

code, pre {
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    background: #eef1f7;
    border-radius: var(--radius-s);
}
code { padding: .15em .4em; font-size: .92em; }
pre { padding: 1em; overflow-x: auto; }

hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2em 0;
}

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

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { flex: 0 0 auto; }
.brand-logo {
    width: 52px;
    height: 52px;
    display: block;
    border-radius: var(--radius-s);
    object-fit: cover;
}
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--ink);
}
.brand-tag {
    display: block;
    font-size: .82rem;
    color: var(--ink-mute);
    margin-top: 2px;
    max-width: 460px;
}

.primary-nav { margin-left: auto; }
.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.primary-nav a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-s);
    color: var(--ink-soft);
    font-weight: 500;
}
.primary-nav a:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
    text-decoration: none;
}
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
    background: var(--accent);
    color: #fff;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ink);
}

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    padding: 14px 0;
    font-size: .88rem;
    color: var(--ink-mute);
}
.breadcrumbs a { color: var(--ink-mute); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 .35em; color: var(--line); }

/* ============================================================
   Основная раскладка контента
   ============================================================ */
.site-main { padding: 16px 0 56px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 36px;
}
.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.layout-full { display: block; }

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

/* ============================================================
   Сайдбар и виджеты
   ============================================================ */
.sidebar { min-width: 0; }
.widget {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 18px 20px;
    margin-bottom: 22px;
    color: var(--ink);
}
.widget-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--ink);
    font-family: var(--serif);
}
.widget a { color: var(--accent); }
.widget a:hover { color: var(--accent-strong); }
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget li {
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    color: var(--ink-soft);
}
.widget li:last-child { border-bottom: none; }
.widget .post-date {
    display: block;
    font-size: .8rem;
    color: var(--ink-mute);
    margin-top: 2px;
}

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: transform .18s ease, box-shadow .18s ease;
    min-width: 0;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}
.card-thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--accent-soft);
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    inset: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.card-title {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-size: 1.18rem;
    line-height: 1.3;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta {
    font-size: .82rem;
    color: var(--ink-mute);
    margin-bottom: 10px;
}
.card-excerpt {
    color: var(--ink-soft);
    font-size: .96rem;
    margin-bottom: 14px;
}
.card-excerpt p {
    margin: 0 0 .5em;
    background: none;
}
.card-more {
    align-self: flex-start;
    margin-top: auto;
    padding: 8px 14px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-radius: var(--radius-s);
    font-size: .9rem;
    font-weight: 500;
}
.card-more:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* Горизонтальная карточка для архивов/поиска */
.card-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    aspect-ratio: auto;
}
.card-row .card-body { padding: 22px 24px; }

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

/* ============================================================
   Главная — тематические блоки
   ============================================================ */
.front-section {
    margin: 48px 0;
}
.front-section-title {
    text-align: left;
    margin: 0 0 24px;
    font-size: 1.8rem;
}
.front-section-title small {
    display: block;
    font-family: var(--sans);
    font-weight: 400;
    font-size: .92rem;
    color: var(--ink-mute);
    margin-top: 6px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Блок 1: текст + иллюстрация */
.block-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    padding: 36px;
}
.block-split.reverse .block-split-text { order: 2; }
.block-split.reverse .block-split-media { order: 1; }
.block-split-text p { font-size: 1.04rem; color: var(--ink-soft); }
.block-split-media {
    border-radius: var(--radius-m);
    overflow: hidden;
    background: var(--accent-soft);
}
.block-split-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Блок 2: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.step {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 22px;
    min-width: 0;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-family: var(--serif);
    margin-bottom: 12px;
}
.step h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}
.step p {
    margin: 0;
    color: var(--ink-soft);
    font-size: .94rem;
}

/* Блок 3: факты */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-l);
    padding: 36px;
}
.fact { min-width: 0; }
.fact-num {
    display: block;
    font-family: var(--serif);
    font-size: 2.2rem;
    color: var(--warm);
    line-height: 1;
    margin-bottom: 6px;
}
.fact-label {
    display: block;
    font-size: .92rem;
    color: #c8d0e2;
}

/* Блок 4: FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.faq-item {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 16px 22px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
    position: relative;
    padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent);
    transition: transform .2s ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
    margin: 12px 0 0;
    color: var(--ink-soft);
}

/* CTA-секция (внутри подвальной части main, не обязательная) */
.cta-band {
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #fff;
    border-radius: var(--radius-l);
    padding: 40px 36px;
    text-align: center;
}
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band p { color: #dbe5f7; font-size: 1.04rem; }
.cta-band .btn { background: var(--warm); color: var(--ink); }
.cta-band .btn:hover { background: #f1c46a; }

.btn {
    display: inline-block;
    padding: 12px 22px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-s);
    font-weight: 500;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--accent-strong); color: #fff; text-decoration: none; }

/* Последние записи на главной */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

/* ============================================================
   Singular контент (запись, страница)
   ============================================================ */
.entry-header {
    margin-bottom: 20px;
}
.entry-title {
    margin: 0 0 10px;
    font-size: 2rem;
}
.entry-meta {
    color: var(--ink-mute);
    font-size: .9rem;
}
.entry-thumbnail {
    margin: 18px 0 24px;
    border-radius: var(--radius-m);
    overflow: hidden;
}
.entry-thumbnail img { display: block; width: 100%; height: auto; }
.entry-content {
    font-size: 1.04rem;
}
.entry-content img {
    border-radius: var(--radius-s);
    margin: 1em 0;
}
.entry-tags {
    margin: 28px 0;
    font-size: .9rem;
    color: var(--ink-mute);
}
.entry-tags a {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-soft);
    border-radius: var(--radius-s);
    color: var(--accent-strong);
    margin-right: 4px;
}
.entry-tags a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ============================================================
   Пагинация
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 36px 0 12px;
    justify-content: center;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    color: var(--ink-soft);
    background: var(--paper-2);
    font-size: .92rem;
    text-decoration: none;
}
.pager .page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pager .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.comments-title { margin-top: 0; font-size: 1.4rem; }
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-list .comment {
    margin-bottom: 18px;
    padding: 16px 18px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
}
.comment-list .children {
    list-style: none;
    margin: 14px 0 0;
    padding: 0 0 0 24px;
    border-left: 2px solid var(--line);
}
.comment-author {
    font-weight: 600;
    color: var(--ink);
}
.comment-meta {
    font-size: .82rem;
    color: var(--ink-mute);
    margin-bottom: 8px;
}
.comment-content p:last-child { margin-bottom: 0; }
.comment-respond {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    font: inherit;
    background: var(--paper-2);
    color: var(--ink);
    margin-bottom: 8px;
}
.comment-form label { display: block; font-size: .88rem; margin-bottom: 4px; color: var(--ink-soft); }
.comment-form .submit {
    background: var(--accent);
    color: #fff;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    font-size: .96rem;
}
.comment-form .submit:hover { background: var(--accent-strong); }

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    background: var(--paper-2);
    color: var(--ink);
    font: inherit;
}
.search-form button {
    padding: 10px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    font: inherit;
}
.search-form button:hover { background: var(--accent-strong); }

.widget .search-form { max-width: 100%; }

/* ============================================================
   404
   ============================================================ */
.error-404 {
    text-align: center;
    padding: 48px 20px;
}
.error-404 .big {
    font-family: var(--serif);
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
    margin: 0 0 10px;
}
.error-404 h1 {
    margin: 0 0 14px;
    font-size: 1.8rem;
}
.error-404 .search-form {
    margin: 24px auto;
}

/* ============================================================
   Cookie-banner
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    background: var(--ink);
    color: #f0f3fb;
    border-radius: var(--radius-m);
    padding: 16px 22px;
    box-shadow: 0 10px 40px rgba(15, 29, 58, .25);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: .92rem;
    line-height: 1.45;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 200px; }
.cookie-banner a { color: var(--warm); text-decoration: underline; }
.cookie-banner .cookie-accept {
    padding: 10px 22px;
    background: var(--warm);
    color: var(--ink);
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}
.cookie-banner .cookie-accept:hover { background: #f1c46a; }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: #0b1731;
    color: #c2cce0;
    padding: 48px 0 18px;
    margin-top: 60px;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}
.site-footer .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
    color: #c2cce0;
}
.site-footer .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.site-footer .widget a {
    color: #e3eaf7;
}
.site-footer .widget a:hover {
    color: var(--warm);
}
.site-footer .widget li {
    border-bottom: 1px dashed rgba(255, 255, 255, .12);
    color: #c2cce0;
}
.site-footer .widget .post-date {
    color: #8a98b5;
}
.site-copyright {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .86rem;
    color: #8a98b5;
    text-align: left;
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
    .block-split {
        grid-template-columns: minmax(0, 1fr);
        padding: 28px;
        gap: 24px;
    }
    .block-split.reverse .block-split-text { order: initial; }
    .block-split.reverse .block-split-media { order: initial; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.45rem; }
    .front-section-title { font-size: 1.5rem; }
    .facts { padding: 28px; }
}

@media (max-width: 600px) {
    body { font-size: 15.5px; }
    .header-inner { gap: 14px; }
    .nav-toggle { display: inline-block; margin-left: auto; }
    .primary-nav {
        margin-left: 0;
        width: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav ul {
        flex-direction: column;
        gap: 2px;
    }
    .primary-nav a {
        padding: 10px 12px;
        border-radius: var(--radius-s);
    }
    .layout-single {
        width: 100%;
    }
    .brand-tag { display: none; }
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
    .cookie-banner .cookie-accept { align-self: flex-start; }
    .fact-num { font-size: 1.8rem; }
    .entry-title { font-size: 1.55rem; }
    .error-404 .big { font-size: 3.6rem; }
}
