/* --- 1. General Container Layout (Flexbox for Filter & Grid) --- */
.mobf-container {
    display: flex;
    gap: 30px; /* Space between sidebar and main content */
    padding: 20px 0;
}

.mobf-sidebar {
    /* Fixed width for the vertical category list on large screens */
    flex: 0 0 200px; 
}

.mobf-main-content {
    flex-grow: 1; /* Takes up the rest of the space */
}

/* --- 2. Vertical Category Filters (Sidebar) --- */
.mobf-sidebar h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.mobf-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobf-categories li {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.95em;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.mobf-categories li:hover {
    background-color: #f4f4f4;
}

.mobf-categories li.active {
    /* Use your site's primary color here */
    background-color: #0073aa; 
    color: white;
    font-weight: bold;
}


/* --- 3. Top Sorting Filters --- */
.mobf-top-filters {
    display: flex;
    justify-content: flex-end; /* Pushes the filter to the far right */
    align-items: center;
    margin-bottom: 25px;
}

#mobf-sort {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-left: 10px;
}


/* --- 4. The Card Grid Layout (CSS Grid) --- */
#mobf-post-grid {
    display: grid;
    /* Create a responsive 3-column layout */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px;
}

/* --- 5. Individual Post Cards (The "Card" Look) --- */
.mobf-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden; /* Keeps the image corners clean */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); /* Subtle lift effect */
    transition: box-shadow 0.3s ease-in-out;
    background-color: white;
    display: flex; /* Flex on the card contents */
    flex-direction: column;
}

.mobf-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.mobf-card img {
    /* Ensures the image fills the card width */
    width: 100%;
    /* Ensures consistent image height (adjust as needed) */
    height: 180px; 
    object-fit: cover;
    display: block;
}

.mobf-card h4 {
    font-size: 1.1em;
    margin: 15px 15px 5px;
    line-height: 1.4;
}

.mobf-card h4 a {
    text-decoration: none;
    color: #333;
}

.mobf-card p {
    font-size: 0.9em;
    color: #666;
    padding: 0 15px 15px;
    margin: 0;
    /* Ensures the excerpt space is used well */
    flex-grow: 1; 
}


/* --- 6. Loading State and Mobile Responsiveness --- */
.mobf-loading {
    grid-column: 1 / -1; /* Center loading message across all columns */
    text-align: center;
    padding: 50px 0;
    font-size: 1.2em;
    color: #aaa;
}

@media (max-width: 900px) {
    .mobf-container {
        flex-direction: column; /* Stack filters and grid vertically on small screens */
        gap: 0;
    }

    .mobf-sidebar {
        /* Full width for categories, pushed to the top */
        flex: 0 0 auto; 
        margin-bottom: 20px;
        border-bottom: 1px solid #ccc;
        padding-bottom: 15px;
    }
    
    .mobf-sidebar h3 {
        padding-left: 10px;
    }

    .mobf-categories {
        /* Optional: Display categories horizontally on small screens */
        display: flex;
        flex-wrap: wrap;
        padding: 0 10px;
    }

    .mobf-categories li {
        margin-right: 8px;
        margin-bottom: 8px;
        padding: 6px 10px;
        font-size: 0.85em;
    }
}