/* ── Blog List Page ── */

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, #1c3966 0%, #2a5298 100%);
    color: #fff;
    padding: 2.5rem 0;
    text-align: center;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.blog-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #fff;
}

.blog-header p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
    font-weight: 300;
    margin: 0;
}

/* Category Nav */
.category-nav {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: sticky;
    top: 70px;
    z-index: 100;
    margin-bottom: 2rem;
    border-radius: 12px;
    padding: 0.25rem 0;
}

.category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.category-menu > li {
    position: relative;
}

.category-menu > li > a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.2rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.category-menu > li > a:hover,
.category-menu > li > a.active {
    color: #1c3966;
    border-bottom-color: #1c3966;
}

.category-menu i {
    font-size: 0.65rem;
    opacity: 0.5;
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 0.5rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid #f0f0f0;
}

.category-menu > li:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: #444;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.dropdown-menu li a:hover {
    background: #f8f9fa;
    color: #1c3966;
}

.all-articles-link > a {
    font-weight: 600 !important;
    color: #1c3966 !important;
    border-bottom: 1px solid #eee;
    background: #fafbfc;
}

/* ── Post Grid ── */
.posts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* ── Post Card ── */
.post-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: row;
    min-height: 200px;
    border: 1px solid #f0f0f0;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

.post-card-image {
    flex: 0 0 300px;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    color: #ccc;
    font-size: 2.5rem;
}

.post-card-body {
    flex: 1;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.post-card-category {
    display: inline-block;
    background: #e8f0fe;
    color: #1c3966;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-card-date {
    font-size: 0.78rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.post-card-title a:hover {
    color: #1c3966;
}

.post-card-excerpt {
    font-size: 0.88rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: #1c3966;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.btn-read-more:hover {
    background: #142d52;
    color: #fff;
    transform: translateX(-3px);
}

.btn-read-more i {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.btn-read-more:hover i {
    transform: translateX(-3px);
}

/* Featured Post (first post) */
.post-card-featured {
    flex-direction: column;
    min-height: auto;
}

.post-card-featured .post-card-image {
    flex: none;
    height: 280px;
}

.post-card-featured .post-card-title {
    font-size: 1.3rem;
    -webkit-line-clamp: 3;
}

.post-card-featured .post-card-excerpt {
    -webkit-line-clamp: 3;
}

/* Two-column grid for posts 2-3 */
.posts-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.post-card-sm {
    flex-direction: column;
    min-height: auto;
}

.post-card-sm .post-card-image {
    flex: none;
    height: 180px;
}

.post-card-sm .post-card-title {
    font-size: 0.95rem;
}

.post-card-sm .post-card-excerpt {
    font-size: 0.82rem;
    -webkit-line-clamp: 2;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    margin-bottom: 2rem;
}

.blog-pagination .page-link {
    border-radius: 10px;
    padding: 0.5rem 1rem;
    color: #1c3966;
    border: 1px solid #e0e0e0;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.blog-pagination .page-item.active .page-link {
    background-color: #1c3966;
    border-color: #1c3966;
    color: #fff;
}

.blog-pagination .page-link:hover {
    background-color: #1c3966;
    color: #fff;
    border-color: #1c3966;
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .posts-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .post-card {
        flex-direction: column;
    }

    .post-card-image {
        flex: none;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .blog-header {
        padding: 1.8rem 0;
        border-radius: 12px;
    }

    .blog-header h1 {
        font-size: 1.4rem;
    }

    .blog-header p {
        font-size: 0.85rem;
    }

    .category-nav {
        top: 60px;
        border-radius: 8px;
    }

    .category-menu {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-menu::-webkit-scrollbar {
        display: none;
    }

    .category-menu > li {
        flex-shrink: 0;
    }

    .category-menu > li > a {
        padding: 0.6rem 0.9rem;
        font-size: 0.82rem;
    }

    .post-card-image {
        height: 180px;
    }

    .post-card-body {
        padding: 1rem;
    }

    .post-card-title {
        font-size: 0.95rem;
    }

    .post-card-excerpt {
        font-size: 0.82rem;
    }
}

/* Sticky category nav on scroll */
.category-nav.scrolled {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-radius: 0;
    padding: 0;
}

.category-nav.scrolled .category-menu > li > a {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
}
