/* Blog listing (/blogs). Scoped with the bl- prefix so category-blogs and
   blog-details keep using the legacy .blog-* rules in style.css. */

.bl-page {
    padding: 64px 0 96px;
}

.bl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 48px;
    align-items: start;
}

/* ---- Post grid ---- */
.bl-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 28px;
}

.bl-card {
    display: flex;
    flex-direction: column;
    background: var(--white-color);
    border: 1px solid #E6E2D6;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.bl-card:hover,
.bl-card:focus-within {
    border-color: var(--theme-color);
    box-shadow: 0 10px 28px rgba(4, 4, 83, .08);
}

/* Drafting-sheet backdrop: shows while the image loads and when it is missing. */
.bl-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background-color: #0b2a4a;
    background-image:
        linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 24px 24px;
    overflow: hidden;
}
.bl-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.bl-card:hover .bl-media img {
    transform: scale(1.03);
}

.bl-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 24px 24px;
}

.bl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--gray-color);
}
.bl-meta a {
    color: var(--theme-color);
    font-weight: 600;
}

.bl-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
}
.bl-title a {
    color: var(--heading-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bl-title a:hover {
    color: var(--theme-color);
}

.bl-excerpt {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--body-font-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bl-more {
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-color);
}
.bl-more:hover {
    text-decoration: underline;
}

/* First post on page 1 spans both columns, image beside text. */
.bl-card--lead {
    grid-column: 1 / -1;
    flex-direction: row;
}
.bl-card--lead .bl-media {
    flex: 0 0 52%;
    aspect-ratio: auto;
    min-height: 320px;
}
.bl-card--lead .bl-body {
    justify-content: center;
    padding: 36px 40px;
}
.bl-card--lead .bl-title {
    font-size: 28px;
    line-height: 1.25;
}
.bl-card--lead .bl-title a {
    -webkit-line-clamp: 4;
}
.bl-card--lead .bl-excerpt {
    font-size: 16px;
    -webkit-line-clamp: 4;
}
.bl-card--lead .bl-more {
    margin-top: 0;
}

/* ---- Pagination ---- */
.bl-pager {
    margin-top: 48px;
}
.bl-pager .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}
.bl-pager .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #E6E2D6;
    border-radius: 6px;
    background: var(--white-color);
    color: var(--heading-color);
    font-weight: 600;
}
.bl-pager .page-link:hover {
    border-color: var(--theme-color);
    color: var(--theme-color);
}
.bl-pager .active .page-link {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: var(--white-color);
}

/* ---- Sidebar ---- */
.bl-aside {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.bl-panel {
    background: var(--white-color);
    border: 1px solid #E6E2D6;
    border-radius: 6px;
    padding: 22px 22px 20px;
}
.bl-panel-title {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 600;
    color: var(--heading-color);
}

.bl-search {
    position: relative;
}
.bl-search-field {
    display: flex;
    align-items: center;
    border: 1px solid #D9D5C7;
    border-radius: 6px;
    background: var(--white-color);
}
.bl-search-field:focus-within {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px rgba(8, 97, 167, .15);
}
.bl-search-field input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    font-size: 15px;
    outline: none;
}
.bl-search-field button {
    height: 46px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: var(--gray-color);
    font-size: 18px;
}

.bl-recent {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bl-recent li + li {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #EEEBE0;
}
.bl-recent a {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.bl-recent .bl-media {
    flex: 0 0 76px;
    aspect-ratio: 1;
    border-radius: 4px;
    background-size: 12px 12px;
}
.bl-recent-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--heading-color);
}
.bl-recent a:hover .bl-recent-title {
    color: var(--theme-color);
}
.bl-recent time {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-color);
}

.bl-cats {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bl-cats a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    font-size: 15px;
    color: var(--body-font-color);
}
.bl-cats li + li a {
    border-top: 1px solid #EEEBE0;
}
.bl-cats a:hover {
    color: var(--theme-color);
}
.bl-cats span {
    color: var(--gray-color);
    font-size: 13px;
}

.bl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.bl-tags li {
    padding: 5px 12px;
    border-radius: 999px;
    background: #F1EEE3;
    font-size: 13px;
    color: var(--body-font-color);
}

.bl-empty {
    padding: 64px 24px;
    text-align: center;
    background: var(--white-color);
    border: 1px solid #E6E2D6;
    border-radius: 6px;
}

/* ---- Responsive ---- */
@media (max-width: 1199px) {
    .bl-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 32px;
    }
}

@media (max-width: 991px) {
    .bl-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .bl-aside {
        position: static;
        max-height: none;
        overflow: visible;
    }
    .bl-card--lead .bl-media {
        flex-basis: 46%;
    }
}

@media (max-width: 767px) {
    .bl-page {
        padding: 40px 0 64px;
    }
    .bl-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .bl-card--lead {
        flex-direction: column;
    }
    .bl-card--lead .bl-media {
        flex: none;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
    .bl-card--lead .bl-body {
        padding: 22px 24px 24px;
    }
    .bl-card--lead .bl-title {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bl-card,
    .bl-media img {
        transition: none;
    }
    .bl-card:hover .bl-media img {
        transform: none;
    }
}

.direction-rtl .bl-more,
.direction-rtl .bl-meta {
    direction: rtl;
}
