/* --- Глобальные настройки и переменные --- */
:root {
    --primary: #0056b3;
    --primary-dark: #004494;
    --accent: #ff9800;
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-light: #7f8c8d;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 35px rgba(0, 86, 179, 0.15);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden; /* Чтобы анимации не вызывали горизонтальный скролл */
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }

/* --- Анимация появления контента --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.wrapper {
    width: 100%; /* На всю ширину */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out;
}

/* --- Шапка (Широкая и стильная) --- */
.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 25px 5%; /* Отступы в процентах для ширины */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

.site-header h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }

.auth-panel a {
    margin-left: 15px;
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(255,255,255,0.15);
    font-weight: 600;
    backdrop-filter: blur(5px);
}
.auth-panel a:hover { background: white; color: var(--primary); transform: translateY(-2px); }

/* --- Основная сетка (На всю ширину) --- */
.main-container {
    display: grid;
    grid-template-columns: 280px 1fr 320px; /* Фиксированные боковины, центр тянется */
    gap: 30px;
    padding: 40px 5%; /* Широкие отступы по краям экрана */
    flex: 1;
}

/* --- Левое меню (Стеклянный эффект) --- */
.sidebar-left {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    height: fit-content;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 20px;
}

.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-list li { margin-bottom: 5px; }
.menu-list a {
    display: block;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}
.menu-list a:hover {
    background: #eef2f7;
    color: var(--primary);
    padding-left: 20px; /* Анимация сдвига текста */
}

/* Вложенное меню */
.menu-list ul { list-style: none; padding-left: 15px; background: #fafafa; margin-top: 5px; }
.menu-list ul a { padding: 8px 20px; font-size: 14px; }

/* --- Центральный контент --- */
.content {
    background: transparent;
}

.content h2 {
    font-size: 32px;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}
.content h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* Карточки новостей с анимацией */
.post-preview {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
}

.post-preview:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 86, 179, 0.1);
}

.post-preview img {
    border-radius: 8px;
    transition: transform 0.5s ease;
}
.post-preview:hover img { transform: scale(1.03); }

.post-preview h3 { margin-top: 0; font-size: 24px; color: var(--text-main); }
.post-preview h3 a:hover { color: var(--primary); }

/* --- Правый сайдбар --- */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease;
}
.widget:hover { transform: translateY(-3px); }

.widget h3 {
    margin-top: 0;
    font-size: 18px;
    color: var(--primary);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* Календарь и таблицы */
.calendar-widget table { width: 100%; text-align: center; }
.calendar-widget td { padding: 8px; border-radius: 50%; transition: background 0.2s; cursor: default; }
.calendar-widget td:hover:not(:empty) { background: #f0f0f0; }

/* --- Подвал --- */
.site-footer {
    background: #1a252f;
    color: #ecf0f1;
    padding: 40px 5%;
    margin-top: auto;
    font-size: 15px;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto 30px auto;
    border-bottom: 1px solid #34495e;
    padding-bottom: 30px;
}
.footer-section {
    margin: 10px 20px;
    min-width: 250px;
}
.footer-section h4 {
    color: #fff;
    border-bottom: 2px solid #3498db;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 15px;
}
.footer-section p { margin: 8px 0; font-size: 15px; }
.footer-section a { color: #bdc3c7; }
.footer-section a:hover { color: #3498db; text-decoration: underline; }
.copyright { text-align: center; font-size: 13px; color: #7f8c8d; margin-top: 20px; }

/* --- Стили для Логотипа в шапке (Исправленные размеры) --- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 20px; /* Расстояние между картинкой и текстом */
}

.site-logo-img {
    max-height: 70px; /* Ограничение высоты */
    max-width: 200px; /* Ограничение ширины */
    width: auto;
    height: auto;
    object-fit: contain; /* Сохраняет пропорции */
    background: rgba(255,255,255,0.9);
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo-text h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    color: white;
}

/* --- Адаптивность --- */
@media (max-width: 1200px) {
    .main-container { grid-template-columns: 240px 1fr; }
    .sidebar-right { display: none; } /* Скрываем виджеты на средних экранах */
}

@media (max-width: 768px) {
    .main-container { grid-template-columns: 1fr; padding: 20px; }
    .sidebar-left { display: none; }
    .site-header { flex-direction: column; gap: 15px; padding: 20px; }
    
    .logo-container { flex-direction: column; text-align: center; gap: 10px; }
    .site-logo-img { max-height: 50px; max-width: 150px; }
    
    .post-preview img { float: none !important; width: 100%; margin-bottom: 15px !important; }
}

/* === СТИЛИ ДЛЯ ТАБЛИЦ ВНУТРИ СТАТЕЙ === */
.full-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 16px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.full-content table thead {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
}

.full-content table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #003d80;
}

.full-content table td {
    padding: 12px 18px;
    border-bottom: 1px solid #e9ecef;
    color: #333;
    vertical-align: top;
}

.full-content table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.full-content table tbody tr:hover {
    background-color: #e7f1ff;
    transition: background-color 0.2s ease;
}

.full-content table tbody tr:last-child td {
    border-bottom: none;
}

/* Картинки внутри таблиц */
.full-content table img {
    max-width: 100%;
    max-height: 80px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Заголовки внутри ячеек таблиц */
.full-content table h1,
.full-content table h2,
.full-content table h3,
.full-content table h4 {
    margin: 0;
    font-size: inherit;
    font-weight: 600;
}

/* Ссылки в таблицах */
.full-content table a {
    color: #0056b3;
    text-decoration: none;
    border-bottom: 1px dotted #0056b3;
}

.full-content table a:hover {
    color: #003d80;
    border-bottom-style: solid;
}

/* Списки внутри ячеек таблиц */
.full-content table ul,
.full-content table ol {
    margin: 0;
    padding-left: 20px;
}

/* Адаптивность для мобильных устройств */
.full-content {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .full-content table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .full-content table th,
    .full-content table td {
        padding: 10px 12px;
    }
}

/* Если Summernote использует Bootstrap классы - переопределяем их */
.full-content table.table {
    margin-bottom: 0;
}

.full-content table.table-bordered {
    border: none;
}

.full-content table.table-striped tbody tr:nth-of-type(odd) {
    background-color: transparent;
}

.full-content table.table-hover tbody tr:hover {
    background-color: #e7f1ff;
}