/* SA Blog Filter — Sabbir Ahmed */
.sa-bf-wrap {
    width: 100%;
    position: relative;
}

/* ── Filter Tabs ── */
.sa-bf-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 0;
}

.sa-bf-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: transparent;
    color: #111111;
    border: 1px solid rgba(17,17,17,0.15);
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    outline: none;
}

.sa-bf-tab:hover {
    background: rgba(17,17,17,0.04);
}

.sa-bf-tab.is-active {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

/* ── Grid ── */
.sa-bf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 24px;
    margin-top: 32px;
    position: relative;
}

.sa-bf-grid.is-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

/* ── Card entry animation ── */
.sa-bf-card {
    animation: sa-bf-fade-up 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Stagger children up to 12 */
.sa-bf-card:nth-child(1)  { animation-delay: 0.00s; }
.sa-bf-card:nth-child(2)  { animation-delay: 0.06s; }
.sa-bf-card:nth-child(3)  { animation-delay: 0.12s; }
.sa-bf-card:nth-child(4)  { animation-delay: 0.18s; }
.sa-bf-card:nth-child(5)  { animation-delay: 0.24s; }
.sa-bf-card:nth-child(6)  { animation-delay: 0.30s; }
.sa-bf-card:nth-child(7)  { animation-delay: 0.36s; }
.sa-bf-card:nth-child(8)  { animation-delay: 0.42s; }
.sa-bf-card:nth-child(9)  { animation-delay: 0.48s; }
.sa-bf-card:nth-child(10) { animation-delay: 0.54s; }
.sa-bf-card:nth-child(11) { animation-delay: 0.60s; }
.sa-bf-card:nth-child(12) { animation-delay: 0.66s; }

@keyframes sa-bf-fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disable for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .sa-bf-card { animation: none; }
}

/* ── Card ── */
.sa-bf-card {
    background: #ffffff;
    border: 1px solid rgba(17,17,17,0.08);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    isolation: isolate;  /* prevent z-index bleed */
}

.sa-bf-card:hover {
    transform: translateY(-2px);
}

/* Image: edge-to-edge, rounded top corners follow card radius */
.sa-bf-card__image {
    display: block;
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    border: 0;
    text-decoration: none;
    /* Card has overflow:hidden + border-radius, image fills top automatically */
}

.sa-bf-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    transition: transform 0.5s ease;
}

.sa-bf-card:hover .sa-bf-card__image img {
    transform: scale(1.04);
}

.sa-bf-card__no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

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

/* ── Meta (category + date) ── */
.sa-bf-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #111111;
    line-height: 1.2;
}

.sa-bf-card__cat {
    display: inline-flex;
}

.sa-bf-sep {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: rgba(17,17,17,0.3);
}

.sa-bf-card__date {
    display: inline-flex;
    color: #111111;
}

/* ── Title ── */
.sa-bf-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #000000;
}

.sa-bf-card__title a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.sa-bf-card__title a:hover {
    opacity: 0.7;
}

/* ── Excerpt ── */
.sa-bf-card__excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(17,17,17,0.65);
}

/* ── Read More ── */
.sa-bf-card__rm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 10px 20px;
    background: transparent;
    color: #111111;
    border: 1px solid rgba(17,17,17,0.15);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    width: max-content;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.sa-bf-card__rm:hover {
    background: rgba(17,17,17,0.04);
    border-color: rgba(17,17,17,0.3);
}

.sa-bf-card__rm svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* ── Load More ── */
.sa-bf-loadmore-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.sa-bf-loadmore {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
    outline: none;
    position: relative;
}

.sa-bf-loadmore:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.sa-bf-loadmore:disabled,
.sa-bf-loadmore.is-done {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sa-bf-loadmore.is-loading {
    cursor: wait;
}

.sa-bf-loadmore-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: sa-bf-spin 0.7s linear infinite;
}

.sa-bf-loadmore.is-loading .sa-bf-loadmore-spinner {
    display: inline-block;
}

@keyframes sa-bf-spin {
    to { transform: rotate(360deg); }
}

.sa-bf-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: rgba(17,17,17,0.6);
    font-size: 15px;
}

/* ── Responsive ── */
/* Responsive fallback for layouts without custom device settings */
@media (max-width: 767px) {
    .sa-bf-filters { gap: 8px; }
    .sa-bf-loadmore-wrap { padding: 0 16px; }
}
