/*
 * Blog home (Figma "Hakini Landing Page" > Final Design > Our Blog Page and
 * Our Blog Page Responsive). Builds on standard-page.css (.sPage tokens,
 * chips, arrows, the article cards and the app section).
 */

.bHome {
    --b-cream: #fff2de;
}

/* Shared meta line: reading time and date */
.bMeta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px !important;
    color: var(--sp-grey);
    font-size: 14px;
    line-height: 20px;
}
.bMeta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bMeta span::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("../images/booking/clock.svg") center / contain no-repeat;
    mask: url("../images/booking/clock.svg") center / contain no-repeat;
}
.bMeta .bMeta__date::before {
    -webkit-mask-image: url("../images/blog/calendar.svg");
    mask-image: url("../images/blog/calendar.svg");
}
.bMeta--light {
    color: #fff;
}

/* ---- Latest posts ----------------------------------------------------------- */

.bHero {
    padding: 32px 0 48px;
    background: var(--sp-hero);
}
.bHero__inner {
    display: grid;
    grid-template-columns: minmax(0, 702fr) minmax(0, 422fr);
    gap: 16px;
}
.bLead {
    position: relative;
    min-height: 450px;
    overflow: hidden;
    border-radius: 24px;
    background: #dfe8f6;
}
.bLead__image,
.bLead__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bLead::after {
    content: "";
    position: absolute;
    inset: 35% 0 0;
    background: linear-gradient(180deg, rgba(11, 61, 145, 0) 0%, rgba(11, 61, 145, 0.75) 45%, #0a3d8f 100%);
    pointer-events: none;
}
.bLead__body {
    position: absolute;
    right: 24px;
    bottom: 28px;
    left: 24px;
    z-index: 1;
    color: #fff;
}
.bLead__title {
    font-family: var(--sp-font-700);
    font-size: 26px;
    line-height: 34px;
}
.bLead__title a,
.bLead__title a:hover,
.bLead__text a,
.bLead__text a:hover {
    color: #fff;
}
.bLead__text {
    display: -webkit-box;
    margin-top: 14px !important;
    overflow: hidden;
    font-size: 15px;
    line-height: 24px;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.bLead__text a {
    text-decoration: underline !important;
}
.bSide {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.bSide li {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 20px;
}
.bSide__image {
    flex: none;
}
.bSide__image img {
    width: 140px;
    height: 140px;
    border-radius: 14px;
    object-fit: cover;
}
.bSide__author {
    font-size: 16px;
}
.bSide__title {
    display: -webkit-box;
    margin-top: 8px !important;
    overflow: hidden;
    font-family: var(--sp-font-700);
    font-size: 17px;
    line-height: 24px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.bSide__title a {
    color: var(--sp-ink);
}

/* ---- Browse by category ----------------------------------------------------- */

.bBrowse {
    padding-top: 56px;
}
.bChips {
    display: flex;
    align-items: center;
    gap: 16px;
}
.bChips__arrow {
    flex: none;
}
.bChips__track {
    display: flex;
    flex: 1;
    gap: 12px;
    padding: 4px 2px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.bChips__track::-webkit-scrollbar {
    display: none;
}
.bChips .sChip {
    flex: none;
    height: 44px;
    padding: 0 16px;
    font-size: 16px;
}
.bBrowse__tools {
    margin-top: 16px;
}
.bBrowse__grid .sArticle[hidden] {
    display: none;
}
.bBrowse__empty {
    padding: 40px 0;
    color: var(--sp-grey);
    font-size: 18px;
    text-align: center;
}

/* ---- Most read -------------------------------------------------------------- */

.bPopular {
    padding-top: 80px;
}
.bPopular__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.bPopular__all {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 16px;
    color: var(--sp-ink);
    font-size: 18px;
}
.bPopular__all:hover {
    color: var(--sp-navy);
}
.bPopular__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 40px;
}
.bCard__media {
    position: relative;
}
.bCard__image img {
    display: block;
    width: 100%;
    aspect-ratio: 270 / 242;
    border-radius: 14px;
    object-fit: cover;
}
.bCard__media .sArticle__share {
    top: 12px;
    inset-inline-start: 12px;
    inset-inline-end: auto;
}
/* White notch in the bottom corner holding the "read" button */
.bCard__go {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 74px;
    height: 74px;
    border-radius: 37px 0 14px 0;
    background: #fff;
}
.bCard__go::after {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 10 10 2M4 2h6v6' fill='none' stroke='%230f172a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat,
        #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}
html:lang(ar) .bCard__go {
    right: auto;
    left: -1px;
    border-radius: 0 37px 0 14px;
}
html:lang(ar) .bCard__go::after {
    left: 16px;
    transform: scaleX(-1);
}
.bCard__category {
    display: inline-block;
    margin-top: 14px;
    color: var(--sp-navy);
    font-size: 15px;
}
.bCard__category:hover {
    color: var(--sp-navy);
    text-decoration: underline;
}
.bCard__title {
    display: -webkit-box;
    margin-top: 8px !important;
    overflow: hidden;
    font-family: var(--sp-font-600);
    font-size: 18px;
    line-height: 26px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.bCard__title a {
    color: var(--sp-ink);
}
.bHome .sApp {
    margin-top: 80px;
}

/* ---- Writers ---------------------------------------------------------------- */

.bWriters {
    margin-top: 80px;
    padding: 48px 0 40px;
    background: var(--b-cream);
}
.bWriters__faces {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-top: 40px;
}
.bWriters__track {
    display: flex;
    align-items: center;
    gap: 32px;
}
.bWriters__face {
    flex: none;
    width: 56px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: #f2e6da;
    opacity: 0.85;
    cursor: pointer;
    transition: width 0.2s, height 0.2s;
}
.bWriters__face[data-near] {
    width: 80px;
    height: 80px;
    opacity: 1;
}
.bWriters__face.is-active {
    width: 120px;
    height: 120px;
    opacity: 1;
}
.bWriters__face[hidden] {
    display: none;
}
.bWriters__face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bWriters__name {
    margin-top: 12px !important;
    font-family: var(--sp-font-700);
    font-size: 20px;
    text-align: center;
}
.bWriters__title {
    margin-top: 4px !important;
    color: var(--sp-grey);
    font-size: 14px;
    text-align: center;
}
.bWriters__posts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 32px !important;
}
.bRow {
    display: flex;
    gap: 22px;
    padding: 24px;
    border: 1px solid #f1e6d6;
    border-radius: 14px;
    background: #fff;
}
.bRow__image {
    flex: none;
}
.bRow__image img {
    width: 188px;
    height: 164px;
    border-radius: 10px;
    object-fit: cover;
}
.bRow__date {
    color: var(--sp-grey);
    font-size: 14px;
}
.bRow__title {
    display: -webkit-box;
    margin-top: 10px !important;
    overflow: hidden;
    font-family: var(--sp-font-600);
    font-size: 20px;
    line-height: 28px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.bRow__title a {
    color: var(--sp-ink);
}
.bRow__text {
    display: -webkit-box;
    margin-top: 10px !important;
    overflow: hidden;
    color: var(--sp-grey);
    font-size: 16px;
    line-height: 24px;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.bWriters__all {
    display: flex;
    width: max-content;
    margin: 32px auto 0;
}

/* ---- Tablet ----------------------------------------------------------------- */

@media (max-width: 1199px) {
    .bHero__inner {
        grid-template-columns: minmax(0, 1fr);
    }
    .bPopular__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bWriters__posts {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- Phone ------------------------------------------------------------------ */

@media (max-width: 767px) {
    .bHero {
        padding: 24px 0 32px;
    }
    .bLead {
        min-height: 520px;
    }
    .bLead__body {
        right: 16px;
        bottom: 20px;
        left: 16px;
    }
    .bLead__title {
        font-size: 20px;
        line-height: 26px;
    }
    .bLead__text {
        font-size: 13px;
        line-height: 20px;
        -webkit-line-clamp: 5;
    }
    .bSide {
        margin-top: 16px;
    }
    .bSide li {
        gap: 16px;
    }
    .bSide__image img {
        width: 114px;
        height: 114px;
    }
    .bSide__author {
        font-size: 14px;
    }
    .bSide__title {
        font-size: 15px;
        line-height: 21px;
    }
    .bBrowse {
        padding-top: 32px;
    }
    .bChips__arrow {
        display: none;
    }
    .bChips__track {
        margin-inline-end: -20px;
    }
    .bChips .sChip {
        height: 38px;
        font-size: 14px;
    }
    .bHome .sPage__h2 {
        font-size: 24px;
        line-height: 32px;
    }
    .bPopular {
        padding-top: 48px;
    }
    .bPopular__head {
        display: block;
    }
    .bPopular__grid {
        grid-template-columns: none;
        grid-auto-columns: 60%;
        grid-auto-flow: column;
        gap: 16px;
        margin-top: 20px;
        margin-inline-end: -20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .bPopular__grid::-webkit-scrollbar {
        display: none;
    }
    .bCard {
        scroll-snap-align: start;
    }
    .bCard__title {
        font-size: 15px;
        line-height: 22px;
    }
    .bCard__go {
        width: 60px;
        height: 60px;
    }
    .bCard__go::after {
        top: 12px;
        left: 12px;
        width: 36px;
        height: 36px;
    }
    html:lang(ar) .bCard__go::after {
        left: 12px;
    }
    .bPopular__all {
        display: flex;
        justify-content: center;
        margin-top: 20px;
        font-size: 16px;
    }
    .bHome .sApp {
        margin-top: 48px;
    }
    .bWriters {
        margin-top: 48px;
        padding: 40px 0 32px;
    }
    .bWriters__faces {
        gap: 12px;
        margin-top: 24px;
    }
    .bWriters__faces > .sArrow {
        display: none;
    }
    .bWriters__track {
        gap: 20px;
    }
    .bWriters__face[data-far] {
        display: none;
    }
    .bWriters__face[data-near] {
        width: 64px;
        height: 64px;
    }
    .bWriters__face.is-active {
        width: 96px;
        height: 96px;
    }
    .bWriters__posts {
        grid-template-columns: none;
        grid-auto-columns: 90%;
        grid-auto-flow: column;
        gap: 12px;
        margin-top: 20px !important;
        margin-inline-end: -20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .bWriters__posts::-webkit-scrollbar {
        display: none;
    }
    .bRow {
        gap: 14px;
        padding: 16px;
        scroll-snap-align: start;
    }
    .bRow__image img {
        width: 112px;
        height: 118px;
    }
    .bRow__title {
        margin-top: 6px !important;
        font-size: 16px;
        line-height: 22px;
    }
    .bRow__text {
        margin-top: 6px !important;
        font-size: 13px;
        line-height: 19px;
        -webkit-line-clamp: 2;
    }
}

/* In-page search: link to the full results page under the cards. */
.bBrowse__more {
    margin-top: 16px !important;
    text-align: center;
}
.bBrowse__more[hidden] {
    display: none;
}
.bBrowse__more a {
    color: var(--sp-navy);
    font-family: var(--sp-font-600);
    text-decoration: underline;
}
.bBrowse__grid[aria-busy="true"] {
    opacity: 0.5;
}
