/* === CSS-переменные для тем === */
:root {
    --background: linear-gradient(to bottom right, #1a1a1d, #2c2c2e);
    --text-color: #e0e0e0;
    --header-bg: #252529;
    --header-text: #d1d5db;
    --sidebar-bg: #2c2c2e;
    --sidebar-text: #d1d5db;
    --category-bg: transparent;
    --category-hover-bg: #3b3b3f;
    --category-active-bg: #60a5fa; /* Зеленый заменен на голубой */
    --category-active-text: #1a1a1d;
    --category-border: #60a5fa; /* Зеленый заменен на голубой */
    --category-active-border: #3b82f6; /* Ховер зеленого заменен на темный голубой */
    --post-bg: #252529;
    --post-link: #d1d5db;
    --post-link-hover: #60a5fa; /* Зеленый заменен на голубой */
    --post-preview: #9ca3af;
    --post-meta: #6b7280;
    --pagination-bg: #2c2c2e;
    --pagination-hover-bg: #3b3b3f;
    --pagination-active-bg: #60a5fa; /* Зеленый заменен на голубой */
    --pagination-active-text: #1a1a1d;
    --pagination-text: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.4);
    --hamburger-stroke: #9ca3af;
}

/* Светлая тема (в стиле ВК, мягкие цвета) */
[data-theme="light"] {
    --background: linear-gradient(to bottom right, #f5f7fa, #e4e7eb);
    --text-color: #333333;
    --header-bg: #ffffff;
    --header-text: #333333;
    --sidebar-bg: #ffffff;
    --sidebar-text: #333333;
    --category-bg: transparent;
    --category-hover-bg: #e6ecf2;
    --category-active-bg: #4a76a8;
    --category-active-text: #ffffff;
    --category-border: #4a76a8;
    --category-active-border: #355a8a;
    --post-bg: #ffffff;
    --post-link: #333333;
    --post-link-hover: #4a76a8;
    --post-preview: #666666;
    --post-meta: #999999;
    --pagination-bg: #ffffff;
    --pagination-hover-bg: #e6ecf2;
    --pagination-active-bg: #4a76a8;
    --pagination-active-text: #ffffff;
    --pagination-text: #333333;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.15);
    --hamburger-stroke: #666666;
}

/* === Общие стили страницы === */
body {
    background: var(--background);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* === Контейнер для контента === */
.container {
    max-width: 985px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 325px 1fr;
    gap: 24px;
}

/* === Стили шапки === */
header {
    background: var(--header-bg);
    box-shadow: var(--shadow);
    padding: 16px 24px;
}

header h1 {
    color: var(--header-text);
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

/* === Стили логотипа === */
.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(to right, var(--header-text), var(--category-border));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    letter-spacing: 1px;
    transition: transform 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 1s ease-in-out;
}

.logo span {
    background: none;
    color: var(--category-border);
    font-weight: 500;
    -webkit-background-clip: initial;
    background-clip: initial;
}

.logo:hover {
    transform: translateY(-2px);
}

/* Анимация появления логотипа */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Стили боковой панели === */
.sidebar {
    background: var(--sidebar-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease-in-out, background 0.3s ease, box-shadow 0.3s ease;
}

.sidebar h2 {
    color: var(--sidebar-text);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px;
}

/* === Стили категорий === */
.category {
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent;
    color: var(--text-color);
    background: var(--category-bg);
	display: flex;
    align-items: center;
    gap: 6px;
}

.category:hover {
    background: var(--category-hover-bg);
    border-left-color: var(--category-border);
}

.category.active {
    background: var(--category-active-bg);
    color: var(--category-active-text);
    border-left-color: var(--category-active-border);
}

/* Стили постов */
.post {
    background: var(--post-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    transition: box-shadow 0.2s ease-in-out, background 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.post-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-title {
    color: var(--post-link);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

.post-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
    display: block;
    transition: opacity 0.3s ease-in-out;
    opacity: 0.95;
}

.post-image:hover {
    opacity: 1;
}

.post-preview {
    color: var(--post-preview);
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.post-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    display: block;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--post-meta);
    font-size: 14px;
    line-height: 1.4;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta-item svg {
    width: 16px;
    height: 16px;
    stroke: var(--post-meta);
    flex-shrink: 0;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .post {
        padding: 16px;
        margin-bottom: 24px;
    }

    .post-title {
        font-size: 20px;
    }

    .post-image {
        height: 180px;
    }

    .post-preview {
        font-size: 15px;
    }

    .post-meta {
        font-size: 13px;
        gap: 10px;
    }

    .post-meta-item svg {
        width: 14px;
        height: 14px;
    }
}

/* Стили для пустого состояния */
.post[style*="text-align: center"] {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 32px;
}

.post[style*="text-align: center"] h2 {
    color: var(--post-link);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.post[style*="text-align: center"] p {
    color: var(--post-preview);
    font-size: 15px;
    margin-bottom: 16px;
}

.post[style*="text-align: center"] span {
    color: var(--post-link-hover);
    cursor: pointer;
}
/* === Стили пагинации === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination span {
    padding: 8px 14px;
    background: var(--pagination-bg);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    color: var(--pagination-text);
}

.pagination span:hover {
    background: var(--pagination-hover-bg);
    color: var(--post-link-hover);
}

.pagination span.active {
    background: var(--pagination-active-bg);
    color: var(--pagination-active-text);
}

/* === Стили гамбургер-меню === */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger svg {
    width: 24px;
    height: 24px;
    stroke: var(--hamburger-stroke);
}

/* Стили для кнопки переключения темы */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--hamburger-stroke);
}

/* === Адаптивные стили для мобильных устройств === */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
        background: var(--sidebar-bg);
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s ease-in-out; /* Добавлено для плавной анимации */
    }

    .sidebar.visible {
        transform: translateX(0);
    }

    .hamburger {
        display: block;
    }

    .post {
        padding: 16px;
    }

    .post a {
        font-size: 20px;
    }

    .pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }

    .logo {
        font-size: 24px;
    }

    .post-preview-image {
        max-width: 100%; /* На мобильных убираем ограничение 300px */
        height: 350px; /* Меньшая высота для компактности */
    }
}

/* === Стили футера === */
.footer {
    background: var(--header-bg);
    padding: 24px 0;
    margin-top: 40px;
    box-shadow: var(--shadow);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copyright {
    color: var(--post-meta);
    font-size: 14px;
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--post-link);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 16px;
    }
    
    .footer-copyright {
        font-size: 13px;
    }

    .footer-links {
        gap: 16px;
        justify-content: flex-start;
    }
    
    #search-form {
        gap: 6px;
    }

    #search-form input {
        padding: 8px 10px;
        font-size: 14px;
    }

    #search-form button {
        padding: 8px;
    }

    #search-form button svg {
        width: 18px;
        height: 18px;
    }
}

/* Стили для формы поиска */
#search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

#search-form input {
    flex: 1;
    padding: 10px 12px;
    background: var(--post-bg);
    color: var(--text-color);
    border: 1.5px solid var(--category-active-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#search-form input::placeholder {
    color: var(--post-meta);
    opacity: 0.7;
}

#search-form input:focus {
    border-color: var(--category-active-border);
    box-shadow: 0 0 0 3px rgba(var(--category-active-border-rgb), 0.2);
    outline: none;
}

#search-form button {
    padding: 10px;
    background: var(--category-active-bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease-in-out, transform 0.1s ease-in-out, box-shadow 0.2s ease-in-out;
}

#search-form button:hover {
    background: var(--category-hover-bg);
    box-shadow: var(--shadow);
}

#search-form button:active {
    transform: scale(0.95);
}

#search-form button svg {
    width: 20px;
    height: 20px;
    stroke: var(--category-active-text);
}
.nav_butt {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
/* Стили кнопки входа в админ-панель */
.admin-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent;
    color: var(--text-color);
    background: var(--category-bg);
    text-decoration: none;
}

.admin-login-btn:hover {
    background: var(--category-hover-bg);
    border-left-color: var(--category-border);
}