/* 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; }
}

/* ============================================================
 * "Glass" style — reproduces the legacy live `my-latest-posts`
 * layout: TALL portrait cards with a frosted-glass info bar at the
 * bottom (centred category + title), square corners. Opt-in via the
 * block's Card style → Glass setting (wrapper `--glass` modifier).
 * ============================================================ */
.aieo-latest-posts-overlay--glass .aieo-latest-posts-overlay__item {
    aspect-ratio: 340 / 540;        /* tall portrait, like the live cards */
    border-radius: 0;
    background: #f1f1f1;
}
/* Frosted-glass bar pinned to the bottom (not a full-height gradient veil). */
.aieo-latest-posts-overlay--glass .aieo-latest-posts-overlay__veil {
    inset: auto 0 0 0;
    height: auto;
    min-height: 96px;
    padding: 16px 14px;
    background: hsla(0, 0%, 100%, 0.4);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    color: inherit;
}
.aieo-latest-posts-overlay--glass .aieo-latest-posts-overlay__text {
    align-items: center;
    text-align: center;
    gap: 5px;
}
/* Category: plain centred grey label (no pill). */
.aieo-latest-posts-overlay--glass .aieo-latest-posts-overlay__cat {
    align-self: center;
    background: transparent;
    color: #666;
    font-size: 1rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
    border-radius: 0;
}
/* Title: the FF blog pink, centred, no shadow. */
.aieo-latest-posts-overlay--glass .aieo-latest-posts-overlay__title {
    color: #d81b60;
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: none;
}
@media (max-width: 768px) {
    .aieo-latest-posts-overlay--glass .aieo-latest-posts-overlay__item {
        aspect-ratio: 340 / 540;
    }
}
