/* ── Blog Search & Tag Filter — style.css ── */

.bsf-wrap { width: 100%; font-family: inherit; }

/* ── Controls ─────────────────────────────── */
.bsf-controls { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }

.bsf-search-wrap { position: relative; display: flex; align-items: center; }
.bsf-search-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: #94a3b8; pointer-events: none; flex-shrink: 0; }
.bsf-search-input {
    width: 100%; padding: 12px 44px 12px 42px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    background: #fff; font-size: 15px; color: #1e293b;
    outline: none; box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.bsf-search-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.bsf-clear-btn { position: absolute; right: 12px; background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 13px; padding: 4px; display: none; }
.bsf-clear-btn.visible { display: block; }
.bsf-clear-btn:hover { color: #1e293b; }

.bsf-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bsf-tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; border: 1.5px solid #e2e8f0;
    border-radius: 999px; background: #fff;
    color: #0d0d0d; font-size: 13px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: all .2s;
}
.bsf-tag:hover { border-color: #ffbe0b; color: #0d0d0d; background: #ffbe0b; }
.bsf-tag.active { border-color: #ffbe0b; background: #ffbe0b; color: #0d0d0d; }
.bsf-tag-count { background: rgba(0,0,0,.1); border-radius: 999px; padding: 1px 6px; font-size: 11px; font-weight: 600; }
.bsf-tag.active .bsf-tag-count { background: rgba(0,0,0,.12); }

/* ── Results info ──────────────────────────── */
.bsf-results-info { font-size: 13px; color: #64748b; margin-bottom: 18px; min-height: 20px; }

/* ── Grid ──────────────────────────────────── */
.bsf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    min-height: 200px;
    position: relative;
    transition: opacity .2s;
}
.bsf-grid.bsf-loading { opacity: .45; pointer-events: none; }

/* ── Spinner ───────────────────────────────── */
.bsf-spinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.bsf-spinner span { width: 10px; height: 10px; border-radius: 50%; background: #2563eb; animation: bsf-bounce .9s infinite ease-in-out both; }
.bsf-spinner span:nth-child(2) { animation-delay: .15s; }
.bsf-spinner span:nth-child(3) { animation-delay: .3s; }
@keyframes bsf-bounce { 0%,80%,100%{transform:scale(0);opacity:.4} 40%{transform:scale(1);opacity:1} }

/* ── Card ──────────────────────────────────── */
.bsf-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.07);
    transition: transform .2s, box-shadow .2s;
    animation: bsf-fadein .3s ease both;
}
.bsf-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
@keyframes bsf-fadein { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

.bsf-card-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.bsf-card-thumb-placeholder {
    width: 100%; aspect-ratio: 16/9;
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
    display: flex; align-items: center; justify-content: center;
}
.bsf-card-thumb-placeholder svg { width: 36px; height: 36px; color: #cbd5e1; }

.bsf-card-body { padding: 20px; }

.bsf-card-date { font-size: 12px; color: #94a3b8; margin-bottom: 6px; font-weight: 500; }

.bsf-card-title { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0 0 8px; line-height: 1.4; }
.bsf-card-title a { color: inherit; text-decoration: none; transition: color .2s; }
.bsf-card-title a:hover { color: #2563eb; }

.bsf-card-excerpt { font-size: 14px; color: #64748b; line-height: 1.6; margin-bottom: 14px; }

.bsf-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.bsf-card-tag {
    font-size: 11px; font-weight: 600; cursor: pointer;
    color: #2563eb; background: rgba(37,99,235,.08);
    border-radius: 999px; padding: 3px 9px;
    text-decoration: none; transition: opacity .2s;
}
.bsf-card-tag:hover { opacity: .75; }

.bsf-card-readmore { font-size: 13px; font-weight: 600; color: #2563eb; text-decoration: none; display: inline-block; }
.bsf-card-readmore:hover { text-decoration: underline; }

/* ── No results ────────────────────────────── */
.bsf-no-results { grid-column: 1/-1; text-align: center; padding: 48px 20px; color: #64748b; }
.bsf-no-results svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: .35; }
.bsf-no-results p { margin: 4px 0; }
.bsf-no-results strong { color: #1e293b; }

/* ── Pagination ────────────────────────────── */
.bsf-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.bsf-page-btn {
    min-width: 36px; height: 36px; padding: 0 10px;
    border: 1.5px solid #e2e8f0; border-radius: 8px;
    background: #fff; color: #1e293b;
    font-size: 14px; font-weight: 500; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.bsf-page-btn:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; }
.bsf-page-btn.active { border-color: #2563eb; background: #2563eb; color: #fff; }
.bsf-page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 600px) {
    .bsf-grid { grid-template-columns: 1fr; }
    .bsf-tag  { font-size: 12px; padding: 5px 11px; }
}
.bsf-wrap .bsf-tags .bsf-tag.active,
.bsf-wrap .bsf-tags .bsf-tag:hover {
    background-color: #ffbe0b !important;
    border-color: #ffbe0b !important;
    color: #0d0d0d !important;
}