* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background-color: #f5f5f5;
    color: #1a1a1a;
    line-height: 1.6;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

/* Main Article Styles */
.article-main {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
    overflow: hidden; /* Предотвращает выход контента за границы */
}


/* Category Badge */
.category-badge {
    display: inline-block;
    background: #FF6600;
    color: #fff;
    padding: 5px 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Arial', sans-serif;
    border-radius: 3px;
    margin-bottom: 20px;
}

/* Article Title */
.article-main h1 {
    font-family: 'Arial', sans-serif;
    font-size: 42px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #000;
}

/* Lead Paragraph */
.lead {
    font-size: 20px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Article Meta */
.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: #666;
}

.author {
    font-weight: bold;
    color: #000;
}

/* Main Image */
.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
    display: block;
}

.image-caption {
    font-size: 13px;
    color: #777;
    font-style: italic;
    margin-bottom: 30px;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.share-btn {
    padding: 10px 20px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    transition: background 0.3s;
}

.share-btn:hover {
    background: #FF6600;
}

/* Article Content */
.article-content {
    max-width: 100%;
    overflow-wrap: break-word; /* Перенос длинных слов */
    word-wrap: break-word;
    word-break: break-word; /* Разрыв длинных слов */
}

/* Дополнительные стили для предотвращения выхода контента */
.article-content * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Специально для таблиц и широких элементов */
.article-content table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.article-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-top: 80px; /* Отступ сверху в ПК версии */
}


.sidebar-block {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar-block h3 {
    font-family: 'Arial', sans-serif;
    font-size: 20px;
    color: #000;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FF6600;
}

.related-article {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.related-article:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.related-article a {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    color: #000;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
    margin-bottom: 5px;
}

.related-article a:hover {
    color: #FF6600;
}

.related-date {
    font-size: 12px;
    color: #999;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sidebar {
        order: 2;
        padding-top: 0; /* Убираем отступ на планшетах */
        position: static; /* Отключаем sticky на планшетах */
        max-height: none; /* Убираем ограничение высоты */
        overflow-y: visible; /* Убираем прокрутку */
    }
}

@media (max-width: 768px) {
    .blog-container {
        padding: 20px 15px;
    }

    .article-main {
        padding: 25px;
    }

    .article-main h1 {
        font-size: 28px;
    }

    .lead {
        font-size: 18px;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 13px;
    }

    .main-image {
        height: 250px;
    }

    .sidebar-block {
        padding: 15px;
    }

    .sidebar-block h3 {
        font-size: 18px;
    }

    .sidebar {
        padding-top: 0; /* Убираем отступ на мобильных */
    }

    .share-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .article-main {
        padding: 20px;
    }

    .article-main h1 {
        font-size: 24px;
    }

    .lead {
        font-size: 16px;
    }

    .category-badge {
        font-size: 11px;
        padding: 4px 12px;
    }

    .main-image {
        height: 200px;
    }

    .share-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}