/*
Theme Name: dds_mercana-tex.ru
Theme URI: https://mercana-tex.ru/
Author: Ильина Елизавета Ильина Елизавета
Description: Информационная тема для аналитического проекта о недвижимости. Швейцарская модульная сетка, холодная морская палитра, песочный акцент.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: zhkompas
*/

/* =====================================================
   1. Переменные и база
   ===================================================== */

:root {
    --bg: #F4F8FB;
    --bg-alt: #FFFFFF;
    --deep: #0B1E33;
    --deep-2: #1A4B5C;
    --side-bg: #E8F0F6;
    --text: #1A2A3A;
    --accent: #E88D5C;
    --accent-2: #2F8F9D;
    --muted: #7A8B9E;
    --line: #DCE4EC;
    --font-head: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Impact, system-ui, sans-serif;
    --font-body: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.72;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='620' height='620' viewBox='0 0 620 620'%3E%3Cdefs%3E%3CradialGradient id='b' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%232F8F9D' stop-opacity='0.16'/%3E%3Cstop offset='100%25' stop-color='%232F8F9D' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='310' cy='310' r='310' fill='url(%23b)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'%3E%3Cpath d='M14 0 L42 0 L56 24 L42 48 L14 48 L0 24 Z' fill='none' stroke='%232F8F9D' stroke-opacity='0.28' stroke-width='1'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'%3E%3Cpath d='M14 0 L42 0 L56 24 L42 48 L14 48 L0 24 Z' fill='none' stroke='%232F8F9D' stroke-opacity='0.28' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat, repeat-y, repeat-y;
    background-position: right -180px top -160px, left top, right top;
    background-attachment: fixed, scroll, scroll;
}

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

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

p {
    margin: 0 0 1.1em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 800;
    color: var(--text);
    line-height: 1.18;
    letter-spacing: 0.01em;
    margin: 0 0 0.7em;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.3rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.28rem; }

ul, ol {
    padding-left: 1.3em;
}

blockquote {
    margin: 1.6em 0;
    padding: 1.4rem 1.6rem;
    border-left: 3px solid var(--accent-2);
    background: #FFFFFF;
    color: var(--text);
}

blockquote p:last-child {
    margin-bottom: 0;
}

code, pre {
    font-family: "SFMono-Regular", Consolas, monospace;
    background: #EEF3F8;
}

pre {
    padding: 1rem 1.2rem;
    overflow-x: auto;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    border: 1px solid var(--line);
}

th, td {
    border: 1px solid var(--line);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

th {
    background: var(--side-bg);
    font-family: var(--font-head);
    letter-spacing: 0.03em;
}

/* Анимированное подчёркивание текстовых ссылок */
.content-area a:not(.btn):not(.page-numbers),
.entry-content a:not(.btn),
.widget a,
.breadcrumbs a {
    position: relative;
    display: inline;
    background-image: linear-gradient(var(--accent-2), var(--accent-2));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: background-size 0.28s ease;
}

.content-area a:not(.btn):not(.page-numbers):hover,
.entry-content a:not(.btn):hover,
.widget a:hover,
.breadcrumbs a:hover {
    background-size: 100% 1px;
}

/* =====================================================
   2. Контейнер и раскладки
   ===================================================== */

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

.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    justify-content: space-between;
    gap: 0 6%;
    align-items: start;
}

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

.site-main {
    padding: 2.6rem 0 4rem;
}

/* =====================================================
   3. Шапка
   ===================================================== */

.site-header {
    background: var(--deep);
    color: #FFFFFF;
    border-bottom: 3px solid var(--accent-2);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    padding: 1.3rem 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    text-decoration: none;
    color: #FFFFFF;
}

.brand-logo,
.brand-mark {
    display: block;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
}

.brand-logo {
    width: auto;
    max-height: 52px;
}

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

.site-title {
    font-family: var(--font-head);
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0;
    display: block;
    color: #FFFFFF;
}

.site-title a {
    color: #FFFFFF;
}

.site-desc {
    display: block;
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: #9FB6C9;
    line-height: 1.45;
    max-width: 46ch;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: transparent;
    color: #FFFFFF;
    border: 1px solid #33526E;
    border-radius: 2px;
    font-family: var(--font-head);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.site-nav {
    min-width: 0;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list a {
    display: inline-block;
    padding: 0.3rem 0;
    color: #DCE7F0;
    font-family: var(--font-head);
    font-size: 1.02rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-list a:hover,
.nav-list .current-menu-item > a {
    color: #FFFFFF;
    border-bottom-color: var(--accent);
}

/* =====================================================
   4. Хлебные крошки
   ===================================================== */

.breadcrumbs {
    font-size: 0.86rem;
    color: var(--muted);
    padding: 0.9rem 0 0;
    margin-bottom: 1.4rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.9rem;
}

.breadcrumbs a {
    color: var(--muted);
}

.breadcrumbs .sep {
    color: var(--accent-2);
    margin: 0 0.3rem;
}

/* =====================================================
   5. Кнопки
   ===================================================== */

.btn {
    display: inline-block;
    padding: 0.72rem 1.5rem;
    border-radius: 2px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #FFFFFF;
    font-family: var(--font-head);
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    background: transparent;
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    border-color: var(--deep);
    color: var(--deep);
}

.btn-ghost:hover {
    background: var(--deep);
    color: #FFFFFF;
}

.btn-light {
    background: transparent;
    border-color: #FFFFFF;
    color: #FFFFFF;
}

.btn-light:hover {
    background: #FFFFFF;
    color: var(--deep);
}

/* =====================================================
   6. Заголовки секций
   ===================================================== */

.section-head {
    text-align: left;
    margin-bottom: 1.8rem;
}

.section-head::before {
    content: "";
    display: block;
    width: 76px;
    height: 2px;
    background: var(--accent-2);
    margin-bottom: 0.9rem;
}

.section-head h2 {
    margin: 0 0 0.4rem;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    max-width: 68ch;
}

.section-head.on-dark h2,
.section-head.on-dark p {
    color: #FFFFFF;
}

.section-head.on-dark p {
    color: #B9CBDA;
}

/* =====================================================
   7. Карточки записей
   ===================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
    gap: 1.6rem;
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    transition: border-color 0.25s ease;
}

.card:hover {
    border-color: var(--accent-2);
}

.card-thumb-wrap {
    display: block;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.card-thumb-wrap a {
    display: block;
}

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

.card-thumb-fallback {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(135deg, var(--deep) 0%, var(--deep-2) 100%);
    position: relative;
}

.card-thumb-fallback::after {
    content: "";
    position: absolute;
    inset: 22% 26%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
    background-size: 22px 22px;
}

.card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
    transition: transform 0.25s ease;
}

.card:hover .card-body {
    transform: translateX(5px);
}

.card-title {
    font-size: 1.24rem;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}

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

.card:hover .card-title a {
    color: var(--deep-2);
}

.card-excerpt {
    color: #46586C;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

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

.card-excerpt p:last-child {
    margin-bottom: 0;
}

.card-foot {
    margin-top: auto;
}

.card-more {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-2);
    border-bottom: 1px solid transparent;
}

.card-more:hover {
    border-bottom-color: var(--accent-2);
}

.post-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.55rem;
    letter-spacing: 0.02em;
}

.post-meta a {
    color: var(--muted);
}

.post-meta .sep {
    margin: 0 0.25rem;
}

/* =====================================================
   8. Пагинация
   ===================================================== */

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 2.6rem 0 0;
}

.pager .page-numbers {
    display: inline-block;
    min-width: 42px;
    padding: 0.5rem 0.85rem;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: #FFFFFF;
    color: var(--text);
    font-family: var(--font-head);
    letter-spacing: 0.04em;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pager a.page-numbers:hover {
    border-color: var(--accent-2);
    color: var(--deep-2);
}

.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
}

.pager .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

/* =====================================================
   9. Записи и страницы
   ===================================================== */

.entry-header {
    margin-bottom: 1.4rem;
}

.entry-title {
    font-size: 2.6rem;
    margin: 0 0 0.5rem;
}

.entry-thumb {
    margin: 0 0 1.6rem;
    border: 1px solid var(--line);
}

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

.entry-content {
    background: #FFFFFF;
    border: 1px solid var(--line);
    padding: 1.9rem 2rem;
}

.entry-content h2,
.entry-content h3 {
    margin-top: 1.6em;
}

.entry-content img {
    display: block;
    height: auto;
}

.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.4em;
}

.entry-tags {
    margin-top: 1.6rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.post-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    font-family: var(--font-head);
    letter-spacing: 0.04em;
}

.archive-head {
    margin-bottom: 1.8rem;
}

.archive-head h1 {
    font-size: 2.6rem;
    margin-bottom: 0.3rem;
}

.archive-head p {
    color: var(--muted);
    margin: 0;
}

/* =====================================================
   10. Сайдбар и виджеты
   ===================================================== */

.sidebar {
    min-width: 0;
}

.sidebar .widget {
    background: var(--side-bg);
    border: 1px solid var(--line);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.4rem;
    color: var(--text);
}

.sidebar .widget-title {
    font-size: 1.1rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #C9D8E4;
    color: var(--deep);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li {
    color: var(--text);
}

.sidebar .widget a {
    color: var(--deep-2);
}

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

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

.sidebar .widget li {
    padding: 0.45rem 0 0.45rem 1.5rem;
    border-bottom: 1px solid #D5E1EA;
    position: relative;
    line-height: 1.45;
}

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

.sidebar .widget li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72rem;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='%232F8F9D' stroke-width='1.6'/%3E%3Cpath d='M12 4 L14.6 12 L12 20 L9.4 12 Z' fill='%23E88D5C'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.sidebar .widget .post-date,
.sidebar .widget .rss-date {
    display: block;
    font-size: 0.78rem;
    color: #5A7186;
}

.widget select,
.widget input[type="search"],
.widget input[type="text"] {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

/* =====================================================
   11. Форма поиска
   ===================================================== */

.search-form {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.search-label {
    flex: 1;
    min-width: 0;
}

.search-form input[type="search"] {
    width: 100%;
    min-width: 0;
    padding: 0.66rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: #FFFFFF;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.search-form input[type="search"]:focus {
    outline: 2px solid var(--accent-2);
    outline-offset: 1px;
}

.search-form button {
    flex: 0 0 auto;
}

/* =====================================================
   12. Главная — общие секции
   ===================================================== */

.front-section {
    padding: 3.2rem 2.2rem;
    margin-bottom: 2.4rem;
    border-radius: 0;
}

.front-section.plain {
    padding-left: 0;
    padding-right: 0;
}

.front-section.alt {
    background-color: var(--bg-alt);
    background-image: radial-gradient(circle, rgba(122, 139, 158, 0.16) 1px, transparent 1px);
    background-size: 13px 13px;
    border: 1px solid var(--line);
}

.wave-divider {
    height: 18px;
    margin: 0 auto 2.4rem;
    width: 78%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18' viewBox='0 0 120 18'%3E%3Cpath d='M0 9 Q15 1 30 9 T60 9 T90 9 T120 9' fill='none' stroke='%237A8B9E' stroke-width='1.4'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
}

.section-rule {
    height: 1px;
    background: var(--line);
    width: 88%;
    margin: 0 auto 2.4rem;
}

/* --- Блок 1: hero --- */

.fs-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: center;
    padding: 3.6rem 2.6rem 3.2rem;
    background: linear-gradient(120deg, var(--deep) 0%, var(--deep-2) 100%);
    border-bottom: 3px solid var(--accent-2);
    color: #FFFFFF;
    margin-bottom: 2.6rem;
}

.fs-hero h1 {
    color: #FFFFFF;
    margin: 0 0 1rem;
}

.fs-hero .hero-lead {
    color: #C4D6E4;
    font-size: 1.08rem;
    max-width: 52ch;
    margin-bottom: 1.7rem;
}

.fs-hero .hero-kicker {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.hero-visual {
    min-width: 0;
}

.hero-visual img {
    display: block;
    width: 100%;
    height: auto;
}

/* --- Блок 2: таймлайн --- */

.timeline {
    position: relative;
    margin: 0;
    padding: 0.4rem 0;
    list-style: none;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--accent-2);
}

.timeline li {
    position: relative;
    width: 46%;
    min-width: 0;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1.5rem;
    background: #FFFFFF;
    border: 1px solid var(--line);
}

.timeline li:nth-child(odd) {
    margin-right: auto;
}

.timeline li:nth-child(even) {
    margin-left: auto;
}

.timeline li::after {
    content: "";
    position: absolute;
    top: 1.5rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px var(--accent);
}

.timeline li:nth-child(odd)::after {
    right: -8.9%;
}

.timeline li:nth-child(even)::after {
    left: -8.9%;
}

.timeline .stage {
    display: block;
    font-family: var(--font-head);
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.timeline h3 {
    font-size: 1.18rem;
    margin: 0 0 0.4rem;
}

.timeline p {
    margin: 0;
    font-size: 0.94rem;
    color: #46586C;
}

/* --- Блок 3: статистика --- */

.fs-stats {
    background: linear-gradient(120deg, var(--deep) 0%, var(--deep-2) 100%);
    padding: 3rem 2.2rem;
    margin-bottom: 2.4rem;
    color: #FFFFFF;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 1.4rem;
    margin-top: 1.8rem;
}

.stat-card {
    min-width: 0;
    background: #FFFFFF;
    padding: 1.5rem 1.2rem;
    text-align: center;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    position: relative;
}

.stat-card .num {
    display: block;
    font-family: var(--font-head);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-2);
}

.stat-card .cap {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.35;
}

.stats-note {
    margin: 1.8rem 0 0;
    padding: 1rem 1.2rem;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    color: #C4D6E4;
    font-size: 0.92rem;
    position: relative;
}

.stats-note::before,
.stats-note::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent);
}

.stats-note::before {
    top: -6px;
    left: -6px;
}

.stats-note::after {
    bottom: -6px;
    right: -6px;
}

/* --- Блок 4: рубрикатор --- */

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.4rem;
}

.topic-tile {
    display: block;
    min-width: 0;
    padding: 1.8rem 1.5rem;
    background: #FFFFFF;
    border: 1px solid var(--line);
    color: var(--text);
    transition: background 0.24s ease, border-color 0.24s ease, transform 0.24s ease;
}

.topic-tile svg {
    display: block;
    width: 52px;
    height: 52px;
    margin-bottom: 1rem;
    stroke: var(--accent-2);
    fill: none;
    stroke-width: 2;
    transition: stroke 0.24s ease;
}

.topic-tile h3 {
    margin: 0 0 0.4rem;
    font-size: 1.24rem;
}

.topic-tile p {
    margin: 0;
    font-size: 0.93rem;
    color: #46586C;
}

.topic-tile:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.topic-tile:hover h3,
.topic-tile:hover p {
    color: #FFFFFF;
}

.topic-tile:hover svg {
    stroke: #FFFFFF;
}

/* --- Последние записи на главной --- */

.fs-latest {
    padding: 0.6rem 0 1.6rem;
    margin-bottom: 2.4rem;
}

.latest-foot {
    margin-top: 1.8rem;
}

/* =====================================================
   13. Комментарии
   ===================================================== */

.comments-area {
    margin-top: 2.4rem;
    background: #FFFFFF;
    border: 1px solid var(--line);
    padding: 1.7rem 1.9rem;
}

.comments-title,
.comment-reply-title {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-bottom: 1.1rem;
}

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

.comment-list ol.children {
    list-style: none;
    padding-left: 1.4rem;
}

.comment-body {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.comment-meta {
    font-size: 0.84rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.comment-form label {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
    color: var(--muted);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: #FFFFFF;
    color: var(--text);
}

.comment-form p {
    margin-bottom: 0.9rem;
}

.comment-form .submit {
    display: inline-block;
    padding: 0.72rem 1.5rem;
    border-radius: 2px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #FFFFFF;
    font-family: var(--font-head);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.comment-form .submit:hover {
    background: transparent;
    color: var(--accent);
    transform: translateY(-2px);
}

/* =====================================================
   14. 404
   ===================================================== */

.error-box {
    background: #FFFFFF;
    border: 1px solid var(--line);
    padding: 2.4rem 2.2rem;
    text-align: left;
}

.error-code {
    font-family: var(--font-head);
    font-size: 5rem;
    line-height: 1;
    color: var(--accent-2);
    margin: 0 0 0.6rem;
}

.error-box .search-form {
    max-width: 480px;
    margin: 1.4rem 0;
}

/* =====================================================
   15. Подвал
   ===================================================== */

.site-footer {
    background: var(--deep);
    color: #C4D6E4;
    border-top: 3px solid var(--accent-2);
    padding: 2.8rem 0 1.6rem;
    margin-top: 2rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 2rem;
}

.footer-col {
    min-width: 0;
}

.site-footer .widget {
    color: #C4D6E4;
    margin-bottom: 1.4rem;
}

.site-footer .widget p,
.site-footer .widget li,
.site-footer .widget td {
    color: #C4D6E4;
}

.site-footer .widget-title {
    font-size: 1.05rem;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.9rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid #24405A;
}

.site-footer .widget a {
    color: #E4EEF6;
}

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

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

.site-footer .widget li {
    padding: 0.38rem 0 0.38rem 1.4rem;
    position: relative;
    line-height: 1.45;
}

.site-footer .widget li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.68rem;
    width: 15px;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='%232F8F9D' stroke-width='1.8'/%3E%3Cpath d='M12 4 L14.6 12 L12 20 L9.4 12 Z' fill='%23E88D5C'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.site-footer .post-date {
    color: #8FA8BC;
    font-size: 0.8rem;
}

.footer-contacts a {
    color: #E4EEF6;
}

.copyright {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #24405A;
    font-size: 0.86rem;
    color: #8FA8BC;
}

/* =====================================================
   16. Cookie-баннер
   ===================================================== */

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.6rem;
    background: var(--deep);
    border-top: 2px solid var(--accent-2);
    color: #DCE7F0;
    font-size: 0.9rem;
}

.cookie-banner p {
    margin: 0;
    max-width: 78ch;
}

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

/* =====================================================
   17. Адаптив
   ===================================================== */

@media (max-width: 960px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.2rem;
    }

    .layout-single {
        width: 100%;
    }

    .fs-hero {
        grid-template-columns: minmax(0, 1fr);
        padding: 2.6rem 1.8rem;
    }

    .stat-card .num {
        font-size: 3.2rem;
    }
}

@media (max-width: 760px) {
    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        flex: 1 0 100%;
        display: none;
    }

    .site-nav.is-open {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        padding-top: 0.6rem;
        border-top: 1px solid #24405A;
    }

    .nav-list li {
        border-bottom: 1px solid #16334F;
    }

    .nav-list a {
        display: block;
        padding: 0.7rem 0;
    }
}

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

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

    .entry-title { font-size: 1.9rem; }

    .site-main {
        padding: 1.8rem 0 2.6rem;
    }

    .front-section {
        padding: 2rem 1.3rem;
    }

    .front-section.plain {
        padding-left: 0;
        padding-right: 0;
    }

    .fs-hero {
        padding: 2.2rem 1.3rem;
    }

    .fs-stats {
        padding: 2rem 1.3rem;
    }

    .entry-content {
        padding: 1.3rem 1.2rem;
    }

    .comments-area {
        padding: 1.3rem 1.2rem;
    }

    .error-box {
        padding: 1.6rem 1.3rem;
    }

    .cookie-banner {
        padding: 0.9rem 1.1rem;
    }

    .timeline::before {
        left: 7px;
    }

    .timeline li {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 1.6rem;
    }

    .timeline li:nth-child(odd)::after,
    .timeline li:nth-child(even)::after {
        left: -7px;
        right: auto;
    }

    .stat-card .num {
        font-size: 2.8rem;
    }

    .wave-divider,
    .section-rule {
        width: 100%;
    }
}
