/* =======================
   Общие стили
======================= */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: #fff;
    line-height: 1.6;
}

/* =======================
   Логотип
======================= */
.logo {
    font-size: 40px;
    font-weight: bold;
    color: #00ff88;
    text-align: center;
}

/* =======================
   Навигация
======================= */
.navbar {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    background-color: #2c2c2c;
    width: 100%;
    box-sizing: border-box;
}

.navbar .nav-links {
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    width: 100%;
}

.navbar .nav-links li { margin: 0; }

.navbar .nav-links a {
    color: #00ff88;
    text-decoration: none;
    font-size: 2.8em;
    padding: 16px 24px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.navbar .nav-links a:hover {
    text-decoration: underline;
    background-color: #3a3a3a;
}

/* =======================
   Контейнер статьи
======================= */
.article-container {
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 0 15px;
    box-sizing: border-box;
}

/* =======================
   Баннер справа — через float (просто и надёжно)
======================= */
.ad-banner1 {
    width: 250px;
    background-color: #3a3a3a;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    float: right;
    margin: 15px 0 15px 20px; /* отступ: снизу/сверху 15px, слева 20px от текста */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    /* flex-shrink: 0; — не нужен при float */
}

/* Центрированные баннеры */
.ad-banner {
    background-color: #3a3a3a;
    padding: 10px;
    text-align: center;
    margin: 15px 0;
    border-radius: 8px;
}

.ad-banner p, .ad-banner1 p {
    margin: 0;
    color: #ccc;
    font-style: italic;
    font-size: 0.9em;
}

/* =======================
   Заголовки
======================= */
h1, h2, h3 {
    color: #00ff88;
}

h1 { font-size: 1.8em; }
h2 { font-size: 1.6em; }
h3 { font-size: 1.4em; }

/* Абзацы и списки */
p, ul, li { margin: 5px 0; }

ul { list-style: none; padding: 0; }

ul li strong { color: #00ff88; }

/* Изображения статьи */
.article-image {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    margin: 15px auto;
    display: block;
    border-radius: 8px;
}

/* Дисклеймер */
.disclaimer {
    font-size: 0.85em;
    color: #ccc;
    margin: 15px 0;
    text-align: center;
}

/* Связанные статьи */
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.related-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: #2c2c2c;
    padding: 8px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.related-card:hover { transform: scale(1.05); }

.related-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 8px;
}

.related-card h3 {
    font-size: 16px;
    margin: 0;
}

/* Футер */
footer .footer-links {
    display: flex !important;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

footer .footer-links li { margin: 0 10px; }

footer .footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
}

footer .footer-links a:hover { text-decoration: underline; }

/* =======================
   Адаптивность
======================= */
@media (max-width: 1024px) {
    /* Отключаем float на планшетах и ниже */
    .ad-banner1 {
        float: none;
        width: 100%;
        margin: 15px auto;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 8px; padding: 10px; }
    .navbar .nav-links { flex-direction: row; justify-content: center !important; width: 100%; margin: 8px 0 0; }
    .navbar .nav-links a { font-size: 2.4em; padding: 12px 20px; }
    .logo { font-size: 20px; }

    h1, h2, h3 { font-size: 1.5em; }
    .article-image { max-height: 300px; }
    .ad-banner { padding: 8px; margin: 10px 0; }
    .related-grid { grid-template-columns: 1fr; gap: 10px; }
    .related-card img { height: 120px; }
    .related-card h3 { font-size: 14px; }
    footer .footer-links { flex-direction: column; align-items: center; margin: 8px 0; }
    footer .footer-links li { margin: 5px 0; }
    footer .footer-links a { font-size: 0.85em; }
}

@media (max-width: 480px) {
    .logo { font-size: 18px; }
    .navbar .nav-links a { font-size: 2.2em; padding: 10px 16px; }
    .article-image { max-height: 250px; }
    .related-card img { height: 100px; }
    .related-card h3 { font-size: 13px; }
}