/* ═══════════════════════════════════════════════════
 *  BB Filtered Posts — Front-End Styles
 *  v3.0.0 — RSS-based architecture
 *
 *  Supports both list and grid layouts.
 *  All styles use !important where needed to
 *  override Editoria theme defaults.
 * ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Root container ── */
.bb-fp-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    max-width: 100%;
}


/* ══════════════════════════════════
   SHARED
   ══════════════════════════════════ */

.bb-fp-heading {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.3rem 0;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #1a1a1a;
    letter-spacing: -0.01em;
}

.bb-fp-subheading {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin: 0 0 1.25rem 0;
}

.bb-fp-empty {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #999;
    text-align: center;
    padding: 2rem 1rem;
}

.bb-fp-error {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #c0392b;
    text-align: center;
    padding: 2.5rem 1rem;
}


/* ══════════════════════════════════
   LIST LAYOUT
   ══════════════════════════════════ */

.bb-fp-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 400px;
}

.bb-fp-list.bb-fp-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
}

.bb-fp-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: background-color 0.2s ease;
}
.bb-fp-item:last-child { border-bottom: none; }
.bb-fp-item:hover { background-color: rgba(0,0,0,0.015); }

.bb-fp-thumb-link {
    flex-shrink: 0;
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.bb-fp-thumb-link:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.bb-fp-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.bb-fp-no-thumb {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-fp-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #bbb;
}
.bb-fp-placeholder-icon svg { width: 100%; height: 100%; }

.bb-fp-content { flex: 1; min-width: 0; }

.bb-fp-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.15rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    flex-wrap: wrap;
}

.bb-fp-source { color: #666; }
.bb-fp-meta-sep { color: #ccc; }
.bb-fp-date { color: #999; font-weight: 400; }

/* Source badge (colored label like news aggregator) */
.bb-fp-source-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    color: #fff;
    line-height: 1.5;
    transition: filter 0.2s;
}

.bb-fp-item:hover .bb-fp-source-badge,
.bb-fp-card:hover .bb-fp-source-badge {
    filter: saturate(1);
}

.bb-fp-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 0.925rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.45;
    color: #1a1a1a;
    text-decoration: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}
.bb-fp-title:hover { color: #4D4D4D; }


/* ══════════════════════════════════
   GRID / CARD LAYOUT
   ══════════════════════════════════ */

.bb-fp-grid {
    display: grid;
    gap: 1.25rem;
    min-height: 400px;
}

.bb-fp-grid.bb-fp-grid-cols-1 { grid-template-columns: 1fr; }
.bb-fp-grid.bb-fp-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.bb-fp-grid.bb-fp-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.bb-fp-grid.bb-fp-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Card */
.bb-fp-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bb-fp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* Card image */
.bb-fp-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f5f5f5;
}

.bb-fp-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.bb-fp-card:hover .bb-fp-card-img {
    transform: scale(1.04);
}

.bb-fp-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
    color: #ccc;
}
.bb-fp-card-placeholder svg {
    width: 32px;
    height: 32px;
}

/* Card body */
.bb-fp-card-body {
    padding: 0.85rem 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}

/* Author row */
.bb-fp-card-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-bottom: 0.15rem;
}

.bb-fp-card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(0,0,0,0.08);
}

.bb-fp-card-source {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

.bb-fp-card-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    color: #bbb;
    text-align: center;
}

.bb-fp-card-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 0.88rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.bb-fp-card:hover .bb-fp-card-title {
    color: #4D4D4D;
}

.bb-fp-card-excerpt {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: #999;
    margin: 0.15rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ══════════════════════════════════
   FILTER BAR
   ══════════════════════════════════ */

.bb-fp-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.bb-fp-filter-toggles {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    flex: 1;
}

.bb-fp-wrapper .bb-fp-filter-toggles button.bb-fp-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1.5px solid transparent !important;
    border-radius: 5px;
    background: #fff !important;
    background-color: #fff !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    user-select: none;
}

.bb-fp-wrapper .bb-fp-filter-toggles button.bb-fp-filter-btn:hover,
.bb-fp-wrapper .bb-fp-filter-toggles button.bb-fp-filter-btn:focus {
    background: #1a1a1a !important;
    background-color: #1a1a1a !important;
    color: #fff !important;
    border-color: #1a1a1a !important;
}

.bb-fp-wrapper .bb-fp-filter-toggles button.bb-fp-filter-btn.active {
    color: #fff !important;
    font-weight: 700;
    background: #1a1a1a !important;
    background-color: #1a1a1a !important;
    border-color: #1a1a1a !important;
}

.bb-fp-wrapper .bb-fp-filter-toggles button.bb-fp-filter-btn.active:hover,
.bb-fp-wrapper .bb-fp-filter-toggles button.bb-fp-filter-btn.active:focus {
    color: #fff !important;
    background: #333 !important;
    background-color: #333 !important;
    border-color: #333 !important;
}

.bb-fp-filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bb-fp-filter-btn.active .bb-fp-filter-dot {
    width: 7px;
    height: 7px;
}

.bb-fp-search-wrap {
    position: relative;
    width: 200px;
}

.bb-fp-search {
    width: 100%;
    padding: 0.4rem 0.7rem 0.4rem 2rem;
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease;
}

.bb-fp-search:focus {
    border-color: rgba(0,0,0,0.2);
}

.bb-fp-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #bbb;
    pointer-events: none;
}


/* ══════════════════════════════════
   NUMBERED PAGINATION
   ══════════════════════════════════ */

.bb-fp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.5rem 0 0.5rem;
}

.bb-fp-wrapper .bb-fp-pagination button.bb-fp-page-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #555 !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 2rem;
    text-align: center;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.bb-fp-wrapper .bb-fp-pagination button.bb-fp-page-btn:hover,
.bb-fp-wrapper .bb-fp-pagination button.bb-fp-page-btn:focus {
    background: #1a1a1a !important;
    background-color: #1a1a1a !important;
    border-color: #1a1a1a !important;
    color: #fff !important;
}

.bb-fp-wrapper .bb-fp-pagination button.bb-fp-page-btn.bb-fp-page-active {
    background: #1a1a1a !important;
    background-color: #1a1a1a !important;
    color: #fff !important;
    border-color: #1a1a1a !important;
    font-weight: 700;
}

.bb-fp-wrapper .bb-fp-pagination button.bb-fp-page-btn.bb-fp-page-active:hover,
.bb-fp-wrapper .bb-fp-pagination button.bb-fp-page-btn.bb-fp-page-active:focus {
    background: #333 !important;
    background-color: #333 !important;
    color: #fff !important;
}

.bb-fp-page-arrow {
    font-size: 1rem;
    padding: 0.35rem 0.55rem;
}

.bb-fp-page-ellipsis {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #999;
    padding: 0 0.15rem;
}


/* ══════════════════════════════════
   ARTICLE COUNT
   ══════════════════════════════════ */

.bb-fp-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    color: #bbb;
    text-align: right;
    padding: 0.5rem 0.75rem 0;
    letter-spacing: 0.02em;
}


/* ══════════════════════════════════
   LOADING SKELETON
   ══════════════════════════════════ */

.bb-fp-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bb-fp-skeleton-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.bb-fp-skeleton-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bb-fp-shimmer 1.5s infinite;
    flex-shrink: 0;
}

.bb-fp-skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bb-fp-skeleton-line {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bb-fp-shimmer 1.5s infinite;
}

.bb-fp-skeleton-line.short { width: 40%; }
.bb-fp-skeleton-line.long { width: 95%; }

/* Grid skeleton */
.bb-fp-skeleton-grid {
    display: grid;
    gap: 1.25rem;
}

.bb-fp-skeleton-card {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.bb-fp-skeleton-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bb-fp-shimmer 1.5s infinite;
}

.bb-fp-skeleton-card-body {
    padding: 0.85rem 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.bb-fp-skeleton-card-line {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bb-fp-shimmer 1.5s infinite;
}

.bb-fp-skeleton-card-line.short { width: 40%; }
.bb-fp-skeleton-card-line.long { width: 85%; }

@keyframes bb-fp-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ══════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════ */

@media (max-width: 1024px) {
    .bb-fp-grid.bb-fp-grid-cols-4,
    .bb-fp-skeleton-grid.bb-fp-grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
    .bb-fp-list.bb-fp-cols-2 { grid-template-columns: 1fr; }
    .bb-fp-grid.bb-fp-grid-cols-4,
    .bb-fp-grid.bb-fp-grid-cols-3,
    .bb-fp-skeleton-grid.bb-fp-grid-cols-4,
    .bb-fp-skeleton-grid.bb-fp-grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .bb-fp-grid.bb-fp-grid-cols-2,
    .bb-fp-skeleton-grid.bb-fp-grid-cols-2 { grid-template-columns: 1fr; }
    .bb-fp-thumb-link, .bb-fp-thumb { width: 48px; height: 48px; }
    .bb-fp-title { font-size: 0.85rem; }
    .bb-fp-heading { font-size: 1.15rem; }
    .bb-fp-card-title { font-size: 0.8rem; }

    .bb-fp-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .bb-fp-search-wrap {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .bb-fp-grid.bb-fp-grid-cols-4,
    .bb-fp-grid.bb-fp-grid-cols-3,
    .bb-fp-grid.bb-fp-grid-cols-2,
    .bb-fp-skeleton-grid.bb-fp-grid-cols-4,
    .bb-fp-skeleton-grid.bb-fp-grid-cols-3,
    .bb-fp-skeleton-grid.bb-fp-grid-cols-2 { grid-template-columns: 1fr; }
}
