/* ============================================
   БЛОГ (blog-page)
   ============================================ */
.blog-page {
    padding: 40px 0;
}

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

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.blog-sidebar {
    position: sticky;
    top: 170px;
    height: fit-content;
}

@media (min-width: 993px) {
    .blog-sidebar {
        max-height: calc(100vh - 180px);
        overflow-y: auto;
    }
    .blog-sidebar::-webkit-scrollbar {
        width: 6px;
    }
    .blog-sidebar::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }
    .blog-sidebar::-webkit-scrollbar-thumb {
        background: #3498db;
        border-radius: 3px;
    }
    .tag-posts.active::-webkit-scrollbar {
        width: 5px;
    }
    .tag-posts.active::-webkit-scrollbar-track {
        background: #f5f5f5;
        border-radius: 3px;
    }
    .tag-posts.active::-webkit-scrollbar-thumb {
        background: #3498db;
        border-radius: 3px;
    }
}

.tags-navigation {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.tags-title {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.tags-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tag-item {
    border-bottom: 1px solid #f0f0f0;
}

.tag-item:last-child {
    border-bottom: none;
}

.tag-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: #555;
    font-size: 15px;
    transition: all 0.3s ease;
}

.tag-toggle:hover {
    color: #3498db;
}

.tag-toggle.active {
    color: #3498db;
    font-weight: 600;
}

.tag-name {
    flex: 1;
}

.tag-count {
    color: #999;
    font-size: 0.9em;
    margin: 0 10px;
}

.tag-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.tag-toggle.active .tag-icon {
    transform: rotate(180deg);
}

.tag-posts {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.tag-posts.active {
    max-height: 320px;
    margin-bottom: 10px;
    overflow-y: auto;
}

.posts-list {
    list-style: none;
    padding: 0 0 0 15px;
    margin: 0;
}

.post-item {
    margin: 8px 0;
    position: relative;
    padding-left: 15px;
}

.post-item:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3498db;
    font-size: 0.9em;
}

.post-link {
    display: block;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    padding: 4px 0;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.post-link:hover {
    color: #3498db;
    padding-left: 12px;
}

.post-link.active {
    color: #3498db;
    font-weight: 500;
    border-left-color: #3498db;
}

.no-tags {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.blog-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.articles-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.tag-section {
    scroll-margin-top: 100px;
}

.blog-page .section-title {
    margin: 0 0 25px 0;
    font-size: 1.8rem;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-count {
    color: #666;
    font-size: 1.2rem;
    font-weight: normal;
}

.blog-page .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

@media (max-width: 768px) {
    .blog-page .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.blog-page .article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    scroll-margin-top: 120px;
    position: relative;
    min-height: 250px;
}

.blog-page .article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.blog-page .article-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.blog-page .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-page .article-card:hover .article-image img {
    transform: scale(1.05);
}

.blog-page .article-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-page .article-header {
    margin-bottom: 15px;
}

.blog-page .article-title {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.blog-page .article-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-page .article-title a:hover {
    color: #3498db;
}

.blog-page .article-excerpt {
    color: #666;
    line-height: 1.4;
    font-size: 0.9rem;
    flex: 1;
}

.blog-page .article-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.blog-page .article-meta {
    font-size: 12px;
    color: #888;
}

.blog-page .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #888;
}

.blog-page .article-author-static,
.blog-page .article-author-name {
    color: #888;
}

.blog-page .meta-item svg {
    flex-shrink: 0;
    stroke: #888;
}

.blog-page .article-read-more {
    width: 100%;
    box-sizing: border-box;
    text-transform: uppercase;
    padding: 8px 16px;
    font-weight: 600;
    border-radius: 25px;
    color: #fff;
    background: linear-gradient(180deg, #03737F 0%, #008bd0 100%);
    transition: all 0.3s ease 0s;
    text-decoration: none;
    font-size: 14px;
}

.blog-page .article-read-more:hover {
    gap: 12px;
    background: #5ab520;
}

.blog-page .article-read-more svg {
    transition: transform 0.3s ease;
    stroke: white;
}

.blog-page .article-read-more:hover svg {
    transform: translateX(5px);
}

.blog-page .article-card {
    background-image: none !important;
}

.blog-page .article-card .article-content h2,
.blog-page .article-card .article-title a,
.blog-page .article-card .article-excerpt,
.blog-page .article-card .article-meta,
.blog-page .article-card .article-meta span {
    color: inherit !important;
}

.blog-page .article-card .article-date {
    color: #888 !important;
    font-size: 0.9rem;
}

.no-articles {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.mobile-tags-toggle {
    display: none;
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .mobile-tags-toggle {
        display: flex;
    }
    
    .blog-sidebar {
        position: static;
    }
    
    .tags-navigation {
        display: none;
    }
    
    .tags-navigation.active {
        display: block;
    }
}
