/* aieo/latest-posts-overlay
 * Mobile (<=768px): horizontal slider with bullet nav.
 * Desktop: 5-up grid (CSS clamp-based, downgrades to 3/2 if narrow).
 */
.aieo-latest-posts-overlay {
    width: 100%;
}

.aieo-latest-posts-overlay__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.aieo-latest-posts-overlay__item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 5 / 4;
    background: #f1f1f1;
}

.aieo-latest-posts-overlay__link,
.aieo-latest-posts-overlay__image-wrap {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.aieo-latest-posts-overlay__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aieo-latest-posts-overlay__veil {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.65) 100%);
    padding: 14px;
    color: #fff;
    pointer-events: none;
}

.aieo-latest-posts-overlay__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.aieo-latest-posts-overlay__cat {
    display: inline-block;
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.92);
    color: #1a1a1a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aieo-latest-posts-overlay__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Optional category link layered on top of the image-wrap so the
 * category badge stays clickable even though the veil is pointer-events:
 * none. Sized to the badge area only. */
.aieo-latest-posts-overlay__cat-link {
    position: absolute;
    top: 0; left: 0;
    width: 50%;
    height: 40%;
    z-index: 2;
    background: transparent;
}

/* Bullets — desktop hides them. */
.aieo-latest-posts-overlay__bullets {
    display: none;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}
.aieo-latest-posts-overlay__bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.aieo-latest-posts-overlay__bullet.is-active {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .aieo-latest-posts-overlay__grid {
        display: flex;
        gap: 1rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .aieo-latest-posts-overlay__grid::-webkit-scrollbar { display: none; }

    .aieo-latest-posts-overlay__item {
        flex: 0 0 85%;
        scroll-snap-align: start;
        aspect-ratio: 4 / 3;
    }

    .aieo-latest-posts-overlay__bullets { display: flex; }
}
