.aelab-blog-archive-widget {
    width: 100%;
    margin: 20px 0;
}

.aelab-blog-archive-title-top {
    margin: 0 0 18px 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.aelab-blog-archive-grid {
    display: grid;
    grid-template-columns: repeat(var(--aelab-cols, 3), minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.aelab-blog-archive-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 360px;
    position: relative; /* prevents any absolute children from escaping */
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.aelab-blog-archive-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    transform: translateY(-2px);
}

.aelab-blog-archive-thumb-link {
    display: block;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.aelab-blog-archive-thumb {
    width: 100%;
    height: 220px;
    background: #f8fafc;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.aelab-blog-archive-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #f8fafc;
}

.aelab-blog-archive-thumb--empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #6b7280;
    font-size: 34px;
}

.aelab-blog-archive-meta {
    /* Meta must be visually below the thumbnail */
    padding: 10px 14px 12px 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    position: relative !important;
    z-index: 2 !important;
    background: #fff; /* visually separates from the thumbnail */
    margin-top: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    clear: both;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
}

.aelab-blog-archive-date {
    font-size: 12px;
    color: #6b7280;
}

.aelab-blog-archive-comments-num {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.aelab-blog-archive-comments {
    display: inline-flex;
    align-items: center;
}

.aelab-blog-archive-views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.aelab-blog-archive-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    color: #6b7280;
}

.aelab-blog-archive-views-num {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.aelab-blog-archive-card-title {
    margin: 10px 0 0 0;
    padding: 0 14px;
}

.aelab-blog-archive-card-title a {
    text-decoration: none;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
}

.aelab-blog-archive-card-title a:hover {
    text-decoration: none; /* avoid visual "font change" on hover */
}

/* Keep title typography stable on hover even with theme-wide a:hover rules */
.aelab-blog-archive-widget .aelab-blog-archive-card-title a,
.aelab-blog-archive-widget .aelab-blog-archive-card-title a:hover,
.aelab-blog-archive-widget .aelab-blog-archive-card-title a:focus,
.aelab-blog-archive-widget .aelab-blog-archive-card-title a:active {
    font-family: inherit !important;
    font-style: normal !important;
    font-variant: normal !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
    text-transform: none !important;
    text-decoration: none !important;
}

.aelab-blog-archive-card-excerpt {
    margin: 10px 0 0 0;
    padding: 0 14px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aelab-blog-archive-card-footer {
    margin-top: auto;
    padding: 14px;
}

.aelab-blog-archive-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    color: #111827;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
}

.aelab-blog-archive-btn:hover {
    border-color: #cbd5e1;
    background: #f9fafb;
}

/* Keep button typography stable on hover as well */
.aelab-blog-archive-widget .aelab-blog-archive-btn,
.aelab-blog-archive-widget .aelab-blog-archive-btn:hover,
.aelab-blog-archive-widget .aelab-blog-archive-btn:focus,
.aelab-blog-archive-widget .aelab-blog-archive-btn:active {
    font-family: inherit !important;
    font-style: normal !important;
    font-variant: normal !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
    text-transform: none !important;
    text-decoration: none !important;
}

.aelab-blog-archive-pagination {
    margin-top: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.aelab-blog-archive-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 6px;
    border: none;
    color: #6b7280;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    background: transparent;
    transition: all 0.15s ease;
}

.aelab-blog-archive-page:hover {
    color: #111827;
    text-decoration: underline;
}

.aelab-blog-archive-page--active {
    color: #007cba;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.aelab-blog-archive-page--disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    color: #6b7280;
    font-weight: 700;
    font-size: 13px;
    cursor: default;
    background: transparent;
}

.aelab-blog-archive-ellipsis {
    color: #6b7280;
    font-weight: 700;
    padding: 0 4px;
}

@media (max-width: 1200px) {
    /* keep configured columns; cards shrink naturally */
}

@media (max-width: 900px) {
    .aelab-blog-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .aelab-blog-archive-card {
        border-radius: 10px;
        border-color: #d9dee7;
    }

    .aelab-blog-archive-meta {
        padding: 8px 12px 10px 12px !important;
        gap: 10px !important;
    }

    .aelab-blog-archive-date,
    .aelab-blog-archive-views-num,
    .aelab-blog-archive-views {
        font-size: 11px;
    }

    .aelab-blog-archive-btn {
        border-radius: 9px;
        border-width: 1px;
        padding: 9px 10px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .aelab-blog-archive-thumb {
        height: 205px;
    }

    .aelab-blog-archive-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
        gap: 16px;
    }

    .aelab-blog-archive-card {
        min-height: 350px;
        border-radius: 10px;
        border: 1px solid #d5dbe5;
    }

    .aelab-blog-archive-meta {
        padding: 8px 12px 10px 12px !important;
        gap: 9px !important;
        border-top: 1px solid #eef2f7;
    }

    .aelab-blog-archive-date,
    .aelab-blog-archive-views,
    .aelab-blog-archive-views-num {
        font-size: 11px !important;
        font-weight: 600;
    }

    .aelab-blog-archive-eye svg {
        width: 13px;
        height: 13px;
    }

    .aelab-blog-archive-card-title {
        margin-top: 8px;
        padding: 0 12px;
    }

    .aelab-blog-archive-card-title a {
        font-size: 15px;
        line-height: 1.45;
    }

    .aelab-blog-archive-card-excerpt {
        display: none !important; /* mobile only: hide description */
    }

    .aelab-blog-archive-card-footer {
        padding: 12px;
    }

    .aelab-blog-archive-btn {
        min-height: 40px;
        border: 1px solid #d6dce7;
        border-radius: 10px;
        background: #fff;
        font-size: 13px;
        font-weight: 700;
        padding: 9px 10px;
    }
}

