/* ==========================================================================
   BLOG (HOME) - Últimos artículos
   Misma identidad que contacto / habilidades:
   Midnight Slate #0f172a · Oro mate #d97706 · Bordes #e2e8f0 · Oswald / Rambla
   ========================================================================== */

.lr-blog {
    --lr-ink: #0f172a;
    --lr-text: #334155;
    --lr-muted: #64748b;
    --lr-line: #e2e8f0;
    --lr-soft: #f8fafc;
    --lr-accent: #d97706;
    --lr-accent-dark: #b45309;
    --lr-accent-bg: #fff7ed;
    margin-top: 4px;
}

.lr-blog__intro {
    font-family: 'Rambla', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--lr-muted);
    max-width: 640px;
    margin: 0 0 28px;
}

/* ---------- Rejilla ---------- */
.lr-blog__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.lr-blog__grid:not(:has(article)) {
    display: none;
}

/* ---------- Tarjeta (anula el float / margin del tema para .blog-entry) ---------- */
.lr-blog .lr-blog__card {
    position: relative;
    float: none;
    width: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--lr-line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.lr-blog .lr-blog__card:hover,
.lr-blog .lr-blog__card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(217, 119, 6, 0.45);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09);
}

/* Imagen: proporción fija (las portadas del blog son 752x269) para evitar saltos de diseño */
.lr-blog__media {
    position: relative;
    aspect-ratio: 752 / 269;
    background: var(--lr-soft);
    border-bottom: 1px solid var(--lr-line);
    overflow: hidden;
}

.lr-blog__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transform: none;
    transition: transform 0.4s ease;
}

.lr-blog .lr-blog__card:hover .lr-blog__media img {
    transform: scale(1.04);
}

/* ---------- Contenido ---------- */
.lr-blog__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 22px 22px;
}

.lr-blog__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0 0 12px;
    font-family: 'Rambla', sans-serif;
    font-size: 12.5px;
    color: var(--lr-muted);
}

.lr-blog__when {
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.lr-blog__meta time,
.lr-blog__read {
    display: inline;
}

.lr-blog__read::before {
    content: "·";
    margin: 0 7px;
    color: #94a3b8;
}

.lr-blog__tag {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--lr-accent-dark);
    background: var(--lr-accent-bg);
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 999px;
    padding: 3px 10px;
}

.lr-blog .lr-blog__title {
    margin: 0 0 10px;
    font-family: 'Rambla', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.lr-blog .lr-blog__title a {
    color: var(--lr-ink);
    font-size: inherit;
    font-family: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

/* Toda la tarjeta es clicable con un solo enlace (accesible: un único destino por tarjeta) */
.lr-blog .lr-blog__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.lr-blog .lr-blog__card:hover .lr-blog__title a {
    color: var(--lr-accent-dark);
}

.lr-blog .lr-blog__title a:focus-visible {
    outline: none;
}

.lr-blog .lr-blog__card:focus-within {
    outline: 2px solid var(--lr-accent);
    outline-offset: 2px;
}

.lr-blog__excerpt {
    margin: 0 0 18px;
    font-family: 'Rambla', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--lr-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lr-blog__more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--lr-accent);
}

.lr-blog__more svg {
    transition: transform 0.25s ease;
}

.lr-blog .lr-blog__card:hover .lr-blog__more svg {
    transform: translateX(4px);
}

/* ---------- Ver todos ---------- */
.lr-blog__footer {
    margin-top: 28px;
}

.lr-blog__all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border: 1px solid var(--lr-ink);
    border-radius: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--lr-ink);
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lr-blog__all:hover,
.lr-blog__all:focus-visible {
    background: var(--lr-ink);
    color: #ffffff;
}

.lr-blog__all:focus-visible {
    outline: 2px solid var(--lr-accent);
    outline-offset: 2px;
}

/* ---------- Tablet: tarjetas horizontales (evita la rejilla 2+1 descompensada) ---------- */
@media (max-width: 1199px) {
    .lr-blog__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .lr-blog .lr-blog__card {
        flex-direction: row;
        align-items: stretch;
    }

    .lr-blog__media {
        flex: 0 0 300px;
        aspect-ratio: auto;
        display: flex;
        align-items: center;
        padding: 20px;
        border-bottom: 0;
        border-right: 1px solid var(--lr-line);
    }

    .lr-blog__media img {
        height: auto;
        aspect-ratio: 752 / 269;
        border-radius: 8px;
    }

    .lr-blog__excerpt {
        -webkit-line-clamp: 2;
    }
}

/* ---------- Móvil: apiladas y compactas ---------- */
@media (max-width: 640px) {
    .lr-blog__intro {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .lr-blog .lr-blog__card {
        flex-direction: column;
    }

    .lr-blog__media {
        flex: none;
        display: block;
        padding: 0;
        aspect-ratio: 752 / 269;
        border-right: 0;
        border-bottom: 1px solid var(--lr-line);
    }

    .lr-blog__media img {
        height: 100%;
        border-radius: 0;
    }

    .lr-blog__body {
        padding: 16px 18px 18px;
    }

    .lr-blog .lr-blog__title {
        font-size: 17px;
    }

    .lr-blog__all {
        display: flex;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lr-blog .lr-blog__card,
    .lr-blog__media img,
    .lr-blog__more svg {
        transition: none;
    }

    .lr-blog .lr-blog__card:hover {
        transform: none;
    }

    .lr-blog .lr-blog__card:hover .lr-blog__media img {
        transform: none;
    }
}

.lr-blog__all svg {
    transition: transform 0.25s ease;
}

.lr-blog__all:hover svg {
    transform: translateX(4px);
}
