/* Blog Hero Section */
.blog-hero-section {
    padding: 60px 0 40px;
    margin-top: 50px;
}

.blog-hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.blog-hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px 0;
    color: #0B132B;
}

.blog-hero-description {
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    color: #6b7280;
}

@media (max-width: 1023px) {
    .blog-hero-section {
        padding: 40px 0 30px;
    }

    .blog-hero-title {
        font-size: 32px;
    }

    .blog-hero-description {
        font-size: 16px;
    }
}

.blog {
    padding: 50px 0;
}

.blog-posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

/* Основной блог - 2 колонки */
@media (min-width: 768px) {
    .blog-posts {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

/* Блоки с фильтрами - 3 колонки */
@media (min-width: 768px) {
    #filtered-posts.blog-posts,
    #filtered-posts-contractors.blog-posts {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

.blog-post {
    display: flex;
    flex-direction: column;
}

.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.category-tag {
    display: inline-block;
    padding: 2px 12px;
    font-size: 16px;
    font-weight: 500;
    color: #0B132B;
    background: rgba(0, 191, 98, 0.15);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-tag:hover {
    background: #00BF62;
    color: #fff;
}

.post-title {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
}

.post-title a {
    color: #00BF62;
    text-decoration: none;
}

.post-excerpt {
    flex: 1;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: #0B132B;
}

/* Author Info */
.post-meta {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.post-date {
    font-size: 13px;
    color: #9ca3af;
}

/* Pagination */
.pagination {
    margin-top: 48px;
    text-align: center;
    display: flex;
    justify-content: center;
    width: 100%;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0;
    font-size: 20px;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pagination a {
    color: #0B132B;
    background: #fff;
}

.pagination a:hover {
    background: #00BF62;
    border-color: #00BF62;
    color: #fff;
}

.pagination .current {
    color: #fff;
    background: #00BF62;
    border-color: #00BF62;
}

.pagination .dots {
    border: none;
    background: transparent;
}

.pagination .prev,
.pagination .next {
    font-size: 24px;
    font-weight: bold;
}

/* Categories Filter Section */
.blog-categories-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid #e5e7eb;
}

.categories-title {
    font-size: 48px;
    font-weight: 700;
    color: #0B132B;
    text-align: center;
    margin: 0 0 20px 0;
}

.categories-description {
    font-size: 18px;
    line-height: 1.6;
    color: #6b7280;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}

.categories-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.category-filter-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #0B132B;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-filter-btn:hover {
    background: rgba(0, 191, 98, 0.1);
    border-color: #00BF62;
    color: #0B132B;
}

.category-filter-btn.active {
    background: #00BF62;
    border-color: #00BF62;
    color: #fff;
}

#filtered-posts,
#filtered-posts-contractors {
    min-height: 300px;
    position: relative;
}

#filtered-posts.loading,
#filtered-posts-contractors.loading {
    opacity: 0.5;
    pointer-events: none;
}

#filtered-posts.loading::after,
#filtered-posts-contractors.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #e5e7eb;
    border-top-color: #00BF62;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No posts message */
.no-posts {
    text-align: center;
    padding: 80px 20px;
}

.no-posts p {
    font-size: 18px;
    color: #6b7280;
}

.no-posts .bc-button,
.no-posts a {
    display: inline-block;
    padding: 12px 24px;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #00BF62;
    border: 2px solid #00BF62;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.no-posts .bc-button:hover,
.no-posts a:hover {
    background: #00a050;
    border-color: #00a050;
    color: #fff;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .post-card {
        padding: 20px;
    }

    .post-title {
        font-size: 20px;
    }

    .post-excerpt {
        font-size: 14px;
    }

    .blog-categories-section {
        margin-top: 60px;
        padding-top: 40px;
    }

    .categories-title {
        font-size: 32px;
    }

    .categories-description {
        font-size: 16px;
    }

    .category-filter-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* ============================================
   SINGLE POST PAGE STYLES
   ============================================ */

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: #00BF62;
    z-index: 999999;
    transition: width 0.1s ease-out;
}

/* Adjust for admin bar when logged in */
body.admin-bar .reading-progress-bar {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .reading-progress-bar {
        top: 46px;
    }
}

/* Hero Section */
.single-hero {
    background: #00BF62;
    padding: 80px 0 60px;
    margin-top: 50px;
    color: #fff;
}

.single-hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.single-hero-categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.hero-category-tag {
    display: inline-block;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hero-category-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.single-hero-title {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 32px 0;
    color: #fff;
}

.single-hero-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 16px;
}

.hero-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-author {
    font-weight: 500;
}

.hero-date,
.hero-read-time {
    opacity: 0.9;
}

.hero-date::before {
    content: "▪";
    margin-right: 8px;
}

.hero-read-time::before {
    content: "▪";
    margin-right: 8px;
}

/* Content Layout */
.single-content-wrapper {
    padding: 60px 0 80px;
    background: #fff;
}

.single-content-layout {
    display: flex;
    justify-content: center;
}

/* Main Content */
.single-main-content {
    max-width: 900px;
    width: 100%;
}

.single-featured-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.single-post-content {
    font-size: 18px;
    line-height: 1.8;
    color: #374151;
}

.single-post-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 40px 0 20px 0;
    color: #0B132B;
}

.single-post-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 16px 0;
    color: #0B132B;
}

.single-post-content p {
    margin-bottom: 24px;
}

.single-post-content ul,
.single-post-content ol {
    margin: 24px 0;
    padding-left: 32px;
}

.single-post-content li {
    margin-bottom: 12px;
}

.single-post-content a {
    color: #2545E6;
    text-decoration: underline;
}

.single-post-content a:hover {
    color: #00BF62;
}

.single-post-content blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    border-left: 4px solid #00BF62;
    background: #f9fafb;
    font-style: italic;
    color: #6b7280;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
}

.single-tags {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #e5e7eb;
    font-size: 16px;
}

.single-tags strong {
    color: #0B132B;
    margin-right: 12px;
}

.single-tags a {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    font-size: 14px;
    color: #0B132B;
    background: #f3f4f6;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.single-tags a:hover {
    background: #00BF62;
    color: #fff;
}

/* Author Card Section */
.author-card-section {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 2px solid #e5e7eb;
}

.author-card {
    display: flex;
    gap: 32px;
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.author-card__photo {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.author-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.author-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Если нет фото, контент занимает всю ширину */
.author-card:not(:has(.author-card__photo)) .author-card__content {
    width: 100%;
}

.author-card__header {
    margin-bottom: 16px;
}

.author-card__label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.author-card__name {
    font-size: 28px;
    font-weight: 700;
    color: #0B132B;
    margin: 0;
    line-height: 1.2;
}

.author-card__bio {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 20px;
}

.author-card__bio p {
    margin: 0 0 12px 0;
}

.author-card__bio p:last-child {
    margin-bottom: 0;
}

.author-card__social {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.author-card__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.author-card__social-link:hover {
    background: #00BF62;
    color: #fff;
}

.author-card__social-link svg {
    width: 20px;
    height: 20px;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .author-card {
        flex-direction: column;
        gap: 24px;
        padding: 24px;
    }

    .author-card__photo {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }

    .author-card__name {
        font-size: 24px;
    }

    .author-card__bio {
        font-size: 15px;
    }

    .author-card__social {
        justify-content: flex-start;
    }
}

/* Related Posts Section */
.related-posts-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid #e5e7eb;
}

.related-posts-title {
    font-size: 32px;
    font-weight: 700;
    color: #0B132B;
    margin: 0 0 32px 0;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

.related-post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.related-post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.related-post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-thumbnail img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.related-post-categories {
    margin-bottom: 12px;
}

.related-category-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #0B132B;
    background: rgba(0, 191, 98, 0.15);
    border-radius: 4px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.related-category-tag:hover {
    background: #00BF62;
    color: #fff;
}

.related-post-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.related-post-title a {
    color: #0B132B;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post-title a:hover {
    color: #00BF62;
}

.related-post-meta {
    margin-top: auto;
    padding-top: 12px;
}

.related-post-date {
    font-size: 14px;
    color: #9ca3af;
}

/* Mobile Adjustments */
@media (max-width: 1023px) {
    .single-hero {
        padding: 60px 0 40px;
    }

    .single-hero-title {
        font-size: 36px;
    }

    .single-post-content {
        font-size: 16px;
    }

    .single-post-content h2 {
        font-size: 28px;
    }

    .single-post-content h3 {
        font-size: 22px;
    }

    .related-posts-section {
        margin-top: 60px;
        padding-top: 40px;
    }

    .related-posts-title {
        font-size: 24px;
    }
}

/* ============================================
   BLOG FOOTER STYLES
   ============================================ */

.blog-footer {
    background: #00BF62;
    color: #fff;
    padding: 60px 0 40px;
    margin-top: 80px;
}

.blog-footer__top {
    margin-bottom: 60px;
}

.blog-footer__search {
    max-width: 400px;
}

.blog-footer__search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.blog-footer__search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    font-size: 16px;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease;
}

.blog-footer__search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.blog-footer__search-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
}

.blog-footer__search-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.blog-footer__search-btn:hover {
    color: #fff;
}

.blog-footer__content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
    margin-bottom: 60px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.blog-footer__column-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-footer__divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 24px;
}

.blog-footer__categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-footer__link {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.5;
}

.blog-footer__link:hover {
    color: #fff;
}

.blog-footer__bottom {
    display: flex;
    align-items: center;
}

.blog-footer__copyright {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .blog-footer {
        padding: 40px 0 30px;
        margin-top: 60px;
    }

    .blog-footer__top {
        margin-bottom: 40px;
    }

    .blog-footer__content {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 40px;
        padding-bottom: 40px;
    }

    .blog-footer__column-title {
        font-size: 16px;
    }

    .blog-footer__link {
        font-size: 15px;
    }

    .blog-footer__copyright {
        font-size: 13px;
    }
}

