/* SEO стили для постов */

/* Хлебные крошки */
.breadcrumbs {
    margin-bottom: 20px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.breadcrumbs a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #005a87;
    text-decoration: underline;
}

.breadcrumbs span {
    color: #333;
}

/* Время чтения */
.reading-time {
    color: #888;
    font-size: 14px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #ddd;
    align-self: flex-start;
}

/* Мета-информация поста */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.post-meta-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
}

.post-meta .post-date {
    color: #888;
}

.post-meta .post-category a {
    color: #007cba;
    text-decoration: none;
    padding: 4px 8px;
    background: #f0f8ff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.post-meta .post-category a:hover {
    background: #007cba;
    color: white;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        justify-content: flex-start;
    }
    
    .post-meta-main {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .reading-time {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #ddd;
        padding-top: 0;
        width: 100%;
        align-self: stretch;
    }
}

/* Стили для структурированных данных (скрытые) */
[itemscope] {
    display: none !important;
}

/* Улучшенные стили для заголовков в содержании */
.toc-list a.active,
.toc-list-mobile a.active {
    color: #007cba !important;
    font-weight: 600;
    position: relative;
}

.toc-list a.active::before,
.toc-list-mobile a.active::before {
    content: "▶";
    position: absolute;
    left: -15px;
    color: #007cba;
    font-size: 12px;
}

/* Стили для связанных постов */
.related-posts__title {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.related-posts__all-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.related-posts__all-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.related-posts__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.related-post-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

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

.related-post-card__image {
    overflow: hidden;
    height: 200px;
}

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

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

.related-post-card__content {
    padding: 20px;
}

.related-post-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #888;
}

.related-post-card__separator {
    color: #ccc;
}

.related-post-card__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

.related-post-card__title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-card__title a:hover {
    color: #007cba;
}

/* Адаптивность для связанных постов */
@media (max-width: 768px) {
    .related-posts__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .related-posts__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .related-post-card__image {
        height: 150px;
    }
    
    .related-post-card__content {
        padding: 15px;
    }
}

/* Стили для архива */
.blog-archive {
    padding: 120px 0 40px 0; /* Еще больше увеличиваем отступ сверху */
}

.archive-header {
    margin-bottom: 60px; /* Увеличиваем отступ снизу */
    text-align: center;
}

.archive-title {
    font-size: 36px; /* Увеличиваем размер шрифта */
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    margin-top: 0; /* Убираем отступ сверху */
}

.archive-description {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.blog-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0; /* Добавляем тонкую рамку для лучшей видимости */
    display: flex;
    flex-direction: column;
    height: 100%; /* Делаем все карточки одинаковой высоты */
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.post-thumbnail {
    height: 100px; /* Уменьшаем высоту в два раза с 150px до 100px */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Центрируем изображение по вертикали и горизонтали */
    transition: transform 0.3s ease;
    display: block; /* Убираем возможные отступы */
    margin: 0; /* Убираем все отступы */
    padding: 0; /* Убираем все отступы */
    vertical-align: top; /* Убираем отступ снизу */
}

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

.post-content {
    padding: 10px; /* Уменьшаем отступы в два раза с 20px до 10px */
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Растягиваем контент */
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px; /* Уменьшаем отступы в два раза с 8px до 4px */
    margin-bottom: 6px; /* Уменьшаем отступ в два раза с 12px до 6px */
    font-size: 12px; /* Уменьшаем размер шрифта с 14px до 12px */
    color: #666;
}

.post-meta .post-date {
    color: #888;
}

.post-meta .post-category a {
    color: #007cba;
    text-decoration: none;
    padding: 4px 8px;
    background: #f0f8ff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.post-meta .post-category a:hover {
    background: #007cba;
    color: white;
}

.post-meta .reading-time {
    color: #888;
    font-size: 12px;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.post-title {
    margin: 0 0 6px 0; /* Уменьшаем отступ в два раза с 12px до 6px */
    font-size: 14px; /* Уменьшаем размер шрифта с 16px до 14px */
    font-weight: 600;
    line-height: 1.2; /* Уменьшаем межстрочный интервал */
    color: #333 !important; /* Делаем заголовок всегда видимым */
}

.post-title a {
    color: #333 !important; /* Делаем ссылку всегда видимой */
    text-decoration: none;
    transition: color 0.3s ease;
    display: block; /* Делаем ссылку блочным элементом */
    width: 100%; /* Занимает всю ширину */
    min-height: 1.4em; /* Минимальная высота для видимости */
}

.post-title a:hover {
    color: #007cba !important; /* При наведении меняем цвет */
}

.post-excerpt {
    color: #666;
    line-height: 1.3; /* Уменьшаем межстрочный интервал */
    margin-bottom: 8px; /* Уменьшаем отступ в два раза с 15px до 8px */
    font-size: 12px; /* Уменьшаем размер шрифта с 14px до 12px */
    flex-grow: 1; /* Растягиваем описание */
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px; /* Уменьшаем отступ между текстом и стрелкой */
    color: white !important; /* Белый цвет текста */
    background: #007cba; /* Синий фон */
    padding: 6px 12px; /* Уменьшаем отступы в два раза */
    border-radius: 4px; /* Уменьшаем закругление */
    text-decoration: none;
    font-weight: 500;
    font-size: 12px; /* Уменьшаем размер шрифта */
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    color: white !important; /* Белый цвет при наведении */
    background: #005a87; /* Темно-синий фон при наведении */
    gap: 12px;
    transform: translateY(-2px); /* Добавляем подъем при наведении */
}

.read-more-btn svg {
    transition: transform 0.3s ease;
}

.read-more-btn:hover svg {
    transform: translateX(4px);
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 0 5px;
    color: #007cba;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination-wrapper .page-numbers:hover,
.pagination-wrapper .page-numbers.current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-posts h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

/* Адаптивность для архива */
@media (max-width: 768px) {
    .blog-archive {
        padding: 100px 0 20px 0; /* Увеличиваем отступ сверху на мобильных */
    }
    
    .archive-title {
        font-size: 28px; /* Увеличиваем размер на мобильных */
        margin-bottom: 15px;
    }
    
    .archive-header {
        margin-bottom: 40px; /* Уменьшаем отступ снизу на мобильных */
    }
    
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-content {
        padding: 8px; /* Уменьшаем отступы в два раза на мобильных */
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* Растягиваем контент на мобильных */
    }
    
    .post-thumbnail {
        height: 80px; /* Уменьшаем высоту изображения в два раза на мобильных */
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .post-title {
        font-size: 13px; /* Уменьшаем размер заголовка на мобильных */
        color: #333 !important; /* Убеждаемся что заголовок виден на мобильных */
    }
    
    .post-title a {
        color: #333 !important; /* Убеждаемся что ссылка видна на мобильных */
    }
    
    .read-more-btn {
        padding: 4px 8px; /* Уменьшаем отступы в два раза на мобильных */
        font-size: 11px; /* Уменьшаем размер шрифта на мобильных */
    }
}
