/* Main Container */
.bfg-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: Arial, sans-serif;
}

/* Top Row: Sort and Search */
.bfg-top-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
	justify-content:space-between;
}

/* Sort Group - Label and Dropdown in Same Line */
.bfg-sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bfg-sort-label {
    font-size: 14px;
    font-weight: 600;
    color: #0f2a47;
    white-space: nowrap;
}

/* Improved Dropdown UI */
.bfg-sort {
    padding: 10px 35px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #0f2a47;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    min-width: 180px;
}

.bfg-sort:hover {
    border-color: #1472ba;
}

.bfg-sort:focus {
    outline: none;
    border-color: #1472ba;
    box-shadow: 0 0 0 3px rgba(20, 114, 186, 0.1);
}

/* Search Group */
.bfg-search-group {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 450px;
}

.bfg-search-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.bfg-search-group input:focus {
    outline: none;
    border-color: #1472ba;
    box-shadow: 0 0 0 3px rgba(20, 114, 186, 0.1);
}

.bfg-search-results {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.bfg-search-results div {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bfg-search-results div:hover {
    background: #f6f6f6;
}

.bfg-search-results div:last-child {
    border-bottom: none;
}

/* Category Menu Row - Inline buttons */
.bfg-category-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.bfg-cat-btn {
    padding: 10px 18px;
    border: 1px solid #ddd!important;
    background: #fff;
    color: #0f2a47;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    outline: none;
    transition: none;
    box-sizing: border-box;
}

.bfg-cat-btn:hover {
    background: #fff;
    border: 1px solid #ddd!important;
    color: #0f2a47;
    outline: none;
}

.bfg-cat-btn:focus {
    outline: none;
    border: 1px solid #ddd!important;
    background: #fff;
    color: #0f2a47;
}

.bfg-cat-btn:active {
    outline: none;
    border: 1px solid #ddd!important;
    background: #fff;
    color: #0f2a47;
}

.bfg-cat-btn.active {
    background: #1472ba;
    color: #fff;
    border: 1px solid #1472ba;
    font-weight: 600;
}

.bfg-cat-btn.active:hover {
    background: #1472ba;
    color: #fff;
    border-color: #1472ba;
    outline: none;
}

.bfg-cat-btn.active:focus {
    border: 1px solid #1472ba;
    background: #1472ba;
    color: #fff;
    outline: none;
}

.bfg-cat-btn.active:active {
    border: 1px solid #1472ba;
    background: #1472ba;
    color: #fff;
    outline: none;
}

/* Grid Layout */
.bfg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 991px) {
    .bfg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .bfg-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Blog Card */
.bfg-card {
    border: 1px solid #e8e8e8;
    padding: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
    overflow: hidden;
}

.bfg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.bfg-card-image {
    width: 100%;
    height: 190px;
    overflow: hidden;
    background: #f8f8f8;
    border-radius: 12px 12px 0 0;
}

.bfg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.bfg-placeholder-image {
    width: 100%;
    height: 100%;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.bfg-card-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    flex: 1;
}

.bfg-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f2a47;
    line-height: 1.3;
    margin: 0 0 12px 0;
    min-height: 50px;
    max-height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bfg-card h3 a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.bfg-card h3 a:hover {
    color: #123456;
}

.bfg-meta {
    font-size: 13px;
    color: #777;
    margin: 0 0 12px 0;
    min-height: 20px;
    line-height: 1.4;
}

.bfg-excerpt {
    font-size: 14px;
    color: #77899c;
    line-height: 1.5;
    margin: 0 0 12px 0;
    min-height: 60px;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.bfg-read-time {
    font-size: 13px;
    color: #fff;
    background: #1472ba;
    padding: 5px 12px;
    border-radius: 6px;
    margin: 0 0 12px 0;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.bfg-read-more {
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: #1472ba;
    text-decoration: none;
    display: inline-block;
    padding-top: 8px;
}

.bfg-read-more:hover {
    color: #0f5a94;
}

/* Load More Button */
.bfg-load {
    margin: 30px auto 0;
    display: block;
    padding: 12px 24px;
    border: none;
    background: #1472ba;
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.bfg-load:hover {
    background: #0f5a94;
}

/* Loading Indicator */
.bfg-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #1472ba;
    font-weight: 600;
}

.bfg-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1472ba;
    border-radius: 50%;
    animation: bfg-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes bfg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spacer for appended content */
.bfg-grid-spacer {
    grid-column: 1 / -1;
    height: 30px;
    margin: 0;
}
