/* Posts list */
:root {
    --primary-post-card-shadow: rgba(0, 0, 0, 0.6);
    --light-green-bg: #f0fdf4;
}

/* Navigation Bar Styles */
.post-navbar {
    background: var(--primary-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Added a subtle shadow */
}

.post-navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
}

/* Add this to your posts.css file or create a new search.css and link it */

.search-group {
    position: relative; /* Essential for positioning the dropdown */
}

.search-dropdown {
    position: absolute;
    top: 100%; /* Position below the search input */
    left: 0;
    width: 100%; /* Make it span the width of the search input */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Ensure it's above other content */
    display: none; /* Hidden by default */
    max-height: 300px; /* Limit height and add scroll if many results */
    overflow-y: auto;
    margin-top: 5px; /* Small gap between input and dropdown */
}

.search-dropdown-item {
    font-size: 1.4rem;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item:hover {
    background-color: #f0f0f0;
    color: #007bff;
}

/* Ensure the search input and button are well-aligned */
.post-navbar-search {
    display: flex;
    align-items: center;
    width: 100%; /* Adjust as needed */
    max-width: 400px; /* Example max width */
}

.post-navbar-search .form-control {
    flex-grow: 1;
    margin-right: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .post-navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-navbar-search {
        margin-top: 10px;
        width: 100%;
        max-width: none; /* Remove max-width on smaller screens */
    }

    .search-dropdown {
        left: 0;
        right: 0;
        width: auto; /* Adjust width for full responsiveness */
    }
}



/* Container for centering content */

.posts-container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Navigation Bar Styles */
.post-navbar {
    background: var(--primary-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Added a subtle shadow */
}

.post-navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-navbar-brand {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.form-control, .form-select {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    font-size: 1.6rem;
}
/* ...existing code... */

.search-group {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 0.5rem;
    padding: 0.15rem 0.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

#searchInput {
    margin: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex: 1 1 auto;
    min-width: 0;
    color: #fff;
    background-color: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 1.6rem;
    padding: 0.5rem 1rem;
    height: 40px;
}

#searchInput:focus {
    outline: none;
    box-shadow: none;
    border-color: #80bdff;
    background-color: rgba(255,255,255,0.3);
}

.btn-search {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: #007bff;
    color: #fff;
    border: 1px solid #007bff;
    border-left: none;
    cursor: pointer;
    font-size: 1.6rem;
    height: 40px;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
}

.btn-search:hover {
    background: #0056b3;
    border-color: #0056b3;
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.filter-container {
    display: flex;
    gap: 1rem;
    align-items: center;;
    margin-bottom: 2rem;
}

.filter-select {
    min-width: 180px;
}

/* Card Styles */
.post-card {
    height: 100%;
    background-color: #fff;
    border: none;
    border-radius: 1rem;
    box-shadow: 2px 2px 16px var(--primary-post-card-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 2px 8px 32px var(--primary-post-card-shadow);
}

.post-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

@media (max-width: 768px) {
    .post-card-img {
        height: 160px;
        border-top-left-radius: 0.75rem;
        border-top-right-radius: 0.75rem;
    }
}

@media (max-width: 480px) {
    .post-card-img {
        height: 120px;
        border-top-left-radius: 0.5rem;
        border-top-right-radius: 0.5rem;
    }
}

.post-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.post-card-title {
    font-size: 1.7rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.post-card-text {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-card-footer {
    font-size: 1.6rem;
    padding: 1rem 1.5rem;
    background-color: transparent;
    text-align: right;
    border-top: 1px solid #f3f4f6; /* Lighter border */
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    border-radius: 0.25rem;
    background-color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* New: Styles for multiple tags */
.post-tags {
    margin-bottom: 1rem;
}

.post-tags .badge {
    margin-right: 0.5rem; /* Space between tags */
    margin-bottom: 0.5rem;
}

.post-meta {
    font-size: 1.4rem;
    color: #6c757d;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}


/* Button Styles */
.btn-read-more {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: var(--primary-color);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid var(--primary-color);
    padding: 0.375rem 0.75rem;
    font-size: 1.6rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.btn-read-more:hover {
    color: #fff;
    background-color: var(--primary-color);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    padding-left: 0;
    list-style: none;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.page-item .page-link {
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--primary-color);
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
    font-size: 1.6rem;
}

.page-item:first-child .page-link { border-radius: 0.25rem 0 0 0.25rem; }
.page-item:last-child .page-link { border-radius: 0 0.25rem 0.25rem 0; }

.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}   



/* Basic media queries for mobile and tablet */
@media (max-width: 768px) {
}

@media (max-width: 480px) {
    .filter-select {
        min-width: 120px;
    }

    .post-navbar-brand{
        text-align: center ;
        font-size: 1.5rem;
    }
    .posts-container {
        padding-left: 5px;
        padding-right: 5px;
    }
}