/* ============================================================================
   KIBO BLOG — POST LISTINGS
   Compact, horizontal card design used by <x-post-listing /> on the home
   page and post index. Vertical rhythm is tight by default (~120px image
   col, 2-line clamp on title + excerpt) so several cards fit above the fold.
   ============================================================================ */

/* ── News card (horizontal: image left, content right) ────────────────── */
.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    margin-bottom: 0.85rem;
}

.news-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Image column — fixed height so every card's image is the same size,
   regardless of title/excerpt length. Image fills via object-fit: cover. */
.news-image {
    overflow: hidden;
    height: 160px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.04);
}

/* Content column — tight padding, vertical flex so the Read-More always
   anchors to the bottom even when the excerpt clamps to fewer lines. */
.news-content {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-dark);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.news-date i {
    color: var(--primary-color);
}

/* Category badges sit between date and title — small gap on each side */
.news-card .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.55rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.news-title {
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
    /* Clamp to 2 lines so cards stay the same height regardless of title length */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    color: var(--primary-color);
}

.news-excerpt {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.5rem;
    /* Clamp to 2 lines — keeps every card the same overall height */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    gap: 1rem;
    padding-top: 0.6rem;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.8rem;
}

.news-meta i {
    color: var(--primary-color);
}

.btn-read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.18s ease;
    margin-top: auto; /* push to bottom of flex content column */
}

.btn-read-more:hover {
    color: var(--secondary-color);
}

.featured-news {
    border: 2px solid var(--accent-color);
}

/* Compact mobile layout — image stacks above content under sm breakpoint */
@media (max-width: 575.98px) {
    .news-image {
        height: 180px;
    }
    .news-content {
        padding: 0.75rem 0.85rem;
    }
}


/* ── Section heading above a listing ───────────────────────────────────── */
.section-title {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}


/* ── Sidebar widgets: recent / popular post rows ──────────────────────── */
.recent-post {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.recent-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.recent-post-img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.35;
    margin-bottom: 0.25rem;
    /* Two-line clamp keeps the row height predictable */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-post-date {
    font-size: 0.78rem;
    color: #666;
}
