/* CSS Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Светлая тема (по умолчанию) */
    --bg-color: #f8f9fa;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --border-color: #e0e0e0;
    --accent-color: #d35400; /* Сдержанный оранжевый */
    --accent-hover: #a84300;
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #f1f3f5;
    --link-color: #2980b9;
    --link-hover: #1a5276;
    --disabled-color: #95a5a6;
    --blockquote-bg: #f8f9fa;
    --blockquote-border: #d0d7de;
    --code-bg: #f1f3f4;
    --theme-toggle-bg: #ecf0f1;
}

[data-theme="dark"] {
    /* Темная тема */
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --border-color: #333;
    --accent-color: #ff8c42;
    --accent-hover: #ff6b00;
    --header-bg: rgba(30, 30, 30, 0.95);
    --footer-bg: #1a1a1a;
    --link-color: #64b5f6;
    --link-hover: #90caf9;
    --disabled-color: #666;
    --blockquote-bg: #252525;
    --blockquote-border: #444;
    --code-bg: #2d2d2d;
    --theme-toggle-bg: #333;
}

/* Инверсия логотипа для темной темы */
[data-theme="dark"] .logo {
    filter: invert(1) brightness(1.2);
}

/* Основные стили */
html {
    font-size: 18px; /* Увеличенный для десктопа */
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Вот эту строку */
}

body {
    font-family: 'PT Serif', serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

/* Шапка */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.logo {
    height: 70px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

h1 {
    font-family: "Oswald", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
    line-height: 1.3;
    margin: 0;
}

h1 a {
    color: inherit;
    text-decoration: none;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #c62828;
    border-radius: 2px;
}

[data-theme="dark"] h1::after {
    background-color: #ef5350;
}
/* Меню для десктопа */
.desktop-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.desktop-menu a {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s;
}

.desktop-menu a:hover {
    color: var(--accent-color);
}

.desktop-menu a.disabled {
    color: var(--disabled-color);
    cursor: not-allowed;
}

/* Кнопка переключения темы */
.theme-toggle {
    background: var(--theme-toggle-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background-color: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

/* Кнопка меню для мобильных (скрыта на десктопе) */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    background-color: var(--card-bg);
    flex-shrink: 0;
}

/* Мобильное меню (popover) */
#main-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 300px;
    box-shadow: var(--card-shadow);
    margin: 10px;
    display: none;
    z-index: 1000;
}

#main-menu:popover-open {
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-header h2 {
    font-size: 1.3rem;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.close-menu {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-menu a {
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color 0.2s;
}

#main-menu a:last-child {
    border-bottom: none;
}

#main-menu a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] #main-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.mobile-theme-btn {
    background: none;
    border: none;
    padding: 1rem;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
}

/* Основное содержимое */
main {
    padding: 2rem 0;
    flex: 1;
}

.intro {
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-color);
    opacity: 0.9;
}

/* Сетка документов */
.documents-list h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doc-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .doc-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.doc-card-content h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.doc-card-content h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.doc-card-content h3 a:hover {
    color: var(--accent-color);
}

.doc-card-content time {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--disabled-color);
    font-weight: 500;
}

.no-docs {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--disabled-color);
    font-style: italic;
}

/* Страница документа */
.document-view .container {
    max-width: 900px;
}

.document-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.bottom-controls {
    margin-top: 2rem;
    margin-bottom: 0;
    padding-top: 1rem;
    padding-bottom: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
}

.back-link {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-decoration: none;
    color: var(--link-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--link-hover);
}

.document-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.document-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.document-content > * {
    margin-bottom: 1.5rem;
}

.document-content h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.document-content h3 {
    font-size: 1.5rem;
    margin-top: 1.8rem;
    margin-bottom: 1rem;
}

.document-content h4, 
.document-content h5, 
.document-content h6 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--disabled-color);
    font-weight: 600;
}

.document-content p {
    text-align: justify;
    hyphens: auto;
}

.document-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin-left: 0;
    font-style: italic;
    background-color: var(--blockquote-bg);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    border: 1px solid var(--blockquote-border);
    border-left-width: 4px;
}

.document-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 2rem auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.document-content a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.document-content a:hover {
    color: var(--link-hover);
}

.document-content ul, 
.document-content ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.document-content code {
    font-family: 'Courier New', monospace;
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Подвал */
footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    opacity: 0.8;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.footer-note {
    font-size: 0.9rem !important;
    font-style: italic;
    opacity: 0.7 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    html {
        font-size: 16px; /* Стандартный размер на мобильных */
    }
    
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .logo-title {
        order: 1;
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
    }
    
    .desktop-menu {
        display: none; /* Скрываем десктопное меню на мобильных */
    }
    
    .documents-grid {
        grid-template-columns: 1fr; /* Одна колонка на мобильных */
    }
    
    .document-container {
        padding: 1.5rem;
    }
    
    .document-content {
        font-size: 1rem; /* Чуть меньше на мобильных */
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .logo {
        height: 50px;
    }
}

@media (min-width: 769px) {
    #main-menu {
        display: none !important; /* Всегда скрываем popover на десктопе */
    }
}

/* Подчеркивание заголовка H1 красным */
h1 {
    position: relative;
    padding-bottom: 0.5rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #c62828; /* Классический насыщенный красный */
    border-radius: 2px;
}

/* Для темной темы сделаем немного светлее */
[data-theme="dark"] h1::after {
    background-color: #ef5350; /* Более светлый красный для темной темы */
}

/* Стилизация логотипа */
.logo {
    height: 120px; /* Увеличиваем с 60px до 80px */
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    background-color: var(--header-bg); /* Фон как у шапки */
    border-radius: 8px; /* Легкое скругление */
    padding: 5px; /* Отступ вокруг логотипа */
    transition: all 0.3s ease; /* Плавные переходы */
}

/* Для светлой темы: делаем черную графику на прозрачном фоне */
[data-theme="light"] .logo {
    filter: none; /* Оставляем как есть */
    background-color: transparent; /* Убираем фон в светлой теме */
    border: 1px solid var(--border-color); /* Добавляем легкую рамку */
}

/* Для темной темы: инвертируем цвета (черное → белое) */
[data-theme="dark"] .logo {
    filter: invert(1) brightness(1.3); /* Инвертируем и немного осветляем */
    background-color: rgba(255, 255, 255, 0.05); /* Легкий светлый фон */
    border: 1px solid var(--border-color);
}

/* Эффект при наведении */
.logo:hover {
    transform: scale(1.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .logo {
        height: 65px; /* Чуть меньше на мобильных */
    }
}

/* ===== Стили для раздела "Персоналии" ===== */
.personalities {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.personalities h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
}

.section-description {
    text-align: center;
    color: var(--disabled-color);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

/* Аккордеон с персоналиями */
.personalities-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.person-details {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: var(--card-bg);
}

.person-details:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .person-details:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.person-details[open] {
    border-color: var(--accent-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .person-details[open] {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Заголовок аккордеона */
.person-summary {
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    list-style: none; /* Убираем стандартный маркер */
    transition: background-color 0.2s;
}

.person-summary:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .person-summary:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Убираем стандартную стрелку */
.person-summary::-webkit-details-marker {
    display: none;
}

/* Кастомная стрелка */
.person-summary::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--accent-color);
}

.person-details[open] .person-summary::after {
    transform: rotate(180deg);
}

.person-name {
    flex: 1;
}

.doc-count {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--disabled-color);
    margin-left: 1rem;
    background-color: var(--theme-toggle-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

/* Список документов внутри аккордеона */
.person-documents {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.person-doc-link {
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-left: 3px solid var(--accent-color);
}

[data-theme="dark"] .person-doc-link {
    background-color: rgba(255, 255, 255, 0.03);
}

.person-doc-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateX(5px);
    color: var(--accent-color);
}

[data-theme="dark"] .person-doc-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.no-docs {
    padding: 1rem;
    text-align: center;
    color: var(--disabled-color);
    font-style: italic;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

[data-theme="dark"] .no-docs {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Адаптивность для раздела */
@media (max-width: 768px) {
    .personalities {
        margin-top: 3rem;
        padding-top: 2rem;
    }
    
    .person-summary {
        padding: 1rem;
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .doc-count {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .person-documents {
        padding: 1rem;
    }
    
    .person-doc-link {
        padding: 0.7rem;
    }
}

/* Якорная ссылка для плавного скролла */
html {
    scroll-padding-top: 100px; /* Учитываем высоту фиксированной шапки */
}
/* ===== Стили для галереи и фотоальбома ===== */

/* Общие стили для страницы галереи */
.gallery-container {
    max-width: 1200px;
}

.gallery-main {
    padding: 2rem 0;
}

/* Хлебные крошки */
.breadcrumbs {
    margin-bottom: 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.breadcrumbs a {
    color: var(--link-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    color: var(--disabled-color);
    margin: 0 0.5rem;
}

/* Заголовок галереи */
.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Сетка альбомов */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.album-card {
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

[data-theme="dark"] .album-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.album-preview {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.album-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Для превью оставляем cover */
    transition: transform 0.5s ease;
}

.album-card:hover .album-preview img {
    transform: scale(1.05);
}

.album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background-color: var(--theme-toggle-bg);
    color: var(--disabled-color);
}

.album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1rem;
    color: white;
    text-align: right;
}

.album-count {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    display: inline-block;
}

.album-info {
    padding: 1.2rem;
    flex: 1;
}

.album-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.4;
}

/* Заголовок альбома */
.album-header {
    margin-bottom: 2rem;
}

.album-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.album-info-text {
    color: var(--disabled-color);
    font-style: italic;
}

/* Сетка фотографий */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.photo-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.photo-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

[data-theme="dark"] .photo-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.photo-thumbnail {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    flex-shrink: 0;
}

/* ФИКС: Убираем object-fit: cover для миниатюр */
.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Изменено с cover на contain */
    background-color: #f5f5f5;
    transition: transform 0.5s ease;
}

[data-theme="dark"] .photo-thumbnail img {
    background-color: #2a2a2a;
}

.photo-item:hover .photo-thumbnail img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.view-icon {
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.photo-info {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.photo-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
}

.photo-info time {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--disabled-color);
    margin-top: 0.3rem;
}

/* Кнопка назад */
.back-to-albums {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Сообщение об отсутствии альбомов */
.no-albums {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.no-albums p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.hint {
    font-size: 0.9rem !important;
    color: var(--disabled-color);
    font-style: italic;
    margin-top: 1.5rem !important;
}

/* Модальное окно для просмотра фото */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.photo-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    z-index: 2001;
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    max-width: 90vw; /* Изменил на vw */
    max-height: 90vh; /* Изменил на vh */
    width: auto; /* Убрал фиксированную ширину */
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 50vh;
    background-color: rgba(0, 0, 0, 0.2);
    overflow: auto; /* Добавил auto для прокрутки если нужно */
}

#modal-image {
    max-width: calc(90vw - 40px); /* Учитываем padding */
    max-height: calc(90vh - 200px); /* Учитываем высоту инфо-панели */
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.modal-info {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    max-height: 30vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.modal-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.meta-item {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.meta-label {
    font-weight: 600;
    color: var(--disabled-color);
    min-width: 80px;
    flex-shrink: 0;
}

.meta-item span:last-child {
    flex: 1;
    word-break: break-word;
}

.image-info {
    display: flex;
    gap: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--disabled-color);
    flex-wrap: wrap;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

#modal-download {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: auto;
}

#modal-download:hover {
    text-decoration: underline;
}

/* Кнопки модального окна */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-nav:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Активная ссылка в меню */
.desktop-menu a.active,
#main-menu a.active {
    color: var(--accent-color);
    font-weight: 600;
}

/* Адаптивность галереи */
@media (max-width: 768px) {
    .gallery-main {
        padding: 1.5rem 0;
    }
    
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95%;
        width: 95%;
        flex-direction: column;
    }
    
    .modal-image-container {
        padding: 1rem;
        min-height: 50vh;
        max-height: 60vh;
        flex: none;
    }
    
    .modal-info {
        max-height: 40vh;
        padding: 1rem;
        overflow-y: auto;
    }
    
    .modal-info h3 {
        font-size: 1.2rem;
    }
    
    .meta-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .photo-info h3 {
        -webkit-line-clamp: 3;
        min-height: 4.2em;
    }
}

@media (max-width: 480px) {
    .albums-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .photo-info h3 {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        min-height: 2.8em;
    }
}

@media (max-height: 700px) {
    .modal-image-container {
        min-height: 50vh;
        max-height: 60vh;
        padding: 1rem;
    }
    
    .modal-info {
        max-height: 40vh;
        padding: 1rem;
    }
}


/* Стили для описания альбома в карточке */
.album-info {
    padding: 1.2rem;
    flex: 1;
}

.album-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.album-description {
    font-size: 0.9rem;
    color: var(--disabled-color);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Ограничиваем 2 строками */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Адаптивность для описания альбома */
@media (max-width: 768px) {
    .album-description {
        -webkit-line-clamp: 3; /* На мобильных можно 3 строки */
    }
}

/* Описание альбома на странице альбома */
.album-description-page {
    color: var(--disabled-color);
    font-style: italic;
    margin-bottom: 1rem;
    max-width: 800px;
    line-height: 1.5;
}