* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #333;
    color: #fff;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    width: 100%;
    top: 0;
    z-index: 1000;
}

header.hidden {
    transform: translateY(-100%);
}

header h1 a {
    color: #fff;
    text-decoration: none;
}

nav ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

nav ul li {
    display: inline;
    margin: 0 10px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

main {
    flex: 1;
}

.main-container {
    display: flex;
    margin: 0 auto;
    gap: 20px;
    padding: 0 15px;
    box-sizing: border-box;
}

.content {
    flex: 1;
    overflow: hidden;
}

.ad-sidebar {
    margin-top: 15px;
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    height: calc(100vh - 20px);
    position: sticky;
    top: 20px;
}

.ad-banner {
    margin-bottom: 20px;
}

.ad-banner img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.hot-label {
    background-color: #580000;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    max-width: 80%;
    margin: 0 auto;
    border-radius: 8px;
    margin-top: 15px;
}

.fresh-label {
    background-color: #4c5eaf;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    max-width: 80%;
    margin: 0 auto;
    border-radius: 8px;
    margin-top: 15px;
}

.fresh-articles {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 20px;
    max-width: 80%;
    margin: 0 auto;
}

.fresh-article {
    flex: 1 1 calc(33.333% - 30px);
    min-width: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.fresh-article:hover {
    transform: scale(1.02);
}

.fresh-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.fresh-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.fresh-content {
    padding: 10px;
    text-align: center;
}

.fresh-title {
    font-size: 1.5em;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fresh-summary {
    font-size: 1em;
    color: #555;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fresh-time {
    font-size: 0.9em;
    color: #888;
    margin-top: 5px;
}

.news-label {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    max-width: 80%;
    margin: 0 auto;
    border-radius: 8px;
    margin-top: 15px;
}

.featured-articles {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 20px;
    max-width: 80%;
    margin: 0 auto;
}

.featured-article {
    flex: 1 1 calc(33.333% - 30px);
    min-width: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.featured-article:hover {
    transform: scale(1.02);
}

.featured-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.featured-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.featured-content {
    padding: 10px;
    text-align: center;
}

.featured-title {
    font-size: 1.5em;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-summary {
    font-size: 1em;
    color: #555;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-date {
    font-size: 0.9em;
    color: #888;
}

.news-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 80%;
    margin: 0 auto;
}

.news-item-list {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    transition: transform 0.3s ease;
    overflow: hidden;
    flex: 1 1 calc(50% - 20px);
    box-sizing: border-box;
    min-width: 600px;
}

.news-item-list:hover {
    transform: scale(1.02);
}

.news-link-list {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.news-image-list {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.news-content-list {
    flex: 1;
    min-width: 0;
}

.news-title-list {
    font-size: 1.1em;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-summary-list {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-date-list {
    font-size: 0.8em;
    color: #888;
}

.news-grid-mobile {
    display: none;
}

.pagination {
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
}

.pagination ul {
    list-style: none;
    padding: 0;
    display: inline-block;
}

.pagination ul li {
    display: inline;
    margin: 0 5px;
}

.pagination ul li a,
.pagination ul li span {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    transition: background-color 0.3s, color 0.3s;
}

.pagination ul li a:hover {
    background-color: #333;
    color: #fff;
}

.pagination ul li.active span {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.pagination ul li.disabled span {
    color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.mobile-ad {
    display: none;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 0 10px;
    }

    .ad-sidebar {
        display: none;
    }

    .mobile-ad {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .mobile-ad img {
        width: 100%;
        height: auto;
        border-radius: 0;
    }

    .hot-label,
    .fresh-label,
    .news-label {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 1em;
    }

    .news-list {
        display: none;
    }

    .news-grid-mobile {
        display: grid;
        grid-template-columns: 1fr;
        height: auto;
        max-width: 100%;
        margin-left: 10px;
        margin-right: 10px;
        margin-top: 20px;
        visibility: visible;
    }

    .news-item-mobile {
        display: flex;
        align-items: flex-start;
        height: auto;
        padding: 10px;
        box-sizing: border-box;
        gap: 10px;
        margin-top: 10px;
        position: relative;
    }

    .news-link-mobile {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        text-decoration: none;
        color: inherit;
    }

    .news-separator {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin: 10px 0;
    }

    .news-image-mobile {
        width: 30vw;
        height: 30vw;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
        object-fit: cover;
    }

    .news-content-mobile {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .news-title-mobile {
        background-color: transparent;
        color: #000;
        font-weight: bold;
        padding: 0;
        text-align: left;
        font-size: 16px;
        margin-bottom: 5px;
    }

    .news-date-mobile {
        background-color: rgba(0, 0, 0, 0.8);
        color: #fff;
        padding: 5px 10px;
        border-radius: 5px;
        font-size: 12px;
        position: absolute;
        right: 10px;
        bottom: 10px;
    }

    .featured-articles,
    .fresh-articles {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .featured-article,
    .fresh-article {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .featured-image,
    .fresh-image {
        height: 120px;
    }

    .featured-title,
    .fresh-title {
        font-size: 1em;
    }

    .featured-summary,
    .fresh-summary {
        font-size: 0.8em;
    }

    .featured-date,
    .fresh-date {
        font-size: 0.7em;
    }
}

@media (min-width: 769px) {
    .mobile-ad {
        display: none;
    }
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Markdown стили */
.markdown-content {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding-bottom: 30px;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.markdown-content p {
    margin-bottom: 1.5em;
}

.markdown-content a {
    color: #000000;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content code {
    background-color: #f8f8f8;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

.markdown-content pre {
    background-color: #f8f8f8;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
}

.markdown-content pre code {
    display: block;
}

.markdown-content blockquote {
    margin: 0;
    padding-left: 1em;
    border-left: 4px solid #ccc;
    color: #666;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 30px;
    margin-bottom: 30px;
    margin-left: auto;
    margin-right: auto;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.markdown-content li {
    margin-bottom: 0.5em;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

.markdown-content th {
    background-color: #f8f8f8;
}