/* ==========================================================================
   КОРНЕВЫЕ ПЕРЕМЕННЫЕ И БАЗОВЫЕ НАСТРОЙКИ
   ========================================================================== */
:root {
    /* Цветовая палитра Литературного Содружества */
    --ls-primary: #2C3E50;
    --ls-secondary: #8B4513;
    --ls-accent: #C19A6B;
    --ls-accent-light: #E8D9C5;
    --ls-dark: #1A252F;
    --ls-light: #F8F5F0;
    --ls-gray-light: #eaeaea;
    --ls-gray: #dee2e6;
    --ls-text: #333;
    --ls-white: #ffffff;
    --ls-success: #28a745;
    --ls-warning: #ffc107;
    --ls-info: #17a2b8;
    --ls-danger: #dc3545;
    
    /* Тени */
    --ls-shadow-sm: 0 2px 5px rgba(44, 62, 80, 0.1);
    --ls-shadow-md: 0 5px 15px rgba(44, 62, 80, 0.1);
    --ls-shadow-lg: 0 10px 25px rgba(44, 62, 80, 0.15);
    --ls-shadow-xl: 0 12px 30px rgba(44, 62, 80, 0.15);
    
    /* Анимации */
    --ls-transition-fast: 0.2s ease;
    --ls-transition-normal: 0.3s ease;
    --ls-transition-slow: 0.5s ease;
    
    /* Скругления */
    --ls-radius-sm: 4px;
    --ls-radius-md: 8px;
    --ls-radius-lg: 10px;
    --ls-radius-xl: 12px;
    --ls-radius-full: 50%;
}

/* ==========================================================================
   ТИПОГРАФИЯ
   ========================================================================== */

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--ls-text);
    background-color: var(--ls-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    color: var(--ls-primary);
}

.display-1, .display-2, .display-3, .display-4 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
}

.lead {
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
}

/* ==========================================================================
   КОМПОНЕНТЫ ЛИТЕРАТУРНОГО ОБЩЕСТВА
   ========================================================================== */

/* Герой-секция */
.hero-section {
    background: linear-gradient(135deg, 
        rgba(44, 62, 80, 0.05) 0%, 
        rgba(139, 69, 19, 0.05) 100%);
    position: relative;
    overflow: hidden;
}


/* Карточки */
.card {
    border: 1px solid var(--ls-accent-light);
    border-radius: var(--ls-radius-lg);
    transition: all var(--ls-transition-normal);
    background: var(--ls-white);
}

.card:hover {
    box-shadow: var(--ls-shadow-lg);
    border-color: var(--ls-accent);
}

/* Кнопки */
.btn-primary {
    background-color: var(--ls-primary);
    border-color: var(--ls-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #1A252F;
    border-color: #1A252F;
}

.btn-outline-primary {
    color: var(--ls-primary);
    border-color: var(--ls-primary);
}

.btn-outline-primary:hover {
    background-color: var(--ls-primary);
    border-color: var(--ls-primary);
    color: white;
}

/* Навигация */
.navbar {
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.1);
}

.navbar-nav .nav-link {
    color: var(--ls-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color var(--ls-transition-fast);
}

.navbar-nav .nav-link:hover {
    color: var(--ls-secondary);
}

.navbar-nav .nav-link.active {
    color: var(--ls-secondary);
    font-weight: 600;
}

/* Секции */
section {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }
}

/* Палитра цветов для текста */
.text-primary {
    color: var(--ls-primary) !important;
}

.text-secondary {
    color: var(--ls-secondary) !important;
}

.text-accent {
    color: var(--ls-accent) !important;
}

/* Фоновая палитра */
.bg-primary {
    background-color: var(--ls-primary) !important;
}

.bg-secondary {
    background-color: var(--ls-secondary) !important;
}

.bg-accent {
    background-color: var(--ls-accent) !important;
}

.bg-accent-light {
    background-color: var(--ls-accent-light) !important;
}

.bg-light {
    background-color: var(--ls-light) !important;
}

/* Бейджи */
.badge.bg-primary {
    background-color: var(--ls-primary) !important;
}

.badge.bg-secondary {
    background-color: var(--ls-secondary) !important;
}

/* Формы */
.form-control {
    border: 1px solid var(--ls-accent-light);
    border-radius: var(--ls-radius-md);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--ls-transition-normal);
}

.form-control:focus {
    border-color: var(--ls-accent);
    box-shadow: 0 0 0 0.25rem rgba(193, 154, 107, 0.25);
}

/* Прогресс-бары */
.progress {
    background-color: var(--ls-accent-light);
    border-radius: var(--ls-radius-md);
    height: 10px;
}

.progress-bar {
    background-color: var(--ls-accent);
    border-radius: var(--ls-radius-md);
}

/* Анимации для литературной темы */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes writing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Анимированные элементы */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.writing-animation {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--ls-accent);
    animation: writing 3.5s steps(40, end);
}

/* Декоративные элементы */
.ink-blot {
    position: relative;
}

.ink-blot::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, 
        rgba(44, 62, 80, 0.1) 0%, 
        rgba(44, 62, 80, 0) 70%);
    border-radius: 50%;
    z-index: -1;
}

.pen-decoration {
    position: relative;
}

.pen-decoration::after {
    content: '✒';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ls-accent);
    opacity: 0.3;
    font-size: 2rem;
}

/* Стили для футера */
.footer {
    background: linear-gradient(to bottom, var(--ls-dark), #151F29);
    color: white;
}

.footer h6 {
    color: var(--ls-accent);
    font-weight: 600;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--ls-transition-fast);
}

.footer a:hover {
    color: var(--ls-accent);
}

.footer address {
    font-style: normal;
    line-height: 1.6;
}

/* Стили для модальных окон */
.modal-content {
    border: none;
    border-radius: var(--ls-radius-lg);
    overflow: hidden;
}

.modal-header {
    background-color: var(--ls-primary);
    color: white;
    border-bottom: 3px solid var(--ls-accent);
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Стили для галереи */
.history-gallery img {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.history-gallery img:hover {
    transform: scale(1.05);
}

/* Стили для таймлайна */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ls-accent);
}

.timeline-year {
    position: absolute;
    left: -40px;
    top: 0;
    background: var(--ls-secondary);
    color: white;
    padding: 5px 10px;
    border-radius: var(--ls-radius-sm);
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

/* Стили для событий */
.event-date-small {
    background: var(--ls-accent-light);
    border-radius: var(--ls-radius-sm);
    padding: 8px;
    text-align: center;
    min-width: 45px;
}

.event-date-small .fw-bold {
    font-size: 1.2rem;
    line-height: 1;
}

/* Стили для обсуждений */
.discussion-topic {
    border-left: 3px solid var(--ls-accent);
    padding-left: 15px;
}

.discussion-topic:hover {
    background: var(--ls-accent-light);
}

/* Адаптивность */
@media (max-width: 992px) {
    .hero-section .display-4 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .timeline {
        padding-left: 30px;
    }
    
    .timeline-year {
        left: -30px;
        min-width: 50px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .hero-section .display-4 {
        font-size: 1.75rem;
    }
    
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-year {
        left: -20px;
        min-width: 40px;
        font-size: 0.8rem;
        padding: 3px 5px;
    }
}

/* Утилитарные классы */
.ls-rounded {
    border-radius: var(--ls-radius-lg);
}

.ls-shadow {
    box-shadow: var(--ls-shadow-md);
}

.ls-hover-shadow:hover {
    box-shadow: var(--ls-shadow-lg);
}

.ls-border {
    border: 1px solid var(--ls-accent-light);
}

.ls-border-accent {
    border: 1px solid var(--ls-accent);
}

/* Стили для текста с эффектом старинной бумаги */
.vintage-text {
    background: linear-gradient(to bottom, 
        rgba(248, 245, 240, 0.9) 0%, 
        rgba(232, 217, 197, 0.9) 100%);
    padding: 20px;
    border: 1px solid var(--ls-accent);
    box-shadow: inset 0 0 20px rgba(139, 69, 19, 0.1);
    position: relative;
}

.vintage-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.1"><path d="M0,0 L100,0 L100,100 Z" fill="%238B4513"/></svg>');
    pointer-events: none;
}

/* Стили для полосы со статистикой и навигацией */
.bg-primary .text-center .fs-5 {
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bg-primary .opacity-75 {
    opacity: 0.85 !important;
}

.bg-primary a {
    transition: all var(--ls-transition-fast);
    position: relative;
    padding: 5px 10px !important;
    border-radius: var(--ls-radius-sm);
}

.bg-primary a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Разделитель между статистикой и навигацией */
@media (min-width: 768px) {
    .bg-primary .row > .col-md-6:first-child {
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }
}

/* Адаптивность */
@media (max-width: 767px) {
    .bg-primary .row > .col-md-6 {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .bg-primary .row > .col-md-6:first-child {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
}