/* Общие стили */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background-color: #333;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Для адаптивности меню */
}

header h1 {
    margin: 0;
    font-size: 1.8em;
}

header h1 a {
    color: #fff;
    text-decoration: none;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    color: #fff;
    font-weight: bold;
    padding: 5px 0;
    display: block;
}

.menu-toggle {
    display: none; /* Скрываем по умолчанию для десктопа */
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
}

/* Main Content Layout */
main {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 30px 0;
}

.news-feed {
    flex: 3; /* Занимает 3 части из 4 */
    min-width: 0; /* Важно для Flexbox */
}

.sidebar {
    flex: 1; /* Занимает 1 часть из 4 */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 250px; /* Минимальная ширина сайдбара */
}

.sidebar h3 {
    margin-top: 0;
    color: #007bff;
}

/* News Item Styles */
.news-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.news-item img {
    max-width: 200px;
    height: auto;
    border-radius: 5px;
    object-fit: cover;
}

.news-item .content {
    flex: 1;
}

.news-item h2 {
    margin-top: 0;
    font-size: 1.5em;
}

.news-item h2 a {
    color: #333;
    text-decoration: none;
}

.news-item h2 a:hover {
    color: #007bff;
}

.news-item p {
    line-height: 1.6;
}

.news-item .meta {
    font-size: 0.9em;
    color: #777;
    margin-top: 10px;
}

/* Sidebar News Item */
.sidebar .news-item-small {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar .news-item-small:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar .news-item-small h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.sidebar .news-item-small h4 a {
    color: #333;
    text-decoration: none;
}

.sidebar .news-item-small h4 a:hover {
    color: #007bff;
}

.sidebar .news-item-small .meta {
    font-size: 0.8em;
    color: #999;
}


/* Footer */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

/* Адаптивность */
@media (max-width: 992px) {
    main {
        flex-direction: column; /* На небольших экранах колонки располагаются одна под другой */
    }

    .news-feed, .sidebar {
        flex: auto; /* Занимают всю доступную ширину */
    }

    .sidebar {
        order: -1; /* Перемещаем сайдбар наверх на мобильных */
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    header nav {
        width: 100%;
        display: none; /* Скрываем навигацию по умолчанию */
    }

    header nav.active {
        display: block; /* Показываем при активации */
    }

    header nav ul {
        flex-direction: column;
        width: 100%;
    }

    header nav ul li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    header nav ul li:last-child {
        border-bottom: none;
    }

    header nav ul li a {
        padding: 10px 15px;
    }

    .menu-toggle {
        display: block; /* Показываем кнопку меню */
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .news-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .news-item img {
        max-width: 100%;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .news-item h2 {
        font-size: 1.2em;
    }
}