/* ============================
   Blog Content Auto-Styling 2026
   Modern Design — KazkiUA
   /static/css/blog-content.css
   ============================ */

/* === Типографіка === */
.blog-content h2 {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #6366f1, #a78bfa, transparent) 1;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.blog-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
    padding-left: 0.75rem;
    border-left: 3px solid #6366f1;
}

.blog-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-content p {
    margin-bottom: 1.25rem;
    line-height: 1.9;
    color: #374151;
    font-size: 1.05rem;
}

.blog-content strong {
    font-weight: 700;
    color: #0f172a;
}

/* === Посилання === */
.blog-content a {
    color: #4f46e5;
    text-decoration: none;
    border-bottom: 1.5px solid #c7d2fe;
    transition: all 0.2s ease;
    padding-bottom: 1px;
}

.blog-content a:hover {
    color: #4338ca;
    border-bottom-color: #4338ca;
    background: linear-gradient(to top, #eef2ff 40%, transparent 40%);
}

/* === Списки === */
.blog-content ul,
.blog-content ol {
    margin-bottom: 1.25rem;
    padding-left: 0;
    list-style: none;
}

.blog-content ul > li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.65rem;
    line-height: 1.75;
    color: #374151;
}

.blog-content ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
}

.blog-content ol {
    counter-reset: ol-counter;
}

.blog-content ol > li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.75;
    color: #374151;
    counter-increment: ol-counter;
}

.blog-content ol > li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 1.6rem;
    height: 1.6rem;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-content li strong {
    color: #0f172a;
}

/* === Blockquote === */
.blog-content blockquote {
    position: relative;
    border: none;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    border-left: 4px solid #6366f1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.blog-content blockquote::before {
    content: '"';
    position: absolute;
    top: -0.25rem;
    left: 0.75rem;
    font-size: 3rem;
    color: #c7d2fe;
    font-family: Georgia, serif;
    line-height: 1;
}

.blog-content blockquote p {
    color: #475569;
    font-style: italic;
    margin-bottom: 0;
    font-size: 1.05rem;
}

/* === Таблиці === */
.blog-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    font-size: 0.925rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.blog-content th {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    font-weight: 600;
    text-align: left;
    padding: 0.85rem 1.15rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.blog-content td {
    padding: 0.8rem 1.15rem;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

.blog-content tbody tr {
    transition: background 0.15s ease;
}

.blog-content tbody tr:nth-child(even) {
    background: #f8fafc;
}

.blog-content tbody tr:hover {
    background: #eef2ff;
}

.blog-content tbody tr:last-child td {
    border-bottom: none;
}

/* === TL;DR блок === */
.blog-content .tldr-box {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #86efac;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.08);
}

.blog-content .tldr-box h2 {
    font-size: 1.2rem;
    color: #15803d;
    margin-top: 0;
    padding-bottom: 0;
    border-bottom: none;
    border-image: none;
    margin-bottom: 0.75rem;
    letter-spacing: 0;
}

.blog-content .tldr-box ul {
    margin-bottom: 0;
}

.blog-content .tldr-box li {
    color: #1f2937;
}

.blog-content .tldr-box li::before {
    display: none;
}

.blog-content .tldr-box li {
    padding-left: 0;
}

/* === AI Answer блок === */
.blog-content .ai-answer {
    background: linear-gradient(135deg, #eef2ff, #ede9fe);
    border: 1px solid #c7d2fe;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.blog-content .ai-answer::before {
    content: '🤖';
    position: absolute;
    top: -0.65rem;
    left: 1.25rem;
    font-size: 1.25rem;
    background: white;
    padding: 0 0.35rem;
    border-radius: 0.5rem;
}

.blog-content .ai-answer strong {
    color: #4338ca;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.blog-content .ai-answer p {
    color: #475569;
    margin-bottom: 0;
    font-size: 0.975rem;
}

/* === Роздільник === */
.blog-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c7d2fe, #a78bfa, #c7d2fe, transparent);
    margin: 3rem 0;
}

/* === Зображення === */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-content img:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* === Code (якщо буде) === */
.blog-content code {
    background: #f1f5f9;
    color: #4f46e5;
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.9em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.blog-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.blog-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* === Мобільна адаптація === */
@media (max-width: 640px) {
    .blog-content h2 {
        font-size: 1.45rem;
        margin-top: 2rem;
    }

    .blog-content h3 {
        font-size: 1.15rem;
    }

    .blog-content p {
        font-size: 1rem;
    }

    .blog-content table {
        font-size: 0.8rem;
    }

    .blog-content th,
    .blog-content td {
        padding: 0.5rem 0.65rem;
    }

    .blog-content blockquote {
        padding: 1rem 1rem 1rem 1.5rem;
    }

    .blog-content blockquote::before {
        font-size: 2rem;
    }

    .blog-content .ai-answer,
    .blog-content .tldr-box {
        padding: 1rem 1.25rem;
    }
}