.blog-page {
    padding-top: 80px;
}

/* Hero Section */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: white;
    padding: 80px 0 40px;
    margin-top: -80px;
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.blog-hero .lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.blog-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.1);
}

.blog-card-date {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
}

.blog-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: var(--primary-green);
}

.blog-card-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #888;
}

/* Single Post */
.blog-single {
    max-width: 800px;
    margin: 0 auto;
}

.blog-single-header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-single-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-single-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    color: #666;
    margin-bottom: 2rem;
}

.blog-single-image {
    margin: 2rem 0;
    border-radius: 15px;
    overflow: hidden;
}

.blog-single-image img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-single-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.blog-single-content h2,
.blog-single-content h3,
.blog-single-content h4 {
    margin: 2rem 0 1rem;
    color: var(--dark-green);
}

.blog-single-content p {
    margin-bottom: 1.5rem;
}

.blog-single-content blockquote {
    border-left: 4px solid var(--primary-green);
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
}

/* Sidebar */
.blog-sidebar {
    padding-left: 3rem;
}

.sidebar-widget {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.sidebar-widget h4 {
    color: var(--dark-green);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.popular-posts-list,
.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-post-item,
.recent-post-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.popular-post-item:last-child,
.recent-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-image,
.recent-post-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
}

.popular-post-image img,
.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content,
.recent-post-content {
    flex-grow: 1;
}

.popular-post-title,
.recent-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.popular-post-title a,
.recent-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-post-title a:hover,
.recent-post-title a:hover {
    color: var(--primary-green);
}

.popular-post-meta,
.recent-post-meta {
    font-size: 0.75rem;
    color: #888;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.blog-pagination .pagination {
    margin: 0;
}

.blog-pagination .page-link {
    color: var(--primary-green);
    border: 1px solid #dee2e6;
    padding: 0.75rem 1.25rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.blog-pagination .page-link:hover {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.blog-pagination .page-item.active .page-link {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-hero {
        padding: 100px 0 40px;
        text-align: center;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-sidebar {
        padding-left: 0;
        margin-top: 3rem;
    }

    .blog-single-title {
        font-size: 2rem;
    }

    .blog-single-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .blog-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .popular-post-item,
    .recent-post-item {
        flex-direction: column;
        text-align: center;
    }

    .popular-post-image,
    .recent-post-image {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Стили для тегов */
.post-tags .badge,
.post-tags .btn {
    margin: 2px;
    transition: all 0.3s ease;
}

.post-tags .badge:hover,
.post-tags .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Адаптивность для облака тегов */
@media (max-width: 768px) {
    .tag-cloud-widget .tags-list {
        text-align: center;
    }
}

/* ДОБАВЛЯЕМ В КОНЕЦ blog.css */

/* Single Post Page */
.blog-single {
    background: #f8f9fa;
}

.blog-single-content {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.blog-single-header {
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.blog-single-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-green);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.blog-single-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    color: #6c757d;
    font-size: 0.9rem;
}

.meta-item a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.3s ease;
}

.meta-item a:hover {
    color: var(--dark-green);
}

.blog-single-image {
    border-radius: 15px;
    overflow: hidden;
}

.blog-single-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content Styles */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2rem 0 1rem;
    color: var(--dark-green);
    font-weight: 600;
}

.post-content h2 {
    font-size: 1.8rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.3rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-green);
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    border-radius: 0 8px 8px 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.post-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.post-content table th,
.post-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.post-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
}

.related-posts h3 {
    color: var(--dark-green);
    font-weight: 600;
}

/* Tag Page Specific */
.tag-description {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Empty States */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: #6c757d;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Responsive Design for Single Post */
@media (max-width: 768px) {
    .blog-single-content {
        padding: 2rem 1.5rem;
        margin: 0 -1rem;
        border-radius: 0;
    }

    .blog-single-title {
        font-size: 2rem;
    }

    .blog-single-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .blog-single-header {
        padding-bottom: 1.5rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .blog-single-content {
        padding: 1.5rem 1rem;
    }

    .blog-single-title {
        font-size: 1.75rem;
    }

    .post-content {
        font-size: 0.95rem;
    }
}

/* Improved Tag Cloud */
.tag-cloud-widget {
    padding: 1rem 0;
}

.tags-list {
    text-align: center;
    line-height: 2.2;
}

.tag-link {
    color: #495057;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 25px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0.25rem;
}

.tag-link:hover {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    text-decoration: none;
}

/* Improved Post Tags */
.post-tags .btn {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-width: 2px;
    transition: all 0.3s ease;
}

.post-tags .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ДОБАВЛЯЕМ В КОНЕЦ blog.css */

/* Исправляем ширину для страницы статьи */
.blog-single-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Hero Section для отдельной статьи */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: white;
    padding: 80px 0 40px;
    margin-top: -50px;
}

.blog-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-single-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
}

.meta-item {
    color: rgba(255,255,255,0.9);
}

.meta-item a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.meta-item a:hover {
    color: white;
    text-decoration: underline;
}

/* Контент статьи */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2rem 0 1rem;
    color: var(--dark-green);
    font-weight: 600;
}

.post-content h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.3rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-green);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.post-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.post-content table th,
.post-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.post-content table th {
    background-color: var(--light-green);
    color: white;
    font-weight: 600;
}

/* Изображение статьи */
.blog-single-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.blog-single-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.blog-single-image:hover img {
    transform: scale(1.02);
}

/* Связанные посты на странице статьи */
.related-posts {
    margin-top: 4rem;
}

.related-posts h3 {
    color: var(--dark-green);
    font-weight: 600;
    font-size: 1.8rem;
}

/* Адаптивность для страницы статьи */
@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-single-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .blog-single-content {
        padding: 1.5rem;
        margin: 0 -0.5rem;
        border-radius: 0;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .blog-single-content {
        padding: 1rem;
    }

    .blog-hero {
        padding: 100px 0 30px;
    }

    .blog-hero h1 {
        font-size: 1.75rem;
    }

    .post-content {
        font-size: 0.95rem;
    }
}

/* Улучшаем sidebar widgets */
.sidebar-widget {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.sidebar-widget h4 {
    color: var(--dark-green);
    margin-bottom: 1.25rem;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 0.5rem;
}

/* Популярные посты в sidebar */
.popular-post-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.popular-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content {
    flex-grow: 1;
}

.popular-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.popular-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-post-title a:hover {
    color: var(--primary-green);
}

.popular-post-meta {
    font-size: 0.75rem;
    color: #888;
}

/* Добавить в blog.css */
.custom-toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.has-error .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.help-block {
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* Стили для кнопок лайков */
.like-post-btn.liked,
.like-comment-btn.liked {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.like-post-btn.liked .far,
.like-comment-btn.liked .far {
    color: white;
}

/* Добавить в blog.css */
.post-actions .btn-group .btn.active {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1;
}

.like-post-btn.active {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.dislike-post-btn.active {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.like-comment-btn.active {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.dislike-comment-btn.active {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

/* Убираем ховер-эффекты для активных кнопок */
.post-actions .btn.active:hover {
    transform: scale(1.1);
}

/* Анимация переключения */
.post-actions .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-actions .btn-group .btn {
    transition: all 0.2s ease;
}

/* Исправления для карточек без изображений */
.blog-card:not(.has-image) .blog-card-image {
    display: none;
}

.blog-card:not(.has-image) .blog-card-content {
    padding-top: 1.5rem;
}

.blog-card:not(.has-image) .blog-card-date {
    position: static;
    background: var(--light-green);
    color: var(--dark-green);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Улучшенные стили для карточек с изображениями */
.blog-card.has-image .blog-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.blog-card.has-image .blog-card-date {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

/* Универсальные стили контента */
.blog-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Мета-информация в карточках */
.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #888;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-card-meta-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.blog-card-read-more {
    margin-left: auto;
}

/* Адаптивность */
@media (max-width: 576px) {
    .blog-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .blog-card-meta-left {
        width: 100%;
        justify-content: space-between;
    }

    .blog-card-read-more {
        margin-left: 0;
        width: 100%;
        text-align: right;
    }
}

/* Улучшенные стили для карточек без изображений */
.blog-card.no-image {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card.no-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.blog-card.no-image .blog-card-date.no-image-date {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
    text-align: center;
}

.blog-card.no-image .blog-card-content {
    padding: 1.5rem;
}

/* Анимации для всех карточек */
.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Иконки в мета-данных */
.blog-card-meta-item i {
    opacity: 0.7;
    font-size: 0.8rem;
}

.blog-card-meta-item:hover i {
    opacity: 1;
    color: var(--primary-green);
}

@media (max-width: 768px) {
    .blog-card.has-image .blog-card-image {
        height: 180px;
    }

    .blog-card-content {
        padding: 1.25rem;
    }

    .blog-card-meta-left {
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-card.has-image .blog-card-image {
        height: 160px;
    }

    .blog-card-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-card-meta-left {
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }

    .blog-card-read-more {
        text-align: center;
        margin-top: 0.5rem;
    }
}