/**
 * Search Results Component Styles
 *
 * Styles for the search results page
 */

/* Main container padding */
.site-main.homepage-content {
    padding-top: 40px; /* Add top padding to create space between header and content */
}

/* Search Header */
.search-header {
    margin-bottom: 40px; /* Increased margin */
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border-primary);
}

.search-title {
    margin-top: 0;
    margin-bottom: 30px; /* Increased margin */
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.search-query {
    color: var(--color-brand-primary);
}

/* Search Filters - Enhanced professional styling */
.search-filters {
    padding: 20px; /* More generous padding */
    background-color: var(--color-background-secondary); /* Softer background */
    border-radius: 6px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    border: 1px solid var(--color-border-primary);
}

.search-filter-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Spread elements evenly */
    align-items: center;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-weight: 600; /* More pronounced */
    color: var(--color-text-primary); /* Darker text for better contrast */
    font-size: 15px;
}

.search-sort-select {
    padding: 10px 14px; /* Larger clickable area */
    border: 1px solid var(--color-border-primary);
    border-radius: 4px;
    background-color: var(--color-background-primary);
    color: var(--color-text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    cursor: pointer;
    min-width: 160px; /* Ensure consistent width */
}

.filter-apply-button {
    padding: 10px 16px; /* Larger button */
    background-color: var(--color-brand-primary);
    color: black;
    border: none;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.filter-apply-button:hover {
    background-color: var(--color-brand-secondary);
    transform: translateY(-1px); /* Subtle lift effect */
}

.filter-apply-button:active {
    transform: translateY(1px); /* Press effect */
}

/* Search Results Count */
.search-result-count {
    margin-bottom: 25px;
    font-size: 16px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Search Results Grid */
.search-results-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px; /* Added space above results */
}

/* Search Result Article */
.search-result-article {
    padding: 24px; /* More generous padding */
    border-radius: 6px;
    background-color: var(--color-background-secondary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-inner {
    display: grid;
    grid-template-columns: 1fr 280px; /* Increased thumbnail column width */
    gap: 24px; /* Increased gap */
    align-items: center; /* Center alignment for better text-image alignment */
}

/* Search Result Category - Styled like article-primary-category */
.search-result-category {
    margin-bottom: 12px;
}

.search-result-category a {
    display: inline-block;
    text-decoration: none;
    color: #333; /* Darker text for better contrast */
    background-color: #a5c6e5; /* Soft blue from Bloomberg style */
    font-weight: 600;
    font-family: 'Arial', sans-serif;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.9rem;
    border-radius: 3px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-result-category a:hover {
    background-color: #8bb5d9; /* Slightly darker shade when hovered */
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Category color variations based on category name */
.search-result-category a[href*="markets"],
.search-result-category a[href*="economy"] {
    background-color: #a5c6e5; /* Soft blue for markets/economy */
}

.search-result-category a[href*="business"],
.search-result-category a[href*="companies"] {
    background-color: #8da9c4; /* Muted blue-gray for business */
}

.search-result-category a[href*="politics"],
.search-result-category a[href*="policy"] {
    background-color: #b4a7d6; /* Soft lavender for politics */
}

.search-result-category a[href*="technology"],
.search-result-category a[href*="tech"] {
    background-color: #a8d8b9; /* Soft mint green for technology */
}

.search-result-category a[href*="opinion"],
.search-result-category a[href*="analysis"] {
    background-color: #e6b1b1; /* Soft rose for opinion/analysis */
}

.search-result-category a[href*="finance"] {
    background-color: #d4e5b7; /* Soft sage green */
}

.search-result-category a[href*="health"] {
    background-color: #c9e7dc; /* Soft aqua */
}

.search-result-category a[href*="world"] {
    background-color: #f5d493; /* Soft gold */
}

.search-result-category a[href*="culture"] {
    background-color: #f4c7ab; /* Soft peach */
}

/* Search Result Title */
.search-result-title {
    margin-top: 0;
    margin-bottom: 14px; /* Slightly increased */
    font-size: 22px; /* Slightly larger */
    font-weight: 600;
    line-height: 1.3;
}

.search-result-title a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-result-title a:hover {
    color: var(--color-brand-primary);
}

/* Search Result Meta */
.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.search-result-byline {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

/* Author match styling */
.search-result-byline.author-match {
    font-weight: 500;
    position: relative;
}

.author-match-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: var(--color-brand-primary);
    color: black;
    border-radius: 50%;
    font-size: 10px;
    margin-left: 5px;
    font-weight: bold;
}

/* Search Result Excerpt */
.search-result-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

/* Search Result Thumbnail */
.search-result-thumbnail {
    width: 280px; /* Increased width */
    height: 180px; /* Increased height to fill about 80% of result height */
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Added subtle shadow */
}

.search-result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-image:hover {
    transform: scale(1.05);
}

/* Search Highlight */
.search-highlight {
    background-color: rgba(252, 208, 10, 0.3);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* Pagination */
.search-pagination {
    margin: 50px 0; /* Increased margin */
    text-align: center;
}

.search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; /* Larger buttons */
    height: 40px; /* Larger buttons */
    padding: 0 10px;
    background-color: var(--color-background-tertiary);
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 15px;
    margin: 0 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-pagination .page-numbers.current {
    background-color: var(--color-brand-primary);
    color: var(--color-background-dark);
    font-weight: 600;
}

.search-pagination .page-numbers:hover:not(.current) {
    background-color: var(--color-border-primary);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 70px 30px; /* More generous padding */
    background-color: var(--color-background-tertiary);
    border-radius: 6px;
    margin-top: 20px;
}

.no-results h2 {
    margin-bottom: 20px;
    font-size: 26px;
    color: var(--color-text-primary);
}

.no-results p {
    color: var(--color-text-secondary);
    font-size: 17px;
    max-width: 600px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .search-result-inner {
        grid-template-columns: 1fr 220px; /* Slightly smaller on medium screens */
    }
    
    .search-result-thumbnail {
        width: 220px;
        height: 160px;
    }
}

@media (max-width: 768px) {
    .search-result-inner {
        grid-template-columns: 1fr;
    }
    
    .search-result-thumbnail {
        width: 100%;
        height: 220px; /* Taller on mobile for better visibility */
        order: -1;
        margin-bottom: 15px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .search-title {
        font-size: 24px;
    }
    
    .search-result-title {
        font-size: 18px;
    }
    
    .search-result-article {
        padding: 15px;
    }
    
    .search-result-thumbnail {
        height: 180px; /* Slightly smaller on very small screens */
    }
} 