/* ==========================================================================
   blog.css — Styles for view_blog.php and view_blogdetails.php
   Requires: Bootstrap 5.3, Bootstrap Icons
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Layout & Page Wrapper
   -------------------------------------------------------------------------- */
.blog-page {
    padding: 40px 0 60px;
    background: #f5f6f8;
}

.blog-main-col {
    padding-right: 32px;
}

@media (max-width: 991.98px) {
    .blog-main-col {
        padding-right: 12px;
    }
}

/* --------------------------------------------------------------------------
   2. Section Header
   -------------------------------------------------------------------------- */
.blog-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #002144;
    padding-left: 14px;
    margin-bottom: 24px;
}

.blog-section-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #002144;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-section-header a {
    font-size: 0.82rem;
    color: #002144;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.blog-section-header a:hover {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   3. Blog Card (listing page)
   -------------------------------------------------------------------------- */
.blog-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 33, 68, 0.13);
}

.blog-card-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.blog-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.blog-card:hover .blog-card-img-wrap img {
    transform: scale(1.04);
}

.blog-card-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #002144;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: background 0.2s;
}

.blog-card-category-badge:hover {
    background: #003a6e;
    color: #fff;
}

.blog-card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
}

.blog-card-meta i {
    font-size: 0.78rem;
    color: #aaa;
}

.blog-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.45;
    margin-bottom: 10px;
    text-decoration: none;
    display: block;
    transition: color 0.2s;
}

.blog-card-title:hover {
    color: #002144;
}

.blog-card-excerpt {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 14px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.blog-card-readmore {
    font-size: 0.8rem;
    font-weight: 600;
    color: #002144;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s, color 0.2s;
    margin-top: auto;
    align-self: flex-start;
}

.blog-card-readmore:hover {
    color: #003a6e;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   4. Empty State
   -------------------------------------------------------------------------- */
.blog-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.blog-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    color: #ccc;
}

.blog-empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* --------------------------------------------------------------------------
   5. Sidebar
   -------------------------------------------------------------------------- */
.blog-sidebar {
    position: sticky;
    top: 20px;
}

.blog-sidebar-section {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 28px;
}

.blog-sidebar-header {
    background: #002144;
    color: #fff;
    padding: 12px 18px;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-sidebar-list {
    padding: 12px 0;
}

/* Trending card in sidebar */
.trending-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    transition: background 0.15s;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item:hover {
    background: #f7f9fc;
}

.trending-item-img {
    width: 76px;
    height: 62px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.trending-item-body {
    flex: 1;
    min-width: 0;
}

.trending-item-category {
    font-size: 0.68rem;
    font-weight: 700;
    color: #002144;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.trending-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-item-date {
    font-size: 0.7rem;
    color: #aaa;
}

/* --------------------------------------------------------------------------
   6. Blog Detail Page
   -------------------------------------------------------------------------- */

/* Breadcrumb */
.blog-breadcrumb {
    padding: 12px 0 4px;
    margin-bottom: 20px;
}

.blog-breadcrumb .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
}

.blog-breadcrumb .breadcrumb-item a {
    color: #002144;
    text-decoration: none;
}

.blog-breadcrumb .breadcrumb-item.active {
    color: #888;
}

/* Hero Image */
.blog-detail-hero {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    aspect-ratio: 16 / 7;
}

.blog-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Article header */
.blog-detail-header {
    margin-bottom: 24px;
}

.blog-detail-category {
    display: inline-block;
    background: #002144;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 14px;
    text-decoration: none;
}

.blog-detail-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 14px;
}

@media (max-width: 767.98px) {
    .blog-detail-title {
        font-size: 1.35rem;
    }
}

.blog-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    font-size: 0.82rem;
    color: #888;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}

.blog-detail-meta i {
    color: #aaa;
    margin-right: 4px;
}

/* Article body content */
.blog-detail-content {
    font-size: 1rem;
    color: #333;
    line-height: 1.85;
}

.blog-detail-content h2,
.blog-detail-content h3,
.blog-detail-content h4 {
    color: #1a1a2e;
    margin-top: 28px;
    margin-bottom: 12px;
    font-weight: 700;
}

.blog-detail-content p {
    margin-bottom: 18px;
}

.blog-detail-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.blog-detail-content ul,
.blog-detail-content ol {
    padding-left: 22px;
    margin-bottom: 18px;
}

.blog-detail-content blockquote {
    border-left: 4px solid #002144;
    padding: 12px 20px;
    background: #f7f9fc;
    color: #555;
    border-radius: 0 6px 6px 0;
    margin: 20px 0;
    font-style: italic;
}

/* Share buttons */
.blog-share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid #eee;
    margin-top: 32px;
}

.blog-share-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.blog-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: opacity 0.2s;
    color: #fff;
}

.blog-share-btn:hover {
    opacity: 0.85;
    color: #fff;
}

.blog-share-btn.facebook  { background: #1877f2; }
.blog-share-btn.twitter   { background: #1da1f2; }
.blog-share-btn.whatsapp  { background: #25d366; }
.blog-share-btn.linkedin  { background: #0a66c2; }

/* --------------------------------------------------------------------------
   7. Related Posts
   -------------------------------------------------------------------------- */
.blog-related {
    margin-top: 40px;
}

.blog-related-header {
    border-left: 4px solid #002144;
    padding-left: 14px;
    margin-bottom: 22px;
}

.blog-related-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #002144;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-related-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.blog-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 33, 68, 0.12);
}

.blog-related-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.blog-related-card-body {
    padding: 12px 14px 16px;
}

.blog-related-card-date {
    font-size: 0.72rem;
    color: #aaa;
    margin-bottom: 6px;
}

.blog-related-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-related-card-title:hover {
    color: #002144;
}

/* --------------------------------------------------------------------------
   8. Pagination
   -------------------------------------------------------------------------- */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.blog-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #002144;
    background: #fff;
    border: 1px solid #dde3ec;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
}

.blog-pagination-btn:hover,
.blog-pagination-btn.active {
    background: #002144;
    color: #fff;
    border-color: #002144;
}

.blog-pagination-btn:disabled,
.blog-pagination-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   9. Loading Spinner
   -------------------------------------------------------------------------- */
.blog-spinner {
    display: none;
    justify-content: center;
    padding: 40px 0;
}

.blog-spinner.active {
    display: flex;
}

/* --------------------------------------------------------------------------
   10. Responsive tweaks
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .blog-page {
        padding: 20px 0 40px;
    }

    .blog-detail-hero {
        border-radius: 8px;
    }

    .blog-share-bar {
        gap: 6px;
    }
}
