/* ==========================================================================
   SEARCH RESULTS STYLING - List Format with Preview
   ========================================================================== */

/* Two-column layout with sidebar */
.site-content-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 40px;
}

#primary.content-area {
    flex: 1;
    min-width: 0; /* Allows flex item to shrink below content size */
}

.widget-area {
    width: 300px;
    flex-shrink: 0;
}

/* Search header */
.search-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.search-header .page-title {
    font-size: 2rem;
    color: #2c2c2c;
    margin: 0;
}

.search-query {
    color: #d2691e;
    font-style: italic;
}

/* Search results list container */
.search-results-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Individual search result item */
.search-result-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #d2691e;
}

/* Result content wrapper */
.search-result-content {
    padding: 20px;
}

/* Result header */
.search-result-header {
    margin-bottom: 12px;
}

.title-with-score {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.search-result-title {
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    min-width: 200px;
}

.search-result-title a {
    color: #2c2c2c;
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-result-title a:hover {
    color: #d2691e;
}

/* Large semantic score badge next to title */
.semantic-score-badge-large {
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Result metadata */
.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 0.875rem;
}

.post-type-badge {
    background-color: #8db4aa;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Semantic score badge */
.semantic-score-badge {
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.author-age {
    background-color: #d2691e !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.post-date,
.post-author {
    color: #666;
}

.post-date::before,
.post-author::before {
    content: "•";
    margin-right: 8px;
    margin-left: 2px;
    color: #999;
}

/* Result excerpt/preview */
.search-result-excerpt {
    color: #444;
    line-height: 1.6;
    margin: 15px 0;
    font-size: 1rem;
}

.search-result-excerpt p {
    margin: 0;
}

/* Result footer */
.search-result-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.read-more-link {
    color: #d2691e;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.read-more-link:hover {
    color: #b8571a;
    transform: translateX(3px);
}

/* No results section */
.no-results {
    background: #f8f8f8;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    margin: 30px 0;
}

.no-results .page-title {
    color: #666;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.no-results .page-content {
    max-width: 600px;
    margin: 0 auto;
}

.no-results .page-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    margin: 40px 0;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination a,
.pagination .current {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #2c2c2c;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: #d2691e;
    color: white;
    border-color: #d2691e;
}

.pagination .current {
    background-color: #d2691e;
    color: white;
    border-color: #d2691e;
}

/* Responsive design */
@media (max-width: 768px) {
    .site-content-wrapper {
        flex-direction: column;
        padding: 20px 15px;
        gap: 30px;
    }

    .widget-area {
        width: 100%;
        order: 2; /* Move sidebar below content on mobile */
    }

    .search-header .page-title {
        font-size: 1.5rem;
    }

    .search-result-content {
        padding: 15px;
    }

    .search-result-title {
        font-size: 1.25rem;
    }

    .title-with-score {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .semantic-score-badge-large {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .search-result-meta {
        font-size: 0.8rem;
        gap: 8px;
    }

    .search-result-excerpt {
        font-size: 0.95rem;
    }

    .no-results {
        padding: 30px 20px;
    }
}

/* Integration with semantic search notice */
.ssss-search-enhancement-notice {
    margin-bottom: 30px !important;
}

/* Custom post type colors */
.search-result-item.post-type-story .post-type-badge {
    background-color: #d2691e;
}

.search-result-item.post-type-poem .post-type-badge {
    background-color: #8db4aa;
}

.search-result-item.post-type-review .post-type-badge {
    background-color: #cd853f;
}

.search-result-item.post-type-art .post-type-badge {
    background-color: #9db09d;
}
