/*
 * The Egg Project — home page "featured blog posts" strip.
 *
 * Loaded by /app/snippets/home-featured-posts.php.
 * Shows up to 3 cards in a 3-across grid: the current blog hero (always) +
 * up to 2 posts flagged home_feature=1 in the admin.
 * Reuses .blog-card__* classes from blog.css for visual consistency.
 */

.home-featured {
    background: #fff;
    padding: 10px 0 80px;
}


/* --- 3-across grid, gracefully centered when fewer cards ------------------------- */

.home-featured__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.home-featured__card {
    background: transparent;
    display: flex;
    flex-direction: column;
    /* Default (3 cards): each takes a third of the row, minus gaps */
    flex: 0 1 calc(33.333% - 27px);
    min-width: 260px;
    max-width: 420px;
}

/* Count-aware sizing so a single card looks intentional instead of tiny */
.home-featured--count-1 .home-featured__card { flex: 0 1 640px; max-width: 640px; }
.home-featured--count-2 .home-featured__card { flex: 0 1 calc(50% - 20px); max-width: 480px; }
.home-featured--count-3 .home-featured__card { flex: 0 1 calc(33.333% - 27px); max-width: 420px; }


/* --- Card image --- */

.home-featured__card .blog-card__image-link {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 18px;
    background: #f6f0e8;
    aspect-ratio: 4 / 3;
}

.home-featured__card .blog-card__image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform .3s ease;
}

.home-featured__card .blog-card__image-link:hover .blog-card__image {
    transform: scale(1.03);
}

.home-featured__card .blog-card__image--placeholder {
    background-color: #f6f0e8;
    background-image: url('/img/logo-tag.png');
    background-size: auto 60%;
    background-repeat: no-repeat;
    background-position: center;
}
.home-featured__card .blog-card__image-link:hover .blog-card__image--placeholder {
    transform: none;
}


/* --- Card body --- */

.home-featured__card .blog-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 2px;
}

.home-featured__card .blog-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.home-featured__card .blog-card__category {
    display: inline-block;
    padding: 5px 12px;
    background: #fce8d1;
    color: #a45a3c;
    border-radius: 999px;
    font-family: 'GTWalsheimPro-Bold', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
}

/* Per-category colour palette — mirrors the /blog listing */
.home-featured__card .blog-card__category--for-fundraising-groups          { background: #d9e4dd; color: #3d5544; }
.home-featured__card .blog-card__category--information-for-everyone        { background: #d5eff5; color: #1f6b7c; }
.home-featured__card .blog-card__category--pip-s-tip-s-and-other-eggciting-info { background: #fef1c7; color: #8a6100; }
.home-featured__card .blog-card__category--recipes                          { background: #fce8d1; color: #a45a3c; }
.home-featured__card .blog-card__category--egg-life-and-all-other-news      { background: #f2dedb; color: #7a3520; }

.home-featured__card .blog-card__date {
    color: rgba(30,39,49,0.55);
    font-size: 13px;
}

.home-featured__card .blog-card__title {
    font-family: 'GTWalsheimPro-Bold', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.25;
    margin: 0;
    color: #1e2731;
}

.home-featured__card .blog-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color .15s ease;
}
.home-featured__card .blog-card__title a:hover { color: #a45a3c; }


/* --- "Read Blog" CTA under the grid --- */

.home-featured__cta {
    display: flex;
    justify-content: center;
    margin: 50px 0 0;
}

/* Small consistency nudge — the site-global .button uses `text-decoration:
 * underline` inherited from anchor styling in some places; make sure the CTA
 * link stays clean, and give it a bit of breathing room. */
.home-featured__cta .button {
    text-decoration: none;
}


/* --- Responsive --- */

@media (max-width: 900px) {
    .home-featured--count-3 .home-featured__card {
        flex: 0 1 calc(50% - 20px);
        max-width: 400px;
    }
}
@media (max-width: 640px) {
    .home-featured {
        padding: 10px 0 50px;
    }
    .home-featured__grid { gap: 25px; }
    .home-featured--count-1 .home-featured__card,
    .home-featured--count-2 .home-featured__card,
    .home-featured--count-3 .home-featured__card {
        flex: 0 1 100%;
        max-width: 420px;
    }
}
