/* ------------------------------------------------------------------ */
/* Blog                                                                 */
/*                                                                      */
/* The chip row, one featured article and the card grid. The hero and   */
/* the two-tone headings come from style.css untouched. The category    */
/* pill and the author/meta line are shared between the featured card   */
/* and the small ones, so they are styled once.                         */
/* Logical properties throughout, so Arabic mirrors on its own.         */
/* ------------------------------------------------------------------ */

.blog-section {
    padding: clamp(30px, 3vw, 56px) 0 var(--section-gap);
}

/* ---- category chips -------------------------------------------------- */

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(7px, .65vw, 14px);
}

.blog-chip {
    padding: clamp(7px, .68vw, 14px) clamp(14px, 1.3vw, 22px);
    border: 1px solid #E1E4ED;
    border-radius: 999px;
    background: var(--white);
    font: inherit;
    font-size: clamp(14px, .85vw, 14px);
    color: var(--text-soft);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

    .blog-chip:hover {
        border-color: var(--navy);
        color: var(--navy);
    }

    .blog-chip.is-active {
        border-color: var(--navy);
        background: var(--navy);
        color: var(--white);
    }

/* ---- shared: pill, author, meta -------------------------------------- */

.post-pill {
    align-self: flex-start;
    display: inline-block;
    padding: clamp(5px, .5vw, 9px) clamp(11px, 1vw, 17px);
    border-radius: 999px;
    background: var(--pill-bg, #EEF0F6);
    font-size: clamp(10px, .8vw, 13px);
    font-weight: 500;
    line-height: 1.2;
    color: var(--pill-fg, var(--navy));
}

.post-pill--rose {
    --pill-bg: #FBE9EC;
    --pill-fg: #B11A18;
}

.post-pill--lilac {
    --pill-bg: #EEECFA;
    --pill-fg: #6C4AB6;
}

.post-pill--green {
    --pill-bg: #E4F3ED;
    --pill-fg: #1a906e;
}

.post-pill--blue {
    --pill-bg: #E7EDFA;
    --pill-fg: #1F3163;
}

.post-pill--grey {
    --pill-bg: #EFF0F4;
    --pill-fg: #4A5C85;
}

.post-pill--red {
    --pill-bg: #FBE3E3;
    --pill-fg: #C0392B;
}

.post-author {
    display: inline-flex;
    align-items: center;
    gap: clamp(8px, .7vw, 12px);
    font-size: clamp(11px, .85vw, 14px);
    color: var(--text-soft);
}

.post-author__avatar {
    flex-shrink: 0;
    width: clamp(26px, 2.1vw, 36px);
    height: clamp(26px, 2.1vw, 36px);
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 25%;
}

.post-author--lg .post-author__avatar {
    width: clamp(36px, 3vw, 50px);
    height: clamp(36px, 3vw, 50px);
}

/* The featured card names the author over two lines; the small cards use
   the same component with a single line. */
.post-author--lg > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-author--lg b {
    font-weight: 500;
    color: var(--navy);
}

.post-author--lg small {
    font-size: .86em;
    color: var(--text-soft);
}

.post-meta {
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, .55vw, 10px);
    font-size: clamp(11px, .82vw, 14px);
    color: var(--text-soft);
    white-space: nowrap;
}

    .post-meta i {
        font-size: .95em;
    }

/* ---- the featured article -------------------------------------------- */

.post-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    margin-top: clamp(18px, 1.8vw, 32px);
    border-radius: 18px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 6px 28px rgba(31, 49, 99, .08);
}

.post-featured__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(9px, .85vw, 15px);
    padding: clamp(20px, 2vw, 38px);
}

.post-featured__eyebrow {
    font-size: clamp(11px, .85vw, 14px);
    font-weight: 500;
    color: #1a906e;
}

.post-featured__title {
    margin: clamp(4px, .4vw, 8px) 0 0;
    font-size: clamp(20px, 1.85vw, 36px);
    font-weight: 700;
    line-height: 1.28;
    /* Two lines, as the design sets it. In `ch` rather than pixels so the cap
     tracks the font size through the clamp above. */
    /*max-width: 22ch;*/
}

    .post-featured__title a,
    .post-card__title a {
        color: var(--navy);
        text-decoration: none;
    }

        .post-featured__title a:hover,
        .post-card__title a:hover {
            text-decoration: underline;
        }

.post-featured__text {
    margin: 0;
    /* max-width: 46ch;*/
    font-size: clamp(15px, .88vw, 20px);
    line-height: 1.7;
    color: var(--text-soft);
}

/* `margin-top: auto` pins the byline to the foot of the column, so it lines
   up with the bottom of the photograph beside it. */
.post-featured__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(12px, 1.4vw, 26px);
    margin-top: auto;
    padding-top: clamp(14px, 1.4vw, 26px);
}

.post-featured__media {
    display: block;
    min-height: clamp(240px, 24vw, 380px);
}

    .post-featured__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* ---- the card grid ---------------------------------------------------- */

.blog-heading {
    margin-top: clamp(34px, 3.4vw, 62px);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 1.7vw, 30px);
    margin-top: clamp(18px, 1.8vw, 32px);
}

.post-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 4px 22px rgba(31, 49, 99, .07);
    transition: transform .2s, box-shadow .2s;
}

    .post-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(31, 49, 99, .11);
    }

.post-card__media {
    display: block;
    aspect-ratio: 16 / 9;
}

    .post-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.post-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
    gap: clamp(10px, .95vw, 16px);
    padding: clamp(14px, 1.4vw, 24px);
}

.post-card__title {
    margin: 0;
    font-size: clamp(14px, 1.15vw, 20px);
    font-weight: 700;
    line-height: 1.35;
}

/* The rule above the byline, and `margin-top: auto` so it sits at the foot
   of the card whether the title ran to one line or two — which is what
   keeps the bylines across a row on one line. */
.post-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    padding-top: clamp(11px, 1vw, 18px);
    border-block-start: 1px solid #EDEFF5;
}

/* ---- empty state ------------------------------------------------------- */

.post-empty {
    margin-top: clamp(20px, 2vw, 34px);
    font-size: var(--fs-sub);
    color: var(--text-soft);
    text-align: center;
}

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

@media (max-width: 991.98px) {
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    /* The photograph goes above the text rather than beside it; `order` puts
     it first without moving the headline away from the top of the DOM. */
    .post-featured {
        grid-template-columns: 1fr;
    }

    .post-featured__body {
        order: 2;
    }

    .post-featured__media {
        order: 1;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .post-featured__title,
    .post-featured__text {
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-card__foot {
        flex-wrap: wrap;
    }
}
