/* 1. БАЗОВЫЕ СТИЛИ */
html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 2. ШАПКА */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible !important; /* Критично для выпадающего меню */
    background: rgba(255, 255, 255, 0.85); /* Делаем белый чуть прозрачным */
    backdrop-filter: blur(10px);          /* Размываем контент под шапкой */
    -webkit-backdrop-filter: blur(10px);
}

/* 1. БАЗОВЫЕ СТИЛИ (работают везде) */
.zoom-check {
    display: none; /* Скрываем сам чекбокс */
}


.photo-frame {
    display: block;
    position: relative;
    cursor: zoom-in;
}

.photo-frame img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.photo-card:hover .zoom-icon {
    opacity: 1;
    transform: scale(1.05);
}

/* Гарантированное скрытие при клике */
.zoom-check:checked ~ .photo-frame .zoom-icon {
    display: none !important;
}


/* Логотип */
.logo { 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: #1e90ff; 
    line-height: 1.2;
    white-space: nowrap; /* На десктопе всегда в одну строку */
    flex-shrink: 0;

}

/* 1. Стилизация лупы в обычном режиме */
.zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px); /* Модный эффект размытия */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    opacity: 0; /* Прячем по умолчанию */
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
    pointer-events: none; /* Чтобы клик проходил сквозь лупу на фото */
}

/* Скрываем чекбокс */
.menu-toggle { display: none; }

/* Иконка бургер */
.hamburger { 
    display: none; 
    flex-direction: column; 
    gap: 5px; 
    cursor: pointer;
}

.hamburger span { 
    width: 28px; 
    height: 3px; 
    background: #333; 
    transition: 0.3s;
    border-radius: 2px;
}

/* Навигация (Десктоп) */
.nav { display: flex; gap: 20px; }
.nav a { 
    text-decoration: none; 
    color: #333; 
    font-weight: 500; 
    transition: 0.2s;
}
.nav a:hover { color: #1e90ff; }

/* 3. КОНТЕНТ */
.main-content {
    flex: 1;
    background-image: url('/media/images/Lena/img5.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    padding: 40px 5%;
}

/* 4. ФУТЕР */


.footer {
    background: #2f3542;
    color: #fff;
    text-align: center;
    padding: 10px 20px; /* Уменьшили вертикальный отступ до 10px */
    margin-top: auto;   /* Оставляем привязку к низу */
    font-size: 0.9rem;  /* Чуть уменьшим шрифт для компактности */
}

.footer p {
    margin: 0; /* Убираем стандартные отступы абзаца, которые "раздувают" футер */
}


.social-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0.7;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 10px;
    border-radius: 5px;
}

.social-links a:hover {
    opacity: 1;
    color: #1e90ff;
    border-color: #1e90ff;
    transform: translateY(-3px); /* Легкий подъем вверх */
    background: rgba(255,255,255,0.05);
}


.about-section {
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(255, 255, 255, 0.8); /* Светлая подложка */
    backdrop-filter: blur(10px);          /* Размытие фона под текстом */
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.about-image img {
    width: 300px;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.about-text h2 {
    color: #1e90ff;
    margin-top: 0;
    font-size: 2rem;
}

.about-text .subtitle {
    font-weight: bold;
    color: #555;
    margin-bottom: 20px;
}

.about-text p {
    line-height: 1.6;
    color: #333;
text-align: justify;
}

.btn-outline {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    border: 2px solid #1e90ff;
    color: #1e90ff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-outline:hover {
    background: #1e90ff;
    color: #fff;
}

.publications-section {
    margin-top: 60px;
    background: rgba(255, 255, 255, 0.9);
    padding: 50px 7%;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}

.section-title {
    text-align: center;
    color: #1e90ff;
    font-size: 1.8rem;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.pub-item {
    display: flex;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
}

.pub-item:hover {
    transform: translateX(10px); /* Легкий сдвиг при наведении */
}

.pub-item:last-child { border-bottom: none; }

.pub-year {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e90ff;
    min-width: 60px;
    padding-top: 5px;
}

.pub-title {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    color: #2f3542;
}

.pub-meta {
    font-style: italic;
    color: #777;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.pub-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 10px;
    text-align: justify;
}

.pub-link {
    color: #1e90ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.2s;
}

.pub-link:hover { text-decoration: underline; }

.book-gallery { margin-top: 50px; padding: 0 5%; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    justify-items: center;
}

.book-card { cursor: pointer; text-align: center; width: 100%; max-width: 200px; }

.book-cover-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.book-card:hover .book-cover-wrapper { transform: scale(1.05) translateY(-10px); }

.book-cover-wrapper img { width: 100%; height: auto; display: block; }

/* Эффект при наведении */
.book-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 144, 255, 0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.3s;
}

.book-overlay span { color: #fff; font-weight: bold; border: 1px solid #fff; padding: 5px 10px; border-radius: 4px; }
.book-card:hover .book-overlay { opacity: 1; }

.book-caption { margin-top: 15px; font-size: 0.9rem; color: #555; font-style: italic; }


.dates-section {
    margin: 60px 0;
    padding: 40px 5%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    border-left: 5px solid #1e90ff; /* Синий акцент как символ памяти */
}

.dates-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.date-row {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px;
    background: #fdfdfd;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: 0.3s;
    position: relative;
}

.date-row:hover {
    border-color: #1e90ff;
    background: #fff;
}

.date-row.current {
    border-color: #1e90ff;
    background: #f0f7ff; /* Выделение ближайшей даты */
}

.date-day {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e90ff;
    min-width: 80px;
    text-align: center;
    border-right: 2px solid #eee;
    padding-right: 20px;
}

.date-title {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #2f3542;
}

.date-desc {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
}

.current-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #1e90ff;
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.candle-section {
    margin: 60px 0;
    text-align: center;
    padding: 40px;
}

.candle-container { position: relative; max-width: 300px; margin: 0 auto; }
.candle-container.h3 { position: relative; max-width: 300px; margin: 0 auto; }
/* Анимация огонька */
.flame {
    width: 20px; height: 35px;
    background: #ff9d00;
    border-radius: 50% 50% 35% 35%;
    margin: 0 auto 5px;
    position: relative;
    opacity: 0; /* Изначально потушена */
    transition: opacity 1s ease;
    box-shadow: 0 0 20px #ff9d00, 0 0 40px #ff5e00;
    animation: flicker 0.1s infinite alternate;
}

.flame.active { opacity: 1; }

@keyframes flicker {
    0% { transform: scale(1) rotate(-1deg); opacity: 0.9; }
    100% { transform: scale(1.1) rotate(1deg); opacity: 1; }
}

.candle-body {
    width: 40px; height: 60px;
    background: #fdfdfd;
    margin: 0 auto 20px;
    border-radius: 5px;
    border: 1px solid #eee;
}

.btn-candle {
    background: #2f3542;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}


.photo-archive {
    margin: 60px 0;
    padding: 0 5%;
}

.photo-grid {
    display: grid;
    /* Увеличиваем минимальный размер, чтобы фото были видны сразу */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px;
}

.photo-card {
    position: relative;
    isolation: isolate; 
    background: #fff;
    padding: 12px 12px 45px 12px; /* Поля как у бумажных фото */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-radius: 2px;
    transition: all 0.4s ease;
    /* Легкий наклон для живости */
    transform: rotate(var(--rotation, -1deg));
}

/* Чередуем наклон для естественности */
.photo-card:nth-child(even) { --rotation: 1.5deg; }
.photo-card:nth-child(3n) { --rotation: -2deg; }

.photo-card:hover {
    transform: scale(1.03) rotate(0deg); /* Выравнивается при наведении */
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    z-index: 5;
}

.photo-frame {
    width: 100%;
    height: 300px; /* Фиксированная высота для ровности сетки */
    overflow: hidden;
    background: #f0f0f0;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Фото заполняет рамку без искажений */
    filter: sepia(0.2); /* Легкий эффект старины (опционально) */
    transition: 0.5s;
}

.photo-card:hover img {
    filter: sepia(0); /* Проявление цвета при наведении */
}

.photo-info {
    position: absolute;
    bottom: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #666;
}




/* 5. МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 768px) {
    .logo {
        white-space: normal; /* Разрешаем перенос на мобильных */
        max-width: 180px;     /* Ограничиваем ширину, чтобы ФИО разбилось на строки */
        font-size: 1.1rem;   /* Чуть уменьшим размер для компактности */
    } 
    .date-row {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .date-day {
        border-right: none;
        border-bottom: 2px solid #eee;
        padding-right: 0;
        padding-bottom: 10px;
        width: 100%;
    }
    .about-section {
        flex-direction: column; /* Фото над текстом */
        padding: 25px;
        text-align: center;
    }
    
    .about-image img {
        width: 200px;
        height: 200px;
        border-radius: 50%; /* На мобилках можно сделать круглым */
    }


   .hamburger { display: flex; }

    .nav {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 5%; /* Отступ от края экрана */
        width: auto;
        min-width: 180px;
	        
        /* Прозрачность и скрытие */
        background: transparent !important;
        box-shadow: none !important;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: all 0.4s ease-in-out;
        z-index: 2000;
    }

    /* Раскрытие меню (связка с вашим id="menu-toggle") */
    .menu-toggle:checked ~ .nav {
        max-height: 500px;
        opacity: 1;
        padding-top: 20px;
    }

    /* Пункты меню (только текст) */
    .nav a {
        display: block !important;
        padding: 5px 0;
        text-align: right;
        font-size: 1.2rem;
        font-weight: 600;
        color: #333 !important;
        /* Тень для читаемости на фоне фото */
        text-shadow: 0px 0px 10px #fff, 0px 0px 5px #fff;
    }

    /* Анимация крестика */
    .menu-toggle:checked + .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle:checked + .hamburger span:nth-child(2) { opacity: 0; }
    .menu-toggle:checked + .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    /* Эффект при нажатии на мобильных */
    .nav a:active, 
    .nav a:hover {
    color: #1e90ff !important; /* Цвет меняется на ярко-синий */
    transform: translateX(-5px); /* Текст слегка «отпрыгивает» влево */
    transition: 0.2s ease; /* Плавный переход */
    }
    .section-title {
    font-size: 1rem;
    }
    .pub-item {
        flex-direction: column;
        gap: 10px;
    }
    .pub-year {
        background: #1e90ff;
        color: #fff;
        display: inline-block;
        width: fit-content;
        padding: 2px 10px;
        border-radius: 4px;
        font-size: 1rem;
    }
    .pub-info { text-align: left; }


}
/* На десктопе добавим красивое подчеркивание */
@media (min-width: 769px) {
.logo {
    transition: color 0.3s ease;
}
.logo:hover {
    color: #0056b3; /* Глубокий синий */
}
    .nav a {
        position: relative;
    }
    .nav a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: -4px;
        left: 0;
        background-color: #1e90ff;
        transition: width 0.3s ease;
    }
    .nav a:hover::after {
        width: 100%;
    }
}


@media (min-width: 1025px) {
    /* Отключаем ЛЮБЫЕ анимации при переходе в режим зума */
    .photo-card:has(.zoom-check:checked),
    .photo-card:has(.zoom-check:checked) .photo-frame,
    .photo-card:has(.zoom-check:checked) img {
        transition: none !important; /* Убираем 0.4s ease */
        animation: none !important;
        transform: none !important;
    }

    /* Исправляем возможный скачок из-за скролла */
    body:has(.zoom-check:checked) {
        overflow: hidden;
        /* Если страница дергается вправо, можно добавить: */
        padding-right: var(--scrollbar-width, 0px); 
    }
    /* 1. Сбрасываем "контекст" карточки, чтобы fixed работал от края до края */
    .photo-card:has(.zoom-check:checked) {
        transform: none !important; /* Убираем наклон карточки */
        perspective: none !important;
        filter: none !important;
        z-index: 9999;
    }

    /* 2. Растягиваем рамку на весь экран */
    .zoom-check:checked ~ .photo-frame {
        position: fixed;
        top: 0 !important;   /* Принудительно в самый верх */
        left: 0 !important;  /* В самый левый край */
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.95);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        margin: 0 !important;
        padding: 0 !important;
        cursor: zoom-out;
    }

    /* 3. Центрируем само изображение */
    .zoom-check:checked ~ .photo-frame img {
        width: auto;
        height: auto;
        max-width: 90%;
        max-height: 85%; /* Оставляем чуть места для воздуха */
        object-fit: contain;
        border: 8px solid white;
        box-shadow: 0 0 40px rgba(0,0,0,0.8);
        filter: sepia(0);
        transform: none !important; /* Сбрасываем любые наклоны картинки */
    }

    /* Прячем текст подписи, чтобы не мешался */
    .zoom-check:checked ~ .photo-info {
        display: none;
    }
}
