:root {
    --base-font-size: 16px; /* Начальный размер шрифта */
}

body {
    background: white;
    margin: 0;
    padding: 0;
    font-size: var(--base-font-size);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh; /* Минимальная высота 100% высоты экрана */
    overflow-x: hidden;
}

/* Верхний заголовок и шапка */
.top-header,
.header {
    text-align: center;
    margin: 0 auto; /* Центрирование */
    padding: 20px 0;
}

.top-header img {
    width: 1240px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 10px 20px;
    margin: 0 auto; /* Центрирование */
}

/* Контейнер для основного контента */
.main-content {
    width: 100%;
    margin: 0 auto;
    padding: 5px;
}

.container {
    display: flex;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

/* Стили для боковых панелей */
aside {
    background-color: white;
    display: flex;
    flex-direction: column;
    width: calc(15% - 10px);
    padding: 1%;
    color: black;
    margin-right: 0;
}
.right-column {
    background-color: white;
    display: flex;
    flex-direction: column;
    width: calc(15% - 10px);
    padding: 1%;
    color: black;
    margin-left: 0;
    margin-right: 0;
}

aside a {
    color: black;
    display: block;
    transition: transform .6s ease;
}

aside a:hover {
    transform: scale(1.02);
    font-weight: bold;
}
.right-item {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 600px;
    max-width: 100%;
    margin: 5px auto;
    text-align: left;
    padding: 10px;
    overflow: hidden;
    transition: transform .6s ease;
}
.right-item a {
    color: black;
    display: block;
    transition: transform .6s ease;
}

.right-item a:hover {
    transform: scale(1.02);
    font-weight: bold;
}
ul li, a {
    text-decoration: none;
}

/* Основной контент */
main {
    flex-grow: 1; /* Занимает оставшееся пространство */
    color: black;
    padding: 1%;
    margin: 0;
    width: calc(100% - 20px);

}

/* Общий стиль заголовков h4 */
 h4 {
    margin: 10px 0;
    text-align: center;
    color: white;
    background-color: #444;
    padding: 5px;
    border-radius: 5px;
    font-weight: 300;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.news-item {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 600px;
    max-width: 100%;
    margin: 5px auto;
    text-align: left;
    padding: 10px;
    overflow: hidden;
    transition: background-color 0.3s;
    transform .6s ease;
}
.news-item a {
    display: flex;
    text-decoration: none;
    width: 100%;
    color: black;
    transition: transform .6s ease;
}

/* Футер */
.footer {
    background-color: #444;
    color: white;
    width: 100%;
    padding: 5px;
    margin: 0 auto;
    text-align: center;
    line-height: 50px;
    box-sizing: border-box;
}
.container {
    display: flex;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

/* Галерея */
.gallery {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    margin: 0 auto;
}

.gallery-container {
    display: flex;
    transition: transform 1s ease;
    padding: 5px;
}

.gallery img {
    width: calc(20% - 10px);
    height: auto;
    margin: 5px;
    flex-shrink: 0;
}

.gallery img.active {
    display: block; /* только активное изображение */
    opacity: 1; /* Полная непрозрачность для активного изображения */
}

/* Меню */
.menu, .font-size-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    min-height: 50px;

}
.menu a, .search input  .font-size-controls a {
    text-decoration: none;
    color: white;
    background-color: #444;
    padding: 5px 10px;
    border-radius: 5px;
    transition: transform .6s ease;
}

.menu a:hover {
    color: #444;
    border: 1px solid #444;
    background-color: white;
    transform: scale(1.1);
}
.font-size-controls a:hover {
    color: #444;
    background-color: white;
    transform: scale(1.1);
}

.search {
    position: relative;
    display: inline-block;
}

.search-input {
    display: none;
    width: 180px;
    padding: 5px;
    border: 1px solid #444;
    border-radius: 5px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.search:hover .search-input,
.search-input:focus {
    display: inline-block;
    opacity: 1;
    transform: translateY(0);
}

/* Контейнер статей в новом номере */
.content-container {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}
.pagination span {
    line-height: 30px;
}

.page-link {
    text-decoration: none;
    color: white;
    background-color: #444;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 0 5px;
    margin-top: 30px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-link:hover {
    color: #444;
    background-color: white;
    transform: scale(1.1);
}
/* Стиль для обложки */
.cover {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 40px;
    width: 50%;
    margin-right: 10px;
    margin-top: 20px;
    height: 15em; /* высота пропорциональна размеру шрифта */
}

.cover img {
    max-width: 20em; /* ширина изображения пропорциональна размеру шрифта */
    height: auto;
}

/* Стиль для верхних статей */
.top-articles {
    flex-grow: 1;
    margin-top: 20px;
    padding: 0px;
}
/* Основные стили для статей */
.article-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    text-align: justify;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px;
    width: calc(100% - 20px);
    overflow: hidden;
    transition: background-color 0.3s, transform 0.6s ease;
}

.article-item a {
    display: flex;
    text-decoration: none;
    width: 100%;
    color: inherit;
}

.article-item:hover {
    transform: scale(1.02);
    background-color: #f0f0f0;
}
.article-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.article-content {
    flex: 1; /* Позволяет тексту занимать оставшееся пространство */
    display: flex; /* Используем flex для выравнивания текста */
    flex-direction: column; /* Выравнивание текста по вертикали */
    justify-content: center; /* Центрирование по вертикали */
}

.article-title {
    font-weight: bold;
}

/* Блок других статей */
.other-articles {
    margin-top: 20px;
}
.other-article-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}
/* Адаптивные стили для экранов между обычными и мобильными */
@media (max-width: 1200px) {

    .header {
        padding: 10px 15px; /* Меньшие отступы на экранах менее 1200px */
    }

    .cover {
        width: 100%;
        height: auto;
        margin: 0 auto;
    }

    .top-articles {
        width: 100%; /* Полная ширина на среднем экране */
        margin-top: 15px;
    }

    .article-item {
        padding: 8px;
    }
}
/* Адаптивные стили для мобильных устройств */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    aside {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }

    main {
        width: 100%;
    }

    .gallery {
        width: 100%;
    }

    .content-container {
        flex-direction: column;
    }

    .cover {
       display: none;
    }

    .top-articles {
        width: 100%;
        margin-top: 20px;
    }

    .article-item {
        width: 100%;
        margin-bottom: 10px;
    }
    .right-column {
        width: 100%;
    }
    .menu {
        display: flex;
        flex-direction: column; /* Элементы будут располагаться вертикально */
        align-items: flex-start;    /* Выровнять элементы по левому краю */
        padding: 0;       /* Отступы сверху и снизу */
    }

    .menu a {
        margin: 0;
        text-align: left;
        width: 100%;
        padding: 10px;
    }

    .font-size-controls {
        display: flex;
        justify-content: flex-start; /* Выровнять кнопки увеличения/уменьшения шрифта по левому краю */
        margin: 0;              /* Убираем отступы сверху для кнопок */
    }

    .search {
        display: flex;
        justify-content: flex-start; /* Выровнять иконку поиска и поле ввода по левому краю */
        margin: 0;              /* Убираем отступы сверху для поиска */
    }

    .search-input {
        margin-left: 5px;   /* Отступ между иконкой поиска и полем ввода */
        padding: 5px;       /* Отступ внутри поля ввода */
    }
}

/* Стили для мобильных устройств (768px и меньше) */
@media (max-width: 768px) {
    .content-container {
        flex-direction: column; /* Вертикальное выравнивание на узком экране */
    }

    .gallery {
        height: auto;
    }
    .cover {
        display: none; /* Скрывает обложку на маленьких экранах */
    }

}

.news-prev {
    display: flex;
    align-items: center;
    text-align: left;
    border-radius: 5px;
    padding: 10px;
    width: calc(100% - 20px);
    overflow: hidden;
    transition: transform .6s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    clear: both;
    width: 800px;
    max-width: 100%;
    margin: 10px auto;
}

.news-prev:hover {
    transform: scale(1.02);
    background-color: #f0f0f0;
}

.news-full {
    background: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    clear: both;
    width: 800px;
    max-width: 100%;
    margin: 20px auto;
    text-align: left;
}

h3 {
    text-align: center;
    margin: 20px 0;
}

.article-prev {
    display: flex;
    align-items: center;
    text-align: justify;
    border-radius: 5px;
    padding: 10px;
    overflow: hidden;
    transition: transform .6s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 10px auto;
}

.article-prev a {
    display: flex;
    text-decoration: none;
    color: black;
    width: 100%;
}
.article-prev:hover {
    transform: scale(1.02);
    background-color: #f0f0f0;
}
.article-link {
    display: flex;
    text-decoration: none;
    color: black;
    width: 100%;
}

.article-full {
    background: white;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    clear: both;
    width: 90%;
    margin: 20px auto;
    text-align: left;
}

.tag-cloud {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
        }

.tag-cloud a {
    color: black;
    display: block;
    margin-top: 10px;
    transition: transform .6s ease;
    font-weight: bold;
    text-decoration: none;
}
.tag-cloud a:hover {
    color: #eb5959;
    text-decoration: none;
    transform: scale(1.05);
}

.centered-link {
    text-align: center;
    margin-top: 20px;
    color: black;
}
.centered-link-container {
    text-align: center;
    margin-top: 20px;
}

.about {
    background: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    clear: both;
    width: 900px;
    max-width: 100%;
    margin: 20px auto;
    text-align: left;
}
.about p {
    margin: 0;
    padding: 10px 0;
    line-height: 1.5;
    font-size: 1em;
    color: #333;
    text-align: justify;
}
p.centered {
    text-align: center;
    font-weight: bold;
}

.search-link {
    display: flex;
    text-decoration: none;
    color: black;
    width: 100%;
}
.search-link:hover {
    font-weight: bold;
}

/* Стиль для контейнера рекламы */
#ads-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* Стиль для отдельных элементов рекламы */
.ad-item {
    margin: 10px;
    flex: 0 1 150px;             /* ширина 150px, но они могут сжиматься */
}

/* Ограничиваем размеры изображения */
.ad-item img {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Стиль для текста с заголовком рекламной секции */
#ad-section-title {
    text-align: center;
    font-weight: bold;
    margin: 10px 0;
}

/* Стиль для контейнера боковой панели рекламы */
.sidebar-ads-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    padding: 0px;
    border-radius: 5px;
}

/* Стиль для заголовка секции рекламы */
.sidebar-ad-section-title {
    text-align: center;
    font-weight: bold;
    margin: 10px 0;
}

/* Стиль для отдельных элементов рекламы */
.sidebar-ad-item {
    margin: 10px 0;
    text-align: center;
    width: 100%;
}

.sidebar-ad-item img {
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    border-radius: 5px;
}

/* Стили для ссылки на рекламу */
.sidebar-ad-item a {
    text-decoration: none;
    color: #333;
}

.sidebar-ad-item a:hover {
    text-decoration: underline;
    color: #007bff;
}