/* ─── Blog Layout ───────────────────────────────────────────────────────── */
body.blog-layout {
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
}

/* Header */
.blog-header {
    background: #fff;
    border-bottom: 2px solid #e9ecef;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.blog-logo-img { max-height: 40px; width: auto; display: block; }

.blog-logo-main {
    font-weight: 700;
    font-size: 1.6rem;
    color: #333;
    text-decoration: none;
}

.blog-logo-sep { color: #aaa; font-weight: 300; }

.blog-logo-sub {
    font-size: 1.1rem;
    font-weight: 500;
    color: #5a6fd6;
    text-decoration: none;
}

.blog-header nav a {
    color: #555;
    text-decoration: none;
    font-size: .9rem;
    transition: color .2s;
}

.blog-header nav a:hover { color: #5a6fd6; }

/* Language switcher */
.lang-switcher a {
    font-size: .82rem;
    padding: 2px 6px;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
}

.lang-switcher a.active {
    background: #5a6fd6;
    color: #fff;
}

/* Breadcrumbs */
.blog-breadcrumb-bar {
    background: #f1f3f5;
    padding: 8px 0;
    font-size: .85rem;
}

.blog-breadcrumb-bar a { color: #5a6fd6; text-decoration: none; }
.blog-breadcrumb-bar a:hover { text-decoration: underline; }

/* ─── Post Card ─────────────────────────────────────────────────────────── */
.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
    height: 100%;
}

.blog-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

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

.blog-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2.5rem;
}

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

.blog-card-meta {
    font-size: .78rem;
    color: #888;
    margin-bottom: 8px;
}

.blog-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

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

.blog-card-title a:hover { color: #5a6fd6; }

.blog-card-excerpt {
    font-size: .88rem;
    color: #666;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-read-more {
    font-size: .85rem;
    color: #5a6fd6;
    text-decoration: none;
    font-weight: 500;
}

.blog-card-read-more:hover { text-decoration: underline; }

/* ─── Featured Post ─────────────────────────────────────────────────────── */
.blog-featured {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    margin-bottom: 2rem;
}

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

.blog-featured-body { padding: 28px 32px; }

.blog-featured-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5a6fd6;
    margin-bottom: 10px;
}

.blog-featured-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.blog-featured-title a { color: #222; text-decoration: none; }
.blog-featured-title a:hover { color: #5a6fd6; }

/* ─── Category Badge ────────────────────────────────────────────────────── */
.blog-cat-badge {
    display: inline-block;
    background: #e8eaf6;
    color: #5a6fd6;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: .75rem;
    font-weight: 500;
    text-decoration: none;
    margin-right: 4px;
    margin-bottom: 4px;
}

.blog-cat-badge:hover { background: #5a6fd6; color: #fff; text-decoration: none; }

.blog-tag-badge {
    display: inline-block;
    background: #f1f3f5;
    color: #666;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .75rem;
    text-decoration: none;
    margin-right: 4px;
    margin-bottom: 4px;
}

.blog-tag-badge:hover { background: #dee2e6; color: #333; text-decoration: none; }

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.blog-sidebar-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 1.5rem;
}

.blog-sidebar-title {
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f3f5;
}

.blog-sidebar-cat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #f8f9fa;
    color: #444;
    text-decoration: none;
    font-size: .9rem;
}

.blog-sidebar-cat-link:hover { color: #5a6fd6; text-decoration: none; }

.blog-sidebar-cat-count {
    background: #f1f3f5;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: .75rem;
    color: #888;
}

/* ─── Single Post ───────────────────────────────────────────────────────── */
.blog-post-cover {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.blog-post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.blog-post-meta {
    color: #888;
    font-size: .85rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.blog-post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

.blog-post-content h2, .blog-post-content h3 { margin-top: 1.8rem; margin-bottom: .8rem; }
.blog-post-content p { margin-bottom: 1.2rem; }
.blog-post-content img { max-width: 100%; border-radius: 6px; }
.blog-post-content blockquote {
    border-left: 4px solid #5a6fd6;
    padding: 12px 20px;
    background: #f8f9ff;
    border-radius: 0 6px 6px 0;
    color: #555;
    margin: 1.5rem 0;
}

/* Inside cards — badges stretch full width */
.blog-card-body .blog-cat-badge {
    display: block;
    margin-right: 0;
}

/* ─── Header Menu ───────────────────────────────────────────────────────── */
.blog-header-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.25rem;
}
.blog-header-menu > li {
    position: relative;
}
.blog-header-menu li a {
    color: #444;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
}
.blog-header-menu li a:hover { color: #5a6fd6; }

/* Dropdown */
.blog-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #fff;
    min-width: 190px;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0,0,0,.13);
    list-style: none;
    padding: 6px 0;
    z-index: 200;
    white-space: nowrap;
}
.blog-header-menu > li.has-dropdown:hover > .blog-dropdown { display: block; }
.blog-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 16px;
    border: 6px solid transparent;
    border-bottom-color: #fff;
    border-top: none;
}
.blog-dropdown li a {
    display: block;
    padding: 9px 18px;
    font-size: .88rem;
    color: #444;
    font-weight: 400;
    text-decoration: none;
}
.blog-dropdown li a:hover {
    background: #f4f6ff;
    color: #5a6fd6;
}

/* ─── View toggle ───────────────────────────────────────────────────────── */
#view-toggle .btn.active {
    background: #5a6fd6;
    border-color: #5a6fd6;
    color: #fff;
}

/* List mode — override col width and card layout */
.blog-view-list .blog-post-col {
    flex: 0 0 100%;
    max-width: 100%;
}

.blog-view-list .blog-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: auto;
}

.blog-view-list .blog-card-img {
    width: 160px;
    min-width: 160px;
    height: 140px;
    object-fit: cover;
    flex-shrink: 0;
}

.blog-view-list .blog-card-img-placeholder {
    width: 160px;
    min-width: 160px;
    height: 140px;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.blog-view-list .blog-card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 18px;
}

.blog-view-list .blog-card-title { font-size: .95rem; margin-bottom: 6px; }
.blog-view-list .blog-card-excerpt { -webkit-line-clamp: 2; margin-bottom: 8px; }
.blog-view-list .blog-card-meta { margin-bottom: 4px; }

@media (max-width: 576px) {
    .blog-view-list .blog-card { flex-direction: column; height: auto; }
    .blog-view-list .blog-card-img,
    .blog-view-list .blog-card-img-placeholder { width: 100%; min-width: 0; height: 160px; }
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.blog-footer {
    background: #2d3748;
    color: #a0aec0;
    padding: 24px 0;
    margin-top: 3rem;
    font-size: .9rem;
}

.blog-footer a { color: #a0aec0; text-decoration: none; }
.blog-footer a:hover { color: #fff; }

/* ─── Pagination ────────────────────────────────────────────────────────── */
.blog-pagination .page-link { color: #5a6fd6; border-color: #dee2e6; }
.blog-pagination .page-item.active .page-link { background: #5a6fd6; border-color: #5a6fd6; }

/* ─── Admin preview img ─────────────────────────────────────────────────── */
.admin-blog-cover-preview { max-width: 100%; max-height: 200px; border-radius: 6px; margin-bottom: 8px; }
