/**
 * Trending Stories Section
 */

.trending-section {
    padding: 40px 0;
}

.trending-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* ==================== LEFT SIDE: Trending Stories ==================== */

.trending-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trending-left .section-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    padding-left: 10px;
    border-left: 3px solid #FF5722;
    display: inline-block;
}

[dir="rtl"] .trending-left .section-title {
    border-left: none;
    padding-right: 10px;
    padding-left: 0;
    border-right: 3px solid #FF5722;
}

/* Featured Story */
.trending-featured {
    display: flex;
    gap: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

/* .trending-featured:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
} */

.trending-featured-image {
    flex: 0 0 355px;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 7px;
}

.trending-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.trending-featured-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.trending-featured-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0 0 12px 0;
}

.trending-featured-description {
    font-family: var(--font-body);
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-featured-time {
    font-size: 13px;
    color: #FF5722;
    font-weight: 600;
}

/* Grid Stories (2 columns x 4 rows = 8 items) */
.trending-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative;
    padding-left: 15px;
}

/* Left column vertical line */
.trending-grid::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 20px;
    bottom: 10px;
    width: 1px;
    background: lightgray;
    z-index: 1;
}

/* Right column vertical line */
.trending-grid::after {
    content: '';
    position: absolute;
    left: calc(50% + 11px);
    top: 20px;
    bottom: 10px;
    width: 1px;
    background: lightgray;
    z-index: 1;
}

/* Grid Item Wrapper */
.trending-grid-wrapper {
    position: relative;
}

/* Orange dot on left column items (odd indices: 0, 2, 4, 6) */
.trending-grid-wrapper:nth-child(odd)::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #FF5722;
    border: 1px solid white;
    border-radius: 50%;
    position: absolute;
    left: -7px;
    top: 20%;
    transform: translateY(-50%);
    z-index: 3;
}

/* Orange dot on right column items (even indices: 1, 3, 5, 7) */
.trending-grid-wrapper:nth-child(even)::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #FF5722;
    border: 1px solid white;
    border-radius: 50%;
    position: absolute;
    left: -7px;
    top: 20%;
    transform: translateY(-50%);
    z-index: 3;
}

/* Grid Item (Anchor Tag) */
.trending-grid-item {
    display: flex;
    gap: 12px;
    overflow: visible; /* Changed from hidden to allow line to show */
    padding: 12px;
    padding-bottom: 0; /* Remove bottom padding so line sits flush */
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* Underline for each card */
.trending-grid-item::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0; /* Position at the bottom */
    height: 1px;
    background: #e0e0e0;
    z-index: 1;
}

.trending-grid-image {
    flex: 0 0 140px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
    z-index: 2;
}

.trending-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.trending-grid-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding-bottom: 12px; /* Add padding here instead */
}

.trending-grid-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== RIGHT SIDE: More Trending ==================== */

.trending-right {
    padding: 5px 15px;
    border-left: 2px solid #FD4C00;
}

[dir="rtl"] .trending-right {
    border-left: none;
    border-right: 2px solid #FD4C00;
}

.trending-right .section-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #18191E;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Orange filled circle dot */
.trending-right .section-title::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #FF5722;
    border-radius: 50%;
    flex-shrink: 0;
}

.more-trending-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.more-trending-item {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    padding: 9.8px;
    border-bottom: 1px solid lightgray;
}

.more-trending-item:hover {
    background: #f8f8f8;
    transform: translateX(5px);
}

.more-trending-number {
    flex: 0 0 30px;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 500;
    color: lightgray;
}

.more-trending-title {
    flex: 1;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading Skeleton */
.trending-skeleton {
    height: 400px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .trending-layout {
        grid-template-columns: 1fr;
    }

    .trending-featured-image {
        flex: 0 0 250px;
        height: 180px;
    }

    .trending-featured-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .trending-section {
        padding: 30px 0;
    }

    .trending-featured {
        flex-direction: column;
    }

    .trending-featured-image {
        flex: none;
        width: 100%;
        height: 200px;
    }

    .trending-grid {
        grid-template-columns: 1fr;
        padding-left: 0;
    }

    /* Hide tree pattern on mobile */
    .trending-grid::before,
    .trending-grid::after {
        display: none;
    }

    .trending-grid-wrapper::before,
    .trending-grid-wrapper::after {
        display: none !important;
    }

    .trending-right {
        padding: 20px;
    }
}

@media (max-width: 480px) {

    .trending-left .section-title,
    .trending-right .section-title {
        font-size: 18px;
    }

    .trending-featured-title {
        font-size: 18px;
    }

    .trending-featured-description {
        font-size: 14px;
    }

    .more-trending-title {
        font-size: 13px;
    }
}