/*
 * The Egg Project — blog listing styles
 *
 * Loaded by /app/views/blog/blog.php via a <link> tag so the changes are isolated
 * to the blog listing and won't touch the rest of the site.
 *
 * Brand palette in use (from main.css):
 *   cream page bg   #f6f0e8
 *   dark ink        #1e2731
 *   orange primary  #fbaf3f
 *   rust            #a45a3c
 *   green           #64846c
 *   teal            #5ec6dc
 */

/* ---------- close the gap between the yellow banner and the blog section ---------- */

/* main.css sets .section--blog { margin-top: -20px } but the <figure class="banner-standard">
 * above the section carries the browser's default figure margin (~16px), plus any bottom
 * padding on the wrapping <section>, which together left a visible white gap. Pull up more
 * aggressively so the cream blog section is flush under the yellow banner. */
.section--blog.blog-listing {
    margin-top: -60px;
    padding-top: 70px;
    position: relative;
    z-index: 1;
}


/* ---------- page title override ---------- */

/* main.css draws an orange left bar via ::before on .section--blog h1 and left-aligns it.
 * Override for the blog listing: center the title and hide the bar. */
.section--blog.blog-listing h1 {
    text-align: center;
    margin: 0 0 40px;
}

.section--blog.blog-listing h1::before {
    display: none;
    content: none;
}


/* ---------- category filter pills ---------- */

.blog-listing .blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    margin: 0 0 40px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    align-items: center;
    justify-content: flex-start;
}

.blog-listing .blog-filter {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    color: #1e2731;
    font-family: 'GTWalsheimPro-Bold', sans-serif;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease;
}

.blog-listing .blog-filter:hover {
    background: #f6f0e8;
}

.blog-listing .blog-filter.is-active {
    background: #64846c;
    color: #fff;
}


/* ---------- featured hero ---------- */

.blog-listing .blog-hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    background: #fbaf3f;
    border-radius: 24px;
    overflow: hidden;
    margin: 0 0 60px;
    min-height: 540px;
}

.blog-listing .blog-hero__text {
    padding: 60px 55px;
    color: #1e2731;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-listing .blog-hero__eyebrow {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    color: #a45a3c;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 20px;
    width: fit-content;
}

.blog-listing .blog-hero__title {
    font-family: hwt-artz, sans-serif;
    font-weight: 700;
    font-size: 44px;
    line-height: 1.08;
    color: #1e2731;
    margin: 0 0 20px;
}

.blog-listing .blog-hero__intro {
    color: rgba(30,39,49,0.8);
    font-size: 17px;
    line-height: 1.55;
    margin: 0 0 30px;
    max-width: 480px;
}

.blog-listing .blog-hero__cta {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    background: #1e2731;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    /* Matching the site's default .button — near-square corners, no letter-spacing */
    border-radius: 1px;
    width: fit-content;
    transition: background-color .15s ease, transform .15s ease;
}

.blog-listing .blog-hero__cta:hover {
    background: #000;
    transform: translateY(-1px);
}

.blog-listing .blog-hero__image {
    background-color: #f6f0e8;
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 480px;
}

.blog-listing .blog-hero__image--placeholder {
    background-image: url('/img/logo-tag.png');
    background-size: auto 65%;
    background-repeat: no-repeat;
    background-position: center;
}

.blog-listing .blog-hero__image-link {
    position: absolute;
    inset: 0;
}


/* ---------- post grid ---------- */

.blog-listing .blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 30px;
    margin: 0 0 50px;
}

.blog-listing .blog-card {
    background: transparent;
    display: flex;
    flex-direction: column;
}

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

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

/* Placeholder — used when a post has no uploaded image. Shows the Egg Project
 * "logo tag" centred on a cream background instead of stretching a wrong-shape
 * image into the card. Skips the transform on hover so it doesn't zoom the logo. */
.blog-listing .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;
}

.blog-listing .blog-card__image-link:hover .blog-card__image--placeholder {
    transform: none;
}

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

.blog-listing .blog-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 4px;
}

.blog-listing .blog-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.blog-listing .blog-card__category {
    display: inline-block;
    padding: 5px 12px;
    background: #fce8d1;              /* default palette — used as fallback for uncategorised */
    color: #a45a3c;
    border-radius: 999px;
    font-family: 'GTWalsheimPro-Bold', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
    transition: background-color .15s ease, color .15s ease;
}


/* Per-category colour palette. Slugs come from _egg_blog_cat_slug() on the category's
 * web_safe_url (lowercased, non-alnum → dash). Each category gets a light tinted bg
 * with a darker text colour, and inverts on card hover for visual feedback. */

.blog-listing .blog-card__category--for-fundraising-groups          { background: #d9e4dd; color: #3d5544; }
.blog-listing .blog-card__category--information-for-everyone        { background: #d5eff5; color: #1f6b7c; }
.blog-listing .blog-card__category--pip-s-tip-s-and-other-eggciting-info { background: #fef1c7; color: #8a6100; }
.blog-listing .blog-card__category--recipes                          { background: #fce8d1; color: #a45a3c; }
.blog-listing .blog-card__category--egg-life-and-all-other-news      { background: #f2dedb; color: #7a3520; }

/* Hover — invert each colour scheme (chip bg becomes the darker text colour).
 * NOTE: the default-fallback hover must come FIRST so the per-category rules
 * (same specificity, later source order) win for known categories. */
.blog-listing .blog-card:hover .blog-card__category                                       { background: #a45a3c; color: #fff; }

.blog-listing .blog-card:hover .blog-card__category--for-fundraising-groups               { background: #3d5544; color: #fff; }
.blog-listing .blog-card:hover .blog-card__category--information-for-everyone             { background: #1f6b7c; color: #fff; }
.blog-listing .blog-card:hover .blog-card__category--pip-s-tip-s-and-other-eggciting-info { background: #8a6100; color: #fff; }
.blog-listing .blog-card:hover .blog-card__category--recipes                              { background: #a45a3c; color: #fff; }
.blog-listing .blog-card:hover .blog-card__category--egg-life-and-all-other-news          { background: #7a3520; color: #fff; }

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

.blog-listing .blog-card__title {
    /* GTWalsheimPro-Bold for card titles; only the hero title keeps hwt-artz */
    font-family: 'GTWalsheimPro-Bold', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.25;
    margin: 0;
    color: #1e2731;
}

.blog-listing .blog-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color .15s ease;
}

.blog-listing .blog-card__title a:hover {
    color: #a45a3c;
}

.blog-listing .blog-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.blog-listing .blog-card__author-avatar {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f6f0e8;
    object-fit: cover;
    object-position: center top;   /* keep her face in frame if the crop tilts */
    flex-shrink: 0;
}

.blog-listing .blog-card__author-name {
    color: #1e2731;
    font-size: 14px;
    font-weight: 700;
}

.blog-listing .blog-empty {
    padding: 60px 0;
    text-align: center;
    color: #1e2731;
    font-size: 18px;
}


/* ---------- load more button (replaces the numbered pagination bar) ---------- */

.blog-listing .blog-load-more-wrap {
    display: flex;
    justify-content: center;
    margin: 20px 0 40px;
}

.blog-listing .blog-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 42px;
    background: #64846c;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: 'GTWalsheimPro-Bold', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}

.blog-listing .blog-load-more:hover {
    background: #556f5c;
    transform: translateY(-1px);
}

.blog-listing .blog-load-more:disabled,
.blog-listing .blog-load-more.is-loading {
    opacity: 0.7;
    cursor: default;
    transform: none;
}


/* ---------- responsive ---------- */

@media (max-width: 960px) {
    .blog-listing .blog-hero {
        grid-template-columns: 1fr;
    }
    .blog-listing .blog-hero__text {
        padding: 40px 30px;
        order: 2;
    }
    .blog-listing .blog-hero__image {
        order: 1;
        min-height: 240px;
    }
    .blog-listing .blog-hero__title {
        font-size: 32px;
    }
    .blog-listing .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 20px;
    }
}

@media (max-width: 600px) {
    .blog-listing .blog-filters {
        border-radius: 20px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .blog-listing .blog-filter {
        white-space: nowrap;
    }
    .blog-listing .blog-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .blog-listing .blog-hero__title {
        font-size: 26px;
    }
    .blog-listing .blog-hero__text {
        padding: 30px 22px;
    }
}
