/**
 * Blog Styles CSS
 * CV Cipta Indah Laksana
 * Dedicated styles for blog pages
 */

/* ============================================
   Blog Article Container
   ============================================ */
.blog-article-container {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-article-header {
    background-color: #f9fafb;
    padding: 40px 0;
}

/* ============================================
   Blog Article Content
   ============================================ */
.blog-content {
    font-size: 18px;
    line-height: 1.8;
    color: #374151;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* First and last child - no margin */
.blog-content > *:first-child {
    margin-top: 0;
}

.blog-content > *:last-child {
    margin-bottom: 0;
}

/* Headings */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: #111827;
}

.blog-content h1 { font-size: 36px; }
.blog-content h2 { font-size: 30px; }
.blog-content h3 { font-size: 24px; }
.blog-content h4 { font-size: 20px; }
.blog-content h5 { font-size: 18px; }
.blog-content h6 { font-size: 16px; }

/* Paragraphs */
.blog-content p {
    margin-bottom: 24px;
    line-height: 1.8;
}

/* Fix for empty paragraphs */
.blog-content p:empty {
    display: none;
}

/* Lists */
.blog-content ul,
.blog-content ol {
    margin-bottom: 24px;
    padding-left: 32px;
}

.blog-content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.blog-content li p {
    margin-bottom: 8px;
}

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

.blog-content ul li::marker {
    color: #2563eb;
}

.blog-content ol li::marker {
    color: #2563eb;
    font-weight: 600;
}

/* Nested lists */
.blog-content ul ul,
.blog-content ol ol,
.blog-content ul ol,
.blog-content ol ul {
    margin-top: 12px;
    margin-bottom: 12px;
}

/* Links */
.blog-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-content a:hover {
    color: #1d4ed8;
}

/* Images */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px 0;
    display: block;
}

.blog-content figure {
    margin: 32px 0;
}

.blog-content figure img {
    margin: 0;
}

.blog-content figcaption {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-top: 12px;
    font-style: italic;
}

/* Blockquote */
.blog-content blockquote {
    border-left: 4px solid #2563eb;
    margin: 32px 0;
    padding: 24px;
    background: #f9fafb;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.blog-content blockquote p {
    font-size: 18px;
    margin-bottom: 0;
}

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

/* Code - inline */
.blog-content code {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
    color: #be185d;
}

/* Code - block */
.blog-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 32px 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
}

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

/* Tables */
.blog-content table {
    width: 100%;
    margin: 32px 0;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

.blog-content th,
.blog-content td {
    padding: 16px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.blog-content th {
    background: #f9fafb;
    font-weight: 600;
}

.blog-content tr:hover {
    background-color: #f9fafb;
}

/* Horizontal Rule */
.blog-content hr {
    margin: 48px 0;
    border: none;
    border-top: 2px solid #e5e7eb;
}

/* Data attributes from rich text editors - hide them */
.blog-content [data-start],
.blog-content [data-end],
.blog-content [data-section-id] {
    display: block;
}

/* Fix for nested paragraphs in lists */
.blog-content li > p {
    display: block;
    margin-bottom: 8px;
}

/* ============================================
   Blog Sidebar Widgets
   ============================================ */
.blog-sidebar-widget {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.blog-widget-header {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.blog-widget-header i {
    margin-right: 10px;
}

.blog-widget-header.primary {
    background: #2563eb;
    color: #ffffff;
}

.blog-widget-header.success {
    background: #059669;
    color: #ffffff;
}

.blog-widget-header.dark {
    background: #111827;
    color: #ffffff;
}

.blog-widget-body {
    padding: 0;
}

/* Popular Posts List */
.blog-popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-popular-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.blog-popular-item:last-child {
    border-bottom: none;
}

.blog-popular-item:hover {
    background-color: #f9fafb;
}

.blog-popular-number {
    width: 28px;
    height: 28px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.blog-popular-info {
    flex: 1;
}

.blog-popular-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
}

.blog-popular-views {
    font-size: 12px;
    color: #6b7280;
}

/* Recommended Posts List */
.blog-recommended-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-recommended-item {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.blog-recommended-item:last-child {
    border-bottom: none;
}

.blog-recommended-item:hover {
    background-color: #f9fafb;
}

.blog-recommended-content {
    display: flex;
    align-items: center;
}

.blog-recommended-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    flex-shrink: 0;
}

.blog-recommended-thumb-placeholder {
    width: 64px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
}

.blog-recommended-info {
    flex: 1;
    min-width: 0;
}

.blog-recommended-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.blog-recommended-date {
    font-size: 12px;
    color: #6b7280;
}

/* Categories */
.blog-categories {
    padding: 20px;
}

.blog-category-tag {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.blog-category-tag:hover {
    background: #2563eb;
    color: #ffffff;
}

/* ============================================
   Blog Card Styles (for blog index)
   ============================================ */
.blog-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-body {
    padding: 20px;
}

.blog-card-category {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.4;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-title a:hover {
    color: #2563eb;
}

.blog-card-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
}

.blog-card-meta {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 16px;
}

.blog-card-meta i {
    margin-right: 4px;
}

/* ============================================
   Blog Breadcrumb
   ============================================ */
.blog-breadcrumb {
    background: #f9fafb;
    padding: 12px 0;
}

.blog-breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.blog-breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.blog-breadcrumb-item a {
    color: #2563eb;
    text-decoration: none;
}

.blog-breadcrumb-item a:hover {
    text-decoration: underline;
}

.blog-breadcrumb-separator {
    margin: 0 12px;
    color: #9ca3af;
}

.blog-breadcrumb-item.active {
    color: #6b7280;
}

/* ============================================
   Blog Article Meta Info
   ============================================ */
.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.blog-meta-badge {
    background: #2563eb;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.blog-meta-badge:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.blog-meta-item {
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
}

.blog-meta-item i {
    margin-right: 6px;
}

.blog-article-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin-bottom: 16px;
}

.blog-article-excerpt {
    font-size: 20px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 24px;
}

.blog-author-box {
    display: flex;
    align-items: center;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.blog-author-avatar {
    width: 56px;
    height: 56px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
}

.blog-author-info h5 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.blog-author-info p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.blog-cover-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 24px;
}

.blog-cover-caption {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 991px) {
    .blog-content {
        font-size: 16px;
    }
    
    .blog-content h1 { font-size: 30px; }
    .blog-content h2 { font-size: 26px; }
    .blog-content h3 { font-size: 22px; }
    
    .blog-article-title {
        font-size: 32px;
    }
    
    .blog-article-container {
        padding: 24px;
    }
}

@media (max-width: 767px) {
    .blog-content {
        font-size: 15px;
    }
    
    .blog-content h1 { font-size: 24px; }
    .blog-content h2 { font-size: 22px; }
    .blog-content h3 { font-size: 20px; }
    .blog-content h4 { font-size: 18px; }
    
    .blog-article-title {
        font-size: 26px;
    }
    
    .blog-article-excerpt {
        font-size: 18px;
    }
    
    .blog-article-container {
        padding: 20px;
    }
    
    .blog-cover-image {
        max-height: 250px;
    }
    
    .blog-article-meta {
        gap: 12px;
    }
}
