/* Từ resources/views/pages/blogs/show.blade.php */
.blog-detail-hero {
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.back-link {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    display: inline-block;
    margin-bottom: 20px;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 1;
}

.blog-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 20px 0 15px;
    line-height: 1.2;
}

.blog-subtitle {
    font-size: 18px;
    opacity: 0.95;
    line-height: 1.6;
}

.blog-meta-header {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: 0.9;
}

.blog-detail-section {
    padding: 60px 0;
}

.blog-detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.blog-main-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.blog-featured-image {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.blog-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-content-body {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
}

.blog-content-body p {
    margin-bottom: 20px;
}

.blog-gallery {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.blog-gallery h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
}

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

.blog-tags-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.blog-tags-section h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags-list .tag {
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s;
}

.tags-list .tag:hover {
    background: #667eea;
    color: white;
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-widget h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.related-blogs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.related-blog-item {
    display: flex;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.related-blog-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-blog-image {
    width: 100px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-blog-content h4 {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-blog-content a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.related-blog-content a:hover {
    color: #667eea;
}

.related-blog-date {
    font-size: 12px;
    color: #999;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.categories-list li:last-child {
    border-bottom: none;
}

.categories-list a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.categories-list a:hover {
    color: #667eea;
}

@media (max-width: 1024px) {
    .blog-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 32px;
    }
    
    .blog-main-content {
        padding: 25px;
    }
}

/* ---------- Bổ sung cho trang chi tiết (dùng cùng css/detail.css) ---------- */
.blog-main-content {
    min-width: 0;
}

.blog-detail-grid {
    align-items: start;
}

/* Nội dung bài dùng .rich-text: giữ tông màu của trang blog */
.blog-content-body.rich-text {
    color: #333;
}

.blog-content-body.rich-text h2,
.blog-content-body.rich-text h3 {
    color: #1f2937;
}

.blog-content-body.rich-text li::marker {
    color: #667eea;
}

.blog-cta {
    margin-bottom: 40px;
    border-left-color: #667eea;
    background: #f5f3ff;
}

.blog-cta .btn {
    white-space: normal;
}

.blog-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.blog-share-label {
    font-weight: 600;
    color: #333;
}

.share-btn {
    padding: 8px 16px;
    border: 1px solid #d4d4d8;
    border-radius: 20px;
    background: white;
    color: #333;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.share-status {
    font-size: 14px;
    color: #16a34a;
}

.blog-author-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 30px 0;
    padding: 20px;
    border-radius: 12px;
    background: #f9fafb;
}

.blog-author-box img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    background: white;
    padding: 8px;
    border: 1px solid #eee;
}

.author-name {
    font-weight: 700;
    color: #333;
}

.author-bio {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.toc-widget .toc-list a::before {
    color: #667eea;
}

.toc-widget .toc-list a:hover {
    color: #667eea;
}

@media (min-width: 1025px) {
    /* Sidebar dính theo khi đọc bài; cao hơn màn hình thì tự cuộn */
    .blog-sidebar {
        position: sticky;
        top: 90px;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        padding: 4px;
        margin: -4px;
    }
}

@media (max-width: 1024px) {
    /* Một cột: mục lục lên trên bài viết, các khối còn lại của sidebar xuống dưới */
    .blog-sidebar {
        display: contents;
    }

    .toc-widget {
        order: -1;
    }

    .blog-sidebar .sidebar-widget:not(.toc-widget) {
        order: 1;
    }
}
