/* ============= БАЗОВЫЕ СТИЛИ ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

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

/* ============= НАВИГАЦИЯ ============= */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#navbar .logo {
    font-size: 2rem;
    font-weight: 800;
    color: #667eea;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #667eea;
}

.nav-menu a.active {
    color: #667eea;
    font-weight: 600;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.nav-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 10px 25px;
    border-radius: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ============= ОБЩИЕ СТИЛИ БЛОГА ============= */
.blog-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 70px 0 60px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin-top: 70px;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">ircle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

.blog-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
    position: relative;
    z-index: 1;
}

.blog-hero-subtitle {
    font-size: 1.5rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease;
    position: relative;
    z-index: 1;
}

/* ============= СЕТКА СТАТЕЙ ============= */
.blog-grid-section {
    padding: 60px 0;
    background: #f8f9fa;
}

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

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

.blog-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
}

.blog-card-image {
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #6366f1;
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 15px;
}

.blog-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255,255,255,0.95);
    color: #667eea;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blog-card-content {
    padding: 25px;
}

.blog-card-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.blog-card-meta i {
    margin-right: 5px;
    color: #667eea;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.blog-card-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: #667eea;
}

.blog-card-description {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.blog-card-link {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.blog-card-link:hover {
    gap: 12px;
}

.blog-card-link i {
    transition: transform 0.3s ease;
}

.blog-card-link:hover i {
    transform: translateX(5px);
}

/* ============= СТРАНИЦА СТАТЬИ ============= */
.blog-post-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 120px 0 50px;
    color: white;
    margin-top: 70px;
}

.back-link {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    opacity: 0.9;
    transition: opacity 0.3s ease, gap 0.3s ease;
    font-weight: 500;
}

.back-link:hover {
    opacity: 1;
    gap: 12px;
}

.blog-post-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
    animation: fadeInUp 0.6s ease;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 20px;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease;
}

.blog-post-meta i {
    margin-right: 8px;
}

.author {
    font-weight: 600;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    animation: fadeInUp 1s ease;
}

.tag-large {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.tag-large:hover {
    background: rgba(255,255,255,0.3);
}

/* ============= КОНТЕНТ СТАТЬИ ============= */
.blog-post-content {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
    animation: fadeInUp 0.8s ease;
}

.blog-post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 40px 0 20px;
    color: #2c3e50;
    position: relative;
    padding-bottom: 10px;
}

.blog-post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.blog-post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px;
    color: #34495e;
}

.blog-post-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 20px;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.blog-post-content li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 10px;
}

.blog-post-content pre {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}
/* Картинки в статьях */
.blog-post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blog-post-content code {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

.blog-post-content strong {
    color: #2c3e50;
    font-weight: 700;
}

.blog-post-content a {
    color: #667eea;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.blog-post-content a:hover {
    color: #764ba2;
}

/* ============= ПОХОЖИЕ СТАТЬИ ============= */
.related-posts {
    background: #f8f9fa;
    padding: 60px 0;
}

.related-posts h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

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

.related-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.related-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.related-card h4 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-card h4 a:hover {
    color: #667eea;
}

.related-card p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.read-time {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

.read-time i {
    margin-right: 5px;
}

/* ============= CTA БЛОК ============= */
.blog-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    text-align: center;
    color: white;
}

.blog-cta h3 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.blog-cta p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.blog-cta .cta-consultation {
    background: white;
    color: #667eea;
    padding: 15px 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-cta .cta-consultation:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ============= FOOTER ============= */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

/* ============= АДАПТИВНОСТЬ ============= */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .nav-cta {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .blog-hero {
        padding: 100px 20px 40px;
    }
    
    .blog-hero-title {
        font-size: 2.5rem;
    }
    
    .blog-hero-subtitle {
        font-size: 1.2rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .blog-post-title {
        font-size: 2rem;
    }
    
    .blog-post-meta {
        font-size: 0.85rem;
        gap: 15px;
    }
    
    .blog-post-content {
        padding: 0 15px;
    }
    
    .blog-post-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-post-content h3 {
        font-size: 1.3rem;
    }
    
    .blog-post-content p,
    .blog-post-content li {
        font-size: 1rem;
    }
    
    .blog-post-content pre {
        padding: 15px;
        font-size: 0.85rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-cta h3 {
        font-size: 2rem;
    }
    
    .blog-cta p {
        font-size: 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    /* Скрытие кнопок FAQ, Портфолио, Услуги в блоге на мобильных */
    body.blog-page .nav-menu a[href="#faq"],
    body.blog-page .nav-menu a[href="#portfolio"],
    body.blog-page .nav-menu a[href="#services"],
    body.blog-page .nav-menu a[href="/#faq"],
    body.blog-page .nav-menu a[href="/#portfolio"],
    body.blog-page .nav-menu a[href="/#services"] {
        display: none !important;
    }
    
    .blog-hero {
        padding: 100px 20px 40px;
    }
}

@media (max-width: 480px) {
    #navbar .logo {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .blog-card-image {
        height: 180px;
    }
    
    .blog-card-content {
        padding: 20px;
    }
    
    .blog-card-title {
        font-size: 1.3rem;
    }
    
    .blog-post-header {
        padding: 100px 20px 40px;
    }
}

/* ============= АНИМАЦИИ ============= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= УЛУЧШЕНИЯ UX ============= */
.blog-card-content::after {
    content: '';
    display: block;
    clear: both;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.blog-post-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 20px;
    margin: 25px 0;
    font-style: italic;
    color: #6c757d;
}
/* Inline код */
.blog-post-content code {
    background: #f4f4f4;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid #e0e0e0;
}

.blog-post-content pre code {
    background: transparent;
    color: #333;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    line-height: 1.5;
    padding: 0;
    border: none;
}
/* Математические формулы */
.blog-post-content .MJXc-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0;
}

.blog-post-content mjx-container {
    display: inline-block;
    margin: 0.5rem 0;
}

/* Блочные формулы */
.blog-post-content mjx-container[display="true"] {
    display: block;
    text-align: center;
    margin: 1.5rem 0;
}

/* Инлайн формулы */
.blog-post-content mjx-container[display="false"] {
    display: inline;
    margin: 0 0.2rem;
}

/* Таблицы */
.blog-post-content table,
.blog-post-content .markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.blog-post-content table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.blog-post-content table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.blog-post-content table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.blog-post-content table tbody tr:hover {
    background: #f8f9fa;
}
