/**
 * Blog Markdown Content Styles
 * Styles for markdown-rendered content in blog articles
 */

/* Blog content base styles */
.blog-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #1a1a1a;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
}

.blog-content h1 { font-size: 2rem; }
.blog-content h2 { font-size: 1.6rem; }
.blog-content h3 { font-size: 1.3rem; }
.blog-content h4 { font-size: 1.1rem; }

.blog-content p {
    margin-bottom: 1.2em;
}

/* Lists */
.blog-content ul,
.blog-content ol {
    margin-bottom: 1.2em;
    padding-left: 1.5em;
}

.blog-content li {
    margin-bottom: 0.5em;
}

.blog-content ul li {
    list-style-type: disc;
}

.blog-content ol li {
    list-style-type: decimal;
}

/* Blockquotes */
.blog-content blockquote {
    border-left: 4px solid var(--primary-color, #3498db);
    padding: 1em 1.5em;
    margin: 1.5em 0;
    background: rgba(0,0,0,0.03);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code blocks */
.blog-content pre {
    background: #1e1e1e;
    padding: 1em 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.blog-content pre code {
    color: #d4d4d4;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.blog-content code {
    background: rgba(0,0,0,0.06);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

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

/* Tables - clean style like Google Docs */
.blog-content table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
}

.blog-content table th,
.blog-content table td {
    padding: 0.75em 1em;
    border: none;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
}

.blog-content table thead tr {
    border-bottom: 2px solid #333;
}

.blog-content table th {
    background: transparent;
    font-weight: 600;
}

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

/* Images */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
}

/* Horizontal rule */
.blog-content hr {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 2em 0;
}

/* Links */
.blog-content a {
    color: var(--primary-color, #3498db);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.blog-content a:hover {
    border-bottom-color: var(--primary-color, #3498db);
}

/* Checkboxes (for task lists) */
.blog-content .form-check {
    padding-left: 1.75em;
    margin-bottom: 0.5em;
}

.blog-content .form-check-input {
    margin-left: -1.75em;
}

/* Blog meta info */
.blog-meta {
    color: #444;
    font-size: 0.95rem;
    padding-bottom: 1em;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1.5em;
}

/* ============================================
   GOOGLE DOCS EMBED MODE STYLES
   Dùng khi contentMode: 'embed' trong BLOG_CONFIG
   ============================================ */

/* Container cho embedded content */
.blog-embed {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* Google Docs iframe */
.google-docs-embed {
    width: 100%;
    min-height: 800px;
    max-height: 2000px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .google-docs-embed {
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .google-docs-embed {
        min-height: 400px;
    }
}

/* Loading state placeholder */
.blog-embed-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
}

.blog-embed-loading::after {
    content: "Đang tải nội dung...";
    color: #6c757d;
    font-style: italic;
}

/* ============================================
   GOOGLE DOCS HTML MODE STYLES
   Dùng khi contentMode: 'html' trong BLOG_CONFIG
   ============================================ */

/* Container cho HTML content từ Google Docs */
.blog-html-content {
    line-height: 1.8;
    color: #1a1a1a;
}

/* Google Docs sử dụng <p> tags */
.blog-html-content p {
    margin-bottom: 1em;
}

/* Headings từ Google Docs */
.blog-html-content h1,
.blog-html-content h2,
.blog-html-content h3,
.blog-html-content h4,
.blog-html-content h5,
.blog-html-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
}

/* Lists từ Google Docs */
.blog-html-content ul,
.blog-html-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.blog-html-content li {
    margin-bottom: 0.5em;
}

/* Tables từ Google Docs */
.blog-html-content table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
}

.blog-html-content td,
.blog-html-content th {
    border: 1px solid #dee2e6;
    padding: 0.75em;
}

/* Images từ Google Docs */
.blog-html-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 4px;
}

/* Links */
.blog-html-content a {
    color: var(--primary-color, #3498db);
}

.blog-meta i {
    color: var(--primary-color, #3498db);
}

/* Blog listing card text colors */
#blog-posts p,
#blog-posts h4,
#blog-posts a.text-dark {
    color: #1a1a1a !important;
}

#blog-posts p {
    color: #333 !important;
}

.text-muted {
    color: #444 !important;
}

/* Blog category badge on list */
.blog-category {
    display: inline-block;
    padding: 0.3em 0.8em;
    background: var(--primary-color, #3498db);
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    margin-bottom: 0.5em;
}

/* Loading state */
.blog-read .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty state */
.blog-empty {
    text-align: center;
    padding: 3em;
    color: #444;
}

.blog-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blog-content {
        font-size: 1rem;
    }
    
    .blog-content h1 { font-size: 1.7rem; }
    .blog-content h2 { font-size: 1.4rem; }
    .blog-content h3 { font-size: 1.2rem; }
    
    .blog-content pre {
        padding: 0.8em 1em;
    }
    
    .blog-content blockquote {
        padding: 0.8em 1em;
        margin: 1em 0;
    }
}
