/* =========================================================
   Últimos Artículos en Grid — estilos
   ========================================================= */

/* Grid contenedor */
.uag-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    margin: 1.5rem 0;
}

.uag-cols-2 { grid-template-columns: repeat(2, 1fr); }
.uag-cols-3 { grid-template-columns: repeat(3, 1fr); }
.uag-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── Card ──────────────────────────────────────────────── */
.uag-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: box-shadow .22s ease, transform .22s ease;
}

.uag-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
    transform: translateY(-3px);
}

/* ─── Imagen ────────────────────────────────────────────── */
.uag-card__imagen-wrap {
    display: block;
    overflow: hidden;
    /* Relación de aspecto fija: todas las imágenes igual de altas */
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.uag-card__imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .35s ease;
}

.uag-card:hover .uag-card__imagen {
    transform: scale(1.05);
}

/* Placeholder cuando no hay imagen */
.uag-card__imagen--vacia {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8efe4 0%, #c8ddb8 100%);
}

/* ─── Cuerpo ────────────────────────────────────────────── */
.uag-card__cuerpo {
    display: flex;
    flex-direction: column;
    flex: 1;           /* ocupa el espacio restante → botón siempre abajo */
    padding: 1.1rem 1.2rem 1.2rem;
    gap: .45rem;
}

/* ─── Meta (fecha / autor) ──────────────────────────────── */
.uag-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .8rem;
    font-size: .75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.uag-card__fecha::before { content: "📅 "; }
.uag-card__autor::before  { content: "✍️ "; }

/* ─── Título ────────────────────────────────────────────── */
.uag-card__titulo {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.uag-card__titulo a {
    color: inherit;
    text-decoration: none;
}

.uag-card__titulo a:hover {
    color: #4a7c3f;   /* verde bosque — fácil de cambiar desde el tema */
    text-decoration: underline;
}

/* ─── Extracto ──────────────────────────────────────────── */
.uag-card__extracto {
    margin: 0;
    font-size: .88rem;
    color: #555;
    line-height: 1.55;
    flex: 1;           /* empuja el botón hacia abajo */
}

/* ─── Botón "Leer más" ──────────────────────────────────── */
.uag-card__leer-mas {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .6rem;
    font-size: .82rem;
    font-weight: 600;
    color: #4a7c3f;
    text-decoration: none;
    transition: gap .18s ease;
}

.uag-card__leer-mas:hover {
    gap: .55rem;
    text-decoration: none;
}

/* ─── Sin resultados ────────────────────────────────────── */
.uag-sin-resultados {
    color: #888;
    font-style: italic;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .uag-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .uag-cols-3,
    .uag-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .uag-cols-2,
    .uag-cols-3,
    .uag-cols-4 { grid-template-columns: 1fr; }
}
