/* ==================== ОСНОВНЫЕ СТИЛИ ==================== */
:root {
    --primary: #8c9e7e;      /* Пастельный зелёный */
    --secondary: #d1d9d0;    /* Светло-серый */
    --accent: #6b8e7e;       /* Темно-зелёный (было #6b88e7e - ошибка) */
    --background: #f5f7f3;   /* Светлый фон */
    --text-color: #333;
    --text-light: #666;
}

/* Основные настройки документа */
body {
    background-color: var(--background);
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.7;
}

//* ==================== ТИПОГРАФИКА КАРТОЧКИ ==================== */
.card-detail {
    line-height: 1.7; /* Основной межстрочный интервал */
}

.card-header h1 {
    line-height: 1.4; /* Чуть плотнее для заголовка */
}

.card-header .cirillic {
    line-height: 1.6; /* Промежуточное значение для подзаголовков */
}

.section-content {
    line-height: inherit; /* Наследует от card-detail */
}

.section-content p {
    margin-bottom: 1em; /* Отступ между параграфами */
}

.section-list {
    line-height: 1.6; /* Для списков чуть меньше */
}

.section-list li {
    margin-bottom: 0.8em; /* Отступ между пунктами списка */
}

.image-caption {
    line-height: 1.5;
}

/* Для markdown-контента */
.card-html-content p,
.card-html-content ul,
.card-html-content ol {
    line-height: 1.7;
    margin-bottom: 1em;
}

.card-html-content li {
    margin-bottom: 0.5em;
}

/* ==================== ШАПКА И МЕНЮ ==================== */
/* Баннер */
.banner {
    background-color: var(--primary);
    padding: 20px;
    text-align: center;
    color: white;
}

/* Горизонтальное меню */
.horizontal-menu {
    background-color: var(--accent);
    padding: 10px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.horizontal-menu a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.horizontal-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ==================== ОСНОВНОЙ МАКЕТ ==================== */
/* Контейнер страницы */
.container {
    display: flex;
    min-height: calc(100vh - 150px);
}

/* Левое меню */
.left-menu {
    width: 250px;
    min-width: 100px;
    padding: 20px;
    background-color: #d1d9d0;
    overflow-y: auto;
    height: calc(100vh - 120px);
    position: sticky;
    top: 60px;
}

.left-menu a {
    line-height: 1.6;
    display: block;
    padding: 8px 15px;
    transition: background-color 0.2s;
    margin: 5px 0;
    color: #333;
    text-decoration: none;
    background-color: rgba(255,255,255,0.2);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.left-menu a:hover {
    background-color: rgba(255,255,255,0.9);
    transform: translateX(5px);
}

.left-menu .back-link {
    font-weight: bold;
    background-color: transparent;
    padding-left: 0;
}

.left-menu .back-link:hover {
    background-color: transparent;
    text-decoration: underline;
    transform: none;
}

/* Активные элементы меню */
.left-menu .active-term {
    background-color: rgba(140, 158, 126, 0.2);
    border-left: 3px solid var(--primary);
    font-weight: bold;
    transform: translateX(5px);
}

.left-menu .active-term:hover {
    background-color: rgba(140, 158, 126, 0.3);
}

/* Основное содержимое */
.content {
    flex: 1;
    padding: 20px;
    background-color: white;
}

/* ==================== КАРТОЧКИ ==================== */
.card-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #d1d9d0; /* Светло-серая граница */
}

.card-header h1 {
    font-size: 2.2rem;
    color: #2c3e50; /* Темно-синий цвет */
    margin-bottom: 5px;
    line-height: 1.3;
}

.card-header .cirillic {
    font-style: italic;
    color: #7f8c8d; /* Серо-голубой цвет */
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 5px 0;
}

/* Для основного описания (если отличается от латинского названия) */
.card-header .cirillic.base-description {
    font-weight: 500;
    color: #5a6b7e; /* Чуть темнее серо-голубого */
}

/* ==================== ГЛОБАЛЬНЫЕ СТИЛИ КАРТОЧЕК ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.card-preview {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-preview a {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.card-preview-content {
    padding: 15px 0 0 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-preview h3 {
    padding: 0;
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: #006400;
    font-weight: 600;
    text-decoration: none !important;
}

.card-preview .cirillic {
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-decoration: none !important;
}

/* Стили для миазмов - всегда внизу карточки */
.card-miasm-container {
    margin-top: auto;
    padding: 10px 10px 10px 0;
}

.card-miasm {
    display: inline-block;
    padding: 3px 8px;
    background: #e8f0e8;
    border: 1px solid #6b8e7e;
    border-radius: 4px;
    font-size: 0.8em;
    color: #2c3e50;
    font-weight: 500;
    text-decoration: none !important;
}

/* Изображения в карточках */
.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-image-placeholder {
    width: 100%;
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 2rem;
    font-weight: bold;
}

/* Детальная страница карточки */
.card-detail {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 25px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-main-image {
    border-radius: 8px;
    margin: 20px auto;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

/* ==================== СЕКЦИИ КАРТОЧЕК ==================== */
.card-section {
    background-color: #f8f9fa;
    border-left: 4px solid #d1d9d0;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
    border-bottom: 1px solid #eee;
}

.card-section h2 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Список в две колонки */
.section-list {
    columns: 2;
    column-gap: 20px;
    padding-left: 20px;
    gap: 36px;
    color: #4a6b82; /* Характерный сине-зеленый цвет */
}

.section-list li {
    margin-bottom: 8px;
    break-inside: avoid;
    position: relative;

}

/* Стили для контента */
.section-content {
    line-height: 1.7;
    color: #333; /* Основной цвет текста */
}

/* Секция описания */
.description-section .section-images-wrapper {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
}

.description-section .dual-image-container,
.description-section .section-image-wrapper.single-image {
    width: 100% !important;
    margin: 0 !important;
}

.description-section .section-image {
    object-fit: contain !important;
    max-height: none !important;
    height: auto !important;
    max-width: 100%;
    background: #f8f8f8;
    padding: 10px;
}

/* Стили для подсекций */
.symptoms-subsection {
    margin-bottom: 1rem;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.symptoms-subsection h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #d1d9d0;
}

/* ==================== ИЗОБРАЖЕНИЯ ==================== */
/* Общие стили изображений */
.section-image-wrapper {
    text-align: center;
    margin: 1rem 0;
}

.section-image {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    object-fit: contain;
}

/* Контейнер для двух изображений */
.section-images-wrapper.dual-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
}

.dual-image-container {
    flex: 1;
    min-width: calc(50% - 10px);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.dual-image-container .section-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: center;
}

/* Подписи к изображениям */
.image-caption {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Сетка атрибутов */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.attribute-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid var(--primary);
}

.attribute-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.attribute-label {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 5px;
    display: block;
}

/* ==================== ФИЛЬТРЫ ==================== */
/* Контейнер фильтров */
.filters-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f7f3;
    border-radius: 8px;
    border: 1px solid #d1d9d0;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #d1d9d0;
    border-radius: 4px;
    background: white;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filter-row input[type="text"]:focus {
    outline: none;
    border-color: #8c9e7e;
    box-shadow: 0 0 0 2px rgba(140, 158, 126, 0.2);
}

.filter-row select {
    padding: 10px 15px 10px 5px;
    border: 1px solid #d1d9d0;
    border-radius: 4px;
    background: white;
    font-size: 1rem;
    color: #4a5568;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filter-row select:focus {
    outline: none;
    border-color: #8c9e7e;
    box-shadow: 0 0 0 2px rgba(140, 158, 126, 0.2);
}

.filter-row button[type="submit"] {
    padding: 10px 20px;
    background-color: #6b8e7e;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-row button[type="submit"]:hover {
    background-color: #5a7c6e;
}

.reset-filters {
    margin-left: auto;
    color: #6b8e7e;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.reset-filters:hover {
    text-decoration: underline;
    background-color: rgba(107, 142, 126, 0.1);
}

.active-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f0e8;
    border-left: 4px solid #6b8e7e;
    border-radius: 0 4px 4px 0;
}

/* ==================== ИСТОЧНИКИ ==================== */
.sources-section {
    background-color: #f8f9fa;
    border-left: 4px solid #d1d9d0;
    padding: 20px; margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
}

.sources-section h2 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #d1d9d0;
}

.sources-section .section-list {
    columns: 1;
    padding-left: 20px;
}

.sources-section .section-list li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 2em;
    line-height: 1.6;
    list-style-type: none;
}

.sources-section .section-list li::before {
    content: "•";
    color: #0288d1;
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.2em;
}

.sources-section a {
    color: #6b8e7e;
    text-decoration: none;
    border-bottom: 1px solid #6b8e7e;
    transition: all 0.2s ease;
    padding-bottom: 1px;
}

.sources-section a:hover {
    color: #01579b;
    border-bottom-color: #0288d1;
}

/* ==================== АДАПТИВНЫЕ СТИЛИ ==================== */
@media (max-width: 768px) {
    body {
        line-height: 1.6;
    }

    p, li {
        line-height: 1.5;
    }

    .keywords-section {
        padding-right: 0;
        min-height: 0;
    }

    .keywords-section .section-image-wrapper {
        position: static;
        width: 100%;
        margin-top: 20px !important;
    }

    .keywords-section .section-content {
        padding-right: 0;
    }

    .section-list {
        columns: 1;
    }

    .section-image {
        max-height: 300px;
    }

    .card-section {
        padding: 15px;
    }

    .attributes-grid {
        grid-template-columns: 1fr;
    }

    .attribute-item {
        padding: 12px;
    }

    .section-images-wrapper.dual-images {
        flex-direction: column;
        gap: 15px;
    }

    .dual-image-container {
        min-width: 100%;
    }

    .dual-image-container .section-image {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .card-categories {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .category-item {
        width: 100%;
        justify-content: center;
    }
}
