/* --- ПОЛОСА ЗАГРУЗКИ --- */
#progress-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 3px;
    width: 0%;
    background-color: #ffffff; 
    z-index: 99999 !important;
    margin: 0;
    padding: 0;
    opacity: 0; 
    transition: width 0.3s ease, opacity 0.3s ease;
    pointer-events: none; 
}

/* --- БАЗОВЫЕ СТИЛИ --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* --- ПОДКЛЮЧЕНИЕ ЛОКАЛЬНЫХ ШРИФТОВ --- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap; 
    src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/inter-v20-latin-700.woff2') format('woff2');
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f3f3f3; 
    color: #333;
    line-height: 1.5;
    font-size: 16px;
    padding-top: 60px;
    -webkit-font-smoothing: antialiased; 
    /* -moz-osx-font-smoothing: grayscale; */
}

a {
    text-decoration: none;
    color: #5e8bb3; 
}
a:hover {
    color: #346799;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- ШАПКА --- */
.site-header {
    background-color: #2b2b2b;
    color: #fff;
    border-bottom: 1px solid #444;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; 
    transition: transform 0.3s ease-in-out;
}
.site-header.header-hidden {
    transform: translateY(-100%);
}

.header-container {
    display: flex;
    align-items: center; 
    justify-content: space-between;
    height: 60px;
    padding: 0 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    height: 100%;
}
.main-nav a {
    color: #aaa;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}
.main-nav a.active, 
.main-nav a:active {
    color: #fff;
}
@media (hover: hover) {
    .main-nav a:hover {
        color: #fff;
    }
}

.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 5px;
}
#nav-home { margin-right: 17px; }
#nav-list { margin-right: 20px; }

.home-icon {
    display: block; 
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.6; 
    transition: opacity 0.2s ease;
}
#nav-list .home-icon {
    width: 25px; 
    height: 25px;
}
.home-link:active .home-icon,
.home-link.active .home-icon {
    opacity: 1 !important; 
}
@media (hover: hover) {
    .home-link:hover .home-icon {
        opacity: 1 !important; 
    }
}

#lang-switcher {
    display: flex;
    align-items: center;
    height: 100%;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    position: relative;
    font-family: 'Inter', sans-serif;
    top: 0.5px;
}
#lang-switcher strong,
#lang-switcher a {
    color: #fff;
    transition: color 0.2s ease;
}
@media (hover: hover) {
    #lang-switcher a:hover {
        color: #fff;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    height: 100%;
}

/* --- СЕТКА --- */
.main-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

.feed {
    flex: 1;
    max-width: 100%;
}

.page-title {
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* --- ТЕКСТ СТАТЬИ --- */
#content h1 {
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-indent: 15px;
    font-size: 1.5em; 
    line-height: 1.2; 
}

#content p,
#content h2 {
    margin-bottom: 15px;
    color: #555;
    text-indent: 15px; 
    text-align: justify; 
}

#content a {
    text-decoration: underline;
    font-weight: 600; 
}

#content ul, #content ol, #content li {
    text-indent: 0 !important; 
}
#content ul {
    list-style-type: disc;
    text-indent: 15px;
    text-align: justify; 
}
#content ol, #content li {
    padding-left: 0px;
    margin-left: 40px;
    text-indent: 0 !important; 
}

#content img {
    width: 100%;
		height: auto;
    max-width: none;
    border-radius: 10px; 
    display: block;
    object-fit: cover; 
    max-height: 800px; 
    border: 2px solid #eee;
}

/* --- АДАПТИВНОСТЬ ОСНОВНОГО КОНТЕНТА --- */
@media (max-width: 1000px) {
    .main-layout.container {
        padding: 0;
        margin-top: 0;
    }
    .feed {
        max-width: 100%;
        padding: 0;
    }
    #content {
        width: 100%;
        border-radius: 0; 
        border-left: none;
        border-right: none;
        margin-bottom: 0;
    }
    .page-title {
        padding: 0 15px;
        margin-top: 20px;
        text-align: center;
    }
    .card {
        padding: 20px 0; 
    }
}

#page-preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* --- КНОПКИ В ШАПКЕ --- */
.font-sizer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-sizer button {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.font-sizer button:focus,
.font-sizer button:active {
    background-color: transparent !important;
    color: #aaa !important;
}

@media (hover: hover) {
    .font-sizer button:hover {
        background-color: #444;
        color: #fff;
    }
}

.font-sizer button:disabled {
    color: #555;
    cursor: not-allowed;
    background-color: transparent;
}

#font-size-display {
    color: #fff;
    font-size: 20px;
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', sans-serif;
    position: relative;
    top: 0.5px; 
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    margin-right: 5px;
}

.theme-switcher button {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.theme-switcher button:focus,
.theme-switcher button:active {
    background-color: transparent !important;
}

@media (hover: hover) {
    .theme-switcher button:hover {
        background-color: #444;
    }
}

.theme-icon {
    width: 18px;
    height: 18px;
    display: block; 
    filter: brightness(0) invert(0.6);
    transition: filter 0.2s ease;
}
.theme-switcher button.active {
    background-color: #444;
}
.theme-switcher button.active .theme-icon, 
.theme-switcher button:hover .theme-icon {
    filter: brightness(0) invert(1);
}

/* --- КНОПКА "НАВЕРХ" --- */
#scroll-to-top {
    position: static;
    width: 32px;
    height: 32px;
    background-color: transparent; 
    color: #aaa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0; 
    margin-left: auto; 
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent; 
}

#scroll-to-top:focus,
#scroll-to-top:active {
    background-color: transparent !important;
    color: #aaa !important;
}
#scroll-to-top:focus .arrow-icon,
#scroll-to-top:active .arrow-icon {
    filter: brightness(0) invert(0.6) !important;
}

@media (hover: hover) {
    #scroll-to-top:hover {
        background-color: #444;
        color: #fff;
    }
    #scroll-to-top:hover .arrow-icon {
        filter: brightness(0) invert(1);
    }
}

.arrow-icon {
    width: 20px;
    height: 20px;
    display: block; 
    filter: brightness(0) invert(0.6); 
    transition: filter 0.3s ease;
}

/* --- ПОДВАЛ --- */
.site-footer {
    text-align: center;
    padding: 10px 0 20px;
    font-size: 14px;
    color: #777;
    margin-top: auto;
}
@media (max-width: 1000px) {
    .site-footer {
        padding-top: 20px;
    }
}

@media (max-width: 500px) {
    .header-container { padding: 0 10px; }
    #nav-home { margin-right: 7px; }
    #nav-list { margin-right: 10px; }
    .font-sizer { margin-left: 0px; gap: 5px; }
    #font-size-display { min-width: 20px; }
}

/* =========================================
   ГЛАВНАЯ СТРАНИЦА (home.php)
   ========================================= */
hr { margin-bottom: 20px; }

.home-list-link{
    text-align:center !important;
    margin-bottom: 40px !important;
}

#content h2.home-main-title{
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
}
#content div.home-intro-text{
    margin-bottom: 40px;
}
#content h2.home-latest-title {
    text-align: center;
    margin-bottom: 25px;
}

/* --- КАРТОЧКИ СТАТЕЙ --- */
.home-articles-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.preview-card {
    background-color: #fff; 
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border: 1px solid #eee;
    transition: box-shadow 0.2s ease;
}

/* Контейнер для картинки и текста */
/* .preview-layout { */
    /* display: flex; */
    /* gap: 20px;  */
    /* /* align-items: center;  */ */
/* } */

.preview-layout { flex-direction: column; align-items: flex-start; gap: 15px; }

/* Блок с картинкой */
/* .preview-image-wrap { */
    /* flex-shrink: 0;  */
    /* width: 200px; */
    /* border-radius: 8px; */
    /* overflow: hidden; */
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
/* } */

.preview-image-wrap { width: 100%; height: 100%; }

/* Ссылка внутри блока (обертка картинки) */
.preview-image-wrap a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Сама картинка */
.preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
    transition: transform 0.3s ease;
		margin: 0 !important;
}

.preview-image-wrap:hover .preview-thumb {
    transform: scale(1.05);
}

/* Блок с текстом */
.preview-content {
    flex: 1; 
    display: flex;
    flex-direction: column;
}

/* Заголовок и чекбокс */
.preview-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.preview-title {
    font-size: 1.3em;
    margin-bottom: 0; 
    line-height: 1.3;
    text-indent: 15px;
    flex: 1; 
		text-align: center;
}

.preview-title a {
    color: #222;
    text-decoration: none !important; 
    transition: color 0.2s;
}
.preview-title a:hover {
    color: #4c9aff; 
}

/* Текст анонса */
.preview-excerpt {
    font-size: 1em;
    color: #555;
    text-indent: 0;
    line-height: 1.6;
    text-align: justify;
    margin-bottom: 10px; 
}

.preview-read-more {
    color: #5e8bb3; 
    font-weight: 600;
    white-space: nowrap;
    text-decoration: underline;
    display: inline-block;
}
.preview-read-more:hover {
    color: #346799;
}

/* Кнопка "СПИСОК ВСЕХ СТАТЕЙ" */
.home-list-btn-wrapper {
    text-align: center;
    margin: 40px 0 40px;
}
@media (max-width: 1000px) {
    .home-list-btn-wrapper { margin-top: 10px; }
}
.home-list-btn {
    display: inline-block;
    background-color: #2b2b2b;
    color: #fff !important;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: 700;
    border-radius: 50px; 
    text-decoration: none !important;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.home-list-btn:hover {
    background-color: #444;
    transform: translateY(-2px);
}

/* Дисклеймер */
.disclaimer-block {
    background-color: #fff8e1;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #ffe082;
    margin-top: 30px;
}
.disclaimer-block h3 {
    margin-bottom: 15px;
    text-indent: 15px;
}
.disclaimer-block p {
    text-indent: 0; 
    margin-bottom: 12px;
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
    text-align: left; 
}

#content .preview-read-more { text-indent: 0px; }
#content .preview-card p,
#content .disclaimer-block p { margin-bottom: 10px; }

/* =========================================
   СПИСОК ВСЕХ СТАТЕЙ (list.php)
   ========================================= */
#content h1 {
    text-indent: 0; 
    text-align: center;
		margin-top: 25px;
    margin-bottom: 30px;
}

.articles-list {
    display: flex;
    flex-direction: column;
}

.list-item {
    margin-bottom: 15px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0; 
    border-bottom: 2px dashed #ccc; 
    transition: border-color 0.2s;
    -webkit-tap-highlight-color: transparent; 
    text-decoration: none !important;
    color: inherit !important;
    outline: none;
}

.list-header:hover {
    border-bottom-color: #4c9aff; 
}

.list-title {
    font-size: 1.2em; 
    margin-bottom: 0;
    text-indent: 0;
    font-weight: 600;
    color: #333;
}

.list-date {
    display: none !important; /* Скрываем дату и время */
}

.list-content {
    padding-top: 15px;
    padding-bottom: 5px;
    border-bottom: 2px dashed #ccc; 
}

.list-excerpt { 
    font-size: 0.95em; 
    color: #555; 
    margin-bottom: 10px; 
    line-height: 1.5;
    text-indent: 0; 
    text-align: left; 
}

.list-read-more { 
    font-size: 0.9em; 
    color: #5e8bb3; 
    font-weight: 600; 
    text-decoration: underline;
    text-indent: 0;
}
.list-read-more:hover {
    color: #346799;
}

.list-header.active,
.list-header.active + .list-content {
    border-bottom-color: #4c9aff; 
}

/* =========================================
   НАВИГАЦИЯ ПО СТАТЬЕ
   ========================================= */
.article-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    gap: 10px;
}

@media (max-width: 1000px) {
	.article-navigation {
			margin-left: 15px;
			margin-right: 15px;
	}
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    background-color: #f3f3f3;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(.disabled) {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.read-btn {
    background-color: transparent;
    color: #5e8bb3;
    border-color: #5e8bb3;
    gap: 8px;
}

.read-btn .checkbox {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #5e8bb3;
    border-radius: 3px;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}

.read-btn.is-read {
    color: #777;
    border-color: #777;
    background-color: #f9f9f9;
}

.read-btn.is-read .checkbox {
    border-color: #777;
    background-color: #777;
}

.read-btn.is-read .checkbox::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* =========================================
   КАСТОМНЫЙ ЧЕКБОКС (ДЛЯ СПИСКА И ГЛАВНОЙ)
   ========================================= */
.list-checkbox-wrap {
    margin-left: auto;
    padding-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1000px) {
		.list-checkbox-wrap {
			padding-right: 15px;
		}
}

.custom-checkbox {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.list-checkbox-wrap.is-read .custom-checkbox {
    background-color: #4c7c36;
    border-color: #4c7c36;
}

.list-checkbox-wrap.is-read .custom-checkbox::after {
    content: '';
    position: absolute;
    top: 49%;
    left: 50%;
    transform: translate(-50%, -55%) rotate(45deg);
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

/* Чекбокс на главной странице */
.preview-title-row .list-checkbox-wrap {
    margin-left: 0;
    padding-left: 0;
    margin-top: 5px;
}

/* Прячем заголовок по умолчанию, чтобы не было прыжков */
#page-title-text {
		font-size: 30px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 1000px) {
		#page-title-text{
				font-size: 25px;
		}
}

@media (max-width: 450px) {
		#page-title-text{
				font-size: 20px;
		}
}

#page-title-text.is-visible {
    display: block;
    opacity: 1;
}

/* =========================================
   ТЕМНАЯ ТЕМА
   ========================================= */
body.dark-theme {
    background-color: #1a1a1a; 
    color: #e0e0e0;
}
body.dark-theme #content.card {
    background-color: #2b2b2b; 
    color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
body.dark-theme #content h1, 
body.dark-theme #content h2, 
body.dark-theme #content h3,
body.dark-theme #content p,
body.dark-theme #content li,
body.dark-theme #content span {
    color: #e0e0e0;
}
body.dark-theme #content a:hover {
    color: #9cc8eb;
}
body.dark-theme .page-title {
    color: #e0e0e0;
}
body.dark-theme .site-footer {
    color: #888;
}
body.dark-theme .site-footer a {
    color: #6ca5d4;
}
body.dark-theme #content img.article-cover {
    border-color: #555;
}

/* Главная (Темная тема) */
body.dark-theme .preview-card {
    background-color: #333;
    border-color: #444;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
body.dark-theme .preview-title a { color: #fff; }
body.dark-theme .preview-title a:hover { color: #6ca5d4; }
body.dark-theme .preview-excerpt { color: #bbb; }
body.dark-theme .preview-read-more { color: #6ca5d4; }
body.dark-theme .preview-image-wrap { border-color: #555; }

body.dark-theme .home-list-btn {
    background-color: #3a3a3a;
    color: #e0e0e0 !important;
}
body.dark-theme .home-list-btn:hover {
    background-color: #4a4a4a;
}
body.dark-theme .disclaimer-block {
    background-color: #3e331f; 
    border-color: #5c4a2c;
}
body.dark-theme .disclaimer-block p {
    color: #ccc;
}

/* Список (Темная тема) */
body.dark-theme .list-header,
body.dark-theme .list-content { border-bottom-color: #555; }
body.dark-theme .list-header:hover { border-bottom-color: #6ca5d4; }
body.dark-theme .list-header.active,
body.dark-theme .list-header.active + .list-content { border-bottom-color: #6ca5d4; }
body.dark-theme .list-title { color: #fff; }
body.dark-theme .list-excerpt { color: #bbb; }
body.dark-theme .list-read-more { color: #6ca5d4; }

/* Навигация по статье (Темная тема) */
body.dark-theme .article-navigation { border-top-color: #444; }
body.dark-theme .nav-btn {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
}
body.dark-theme .nav-btn:hover:not(.disabled) {
    background-color: #444;
    border-color: #555;
}
body.dark-theme .read-btn {
    background-color: transparent;
    color: #6ca5d4;
    border-color: #6ca5d4;
}
body.dark-theme .read-btn .checkbox { 
    border-color: #5e9ed6; 
    background-color: #5e9ed6; 
}
body.dark-theme .read-btn.is-read .checkbox::after { border-color: white; }
body.dark-theme .read-btn.is-read {
    color: #aaa;
    border-color: #555;
    background-color: #2b2b2b;
}
body.dark-theme .read-btn.is-read .checkbox {
    border-color: #5e9ed6; 
    background-color: #5e9ed6; 
}

/* Чекбоксы (Темная тема) */
body.dark-theme .custom-checkbox { border-color: #555; }
body.dark-theme .list-checkbox-wrap.is-read .custom-checkbox {
    background-color: #5e9ed6; 
    border-color: #5e9ed6;
}

/* =========================================
   ЗЕЛЕНАЯ (ПРИРОДНАЯ) ТЕМА
   ========================================= */
body.nature-theme {
    background-color: #e8f0e5; 
    color: #2e4020; 
}
body.nature-theme #content.card {
    background-color: #fff;
    color: #2e4020;
    box-shadow: 0 2px 5px rgba(46, 64, 32, 0.1);
}
body.nature-theme #content h1, 
body.nature-theme #content h2, 
body.nature-theme #content h3,
body.nature-theme #content p,
body.nature-theme #content li,
body.nature-theme #content span {
    color: #2e4020;
}
body.nature-theme #content a:hover {
    color: #345c22;
}
body.nature-theme .page-title {
    color: #2e4020;
}
body.nature-theme .site-footer {
    color: #5a7a4a;
}
body.nature-theme .site-footer a {
    color: #4c7c36;
}
body.nature-theme .site-header {
    background-color: #2b2b2b; 
    border-bottom: 1px solid #2e4a21;
}
body.nature-theme .main-nav a.active, 
body.nature-theme .main-nav a:active,
body.nature-theme .home-link.active .home-icon {
    color: #d2e8c8; 
    opacity: 1;
}
body.nature-theme .main-nav a { color: #9fb896; }
@media (hover: hover) {
    body.nature-theme .main-nav a:hover { color: #d2e8c8; }
}
body.nature-theme #content img.article-cover { border-color: #c8e0b8; }

/* Кнопки в шапке (Зеленая тема) */
body.nature-theme .font-sizer button:focus,
body.nature-theme .font-sizer button:active {
    background-color: transparent !important;
    color: #aaa !important;
}
body.nature-theme .theme-switcher button:focus,
body.nature-theme .theme-switcher button:active { background-color: transparent !important; }
@media (hover: hover) {
    body.nature-theme .font-sizer button:hover {
        background-color: #384b2e; 
        color: #ffffff;
    }
    body.nature-theme .theme-switcher button:hover { background-color: #384b2e; }
}
body.nature-theme .theme-switcher button.active { background-color: #384b2e; }

body.nature-theme #scroll-to-top:focus,
body.nature-theme #scroll-to-top:active {
    background-color: transparent !important;
    color: #aaa !important;
}
body.nature-theme #scroll-to-top:focus .arrow-icon,
body.nature-theme #scroll-to-top:active .arrow-icon { filter: brightness(0) invert(0.6) !important; }
@media (hover: hover) {
    body.nature-theme #scroll-to-top:hover {
        background-color: #384b2e;
        color: #ffffff;
    }
    body.nature-theme #scroll-to-top:hover .arrow-icon { filter: brightness(0) invert(1); }
}

/* Главная (Зеленая тема) */
body.nature-theme .preview-card {
    background-color: #f4f9f2;
    border-color: #d0e0cb;
    box-shadow: 0 4px 15px rgba(46, 64, 32, 0.05);
}
body.nature-theme .preview-title a { color: #2e4020; }
body.nature-theme .preview-title a:hover { color: #4c7c36; }
body.nature-theme .preview-excerpt { color: #4a5a40; }
body.nature-theme .preview-read-more { color: #4c7c36; }
body.nature-theme .preview-image-wrap { border-color: #c8e0b8; }

body.nature-theme .home-list-btn { background-color: #4c7c36; }
body.nature-theme .home-list-btn:hover { background-color: #3a5f28; }
body.nature-theme .disclaimer-block {
    background-color: #f0f7eb; 
    border-color: #c8e0b8;
}
body.nature-theme .disclaimer-block p { color: #3a4a30; }

/* Список (Зеленая тема) */
body.nature-theme .list-header,
body.nature-theme .list-content { border-bottom-color: #c8e0b8; }
body.nature-theme .list-header:hover { border-bottom-color: #4c7c36; }
body.nature-theme .list-header.active,
body.nature-theme .list-header.active + .list-content { border-bottom-color: #4c7c36; }
body.nature-theme .list-title { color: #2e4020; }
body.nature-theme .list-excerpt { color: #4a5a40; }
body.nature-theme .list-read-more { color: #4c7c36; }

/* Навигация (Зеленая тема) */
body.nature-theme .article-navigation { border-top-color: #c8e0b8; }
body.nature-theme .nav-btn {
    background-color: #f4f9f2;
    color: #2e4020;
    border-color: #d0e0cb;
}
body.nature-theme .nav-btn:hover:not(.disabled) {
    background-color: #e8f0e5;
    border-color: #c8e0b8;
}
body.nature-theme .read-btn {
    background-color: transparent;
    color: #4c7c36;
    border-color: #4c7c36;
}
body.nature-theme .read-btn .checkbox { border-color: #4c7c36; }
body.nature-theme .read-btn.is-read {
    color: #6b8c5c;
    border-color: #a3c491;
    background-color: #f0f7eb;
}
body.nature-theme .read-btn.is-read .checkbox {
    border-color: #6b8c5c;
    background-color: #6b8c5c;
}

/* Чекбоксы (Зеленая тема) */
body.nature-theme .custom-checkbox { border-color: #a3c491; }
body.nature-theme .list-checkbox-wrap.is-read .custom-checkbox {
    background-color: #4c7c36;
    border-color: #4c7c36;
}

/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ГЛАВНОЙ И СПИСКА
   ========================================= */
@media (max-width: 1000px) {
    /* Главная: полосы */
    .home-intro-text,
    .home-main-title,
    .home-latest-title,
    .home-list-btn-wrapper,
    .disclaimer-block {
        padding-left: 0px !important;
        padding-right: 0px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .home-articles-list { padding: 0 !important; gap: 0 !important; }
    .preview-card {
        padding: 20px 0px !important; 
        border-radius: 0 !important; 
        border: none !important; 
        border-top: 1px solid #eee !important; 
        border-bottom: 1px solid #eee !important; 
        margin-bottom: 25px !important; 
        background-color: #fff; 
    }
    .preview-layout { padding: 0 15px; gap: 15px; }
    .disclaimer-block {
        border-radius: 0 !important;
        border: none !important;
        border-top: 1px solid #ffe082 !important;
        border-bottom: 1px solid #ffe082 !important;
        padding: 20px 0px !important;
        margin-bottom: 20px !important;
    }
    
    /* Адаптация линий карточек под темы */
    body.dark-theme .preview-card { border-top-color: #444 !important; border-bottom-color: #444 !important; background-color: #2b2b2b; }
    body.nature-theme .preview-card { border-top-color: #c8e0b8 !important; border-bottom-color: #c8e0b8 !important; background-color: #f4f9f2; }
    body.dark-theme .disclaimer-block { border-top-color: #5c4a2c !important; border-bottom-color: #5c4a2c !important; }
    body.nature-theme .disclaimer-block { border-top-color: #c8e0b8 !important; border-bottom-color: #c8e0b8 !important; }

    /* Отступы для текста статей */
    #content:not(:has(.home-main-title)) p,
    #content:not(:has(.home-main-title)) h1,
    #content:not(:has(.home-main-title)) h2,
    #content:not(:has(.home-main-title)) h3,
    #content:not(:has(.home-main-title)) ul,
    #content:not(:has(.home-main-title)) ol,
    #content:not(:has(.home-main-title)) li {
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box; 
    }
    #content .preview-layout p,
    #content .preview-layout h1,
    #content .preview-layout h2,
    #content .preview-layout h3,
    #content .preview-layout ul,
    #content .preview-layout ol,
    #content .preview-layout li {
        padding-left: 0px !important;
        padding-right: 0px !important;
    }
    #content:not(:has(.home-main-title)) ul, 
    #content:not(:has(.home-main-title)) ol { padding-left: 35px !important; }
    #content:not(:has(.home-main-title)) li { padding-left: 0 !important; }
    #content:not(:has(.home-main-title)) img.article-cover {
        width: calc(100% - 30px) !important;
        margin-left: 15px !important;
        margin-right: 15px !important;
    }
}

/* @media (max-width: 1000px) { */
    /* .preview-layout { flex-direction: column; align-items: flex-start; gap: 15px; } */
    /* .preview-image-wrap { width: 100%; height: 100%; } */
    /* .preview-title { text-align: center; } */
/* } */

@media (max-width: 600px) {
    .article-navigation { flex-direction: column; }
    .nav-btn { width: 100%; }
}

/* --- ПОЯСНЕНИЕ ДЛЯ ГАЛОЧКИ В СПИСКЕ --- */
.list-legend {
    display: flex;
    justify-content: flex-end; /* Прижимаем вправо */
    flex-wrap: wrap;           /* Разрешаем перенос на новую строку */
    align-items: center;
    gap: 15px;                 /* Расстояние между пунктами в строке */
    margin-top: 20px;
    padding-top: 15px;
    font-size: 0.9em;
    color: #888;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;                 /* Расстояние между чекбоксом и текстом */
    white-space: nowrap;      /* Запрещаем тексту разрываться на части */
}

.legend-item:first-child {
		padding-left: 15px;
		padding-right: 15px;
}

.legend-item .list-checkbox-wrap {
    padding-left: 0;
    padding-right: 0;
}
.legend-item .list-checkbox-wrap.is-read {
    padding-left: 0;
}

@media (max-width: 1000px) {
	.legend-item:last-child {
			padding-right: 15px;
	}
}

/* --- АДАПТАЦИЯ ПОД ТЕМЫ --- */

/* Темная тема */
body.dark-theme .list-legend { color: #aaa; }
body.dark-theme .list-legend .legend-checkbox { border-color: #555; }
body.dark-theme .list-legend .legend-checkbox.is-checked {
    background-color: #5e9ed6;
    border-color: #5e9ed6;
}

/* Зеленая тема */
body.nature-theme .list-legend { color: #6b8c5c; }
body.nature-theme .list-legend .legend-checkbox { border-color: #a3c491; }
body.nature-theme .list-legend .legend-checkbox.is-checked {
    background-color: #4c7c36;
    border-color: #4c7c36;
}

/* =========================================
   ПОИСК ПО СТАТЬЯМ (list.php)
   ========================================= */
.search-wrapper {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

@media (max-width: 1000px) {
	.search-wrapper {
			margin-left: 15px;
			margin-right: 15px;
	}
}

.search-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.search-wrapper input:focus {
    border-color: #4c9aff;
    background-color: #fff;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: #888;
    pointer-events: none;
}

#search-clear {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #888;
    cursor: pointer;
    display: none; /* JS будет менять на 'flex' */
    padding: 0;
    align-items: center;
    justify-content: center;
    height: 100%;
    top: 0;
}

#search-clear:hover {
    color: #333;
}

/* Подсветка найденного текста */
.search-highlight {
    background-color: #ffe066; /* Желтый маркер */
    color: #000;
    border-radius: 2px;
}

/* Темная тема */
body.dark-theme .search-wrapper input {
    background-color: #2b2b2b;
    border-color: #444;
    color: #e0e0e0;
}
body.dark-theme .search-wrapper input:focus {
    border-color: #5e9ed6;
    background-color: #333;
}
body.dark-theme .search-icon,
body.dark-theme #search-clear {
    color: #888;
}
body.dark-theme #search-clear:hover {
    color: #fff;
}
body.dark-theme .search-highlight {
    background-color: #b38b00;
    color: #fff;
}

/* Зеленая тема */
body.nature-theme .search-wrapper input {
    background-color: #f4f9f2;
    border-color: #c8e0b8;
    color: #2e4020;
}
body.nature-theme .search-wrapper input:focus {
    border-color: #4c7c36;
    background-color: #fff;
}
body.nature-theme .search-icon,
body.nature-theme #search-clear {
    color: #6b8c5c;
}
body.nature-theme #search-clear:hover {
    color: #2e4020;
}
body.nature-theme .search-highlight {
    background-color: #d2e8c8;
    color: #2e4020;
}

/* --- ЗАТЕМНЕНИЕ КОНТЕНТА ПРИ ПЕРЕХОДЕ --- */
#content-overlay {
    position: fixed;
    top: 60px; /* Отступ под высоту шапки */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background-color: rgba(243, 243, 243, 0.7); /* Светлая тема (цвет фона + прозрачность) */
    backdrop-filter: blur(2px); /* Легкое размытие для красоты */
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none; /* Чтобы клики проходили сквозь него */
}

/* Класс, который включает затемнение */
#content-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Блокируем клики, пока грузится новая страница */
}

/* Адаптация под темную тему */
body.dark-theme #content-overlay {
    background-color: rgba(26, 26, 26, 0.7); /* Темный фон */
}

/* Адаптация под зеленую тему */
body.nature-theme #content-overlay {
    background-color: rgba(232, 240, 229, 0.7); /* Зеленоватый фон */
}

/* --- КАРТИНКИ С ПОДПИСЯМИ В СТАТЬЯХ --- */
.article-image-wrapper {
    text-align: center;
}

.article-image-caption {
    display: block;
    padding: 0 15px; /* Чтобы текст не прилипал к краям на мобильных */
}

.preview-title-row h3 {
	margin-top: 25px;
  margin-bottom: 30px;
	font-weight: 600;
  margin-bottom: 20px;
  color: #333;
  text-indent: 15px;
  font-size: 1.5em;
  line-height: 1.2;
}