/* =========================================
   Trending Posts Section
   ========================================= */

.blog-over-trending-wrapper {
    margin: 40px 0;
    padding: 40px 0;
    background: var(--blog-over-bg-body, #f9fafb);
    border-top: 1px solid var(--blog-over-border-color, #e5e7eb);
}

/* ── Section Header ─────────────────────────────── */
.blog-over-trending-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.blog-over-trending-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--blog-over-primary, #3b82f6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 50px;
    white-space: nowrap;
}

/* ── List Container ─────────────────────────────── */
.blog-over-trending-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Single Item ────────────────────────────────── */
.blog-over-trending-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--blog-over-border-color, #e5e7eb);
    transition: background 0.2s ease, padding 0.2s ease;
}

.blog-over-trending-item:last-child {
    border-bottom: none;
}

.blog-over-trending-item:first-child {
    padding-top: 0;
}

.blog-over-trending-item:hover {
    background: transparent;
}

/* ── Rank Number ────────────────────────────────── */
.blog-over-trending-rank {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: var(--blog-over-primary, #3b82f6);
    background: rgba(59, 130, 246, 0.08);
    border: 1.5px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    line-height: 1;
    transition: all 0.25s ease;
}

.blog-over-trending-item:first-child .blog-over-trending-rank {
    background: var(--blog-over-primary, #3b82f6);
    color: #fff;
    border-color: var(--blog-over-primary, #3b82f6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.blog-over-trending-item:nth-child(2) .blog-over-trending-rank {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blog-over-primary, #3b82f6);
}

.blog-over-trending-item:nth-child(3) .blog-over-trending-rank {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blog-over-secondary, #1e40af);
}

.blog-over-trending-item:hover .blog-over-trending-rank {
    transform: scale(1.08);
}

/* ── Thumbnail ──────────────────────────────────── */
.blog-over-trending-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--blog-over-bg-input, #f3f4f6);
}

.blog-over-trending-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.blog-over-trending-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-over-trending-item:hover .blog-over-trending-thumb img {
    transform: scale(1.06);
}

/* ── Content Area ───────────────────────────────── */
.blog-over-trending-content {
    flex: 1;
    min-width: 0;
}

/* ── Category Badge ─────────────────────────────── */
.blog-over-trending-category {
    margin-bottom: 6px;
}

.blog-over-trending-category a {
    display: inline-block;
    padding: 2px 9px;
    background: var(--blog-over-secondary, #1e40af);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.blog-over-trending-category a:hover {
    background: var(--blog-over-primary, #3b82f6);
}

/* ── Title ──────────────────────────────────────── */
.blog-over-trending-title {
    font-size: 0.97rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 7px;
    /* 2-line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-over-trending-title a {
    color: var(--blog-over-heading-color, #1e293b);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-over-trending-title a:hover {
    color: var(--blog-over-primary, #3b82f6);
}

/* ── Meta ───────────────────────────────────────── */
.blog-over-trending-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--blog-over-text-muted, #6b7280);
}

.blog-over-trending-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.blog-over-trending-meta i {
    font-size: 0.72rem;
    color: var(--blog-over-meta-color, #9ca3af);
}

/* ── Link Overlay ───────────────────────────────── */
.blog-over-trending-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── Dark Mode ──────────────────────────────────── */
body.blog-over-dark-mode .blog-over-trending-wrapper {
    background: var(--blog-over-bg-body);
    border-top-color: var(--blog-over-border-color);
}

body.blog-over-dark-mode .blog-over-trending-item {
    border-bottom-color: var(--blog-over-border-color);
}

body.blog-over-dark-mode .blog-over-trending-rank {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

body.blog-over-dark-mode .blog-over-trending-item:first-child .blog-over-trending-rank {
    background: var(--blog-over-primary);
    border-color: var(--blog-over-primary);
}

body.blog-over-dark-mode .blog-over-trending-title a {
    color: var(--blog-over-heading-color);
}

body.blog-over-dark-mode .blog-over-trending-meta {
    color: var(--blog-over-text-muted);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 576px) {
    .blog-over-trending-wrapper {
        padding: 25px 0;
        margin: 25px 0;
    }

    .blog-over-trending-thumb {
        width: 58px;
        height: 58px;
    }

    .blog-over-trending-rank {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .blog-over-trending-title {
        font-size: 0.9rem;
    }
}

/* ── Numbered Layout – Grid Columns ────────────── */
.blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 30px;
}

.blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 30px;
}

.blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 30px;
}

@media (max-width: 991px) {
    .blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-3,
    .blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-2,
    .blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-3,
    .blog-over-trending-layout-numbered .blog-over-trending-list.blog-over-trending-cols-4 {
        grid-template-columns: 1fr;
    }
}
