/**
 * PROJECT SEARCH SYSTEM: TOTAL UI STYLESHEET
 * Theme: Community Reporter (Pink/Purple: #cc238d)
 */

/* ==========================================================================
   1. Main Layout & Scoping
   ========================================================================== */
.project-search-main-container {
    margin-top: 2.5rem;
    clear: both;
}

/* ==========================================================================
   2. Facet / Category Filters (The Pills)
   ========================================================================== */
.project-search-facets-wrapper {
    margin-bottom: 2rem;
}

/* Facet Headers - MUST BE VISIBLE */
.project-search-facets-wrapper h2,
.project-search-facets-wrapper .facets-widget-title {
    display: block !important;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px !important;
    color: #333;
    text-transform: none;
}

/* Pill List Alignment */
.project-search-facets-wrapper ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-search-facets-wrapper ul li {
    margin: 0 !important;
    padding: 0 !important;
}

/* The Individual Pill */
.project-search-facets-wrapper .facet-item a {
    display: inline-block;
    padding: 8px 18px;
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid #e2e8f0;
}

.project-search-facets-wrapper .facet-item a:hover {
    border-color: #cc238d;
    color: #cc238d;
}

/* The Selected/Active Pill */
.project-search-facets-wrapper .facet-item.is-active a {
    background: #cc238d !important;
    color: #ffffff !important;
    border-color: #cc238d !important;
    box-shadow: 0 4px 6px rgba(204, 35, 141, 0.2);
}

/* Clean up facet counts */
.project-search-facets-wrapper .facet-item__count {
    display: none;
}

/* ==========================================================================
   3. Inline Search Form (Pixel-Perfect Alignment)
   ========================================================================== */

/* The Search Bar Container */
.project-search-results-wrapper .views-exposed-form {
    margin-bottom: 3rem;
}

/* Force Flex Row and Vertical Centering */
.project-search-results-wrapper .views-exposed-form .form--inline {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important; /* Forces input and button onto the same center line */
    justify-content: flex-start;
    gap: 12px;
    background: #fdfdfd;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
}

/* HIDE THE SEARCH LABEL (Targeted) */
.project-search-results-wrapper .form-item-search-api-fulltext label {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
}

/* Normalize the Search Input Wrapper */
.project-search-results-wrapper .form-item-search-api-fulltext {
    margin: 0 !important;
    padding: 0 !important;
    flex-grow: 1;
    max-width: 450px;
}

/* The Search Input (Pill Shape) */
.project-search-results-wrapper input[id^="edit-search-api-fulltext"] {
    display: block;
    width: 100%;
    height: 46px !important; /* Explicit height matching button */
    line-height: 46px !important;
    padding: 0 20px !important;
    margin: 0 !important;
    border-radius: 50px !important;
    border: 1px solid #ccc !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
}

/* Normalize Button Container */
.project-search-results-wrapper .form-actions {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
}

/* The Apply Button (Small Pill) */
.project-search-results-wrapper .form-actions input[type="submit"] {
    height: 46px !important; /* Matches input exactly */
    line-height: 46px !important;
    padding: 0 30px !important;
    margin: 0 !important;
    border-radius: 50px !important;
    background-color: #cc238d !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase;
    border: none !important;
    cursor: pointer;
    box-sizing: border-box !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.project-search-results-wrapper .form-actions input[type="submit"]:hover {
    background-color: #a31c71 !important;
}

/* ==========================================================================
   4. The Card Grid (Responsive 3-Column)
   ========================================================================== */
.project-search-results-wrapper .view-content {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 30px;
}

/* Tablet: 2 Columns */
@media (min-width: 768px) {
    .project-search-results-wrapper .view-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 Columns */
@media (min-width: 1200px) {
    .project-search-results-wrapper .view-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   5. Search State Visuals (Optional)
   ========================================================================== */

/* Hide empty facet containers to prevent awkward whitespace */
.project-search-facets-wrapper:empty {
    display: none;
}
