/* TOC Sidebar */
.toc-sidebar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    font-size: 14px;
}

.toc-toggle {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 8px;
    border-radius: 8px 0 0 8px; /* đổi góc bo cho bên phải */
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.toc-menu {
    position: absolute;
    right: 100%;
    top: 0;
    background: white;
    width: 280px;
    max-height: 42vh;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 15px;
    display: none;
    transition: all 0.3s;
}

.toc-menu.open { display: block; }

.toc-menu h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

#toc-list { margin: 0; padding: 0; list-style: none; }
#toc-list li { margin: 6px 0; }
#toc-list a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    border-right: 3px solid transparent; /* đổi từ border-left sang border-right */
    transition: all 0.2s;
}
#toc-list a:hover { 
    color: #007bff; 
    border-right-color: #007bff; 
}

.toc-level-1 { font-weight: bold; }
.toc-level-2 { padding-left: 10px; font-weight: 600; }
.toc-level-3 { padding-left: 20px; font-size: 0.95em; }

/* Vẫn hiển thị trên di động */
@media (max-width: 768px) {
    .toc-sidebar {
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    .toc-menu {
        width: 250px;
        font-size: 13px;
    }
}

/* === BLOG PAGE - HOÀN TOÀN RIÊNG BIỆT === */
.blog-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Reset ảnh hưởng từ style.css */
.blog-page * {
    box-sizing: border-box;
}
.blog-page h2, .blog-page h3 {
    margin: 0;
    padding: 0;
    font-weight: normal;
    line-height: normal;
}

/* Header */
.blog-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #007bff;
}

.blog-page-title {
    font-size: 1.9rem;
    margin: 0 0 8px;
    font-weight: 700;
}

.blog-subtitle {
    color: #555;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 26px;
    margin-top: 20px;
}

.blog-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Thumbnail */
.blog-thumb-link {
    display: block;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.blog-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-thumb-placeholder {
    height: 100%;
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #90caf9;
    font-size: 1.8rem;
    font-weight: bold;
}

/* Body */
.blog-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
}

.blog-card-title a {
    color: #1a3c6e;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.blog-tag a {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-decoration: none;
    font-weight: 500;
}

.blog-card-excerpt {
    color: #444;
    font-size: 0.94rem;
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 50px 20px;
    font-size: 1.1rem;
}

.post-thumbnail{
    max-width:100%;
    margin: 20px 0;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    background: #fff;
}

.post-meta{
    text-align:center;
}

.post-content{
    text-align:left;
}

figure {
    margin:0;
}
/* Responsive */
@media (max-width: 768px) {
    .blog-page { padding: 15px; }
    .blog-page-title { font-size: 1.7rem; }
    .blog-grid { grid-template-columns: 1fr; gap: 20px; }
    .blog-thumb-link { height: 160px; }
    .blog-card-body { padding: 16px; }
}