/* ==========================================================================
   Blogs listing page (bl-*)
   Covers are uploaded in many sizes (wide banners, squares, 16:9 ...). Every frame has a fixed
   ratio and the picture is shown whole (contain) over a blurred, zoomed copy of itself,
   so nothing is cropped and there are no empty bars.
   ========================================================================== */

.bl {
    --bl-primary: #421f61;
    --bl-deep: #2a1140;
    --bl-accent: #dea8e4;
    --bl-text: #5f4b70;
    --bl-soft: #f7f2fa;
    --bl-line: #ece3f1;
    padding: 70px 0 90px;
    background: var(--bl-soft);
}

.bl__empty {
    text-align: center;
    color: var(--bl-text);
    font-size: 18px;
}

.bl__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bl-primary);
    background: #fff;
    border: 1px solid var(--bl-line);
}

.bl__label i {
    color: #d49ddb;
}

.bl__heading {
    margin: 64px 0 26px;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    color: var(--bl-primary);
}

.bl__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}

@media (min-width: 640px) {
    .bl__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bl__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

/* ---------- card ---------- */

.bl-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--bl-line);
    box-shadow: 0 10px 30px -18px rgba(66, 31, 97, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bl-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 44px -20px rgba(66, 31, 97, 0.38);
}

.bl-card__media {
    position: relative;
    display: block;
    aspect-ratio: 2 / 1; /* most uploaded covers are wide 8:3 banners; other sizes sit whole over the blur */
    overflow: hidden;
    background: var(--bl-deep);
}

.bl-card__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(22px) saturate(1.2) brightness(0.85);
    transform: scale(1.25);
}

.bl-card__img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.bl-card:hover .bl-card__img {
    transform: scale(1.04);
}

.bl-card__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #4a1f6e, var(--bl-deep));
}

.bl-card__placeholder img {
    width: 64px;
    opacity: 0.6;
}

.bl-card__chip {
    position: absolute;
    bottom: 12px; /* bottom corner: covers usually carry their own title at the top */
    inset-inline-start: 12px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--bl-primary);
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.bl-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    padding: 22px 24px 24px;
}

.bl-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    color: #8b7a99;
}

.bl-card__meta i {
    margin-inline-end: 5px;
    color: #c996d2;
}

/* the title is always shown in full */
.bl-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--bl-primary);
    overflow-wrap: break-word;
}

.bl-card__title a {
    color: inherit !important;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.35s ease;
}

[dir="rtl"] .bl-card__title a {
    background-position: 100% 100%;
}

.bl-card:hover .bl-card__title a {
    background-size: 100% 2px;
}

/* only the short description is cut to 3 lines */
.bl-card__excerpt {
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--bl-text);
}

.bl-card__more {
    margin-top: auto;
    padding-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    font-size: 15px;
    font-weight: 800;
    color: var(--bl-primary) !important;
}

.bl-card__more i {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: #fff;
    background: var(--bl-primary);
    transition: transform 0.3s ease, background 0.3s ease;
}

[dir="rtl"] .bl-card__more i,
[dir="rtl"] .bl-pager__arrow i {
    transform: scaleX(-1);
}

.bl-card:hover .bl-card__more i {
    background: #7a3f99;
    transform: translateX(4px);
}

[dir="rtl"] .bl-card:hover .bl-card__more i {
    transform: scaleX(-1) translateX(4px);
}

/* ---------- featured (newest) article ---------- */

.bl-card--featured .bl-card__title {
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.45;
}

.bl-card--featured .bl-card__excerpt {
    font-size: 16.5px;
    -webkit-line-clamp: 4;
}

@media (min-width: 992px) {
    .bl-card--featured {
        display: grid;
        grid-template-columns: 1.35fr 1fr;
    }

    .bl-card--featured .bl-card__media {
        aspect-ratio: auto;
        min-height: 100%;
    }

    .bl-card--featured .bl-card__img {
        position: absolute;
        inset: 0;
    }

    .bl-card--featured .bl-card__body {
        justify-content: center;
        gap: 16px;
        padding: 40px 44px;
    }

    .bl-card--featured:hover {
        transform: translateY(-4px);
    }
}

@media (min-width: 992px) {
    /* the featured frame keeps a 2:1 ratio of its column (and grows with the text beside it) */
    .bl-card--featured .bl-card__media::before {
        content: "";
        display: block;
        padding-top: 50%;
    }
}

/* ---------- pagination ---------- */

.bl-pager {
    margin-top: 56px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.bl-pager__page,
.bl-pager__arrow {
    min-width: 46px;
    height: 46px;
    padding: 0 12px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--bl-primary) !important;
    background: #fff;
    border: 1px solid var(--bl-line);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bl-pager a:hover {
    border-color: var(--bl-accent);
    background: #fbf6fd;
}

.bl-pager__page.is-current {
    color: #fff !important;
    background: var(--bl-primary);
    border-color: var(--bl-primary);
    box-shadow: 0 10px 20px -10px rgba(66, 31, 97, 0.6);
}

.bl-pager__arrow.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

@media (max-width: 575px) {
    .bl {
        padding: 44px 0 64px;
    }

    .bl-card__body {
        padding: 18px 18px 20px;
    }

    .bl-card__title {
        font-size: 18.5px;
    }

    .bl__heading {
        margin-top: 44px;
    }
}
