﻿/* ============================================================
   blog-card.css  —  Componente reutilizable de tarjeta de blog
   ============================================================ */

.blog-card {
    height: 220px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    transition: transform .2s ease, box-shadow .2s ease;
}

    .blog-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
    }

/* ── Imagen ───────────────────────────────────────────────── */
.blog-card-img {
    width: 200px;
    min-width: 200px;
    height: 100%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

/* ── Cuerpo ───────────────────────────────────────────────── */
.blog-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

/* ── Tags ─────────────────────────────────────────────────── */
.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* ── Título ───────────────────────────────────────────────── */
.blog-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: .4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .blog-title a {
        color: inherit;
        text-decoration: none;
    }

        .blog-title a:hover {
            text-decoration: underline;
        }

/* ── Excerpt ──────────────────────────────────────────────── */
.blog-excerpt {
    color: #6b7280;
    font-size: .875rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-bottom: 0;
}

/* ── Footer ───────────────────────────────────────────────── */
.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: .75rem;
    margin-top: auto;
    border-top: 1px solid #f3f4f6;
}

.blog-author {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
}

.blog-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
    flex-shrink: 0;
}

.blog-meta {
    display: flex;
    flex-direction: column;
    font-size: .8rem;
    min-width: 0;
}

.blog-author-name {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-date {
    color: #9ca3af;
    white-space: nowrap;
}

.read-link {
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: .75rem;
}

/* ── Animación de entrada ─────────────────────────────────── */
.blog-card-anim {
    opacity: 0;
    transform: translateY(12px);
}

.blog-card-enter {
    animation: cardFadeUp .35s ease both;
}

@keyframes cardFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 576px) {
    .blog-card {
        flex-direction: column;
        height: auto;
    }

    .blog-card-img {
        width: 100%;
        min-width: unset;
        height: 180px;
    }
}
