/**
 * Blogs section. Three columns: a large post, a medium one, and a stack of
 * three compact rows. Proportions follow the reference layout (359 / 359 / 543
 * inside a 1300px container).
 */

.hebd-blogs {
    --hebd-green: #1c9548;
    --hebd-ink: #000;
    --hebd-muted: #888;
    --hebd-line: #e2e8e4;
    --hebd-radius: 20px;

    padding: var(--hebd-section-space, 44px) 0;
    font-family: var(--hebd-font-body, "Montserrat", "Hind Siliguri", system-ui, sans-serif);
}

.hebd-blogs__title {
    margin: 0 0 30px;
    font-family: var(--hebd-font-heading, "Montserrat", "Hind Siliguri", system-ui, sans-serif);
    font-size: 36px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hebd-green);
    text-align: center;
}

.hebd-blogs__grid {
    /* Text-led section: do not stretch to the full 1920px container. */
    max-width: 1560px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 20px;
    align-items: start;
}

/* Only one post to show: let it use the full row rather than sit in a corner. */
.hebd-blogs__grid--single {
    grid-template-columns: minmax(0, 620px);
    justify-content: center;
}

.hebd-blogs__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

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

.hebd-blog {
    min-width: 0;
}

.hebd-blog__thumb {
    display: block;
    overflow: hidden;
    border-radius: var(--hebd-radius);
    background: #eef1ef;
}

.hebd-blog__thumb img,
.hebd-blog__thumb-empty {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.hebd-blog__thumb:hover img {
    transform: scale(1.03);
}

.hebd-blog__body {
    padding-top: 14px;
}

.hebd-blog__author {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--hebd-ink);
}

/* Title on the left, date pinned to the right on the same row. */
.hebd-blog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hebd-blog__heading {
    margin: 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--hebd-ink);
}

.hebd-blog__heading a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hebd-blog__heading a:hover {
    color: var(--hebd-green);
}

.hebd-blog__date {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--hebd-muted);
    white-space: nowrap;
}

.hebd-blog__excerpt {
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--hebd-ink);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Variants                                                            */
/* ------------------------------------------------------------------ */

.hebd-blog--featured .hebd-blog__thumb {
    aspect-ratio: 359 / 279;
}

.hebd-blog--medium .hebd-blog__thumb {
    aspect-ratio: 359 / 196;
}

.hebd-blog--medium .hebd-blog__excerpt {
    -webkit-line-clamp: 3;
}

/* Compact rows: thumbnail left, text right. */
.hebd-blog--compact {
    display: grid;
    grid-template-columns: 217px minmax(0, 1fr);
    gap: 15px;
    align-items: start;
}

.hebd-blog--compact .hebd-blog__thumb {
    aspect-ratio: 217 / 169;
}

.hebd-blog--compact .hebd-blog__body {
    padding-top: 4px;
}

/* The reference puts the date on its own line here, above the title. */
.hebd-blog--compact .hebd-blog__head {
    display: block;
}

.hebd-blog--compact .hebd-blog__date {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    color: var(--hebd-ink);
}

.hebd-blog--compact .hebd-blog__heading {
    font-size: 16px;
}

.hebd-blog--compact .hebd-blog__excerpt {
    margin-top: 4px;
    font-size: 15px;
    -webkit-line-clamp: 2;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.hebd-blogs__footer {
    display: flex;
    justify-content: center;
    margin-top: 34px;
}

.hebd-blogs__more {
    font-size: 15px;
    font-weight: 500;
    color: var(--hebd-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .18s ease, border-color .18s ease;
}

.hebd-blogs__more:hover {
    color: var(--hebd-green);
    border-bottom-color: currentColor;
}

.hebd-blogs-empty {
    padding: 24px;
    text-align: center;
    color: #6b7c71;
    border: 1px dashed var(--hebd-line);
    border-radius: 12px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1199.98px) {
    .hebd-blogs__grid {
        grid-template-columns: 1fr 1fr;
    }

    /* The compact stack drops below and spans both columns. */
    .hebd-blogs__list {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .hebd-blog--compact {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
}

@media (max-width: 767.98px) {
    .hebd-blogs {
        padding: 32px 0;
    }

    .hebd-blogs__title {
        font-size: 26px;
        margin-bottom: 22px;
    }

    .hebd-blogs__grid,
    .hebd-blogs__grid--single {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .hebd-blogs__list {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    /* Back to thumbnail-beside-text, which reads better in a narrow column. */
    .hebd-blog--compact {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 12px;
    }

    .hebd-blog--compact .hebd-blog__heading,
    .hebd-blog--compact .hebd-blog__excerpt,
    .hebd-blog--compact .hebd-blog__date {
        font-size: 13px;
    }

    .hebd-blog--compact .hebd-blog__excerpt {
        -webkit-line-clamp: 2;
    }
}
