:root {
    --bg-color: #FAFAFA;
    --surface-color: #FFFFFF;
    --accent-yellow: #FFF5E1;
    --accent-emerald: #1A433A;
    --accent-emerald-light: #D4E2D4;
    --text-main: #2B2B2B;
    --text-muted: #666666;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Шапка сайта */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background-color: var(--surface-color);
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-emblem {
    width: 150px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-emerald);
    letter-spacing: -0.5px;
}

/* Навигация */
nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

nav a:hover, nav a.active {
    color: var(--accent-emerald);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-emerald);
    border-radius: 2px;
}

.nav-future {
    color: var(--text-muted);
    font-style: italic;
    cursor: not-allowed;
}

/* Личный кабинет */
.header-right {
    display: flex;
    align-items: center;
}

.user-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-yellow);
    border: 2px solid var(--accent-emerald-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
}

.user-avatar-btn i {
    color: var(--accent-emerald);
    font-size: 1.1rem;
}

/* Основной контент */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 5%;
}

.hero-section {
    background-color: var(--surface-color);
    padding: 60px;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.01);
    margin-bottom: 40px;
}

.badge {
    display: inline-block;
    background-color: var(--accent-yellow);
    color: var(--text-main);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.8rem;
    color: var(--accent-emerald);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-text {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 35px;
}

.btn-primary {
    display: inline-block;
    background-color: var(--accent-emerald);
    color: #FFFFFF;
    padding: 14px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #245c50;
}

/* Лента постов */
.log-item {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.02);
}

.log-header {
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-content {
    font-size: 1.05rem;
}

.log-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* Подвал */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
        gap: 8px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px 25px;
    }

    .header-right {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    .hero-section {
        padding: 30px 20px;
        border-radius: 16px;
    }

    h1 {
        font-size: 2rem;
    }

    .hero-text {
        font-size: 1rem;
    }
}

/* РАЗДЕЛ: ОБ АВТОРЕ (СЛАЙДЕР И ИНФОРМАЦИЯ)*/

/* Главный контейнер секции */
.author-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 0 0 60px 0;
    margin-bottom: 60px;
}

.author-gallery {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow-x: auto; /* Включает горизонтальную прокрутку */
    scroll-snap-type: x mandatory; /* Эффект мягкого прилипания при скролле */
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.author-gallery::-webkit-scrollbar {
    height: 6px;
}

.author-gallery::-webkit-scrollbar-thumb {
    background-color: var(--accent-emerald-light);
    border-radius: 10px;
}

/* Карточки-контейнеры для фотографий внутри слайдера */
.photo-main,
.photo-sub {
    flex: 0 0 85%; /* На смартфонах карточка занимает 85% ширины экрана */
    scroll-snap-align: center; /* Центрирует фото при остановке скролла */
    height: 850px; /* Оптимальная высота, чтобы фото не выглядело огромным */
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

.photo-main {
    background-color: var(--accent-yellow);
}

.photo-sub {
    background-color: var(--accent-emerald-light);
}

/* Адаптация ширины фото под экраны компьютеров (ПК) */
@media (min-width: 992px) {
    .photo-main,
    .photo-sub {
        flex: 0 0 65%; /* На ПК карточки становятся шире для лучшего обзора */
    }
}

/* Сами картинки внутри слайдера */
.photo-main img,
.photo-sub img,
.author-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* Запрещает случайный захват картинки мышкой */
}


/* --- ТЕКСТОВАЯ ИНФОРМАЦИЯ И СОЦСЕТИ --- */

.author-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.author-info h2 {
    font-size: 2.2rem;
    color: var(--accent-emerald);
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 700;
}

/* Блок социальных сетей */
.author-socials {
    margin: 15px 0 25px 0;
    width: 100%;
}

.socials-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
}

.socials-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: var(--surface-color);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-emerald);
    text-decoration: none;
    transition: all 0.25s ease;
}

.social-link i {
    color: inherit;
    font-size: 1.3rem;
    line-height: 1;
}

.social-link:hover {
    transform: translateY(-3px);
    background-color: var(--accent-yellow);
    border-color: var(--accent-emerald-light);
    box-shadow: 0 5px 15px rgba(26, 67, 58, 0.05);
}


/* --- КАРТОЧКИ ФАКТОВ И ОБРАЗОВАНИЯ --- */

.author-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0 30px 0;
    width: 100%;
}

.fact-card {
    background-color: var(--surface-color);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.02);
}

.fact-icon i {
    color: var(--accent-emerald);
    font-size: 1.5rem;
    margin-bottom: 12px;
    display: inline-block;
}

.fact-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--accent-emerald);
}

.fact-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}


/* ДОПОЛНИТЕЛЬНЫЕ ИСПРАВЛЕНИЯ ШАПКИ*/

header a.brand-name {
    text-decoration: none;
    color: var(--accent-emerald);
    transition: opacity 0.2s ease;
}

header a.brand-name:hover {
    opacity: 0.8;
}


/* --- АДАПТИВНОСТЬ ДЛЯ БЛОКА АВТОРА --- */

@media (max-width: 992px) {
    .author-section {
        grid-template-columns: 1fr; /* Перестраивает фото и текст в одну колонку */
        gap: 40px;
    }

    .socials-row {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .author-facts {
        grid-template-columns: 1fr; /* Карточки образования встают друг под друга */
    }
}

/* о проекте текст */
/* Оформление текста в блоке О проекте */
.hero-description {
    max-width: 800px;
    margin-bottom: 35px;
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.7;
}

.hero-description p {
    margin-bottom: 16px;
    text-align: justify;
}

/* Выделение ключевых слов */
.highlight-name {
    color: var(--accent-emerald);
    font-weight: 700;
    border-bottom: 2px solid var(--accent-emerald-light);
}

.highlight-spec {
    background-color: var(--accent-yellow);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.project-name {
    font-style: italic;
    color: var(--text-muted);
}

/* Минималистичная плашка-цитата */
.hero-quote {
    background-color: var(--bg-color);
    border-left: 4px solid var(--accent-emerald);
    padding: 15px 20px;
    border-radius: 0 12px 12px 0;
    margin: 25px 0;
    font-weight: 600;
    color: var(--accent-emerald);
    font-size: 1.15rem;
}

/*
Электронная книга
 */
/
.book-content p {
    margin-bottom: 20px;
    text-indent: 30px; /* Красная строка для каждого абзаца */
    text-align: justify;
    color: var(--text-main);
    font-size: 1.15rem;
    line-height: 1.8;
}

.book-content h2,
.book-content h3 {
    color: var(--accent-emerald);
    margin: 35px 0 20px 0;
    font-weight: 700;
    line-height: 1.3;
}
/* Контейнер пагинации */
.book-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    padding: 20px 0;
    border-top: 1px solid rgba(26, 67, 58, 0.08);
}

/* Текст счетчика глав */
.book-pagination .page-counter {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--text-muted, #666666);
    font-size: 0.95rem;
}

/* Красивая анимация кнопок пагинации при наведении */
.book-pagination .btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 10px 22px;
    background-color: var(--accent-emerald, #1A433A);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.book-pagination .btn-primary:hover {
    transform: translateY(-2px);
    background-color: #245c50;
    box-shadow: 0 4px 12px rgba(36, 92, 80, 0.15);
}

.book-pagination .btn-primary:active {
    transform: translateY(0);
}

/* Блок обложки книги */
.book-cover-block {
    text-align: center;
    margin-bottom: 50px;
}

/* Контейнер для картинки 200x300 */
.book-cover-container {
    width: 400px;
    height: 600px;
    background-color: var(--accent-emerald-light);
    margin: 0 auto 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden; /* Обрезает картинку по радиусу углов */
}

.book-cover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет рамку без искажения пропорций */
    display: block;
}

.book-title-main {
    color: var(--accent-emerald);
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.book-author-main {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-style: italic;
}

.book-divider {
    border: 0;
    height: 1px;
    background-color: var(--accent-emerald-light);
    margin-top: 30px;
}
/* Убираем маркеры-точки и отступы у списков в книге */
.book-content ul {
    list-style: none; /* Полностью скрывает точки сбоку */
    padding: 0;       /* Убирает сдвиг текста вправо */
    margin: 0 0 20px 0;
}

.book-content li {
    margin-bottom: 12px; /* Расстояние между строками оглавления */
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Красивое оформление ссылок в оглавлении */
.book-content a {
    color: var(--accent-emerald);
    text-decoration: none;
    border-bottom: 1px dashed rgba(26, 67, 58, 0.3);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.book-content a:hover {
    color: #245c50;
    border-bottom-style: solid;
    border-bottom-color: var(--accent-emerald);
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО АВТОРИЗАЦИИ
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 67, 58, 0.2); /* Фирменный изумрудный оверлей */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #FFFFFF;
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(26, 67, 58, 0.05);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted, #666666);
    cursor: pointer;
    line-height: 1;
}

.modal-content h2 {
    color: var(--accent-emerald, #1A433A);
    font-size: 1.6rem;
    margin-bottom: 6px;
    font-weight: 700;
}

.modal-subtitle {
    color: var(--text-muted, #666666);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-emerald, #1A433A);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(26, 67, 58, 0.15);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    border-color: var(--accent-emerald, #1A433A);
}

/* Ошибки */
.auth-error-msg {
    display: none;
    background: #FFF5F5;
    color: #C53030;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-left: 3px solid #E53E3E;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
}

/* Переключалка */
.modal-toggle-text {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted, #666666);
}

.toggle-link-btn {
    background: none;
    border: none;
    color: var(--accent-emerald, #1A433A);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    padding: 0;
}

/* ==========================================================================
   ВЫДВИЖНАЯ ПАНЕЛЬ ПРОФИЛЯ (DRAWER) — PREMIUM RECONSTRUCT
   ========================================================================== */

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 67, 58, 0.15); /* Чуть более глубокий оттенок */
    backdrop-filter: blur(8px); /* Усиленное размытие для фокуса */
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 2500;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-content {
    position: absolute;
    top: 16px; /* Делаем отступы сверху, снизу и справа, чтобы панель "парила" */
    right: -440px;
    width: calc(100% - 32px);
    max-width: 400px;
    height: calc(100% - 32px);
    background: #FFFFFF;
    box-shadow: -15px 0 40px rgba(26, 67, 58, 0.08); /* Теплая фирменная тень */
    border: 1px solid rgba(26, 67, 58, 0.08);
    border-radius: 24px; /* Красивые глубокие скругления */
    padding: 40px 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Фирменный мягкий выезд */
}

.drawer-overlay.active .drawer-content {
    right: 16px; /* Встает с аккуратным зазором от края экрана */
}

.drawer-close-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    background: rgba(26, 67, 58, 0.04);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--accent-emerald, #1A433A);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.drawer-close-btn:hover {
    background: rgba(26, 67, 58, 0.08);
    transform: scale(1.05);
}

/* Шапка профиля */
.profile-header {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 35px;
}

.profile-avatar-large {
    font-size: 2.5rem;
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, rgba(26, 67, 58, 0.03), rgba(26, 67, 58, 0.08));
    border: 2px solid rgba(26, 67, 58, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(26, 67, 58, 0.05);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Обрезает края, сохраняя пропорции без растягивания */
    display: block;
    border-radius: 50%;
}

.profile-header h3 {
    color: var(--accent-emerald, #1A433A);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
}

/* Поля формы и текстовые зоны */
.drawer-content input[type="text"],
.drawer-content textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(26, 67, 58, 0.12);
    background: #FAFAFA;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main, #222222);
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.drawer-content input[type="text"]:focus,
.drawer-content textarea:focus {
    border-color: var(--accent-emerald, #1A433A);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(26, 67, 58, 0.05); /* Мягкое внешнее свечение */
}

.profile-success-msg {
    display: none;
    color: #137333;
    background: #E6F4EA;
    border: 1px solid #CEEAD6;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

/* Кнопки действий */
.profile-save-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26, 67, 58, 0.15);
}

.btn-logout {
    margin-top: auto;
    background: transparent;
    border: 1px solid rgba(229, 62, 62, 0.2);
    color: #E53E3E;
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.btn-logout:hover {
    background: #FFF5F5;
    border-color: #E53E3E;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптивность под смартфоны */
@media (max-width: 440px) {
    .drawer-content {
        top: 0;
        right: -100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .drawer-overlay.active .drawer-content {
        right: 0;
    }
}


/* Стили для Telegram-разметки */
.post-content strong {
    font-weight: 700;
    color: var(--text-main);
}

.post-content em {
    font-style: italic;
    opacity: 0.9;
}

.post-content del {
    text-decoration: line-through;
    opacity: 0.6;
}

.post-content code {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(26, 67, 58, 0.06);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #c0392b; /* Приятный красноватый оттенок для кода */
}

