/*
Theme Name: dds_islamshariat.ru NEW
Theme URI: https://islamshariat.ru/
Author: Алексей Миронов
Author URI: https://islamshariat.ru/
Description: Просветительский проект о том, как религия отражается в истории, искусстве и облике городов. Сайт рассказывает о храмах, монастырях, мечетях, святынях и памятниках культуры как о живой части исторической памяти и наследия России.
Version: 1.1.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: islamshariat-new
*/

/* =========================================================
   1. БАЗОВЫЕ ПЕРЕМЕННЫЕ И СБРОС
   ========================================================= */

:root {
    --bg-page: #F9F6F0;
    --bg-soft: #F2EDE3;
    --bg-card: #FFFCF6;
    --bg-footer: #1F1B16;
    --bg-footer-pattern: #221E18;
    --text-main: #2C2A28;
    --text-muted: #6B6660;
    --text-on-dark: #E8DFC9;
    --text-on-dark-muted: #A8A091;
    --accent: #A53F2B;
    --accent-dark: #872E1E;
    --gold: #C29A4B;
    --gold-soft: #D9B879;
    --indigo: #2C3E6B;
    --border-soft: #E2DCD3;
    --border-strong: #C9C0B2;
    --shadow-soft: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-hover: 0 6px 18px rgba(60,40,20,0.10);
    --radius: 6px;
    --serif: 'Literata', 'Spectral', 'PT Serif', Georgia, serif;
    --sans: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
    animation: pageFadeIn 0.45s ease;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--indigo);
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
    margin: 0 0 0.6em;
}

h1 { font-size: 2.2em; }
h2 { font-size: 1.7em; }
h3 { font-size: 1.35em; }
h4 { font-size: 1.15em; }

p {
    margin: 0 0 1em;
}

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

ul, ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

blockquote {
    margin: 1.2em 0;
    padding: 1em 1.4em;
    border-left: 3px solid var(--gold);
    background: var(--bg-soft);
    font-family: var(--serif);
    font-style: italic;
    color: var(--text-muted);
}

code, pre {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.92em;
    background: var(--bg-soft);
    border-radius: 4px;
}

code {
    padding: 2px 6px;
}

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

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

th, td {
    padding: 0.7em 1em;
    border: 1px solid var(--border-soft);
    text-align: left;
}

th {
    background: var(--bg-soft);
    font-family: var(--serif);
    font-weight: 600;
}

hr {
    border: 0;
    border-top: 1px dashed var(--border-strong);
    margin: 2em 0;
}

/* =========================================================
   2. КОНТЕЙНЕР И LAYOUT
   ========================================================= */

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

.site-main {
    padding: 32px 0 56px;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 40px;
    align-items: flex-start;
}

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

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

@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
    }
    .layout-no-sidebar {
        width: 100%;
    }
}

/* =========================================================
   3. ШАПКА
   ========================================================= */

.site-header {
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-soft);
    position: relative;
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--accent) 50%, var(--gold) 70%, transparent);
    opacity: 0.55;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-main);
    flex: 1 1 320px;
    min-width: 0;
}

.brand:hover {
    text-decoration: none;
    color: var(--text-main);
}

.brand-logo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: block;
}

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

.brand-name {
    font-family: var(--serif);
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-tag {
    font-size: 0.82em;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Кнопка "Сакральный свет" */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.88em;
    font-family: var(--serif);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.theme-toggle:hover {
    background: var(--gold);
    color: var(--bg-page);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

/* Поиск-арка */
.header-search-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-strong);
    background: transparent;
    cursor: pointer;
    border-radius: 40px 40px 6px 6px;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}

.header-search-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.header-search-toggle svg {
    width: 18px;
    height: 18px;
}

.header-search-panel[hidden] {
    display: none !important;
}

.header-search-panel {
    width: 100%;
    padding: 14px 0 18px;
    border-top: 1px dashed var(--border-strong);
    display: block;
}

/* =========================================================
   4. НАВИГАЦИЯ
   ========================================================= */

.main-nav {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border-soft);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.menu-toggle[hidden] {
    display: none !important;
}

.menu-toggle {
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 8px 14px;
    cursor: pointer;
    font-family: var(--sans);
    color: var(--text-main);
    font-size: 0.95em;
}

.menu-toggle[aria-expanded="true"] {
    background: var(--accent);
    color: var(--bg-page);
    border-color: var(--accent);
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.primary-menu a {
    display: block;
    padding: 14px 18px;
    color: var(--text-main);
    font-family: var(--serif);
    font-size: 1.02em;
    border-bottom: 2px solid transparent;
    transition: border-color 0.25s, color 0.25s;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
    color: var(--accent);
    border-bottom-color: var(--gold);
    text-decoration: none;
}

@media (max-width: 760px) {
    .menu-toggle {
        display: inline-block;
    }
    .primary-menu[hidden] {
        display: none !important;
    }
    .primary-menu {
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
    }
    .primary-menu a {
        padding: 10px 4px;
    }
    .nav-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 0;
    }
}

/* =========================================================
   5. ХЛЕБНЫЕ КРОШКИ
   ========================================================= */

.breadcrumbs {
    font-size: 0.88em;
    color: var(--text-muted);
    padding: 16px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-family: var(--serif);
}

.breadcrumbs a {
    color: var(--text-muted);
    border-bottom: 1px dotted var(--border-strong);
}

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

.breadcrumbs .sep {
    color: var(--gold);
    font-size: 1.1em;
}

/* =========================================================
   6. КАРТОЧКИ ЗАПИСЕЙ
   ========================================================= */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin: 24px 0;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

.card-thumb-wrap {
    overflow: hidden;
    background: var(--bg-soft);
}

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

.card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.card:hover .card-thumb-wrap img {
    transform: scale(1.04);
}

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

.card-meta {
    font-size: 0.82em;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.card-meta a {
    color: var(--gold);
}

.card-meta .cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    display: inline-block;
}

.card-title {
    font-size: 1.18em;
    margin: 0 0 10px;
    line-height: 1.3;
}

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

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

.card-excerpt {
    font-size: 0.95em;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 14px;
}

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

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

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

/* Горизонтальная карточка (для блога) */
.card-horizontal {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.card-horizontal .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
}

.card-horizontal .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.card-horizontal .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-horizontal .card-body {
    flex: 1;
    min-width: 0;
}

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

/* =========================================================
   7. КНОПКИ
   ========================================================= */

.btn,
button.btn,
input[type="submit"].btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--bg-page);
    box-shadow: var(--shadow-soft);
    transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.15s;
}

.btn:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--bg-page);
    box-shadow: 0 4px 12px rgba(165,63,43,0.18), inset 0 0 0 1px rgba(255,255,255,0.06);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--gold-soft);
}

.btn-small {
    padding: 8px 18px;
    font-size: 0.88em;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* =========================================================
   8. СТРАНИЦА БЛОГА И АРХИВЫ
   ========================================================= */

.page-title-block {
    margin: 6px 0 28px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-strong);
}

.page-title-block h1 {
    margin: 0;
}

.archive-description {
    color: var(--text-muted);
    margin-top: 8px;
}

.posts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* =========================================================
   9. ОДИНОЧНАЯ ЗАПИСЬ И СТРАНИЦА
   ========================================================= */

.entry {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 32px 36px;
}

.entry-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px dashed var(--border-strong);
}

.entry-title {
    font-size: 2em;
    margin: 0 0 12px;
}

.entry-meta {
    font-size: 0.9em;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.entry-meta a {
    color: var(--gold);
}

.entry-thumbnail {
    margin: 0 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
}

.entry-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content img {
    border-radius: var(--radius);
}

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

.entry-tags {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px dashed var(--border-strong);
    font-size: 0.9em;
    color: var(--text-muted);
}

.entry-tags a {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 4px 4px 0;
    background: var(--bg-soft);
    border-radius: 12px;
    color: var(--accent);
    font-size: 0.92em;
}

.entry-tags a:hover {
    background: var(--accent);
    color: var(--bg-page);
    text-decoration: none;
}

@media (max-width: 600px) {
    .entry {
        padding: 22px 18px;
    }
    .entry-title {
        font-size: 1.5em;
    }
}

/* =========================================================
   10. СТРАНИЦА БЛОГА
   ========================================================= */

.blog-intro {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--gold);
    padding: 22px 28px;
    border-radius: var(--radius);
    margin-bottom: 28px;
    font-family: var(--serif);
    color: var(--text-muted);
    font-size: 1.05em;
    line-height: 1.55;
}

.blog-intro p {
    margin: 0;
}

/* =========================================================
   11. ПАГИНАЦИЯ
   ========================================================= */

.pagination {
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-strong);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    min-width: 38px;
    padding: 8px 12px;
    text-align: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: var(--serif);
    background: var(--bg-card);
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--accent);
    color: var(--bg-page);
    border-color: var(--accent);
    text-decoration: none;
}

.pagination .current {
    background: var(--accent);
    color: var(--bg-page);
    border-color: var(--accent);
    font-weight: 600;
}

.pagination .dots {
    border-color: transparent;
    background: transparent;
}

/* =========================================================
   12. САЙДБАР И ВИДЖЕТЫ
   ========================================================= */

.sidebar {
    min-width: 0;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
}

/* Контраст в сайдбаре: светлый фон → тёмный текст */
.sidebar .widget,
.sidebar .widget * {
    color: var(--text-main);
}

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

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

.widget-title,
.sidebar .widget h2,
.sidebar .widget h3 {
    font-family: var(--serif);
    font-size: 1.08em;
    color: var(--text-main);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gold);
    position: relative;
}

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

.widget li {
    padding: 7px 0;
    border-bottom: 1px dotted var(--border-soft);
    font-size: 0.95em;
}

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

.widget li a {
    text-decoration: none;
}

/* «Последние записи» — даты */
.widget_recent_entries .post-date {
    display: block;
    font-size: 0.82em;
    color: var(--text-muted);
    font-family: var(--serif);
    margin-top: 2px;
}

.widget select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-page);
    color: var(--text-main);
    font-family: var(--sans);
}

/* =========================================================
   13. ГЛАВНАЯ СТРАНИЦА
   ========================================================= */

.front-section {
    margin: 56px 0;
}

.front-section.first {
    margin-top: 32px;
}

.section-heading {
    text-align: center;
    margin-bottom: 36px;
}

.section-heading h2 {
    font-size: 1.85em;
    margin: 0 0 8px;
    position: relative;
    display: inline-block;
    padding: 0 50px;
}

.section-heading h2::before,
.section-heading h2::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 36px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.section-heading h2::before {
    left: 0;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.section-heading h2::after {
    right: 0;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.section-heading p {
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--serif);
    font-size: 1.05em;
}

/* Витрина наследия — конфессии России */
.heritage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.heritage-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform 0.3s, box-shadow 0.3s;
    color: var(--bg-page);
    isolation: isolate;
}

.heritage-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.heritage-art {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.heritage-art svg {
    width: 100%;
    height: 100%;
    display: block;
}

.heritage-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,15,10,0.85) 0%, rgba(20,15,10,0.35) 55%, rgba(20,15,10,0.05) 100%);
    z-index: -1;
}

.heritage-body {
    padding: 24px 22px;
    color: var(--bg-page);
}

.heritage-tradition {
    font-family: var(--serif);
    font-size: 1.4em;
    margin: 0 0 6px;
    color: var(--gold-soft);
}

.heritage-desc {
    font-size: 0.92em;
    line-height: 1.5;
    color: rgba(232,223,201,0.92);
    margin: 0;
}

/* Категории */
.categories-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.cat-chip {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--serif);
    font-size: 0.95em;
    transition: all 0.25s;
}

.cat-chip:hover {
    background: var(--accent);
    color: var(--bg-page);
    border-color: var(--accent);
    text-decoration: none;
}

.cat-chip .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    background: var(--gold);
}

/* Лента времени (декор. секция) */
.timeline-section {
    background: var(--bg-soft);
    padding: 50px 0;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    margin: 56px 0;
}

.timeline {
    position: relative;
    margin: 32px 0 0;
    padding-left: 28px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gold);
    opacity: 0.5;
}

.timeline-item {
    position: relative;
    padding: 0 0 22px 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-page);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(165,63,43,0.08);
}

.timeline-date {
    font-family: var(--serif);
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-title {
    font-family: var(--serif);
    font-size: 1.1em;
    margin: 0 0 4px;
}

.timeline-text {
    color: var(--text-muted);
    font-size: 0.95em;
    margin: 0;
}

/* Слайдер карты */
.map-block {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
}

.map-illustration {
    max-width: 720px;
    margin: 0 auto;
}

.map-illustration svg {
    width: 100%;
    height: auto;
    display: block;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
    font-size: 0.92em;
    color: var(--text-muted);
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.map-legend .marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-page);
    box-shadow: 0 0 0 1px var(--accent);
}

/* =========================================================
   14. КОММЕНТАРИИ
   ========================================================= */

.comments-area {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px dashed var(--border-strong);
}

.comments-title {
    font-family: var(--serif);
    font-size: 1.4em;
    margin: 0 0 18px;
}

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

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

.comment-body {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.comment-author {
    font-family: var(--serif);
    font-weight: 600;
    margin-bottom: 4px;
}

.comment-meta {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

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

.comment-form label {
    display: block;
    font-family: var(--serif);
    font-size: 0.92em;
    margin-bottom: 4px;
    color: var(--text-main);
}

.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(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--sans);
    font-size: 0.96em;
    margin-bottom: 14px;
}

.comment-form textarea {
    min-height: 110px;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(165,63,43,0.08);
}

.comment-form .form-submit {
    margin-top: 4px;
}

.comment-form input[type="submit"] {
    background: var(--accent);
    color: var(--bg-page);
    border: 1px solid var(--accent);
    padding: 12px 28px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.95em;
    transition: background 0.25s;
}

.comment-form input[type="submit"]:hover {
    background: var(--accent-dark);
}

/* =========================================================
   15. ПОИСК
   ========================================================= */

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--sans);
    font-size: 0.95em;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(165,63,43,0.08);
}

.search-form input[type="submit"] {
    padding: 10px 20px;
    background: var(--accent);
    color: var(--bg-page);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--sans);
    transition: background 0.25s;
}

.search-form input[type="submit"]:hover {
    background: var(--accent-dark);
}

/* =========================================================
   16. ПОДВАЛ
   ========================================================= */

.site-footer {
    background: var(--bg-footer);
    color: var(--text-on-dark);
    margin-top: 64px;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(194,154,75,0.06) 0, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(165,63,43,0.05) 0, transparent 45%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23C29A4B' stroke-opacity='0.06' stroke-width='1'><path d='M40 8 Q50 8 50 28 L50 52 L30 52 L30 28 Q30 8 40 8 Z'/><circle cx='40' cy='8' r='3'/><path d='M10 60 L70 60'/><path d='M20 70 Q40 65 60 70'/></g></svg>");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

.footer-main {
    position: relative;
    z-index: 1;
    padding: 50px 0 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

@media (max-width: 880px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

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

/* Контраст в футере: тёмный фон → светлый текст */
.footer-col,
.footer-col * {
    color: var(--text-on-dark);
}

.footer-col .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
}

.footer-col .widget-title,
.footer-col .widget h2,
.footer-col .widget h3 {
    color: var(--gold-soft);
    border-bottom-color: rgba(194,154,75,0.35);
}

.footer-col a {
    color: var(--text-on-dark);
    border-bottom: 1px dotted rgba(232,223,201,0.25);
}

.footer-col a:hover {
    color: var(--gold-soft);
    border-bottom-color: var(--gold-soft);
    text-decoration: none;
}

.footer-col li {
    border-bottom-color: rgba(232,223,201,0.10);
}

.footer-col .post-date,
.footer-col .widget_recent_entries .post-date {
    color: var(--text-on-dark-muted);
}

.footer-col select {
    background: rgba(255,255,255,0.06);
    color: var(--text-on-dark);
    border-color: rgba(232,223,201,0.2);
}

.footer-bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(232,223,201,0.12);
    padding: 18px 0 22px;
    text-align: center;
    font-size: 0.88em;
    color: var(--text-on-dark-muted);
    font-family: var(--serif);
}

/* =========================================================
   17. COOKIE-БАННЕР
   ========================================================= */

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

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    background: var(--bg-footer);
    color: var(--text-on-dark);
    padding: 16px 22px;
    border-radius: var(--radius);
    border: 1px solid rgba(194,154,75,0.3);
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
    font-size: 0.92em;
    line-height: 1.5;
}

.cookie-banner p {
    flex: 1 1 280px;
    margin: 0;
    color: var(--text-on-dark);
}

.cookie-banner a {
    color: var(--gold-soft);
    border-bottom: 1px dotted var(--gold-soft);
}

.cookie-banner button {
    background: var(--gold);
    color: var(--bg-footer);
    border: 1px solid var(--gold);
    padding: 9px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.92em;
    font-weight: 500;
    transition: background 0.25s;
}

.cookie-banner button:hover {
    background: var(--gold-soft);
}

/* =========================================================
   18. 404
   ========================================================= */

.error-404 {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.error-404 h1 {
    font-size: 4em;
    margin: 0 0 8px;
    color: var(--accent);
}

.error-404 p {
    color: var(--text-muted);
    margin: 0 auto 24px;
    max-width: 500px;
}

.error-404 .search-form {
    max-width: 480px;
    margin: 0 auto 18px;
}

/* =========================================================
   19. РЕЖИМ "САКРАЛЬНЫЙ СВЕТ"
   ========================================================= */

body.sacred-light {
    --bg-page: #181F2C;
    --bg-soft: #1F273A;
    --bg-card: #232C42;
    --text-main: #E2D9C4;
    --text-muted: #A89F88;
    --border-soft: #2E3850;
    --border-strong: #455066;
    --accent: #D9B879;
    --accent-dark: #C29A4B;
    --gold: #E8C788;
    --indigo: #A4B4D8;
}

body.sacred-light .site-header {
    background: #1A2030;
}

body.sacred-light .main-nav {
    background: #1F273A;
}

body.sacred-light img {
    filter: brightness(0.92) drop-shadow(0 0 12px rgba(217,184,121,0.15));
}

body.sacred-light .heritage-card::after {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0.05) 100%);
}

/* =========================================================
   20. УТИЛИТЫ
   ========================================================= */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.alignleft { float: left; margin: 0 1.4em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

@media (max-width: 600px) {
    .alignleft, .alignright {
        float: none;
        margin: 0 0 1em;
    }
    body { font-size: 16px; }
    h1 { font-size: 1.7em; }
    h2 { font-size: 1.4em; }
    .section-heading h2 {
        padding: 0 30px;
        font-size: 1.45em;
    }
    .section-heading h2::before,
    .section-heading h2::after {
        width: 22px;
    }
}
