/*
 * pages/blog.css - the article catalogue in home.php.
 * Loaded on is_home() only; nothing else on the site uses these classes.
 */

.de-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto 40px auto;
}

.de-tarjeta-post {
    position:relative;
    background-color: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(16, 91, 122, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.de-tarjeta-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(16, 91, 122, 0.12);
}

.de-tarjeta-img-contenedor {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.de-img-tarjeta {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.de-tarjeta-post:hover .de-img-tarjeta {
    transform: scale(1.05);
}

.de-tarjeta-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.de-tarjeta-titulo {
    font-size: 22px !important;
    line-height: 1.4em;
    margin: 0 0 20px 0;
}

.de-tarjeta-titulo a {
    color: var(--color-texto);
    text-decoration: none;
    transition: color 0.2s ease;
}

.de-tarjeta-titulo a:hover {
    color: var(--color-primario);
}

/* Stretches the title link over the whole card, so the entire card is
   clickable without nesting anchors. */
.de-tarjeta-titulo a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.de-tarjeta-leer-mas {
    align-self: flex-start;
    color: var(--color-primario);
    font-weight: bold;
    font-size: 16px;
    text-decoration: none;
    margin-top: auto;
    position: relative;
    padding-bottom: 2px;
}

/* Underline that wipes in from the left on card hover. */
.de-tarjeta-leer-mas::after {
    content: "";
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-primario);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.de-tarjeta-post:hover .de-tarjeta-leer-mas::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

@media (max-width: 1024px) {
    .de-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        padding: 0 20px;
    }
    .de-tarjeta-titulo { font-size: 20px !important; }
}

@media (max-width: 768px) {
    .de-blog-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 10px;
    }
    .de-tarjeta-img-contenedor { height: 200px; }
    .de-tarjeta-titulo { font-size: 18px !important; }
}
