/*
Theme Name: Hrams NN Classic
Description: Классическая PHP-тема для каталога храмов.
Version: 2.0 (Оптимизированная)
*/

/* ==========================================================================
   1. БАЗОВЫЕ НАСТРОЙКИ И ПЕРЕМЕННЫЕ
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Oswald:wght@500;700&display=swap&subset=cyrillic');

:root {
    --color-red: #CC0000;
    --color-cream: #F4F1EA;
    --color-dark: #1A1A1A;
    --font-head: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--color-cream);
    color: var(--color-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    font-size: 16px;
}

/* Единый контейнер для выравнивания всего сайта */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Единый стиль заголовков секций */
.section-title {
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 2rem;
    margin-bottom: 40px;
    border-bottom: 3px solid var(--color-red);
    display: inline-block;
    padding-bottom: 10px;
}

/* ==========================================================================
   2. ШАПКА И ПОДВАЛ
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-dark);
    color: var(--color-cream);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.site-logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-cream);
    letter-spacing: 0.05em;
}
.site-logo span { color: var(--color-red); }

.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a {
    color: var(--color-cream);
    text-decoration: none;
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}
.main-nav a:hover { color: var(--color-red); }

.site-footer {
    background-color: var(--color-dark);
    color: var(--color-cream);
    padding: 30px 0;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    font-size: 0.9rem;
}

/* Бургер-меню */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-cream);
    transition: all 0.3s ease;
}
.burger-menu.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-menu.active span:nth-child(2) { opacity: 0; }
.burger-menu.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ==========================================================================
   3. КОМПОНЕНТЫ (Кнопки, Бейджи, Карточки)
   ========================================================================== */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-family: var(--font-head);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 15px;
    font-weight: 700;
}
.status-badge.open { background-color: #28a745; color: #fff; }
.status-badge.closed { background-color: #dc3545; color: #fff; }

.front-hero-btn, .route-btn, .submit-btn, .tour-btn, .suggest-btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
}

/* ==========================================================================
   4. СТРАНИЦА: ГЛАВНАЯ (front-page)
   ========================================================================== */
.front-hero {
    background-color: var(--color-red);
    color: var(--color-cream);
    padding: 120px 0;
    text-align: center;
}
.front-hero h1 {
    font-family: var(--font-head);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-transform: uppercase;
    line-height: 1.1;
    margin: 0 0 30px 0;
}
.front-hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px auto;
    opacity: 0.9;
}
.front-hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.front-hero-btn.primary { background-color: var(--color-cream); color: var(--color-red); }
.front-hero-btn.secondary { background: transparent; color: var(--color-cream); border: 2px solid var(--color-cream); }
.front-hero-btn:hover { transform: translateY(-2px); }
.front-hero-btn.secondary:hover { background: var(--color-cream); color: var(--color-red); }

.front-stats { padding: 60px 0; background: var(--color-dark); color: var(--color-cream); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}
.stat-number { font-family: var(--font-head); font-size: 3rem; font-weight: 700; color: var(--color-red); margin-bottom: 10px; }
.stat-label { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.9; }

.front-featured, .front-latest, .front-districts, .front-map-preview, .front-about { padding: 80px 0; }
.front-featured, .front-map-preview { background: #fff; }
.front-districts, .front-about { background: var(--color-cream); }
.front-about { color: var(--color-cream); background: var(--color-dark); }

.front-section-title {
    font-family: var(--font-head);
    text-transform: uppercase;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 20px;
}
.front-section-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-top: -10px;
    margin-bottom: 50px;
}
.front-view-all-btn {
    display: inline-block;
    font-family: var(--font-head);
    text-transform: uppercase;
    color: var(--color-red);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-red);
    padding-bottom: 5px;
    margin-top: 40px;
}

.districts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.district-card {
    display: block; background: #fff; padding: 25px; border-radius: 4px;
    border-left: 4px solid var(--color-red); text-decoration: none; color: var(--color-dark);
    transition: transform 0.2s, box-shadow 0.2s;
}
.district-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.district-name { font-family: var(--font-head); text-transform: uppercase; font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.district-count { font-size: 0.9rem; color: #666; }

.map-preview-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.map-preview-text h2 { font-family: var(--font-head); text-transform: uppercase; font-size: 2.5rem; margin-bottom: 20px; line-height: 1.2; }
.map-preview-image img { width: 100%; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }

.about-content { max-width: 800px; margin: 0 auto; text-align: center; }
.about-content h2 { font-family: var(--font-head); text-transform: uppercase; font-size: 2.5rem; margin-bottom: 30px; }
.about-buttons { display: flex; gap: 20px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }

/* ==========================================================================
   5. СТРАНИЦА: АРХИВ ХРАМОВ (archive-hram)
   ========================================================================== */
.archive-hero { background-color: var(--color-dark); color: var(--color-cream); padding: 80px 0; text-align: center; }
.archive-hero h1 { font-family: var(--font-head); text-transform: uppercase; font-size: 3rem; margin: 0 0 10px 0; }
.hram-list { padding: 60px 0; }

.hram-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.hram-card {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 4px; overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hram-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.hram-card-img img { width: 100%; height: 220px; object-fit: cover; display: block; }
.featured-card .hram-card-img img { height: 280px; }

.hram-card-body { padding: 20px; }
.hram-card-body h3 { font-family: var(--font-head); text-transform: uppercase; font-size: 1.2rem; margin: 0 0 10px 0; line-height: 1.3; }
.hram-card-body h3 a { color: var(--color-dark); text-decoration: none; }
.hram-card-body h3 a:hover { color: var(--color-red); }
.hram-card-date { font-family: var(--font-head); color: var(--color-red); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.05em; margin-bottom: 10px; }
.hram-card-desc { font-size: 0.95rem; color: #555; margin-bottom: 15px; }
.hram-card-link { font-family: var(--font-head); text-transform: uppercase; font-size: 0.85rem; color: var(--color-red); text-decoration: none; letter-spacing: 0.05em; }
.hram-card-link:hover { text-decoration: underline; }

/* Фильтр по районам */
.district-filter {
    display: flex; align-items: center; gap: 15px; margin-bottom: 40px; padding: 20px;
    background: #fff; border-left: 4px solid var(--color-red); border-radius: 0 4px 4px 0; flex-wrap: wrap;
}
.filter-select {
    flex: 1; min-width: 200px; padding: 10px 15px; font-family: var(--font-body); font-size: 1rem;
    border: 2px solid #d0d0d0; border-radius: 4px; background: var(--color-cream); cursor: pointer;
}
.filter-select:focus, .filter-select:hover { outline: none; border-color: var(--color-red); }

/* ==========================================================================
   6. СТРАНИЦА: ОДИН ХРАМ (single-hram)
   ========================================================================== */
/* Хлебные крошки */
.breadcrumbs { max-width: 1140px; margin: 20px auto 0; padding: 0 20px; font-size: 0.9rem; color: #666; }
.breadcrumbs a { color: var(--color-red); text-decoration: none; transition: opacity 0.2s; }
.breadcrumbs a:hover { opacity: 0.7; text-decoration: underline; }
.breadcrumbs .bc-sep { margin: 0 8px; color: #ccc; }
.breadcrumbs .bc-current { color: #333; font-weight: 500; }

/* Hero */
.hram-hero { background-color: var(--color-dark); color: var(--color-cream); padding: 80px 0; }
.hram-hero h1 { font-family: var(--font-head); font-size: clamp(2.5rem, 5vw, 4rem); text-transform: uppercase; line-height: 1.1; margin: 0 0 20px 0; }
.hram-hero .subtitle { font-size: 1.2rem; font-style: italic; opacity: 0.8; margin-bottom: 30px; }
.hram-meta { display: flex; gap: 30px; font-family: var(--font-head); text-transform: uppercase; font-size: 0.9rem; }
.hram-meta span { color: var(--color-red); font-weight: 700; }

/* Паспорт */
.hram-passport { padding: 60px 0; }
.passport-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.passport-item { border: 1px solid #d0d0d0; padding: 24px; border-radius: 4px; background: #fff; }
.passport-item .label { font-family: var(--font-head); text-transform: uppercase; font-size: 0.8rem; color: #888; margin-bottom: 8px; display: block; }
.passport-item .value { font-size: 1.1rem; font-weight: 500; margin: 0; }

/* Основной текст (Типографика) */
.hram-content-wrapper {
    padding: 40px 0 80px 0;
}
.hram-content {
    max-width: 800px; /* Оптимальная ширина для чтения */
    margin: 0 auto;
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    color: #2a2a2a;
}
.hram-content h2 { font-family: var(--font-head); text-transform: uppercase; font-size: 1.8rem; margin-top: 50px; margin-bottom: 25px; padding-bottom: 10px; border-bottom: 2px solid var(--color-red); }
.hram-content h3 { font-family: var(--font-head); font-size: 1.4rem; margin-top: 35px; margin-bottom: 15px; }
.hram-content p { margin-bottom: 1.5em; }
.hram-content h2 + p::first-letter, .hram-content h3 + p::first-letter {
    font-family: var(--font-head); font-size: 3.5rem; float: left; line-height: 0.8; padding-right: 10px; padding-top: 5px; color: var(--color-red);
}
.hram-content blockquote { border-left: 4px solid var(--color-red); background: #fff; margin: 35px 0; padding: 25px 30px; font-style: italic; font-size: 1.15rem; color: #444; border-radius: 0 4px 4px 0; }
.hram-content ul, .hram-content ol { margin-bottom: 25px; padding-left: 25px; }
.hram-content ul li::marker { color: var(--color-red); font-size: 1.2em; }
.hram-content img { max-width: 100%; height: auto; border-radius: 4px; margin: 30px 0 10px 0; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.hram-content a { color: var(--color-red); text-decoration: underline; text-underline-offset: 3px; }
.hram-content a:hover { text-decoration: none; }

/* Оглавление (Sticky) */
.hram-toc {
    background: var(--color-cream); border-left: 4px solid var(--color-red); padding: 25px 30px; border-radius: 0 4px 4px 0;
}
.toc-title { font-family: var(--font-head); text-transform: uppercase; font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; }
.hram-toc ul { list-style: none; padding: 0; margin: 0; }
.hram-toc li { margin-bottom: 8px; }
.hram-toc a { color: var(--color-dark); text-decoration: none; font-size: 1rem; transition: color 0.2s, padding-left 0.2s; display: block; }
.hram-toc a:hover { color: var(--color-red); padding-left: 5px; }

@media (min-width: 1024px) {
    .hram-content-wrapper {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 40px;
        align-items: start;
    }
    .hram-toc {
        position: sticky;
        top: 90px; /* Отступ под липкую шапку */
    }
}

/* Хронология */
.hram-timeline { padding: 60px 0; background-color: #fff; }
.timeline-list { position: relative; padding-left: 30px; border-left: 3px solid var(--color-red); }
.timeline-item { position: relative; margin-bottom: 30px; padding-left: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -38px; top: 6px; width: 14px; height: 14px; background: var(--color-red); border: 3px solid var(--color-cream); border-radius: 50%; box-shadow: 0 0 0 2px var(--color-red); }
.timeline-year { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--color-red); text-transform: uppercase; margin-bottom: 5px; }

/* Святыни и Расписание */
.hram-info-grid { padding: 60px 0; background-color: #fff; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px; }
.info-block { background: var(--color-cream); padding: 30px; border-left: 4px solid var(--color-red); border-radius: 0 4px 4px 0; }
.info-block .section-title { margin-bottom: 20px; font-size: 1.5rem; }
.relics-list { list-style: none; padding: 0; margin: 0; }
.relics-list li { padding: 12px 0 12px 30px; border-bottom: 1px solid #e0e0e0; position: relative; }
.relics-list li::before { content: '??'; position: absolute; left: 0; top: 12px; }
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-item { padding: 12px 15px; background: #fff; border-radius: 4px; border-left: 3px solid var(--color-red); font-size: 0.95rem; }
.calendar-btn { display: inline-block; margin-top: 15px; padding: 10px 20px; background-color: var(--color-dark); color: var(--color-cream); font-family: var(--font-head); text-transform: uppercase; font-size: 0.85rem; text-decoration: none; border-radius: 4px; }
.calendar-btn:hover { background-color: var(--color-red); }

/* Медиа: Галерея и Тур */
.hram-media { padding: 60px 0; background-color: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; margin-bottom: 50px; }
.gallery-item { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: 4px; cursor: pointer; background: #f0f0f0; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-overlay { position: absolute; inset: 0; background: rgba(204, 0, 0, 0); display: flex; align-items: center; justify-content: center; transition: background 0.3s ease; }
.gallery-item:hover .gallery-overlay { background: rgba(204, 0, 0, 0.3); }
.zoom-icon { color: #fff; font-size: 2rem; opacity: 0; transform: scale(0.7); transition: all 0.3s ease; }
.gallery-item:hover .zoom-icon { opacity: 1; transform: scale(1); }

.tour-container { max-width: 900px; margin: 0 auto 50px; }
.tour-slideshow { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
.tour-slide { display: none; position: relative; }
.tour-slide.active { display: block; animation: fadeIn 0.5s; }
.tour-slide img { width: 100%; height: 500px; object-fit: cover; }
.tour-slide-info { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); color: #fff; padding: 30px; }
.tour-controls { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 20px; }
.tour-btn { background: var(--color-red); color: #fff; border: none; padding: 10px 25px; border-radius: 4px; cursor: pointer; font-family: var(--font-head); text-transform: uppercase; }
.tour-counter { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.video-container { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 4px; background: #000; max-width: 900px; margin: 0 auto; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Лайтбокс */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(26, 26, 26, 0.95); z-index: 10000; align-items: center; justify-content: center; padding: 20px; }
.lightbox.active { display: flex; }
.lightbox-content { max-width: 90vw; max-height: 85vh; text-align: center; }
.lightbox-content img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 4px; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; background: var(--color-red); color: var(--color-cream); border: none; width: 50px; height: 50px; font-size: 1.5rem; cursor: pointer; border-radius: 50%; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* Как добраться + Карта */
.hram-transport-map { padding: 60px 0; background-color: var(--color-cream); }
.transport-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 40px; }
.transport-item { display: flex; gap: 15px; padding: 20px; background: #fff; border-radius: 4px; border: 1px solid #e0e0e0; transition: transform 0.2s, box-shadow 0.2s; }
.transport-item:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.transport-icon { font-size: 2rem; flex-shrink: 0; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: var(--color-cream); border-radius: 50%; }
.transport-label { font-family: var(--font-head); text-transform: uppercase; font-size: 0.85rem; color: #888; margin-bottom: 6px; }

.map-container { width: 100%; border: 1px solid #e0e0e0; border-radius: 4px; overflow: hidden; margin-bottom: 30px; }
.route-buttons { display: flex; gap: 15px; margin-top: 25px; flex-wrap: wrap; }
.route-btn { flex: 1; min-width: 180px; padding: 14px 20px; border-radius: 4px; text-decoration: none; text-align: center; font-family: var(--font-head); text-transform: uppercase; font-size: 0.9rem; color: #fff; font-weight: 600; }
.yandex-btn { background: #FC3F1D; }
.gis-btn { background: #00A651; }
.google-btn { background: #4285F4; }

.panorama-section { padding: 60px 0 0 0; background-color: var(--color-cream); }
.panorama-container { border-radius: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
.panorama-hint { text-align: center; margin-top: 15px; color: #666; font-size: 0.9rem; }

/* Праздники и Источники */
.hram-extra-info { padding: 60px 0; background-color: var(--color-cream); }
.extra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.extra-block { background: #fff; padding: 30px; border-radius: 4px; border-top: 3px solid var(--color-red); }
.extra-block .section-title { margin-bottom: 20px; font-size: 1.5rem; }
.feasts-list, .sources-list { padding-left: 20px; margin: 0; }
.feasts-list li, .sources-list li { padding: 10px 0; border-bottom: 1px solid #eee; font-size: 0.95rem; }

/* Рейтинг и Отзывы */
.hram-reviews { padding: 60px 0; background: #fff; }
.rating-block { background: var(--color-cream); padding: 30px; border-radius: 4px; border-left: 4px solid var(--color-red); margin-bottom: 40px; }
.rating-stars { display: flex; gap: 5px; margin-bottom: 15px; }
.star { font-size: 2.5rem; color: #ddd; cursor: pointer; transition: color 0.2s, transform 0.2s; }
.star:hover, .star.active, .star.half { color: #FFD700; }
.star:hover { transform: scale(1.2); }
.rating-info { display: flex; gap: 15px; align-items: center; font-family: var(--font-head); }
.rating-average { font-size: 1.5rem; font-weight: 700; }
.review-item { background: var(--color-cream); padding: 20px; border-radius: 4px; margin-bottom: 15px; border-left: 3px solid var(--color-red); }
.review-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-family: var(--font-head); }
.comment-respond { background: var(--color-cream); padding: 30px; border-radius: 4px; border-left: 4px solid var(--color-red); }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px; border: 1px solid #d0d0d0; border-radius: 4px; margin-bottom: 15px; }
.comment-form .form-submit input { background: var(--color-red); color: #fff; border: none; padding: 12px 30px; font-family: var(--font-head); text-transform: uppercase; cursor: pointer; border-radius: 4px; }

/* Навигация между храмами */
.hram-navigation { padding: 40px 0; border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; background: #fff; }
.nav-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }
.nav-item { text-decoration: none; color: var(--color-dark); padding: 15px; border-radius: 4px; transition: background 0.2s; }
.nav-item:hover { background: var(--color-cream); }
.nav-item.prev { text-align: left; }
.nav-item.next { text-align: right; }
.nav-item.center { font-family: var(--font-head); text-transform: uppercase; color: var(--color-red); border: 1px solid var(--color-red); }
.nav-item.center:hover { background: var(--color-red); color: var(--color-cream); }
.nav-label { display: block; font-size: 0.8rem; color: #888; text-transform: uppercase; margin-bottom: 5px; }
.nav-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; }

/* Похожие храмы */
.related-hrams { padding: 60px 0; background-color: var(--color-cream); }

/* ==========================================================================
   7. СПЕЦИАЛЬНЫЕ СТРАНИЦЫ (Маршруты, Календарь, О проекте)
   ========================================================================== */
.routes-hero, .calendar-hero, .about-hero, .static-page-hero, .map-hero, .volunteer-hero {
    background: var(--color-dark); color: var(--color-cream); padding: 80px 0; text-align: center;
}
.routes-hero h1, .calendar-hero h1, .about-hero h1, .static-page-hero h1, .map-hero h1 {
    font-family: var(--font-head); text-transform: uppercase; font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 10px;
}

.route-card { background: #fff; border-radius: 8px; padding: 40px; margin-bottom: 40px; border-left: 6px solid var(--color-red); box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.route-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.route-meta { background: var(--color-cream); padding: 8px 16px; border-radius: 20px; font-family: var(--font-head); font-size: 0.9rem; }
.stop-item { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.stop-number { flex-shrink: 0; width: 40px; height: 40px; background: var(--color-red); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; }

.calendar-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 15px; }
.calendar-item { display: flex; gap: 20px; background: #fff; padding: 20px; border-radius: 4px; border-left: 4px solid var(--color-red); transition: transform 0.2s; }
.calendar-item:hover { transform: translateX(5px); }
.calendar-date { flex-shrink: 0; width: 120px; text-align: center; }
.date-day { display: block; font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--color-red); text-transform: uppercase; }

.volunteer-form { max-width: 600px; margin: 0 auto; background: #fff; padding: 40px; border-radius: 8px; border-left: 4px solid var(--color-red); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-family: var(--font-head); text-transform: uppercase; font-size: 0.9rem; margin-bottom: 8px; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #d0d0d0; border-radius: 4px; font-family: var(--font-body); font-size: 1rem; }

/* ==========================================================================
   8. УТИЛИТЫ И ВИДЖЕТЫ
   ========================================================================== */
/* Кнопка "Случайный храм" */
.random-hram-btn {
    display: inline-block; background: var(--color-red); color: var(--color-cream); padding: 8px 16px;
    border-radius: 4px; text-decoration: none; font-family: var(--font-head); font-size: 0.85rem;
    text-transform: uppercase; margin-left: 20px; transition: all 0.2s;
}
.random-hram-btn:hover { background: #a00000; transform: translateY(-2px); }

/* Кнопка Наверх */
#backToTop {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background-color: var(--color-red);
    color: var(--color-cream); border: none; border-radius: 50%; font-size: 1.5rem; cursor: pointer;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3); z-index: 999;
}
#backToTop.show { opacity: 1; visibility: visible; }
#backToTop:hover { transform: translateY(-3px); background-color: #a00000; }

/* Виджет доступности */
#accessibilityToggle {
    position: fixed; bottom: 90px; right: 30px; width: 50px; height: 50px; background-color: var(--color-dark);
    color: var(--color-cream); border: 2px solid var(--color-cream); border-radius: 50%; font-family: var(--font-head);
    font-size: 1.2rem; font-weight: 700; cursor: pointer; z-index: 998; transition: all 0.3s ease;
}
#accessibilityToggle:hover { background-color: var(--color-red); border-color: var(--color-red); }
body.large-font-mode { font-size: 120% !important; }
body.large-font-mode .hram-content { font-size: 1.3rem !important; line-height: 1.9 !important; }

/* Переключатель языков */
.language-switcher { position: fixed; top: 80px; right: 90px; z-index: 100; display: flex; gap: 5px; }
.language-switcher a { background: var(--color-dark); color: var(--color-cream); padding: 8px 12px; border-radius: 4px; text-decoration: none; font-size: 0.85rem; }
.language-switcher a.active, .language-switcher a:hover { background: var(--color-red); }

/* Виджет погоды */
.weather-widget { background: var(--color-cream); border-left: 4px solid var(--color-red); padding: 20px; margin: 20px auto 30px; max-width: 800px; border-radius: 0 4px 4px 0; }
.weather-title { font-family: var(--font-head); text-transform: uppercase; font-size: 1.1rem; margin: 0 0 15px 0; }
.weather-container { border-radius: 4px; overflow: hidden; background: #fff; }
.weather-container iframe { display: block; width: 100%; }
.weather-hint { font-size: 0.85rem; color: #666; margin-top: 10px; font-style: italic; text-align: center; }

/* Счётчик и Печать */
.views-counter { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--color-cream); border-radius: 4px; margin: 30px auto 0; max-width: 400px; font-size: 0.95rem; color: #555; }
.views-counter strong { color: var(--color-red); font-family: var(--font-head); font-size: 1.1rem; }
.print-page-btn { display: block; margin: 30px auto 0; padding: 12px 25px; background: var(--color-dark); color: var(--color-cream); border: none; border-radius: 4px; font-family: var(--font-head); text-transform: uppercase; font-size: 0.9rem; cursor: pointer; }
.print-page-btn:hover { background: var(--color-red); }

/* QR-код */
.qr-block { background: var(--color-cream); border: 2px solid var(--color-red); border-radius: 8px; padding: 25px; text-align: center; max-width: 280px; margin: 40px auto 0; }
.qr-image { width: 200px; height: 200px; border-radius: 4px; background: #fff; padding: 10px; margin: 0 auto 15px; display: block; }
.qr-download-btn { display: inline-block; background: var(--color-red); color: #fff; padding: 8px 16px; border-radius: 4px; text-decoration: none; font-family: var(--font-head); font-size: 0.85rem; text-transform: uppercase; }

/* Краудсорсинг */
.crowdsuggest-block { background: var(--color-cream); border: 2px dashed var(--color-red); border-radius: 8px; padding: 30px; text-align: center; margin: 40px auto 0; max-width: 600px; }
.crowdsuggest-block h3 { font-family: var(--font-head); text-transform: uppercase; font-size: 1.1rem; margin-bottom: 10px; }
.suggest-form { margin-top: 25px; text-align: left; }

/* Аудиогид */
.audio-guide-block { background: linear-gradient(135deg, var(--color-cream) 0%, #fff 100%); border: 2px solid var(--color-red); border-radius: 8px; padding: 25px; text-align: center; max-width: 500px; margin: 40px auto 0; }
.audio-guide-btn { background: var(--color-red); color: #fff; border: none; padding: 15px 30px; border-radius: 50px; font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; transition: all 0.3s; font-family: var(--font-head); text-transform: uppercase; }
.audio-guide-btn.playing { background: #28a745; animation: pulse 2s infinite; }
.audio-progress { height: 4px; background: #ddd; border-radius: 2px; margin-top: 15px; overflow: hidden; display: none; }
.audio-guide-btn.playing + .audio-progress { display: block; animation: progress 30s linear infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }
@keyframes progress { 0% { width: 0%; } 100% { width: 100%; } }

/* ==========================================================================
   9. АДАПТИВНОСТЬ (МОБИЛЬНЫЕ УСТРОЙСТВА)
   ========================================================================== */
@media (max-width: 900px) {
    .burger-menu { display: flex; }
    .main-nav {
        position: absolute; top: 70px; left: 0; right: 0; background: var(--color-dark);
        flex-direction: column; padding: 20px; gap: 15px; transform: translateY(-150%);
        transition: transform 0.3s ease; border-bottom: 3px solid var(--color-red);
    }
    .main-nav.active { transform: translateY(0); }
    .main-nav a { width: 100%; text-align: center; padding: 10px; border: 1px solid rgba(255,255,255,0.1); }
    .random-hram-btn { margin-left: 0 !important; margin-top: 10px; display: block; text-align: center; }

    .hram-hero { padding: 40px 0; }
    .hram-meta { flex-direction: column; gap: 10px; }
    .nav-grid { grid-template-columns: 1fr; text-align: center; }
    .nav-item.prev, .nav-item.next { text-align: center; }
    .map-preview-content { grid-template-columns: 1fr; gap: 30px; }
    .language-switcher { top: 70px; right: 80px; }
    #accessibilityToggle { right: 20px; bottom: 90px; width: 45px; height: 45px; }
    .theme-toggle { top: 70px; right: 20px; width: 45px; height: 45px; }
    .tour-slide img { height: 300px; }
    .calendar-item { flex-direction: column; gap: 10px; }
    .calendar-date { width: 100%; text-align: left; }
}

@media (max-width: 768px) {
    .section-title { font-size: 1.5rem; }
    .info-grid, .extra-grid, .stats-grid { grid-template-columns: 1fr; }
    .timeline-list { padding-left: 20px; }
    .timeline-item { padding-left: 15px; }
    .timeline-year { font-size: 1.2rem; }
    .hram-content { font-size: 1rem; line-height: 1.7; padding: 20px 0 60px 0; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.2rem; }
    .front-hero { padding: 60px 0; }
    .front-hero-buttons { flex-direction: column; align-items: center; }
    .front-hero-btn { width: 100%; max-width: 300px; text-align: center; }
    .route-buttons { flex-direction: column; }
    .route-btn { min-width: 100%; }
}

/* ==========================================================================
   10. ТЁМНАЯ ТЕМА
   ========================================================================== */
.theme-toggle {
    position: fixed; top: 80px; right: 30px; width: 50px; height: 50px; background: var(--color-dark);
    color: var(--color-cream); border: none; border-radius: 50%; font-size: 1.5rem; cursor: pointer;
    z-index: 1000; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.theme-toggle:hover { transform: scale(1.1); background: var(--color-red); }

body.dark-theme {
    --color-cream: #1A1A1A;
    --color-dark: #F4F1EA;
    --color-red: #E63946;
    background-color: #0d0d0d;
    color: #F4F1EA;
}
body.dark-theme .site-header, body.dark-theme .site-footer { background-color: #1a1a1a; border-color: #333; }
body.dark-theme .hram-hero, body.dark-theme .archive-hero, body.dark-theme .front-about,
body.dark-theme .routes-hero, body.dark-theme .calendar-hero, body.dark-theme .about-hero,
body.dark-theme .static-page-hero, body.dark-theme .map-hero, body.dark-theme .volunteer-hero { background-color: #1a1a1a; }
body.dark-theme .hram-passport, body.dark-theme .hram-content, body.dark-theme .hram-timeline,
body.dark-theme .hram-media, body.dark-theme .hram-info-grid, body.dark-theme .hram-transport-map,
body.dark-theme .hram-extra-info, body.dark-theme .related-hrams, body.dark-theme .hram-reviews { background-color: #0d0d0d; color: #F4F1EA; }
body.dark-theme .passport-item, body.dark-theme .hram-card, body.dark-theme .info-block,
body.dark-theme .transport-item, body.dark-theme .extra-block, body.dark-theme .review-item,
body.dark-theme .comment-respond, body.dark-theme .qr-block, body.dark-theme .audio-guide-block,
body.dark-theme .crowdsuggest-block, body.dark-theme .route-card, body.dark-theme .calendar-item,
body.dark-theme .volunteer-form, body.dark-theme .district-card, body.dark-theme .weather-container {
    background-color: #1a1a1a; border-color: #333; color: #F4F1EA;
}
body.dark-theme .hram-card h3 a, body.dark-theme .hram-content h2, body.dark-theme .hram-content h3 { color: #F4F1EA; }
body.dark-theme .hram-card-date { color: var(--color-red); }
body.dark-theme .hram-card-desc, body.dark-theme .timeline-desc, body.dark-theme .transport-value, body.dark-theme .stat-label { color: #ccc; }
body.dark-theme .hram-toc { background: #1a1a1a; border-left-color: var(--color-red); }
body.dark-theme .hram-toc a { color: #F4F1EA; }
body.dark-theme .hram-toc a:hover { color: var(-- a00000; }
body.dark-theme .gallery-item { background: #1a1a1a; }
body.dark-theme .map-container, body.dark-theme .video-container, body.dark-theme .tour-slideshow { background: #000; }
body.dark-theme input, body.dark-theme textarea, body.dark-theme select { background: #1a1a1a; color: #F4F1EA; border-color: #333; }
body.dark-theme .schedule-item { background: #0d0d0d; }

/* ==========================================================================
   11. СТИЛИ ДЛЯ ПЕЧАТИ (Ctrl + P)
   ========================================================================== */
@media print {
    .site-header, .site-footer, .hram-map-section, .related-hrams, #backToTop, .breadcrumbs,
    .weather-widget, .qr-block, .route-buttons, .print-page-btn, .theme-toggle, .share-block,
    .hram-reviews, .lightbox, .hram-navigation, .audio-guide-block, .crowdsuggest-block,
    .language-switcher, #accessibilityToggle { display: none !important; }

    body, .hram-hero, .hram-passport, .hram-content, .hram-timeline, .hram-info-grid,
    .hram-transport-map, .hram-extra-info {
        background-color: #fff !important; color: #000 !important; padding: 0 !important; margin:  are 0 !important;
    }
    .hram-hero h1 { color: #000 !important; font-size: 28pt !important; margin-bottom: 10px !important; }
    .passport-item, .info-block, .transport-item, .extra-block {
        border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid;
    }
    .section-title { border-bottom-color: #000 !important; color: #000 !important; }
    a { color: #000 !important; text-decoration: none !important; }
    a[href]:after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
    .hram-content { max-width: 100% !important; font-size: 12pt !important; }
}