/* === Blog CSS (BEM) === */
/* Минимальные стили, позже заменит дизайнер */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1a1a2e; line-height: 1.6; background: #fafafa; }
a { color: #6d28d9; text-decoration: none; }
a:hover { color: #7c3aed; }
img { max-width: 100%; height: auto; }

/* === Container === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* === Header === */
.blog-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid #e5e7eb; transition: box-shadow .2s; }
.blog-header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.header-content { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; font-weight: 800; color: #6d28d9; }
.logo-title { font-size: 16px; }
.tagline { font-size: 11px; color: #9ca3af; display: block; }
.header-nav { display: flex; align-items: center; gap: 20px; }
.nav-link { color: #374151; font-size: 14px; font-weight: 500; }
.nav-link.active { color: #6d28d9; }
.nav-link:hover { color: #6d28d9; }
.nav-divider { width: 1px; height: 20px; background: #e5e7eb; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.btn-primary { background: #6d28d9; color: #fff; }
.btn-primary:hover { background: #7c3aed; color: #fff; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: #374151; margin: 5px 0; transition: .2s; }
.mobile-menu { display: none; }
.mobile-menu.open { display: flex; flex-direction: column; padding: 16px 20px; border-top: 1px solid #e5e7eb; }
.mobile-link { padding: 10px 0; color: #374151; font-size: 15px; }
.mobile-link.primary { color: #6d28d9; font-weight: 600; }
.mobile-divider { height: 1px; background: #e5e7eb; margin: 8px 0; }

/* === Breadcrumbs === */
.breadcrumbs-wrapper { background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.breadcrumbs { padding: 12px 0; font-size: 13px; color: #6b7280; }
.breadcrumbs a { color: #6b7280; }
.breadcrumbs a:hover { color: #6d28d9; }
.breadcrumbs .separator { margin: 0 6px; }
.breadcrumbs .current { color: #374151; }

/* === Main === */
.blog-main { padding: 32px 0 60px; min-height: 60vh; }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; color: #1a1a2e; }
.page-description { color: #6b7280; margin-bottom: 24px; }
.section-title { font-size: 20px; font-weight: 600; margin-bottom: 16px; color: #1a1a2e; }

/* === Blog Layout === */
.blog-layout { display: grid; grid-template-columns: 1fr 280px; gap: 40px; }

/* === Posts Grid === */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-bottom: 32px; }
.posts-grid--featured { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.posts-section { margin-top: 32px; }
.featured-section { margin-bottom: 16px; }

/* === Post Card === */
.post-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; transition: box-shadow .2s, transform .2s; }
.post-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); transform: translateY(-2px); }
.post-card__image { display: block; aspect-ratio: 16/9; overflow: hidden; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 16px; }
.post-card__category { font-size: 12px; color: #6d28d9; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.post-card__title { font-size: 17px; font-weight: 600; margin: 6px 0 8px; line-height: 1.3; }
.post-card__title a { color: #1a1a2e; }
.post-card__title a:hover { color: #6d28d9; }
.post-card__desc { font-size: 14px; color: #6b7280; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__meta { display: flex; gap: 12px; margin-top: 12px; font-size: 12px; color: #9ca3af; }

/* === Post Detail === */
.post-detail { max-width: 800px; margin: 0 auto; }
.post-detail__header { margin-bottom: 24px; }
.post-detail__title { font-size: 32px; font-weight: 700; line-height: 1.25; margin-bottom: 12px; }
.post-detail__meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: #6b7280; }
.post-detail__category { color: #6d28d9; font-weight: 500; }
.post-detail__image { margin-bottom: 24px; border-radius: 12px; overflow: hidden; }
.post-detail__image img { width: 100%; }
.post-detail__content { font-size: 16px; line-height: 1.8; color: #374151; }
.post-detail__content h2 { font-size: 24px; font-weight: 600; margin: 32px 0 12px; color: #1a1a2e; }
.post-detail__content h3 { font-size: 20px; font-weight: 600; margin: 24px 0 8px; color: #1a1a2e; }
.post-detail__content p { margin-bottom: 16px; }
.post-detail__content ul, .post-detail__content ol { margin: 0 0 16px 24px; }
.post-detail__content li { margin-bottom: 6px; }
.post-detail__content blockquote { border-left: 4px solid #6d28d9; padding: 12px 20px; margin: 16px 0; background: #f5f3ff; border-radius: 0 8px 8px 0; color: #4c1d95; }
.post-detail__content img { border-radius: 8px; margin: 16px 0; }
.post-detail__content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.post-detail__content th, .post-detail__content td { border: 1px solid #e5e7eb; padding: 10px 14px; text-align: left; }
.post-detail__content th { background: #f9fafb; font-weight: 600; }
.post-detail__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 20px; border-top: 1px solid #e5e7eb; }

/* === Similar Posts === */
.similar-posts { margin-top: 48px; padding-top: 32px; border-top: 1px solid #e5e7eb; }

/* === Sidebar === */
.blog-sidebar { position: sticky; top: 80px; align-self: start; }
.sidebar-block { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 20px; margin-bottom: 20px; }
.sidebar-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.sidebar-list { list-style: none; }
.sidebar-list li { margin-bottom: 8px; }
.sidebar-list a { color: #374151; font-size: 14px; }
.sidebar-list a:hover { color: #6d28d9; }

/* === Tags === */
.tag-link { display: inline-block; padding: 4px 10px; background: #f5f3ff; color: #6d28d9; border-radius: 6px; font-size: 13px; margin: 2px; }
.tag-link:hover { background: #ede9fe; color: #5b21b6; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* === Subcategories === */
.subcategories-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.subcategory-link { display: inline-block; padding: 6px 14px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px; color: #374151; }
.subcategory-link:hover { border-color: #6d28d9; color: #6d28d9; }

/* === Pagination === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 32px; }
.pagination__pages { display: flex; gap: 4px; }
.pagination__link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: #374151; background: #fff; border: 1px solid #e5e7eb; }
.pagination__link:hover { border-color: #6d28d9; color: #6d28d9; }
.pagination__link--current { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.pagination__link--prev, .pagination__link--next { font-weight: 500; }
.pagination__ellipsis { display: inline-flex; align-items: center; padding: 0 4px; color: #9ca3af; }

/* === Footer === */
.blog-footer { background: #1a1a2e; color: #d1d5db; padding: 48px 0 24px; margin-top: 60px; }
.blog-footer a { color: #d1d5db; }
.blog-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-logo .logo-icon { color: #a78bfa; }
.footer-logo .logo-title { color: #fff; }
.footer-description { font-size: 14px; line-height: 1.5; color: #9ca3af; }
.footer-section h4 { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer-section nav { display: flex; flex-direction: column; gap: 8px; }
.footer-section nav a { font-size: 14px; }
.footer-bottom { border-top: 1px solid #374151; padding-top: 20px; text-align: center; }
.copyright { font-size: 13px; color: #9ca3af; }
.footer-contact { font-size: 11px; color: #6b7280; margin-top: 4px; }

/* === Responsive === */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { position: static; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .post-detail__title { font-size: 24px; }
    .page-title { font-size: 22px; }
}
