/**
 * Search Results Page Styles
 */

/* Container */
.search-results-container {
    max-width: var(--container-width, 1280px);
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* Header */
.search-header {
    margin-bottom: 2rem;
}

.search-title {
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.search-count {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

/* Search Form */
.search-form-wrapper {
    margin-bottom: 1.5rem;
}

.search-results-form .search-input-group {
    display: flex;
    max-width: 600px;
}

.search-results-form .search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px 0 0 6px;
    font-size: 1rem;
    font-family: inherit;
}

.search-results-form .search-field:focus {
    outline: none;
    border-color: var(--color-primary, #2563eb);
}

.search-results-form .search-submit {
    padding: 0.75rem 1.5rem;
    background: var(--color-primary, #2563eb);
    color: #fff;
    border: 1px solid var(--color-primary, #2563eb);
    border-left: none;
    border-radius: 0 6px 6px 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-results-form .search-submit:hover {
    background: var(--color-primary-dark, #1d4ed8);
}

/* Sort Controls */
.search-controls {
    margin-bottom: 1rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-right: 0.5rem;
}

.sort-btn {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    background: #e5e7eb;
}

.sort-btn.active {
    background: var(--color-primary, #2563eb);
    color: #fff;
}

/* Post Type Tabs */
.search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.search-tab {
    padding: 0.5rem 1rem;
    color: var(--color-primary, #2563eb);
    text-decoration: none;
    font-size: 0.938rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-tab:hover {
    color: var(--color-primary-dark, #1d4ed8);
}

.search-tab.active {
    color: var(--color-primary, #2563eb);
    border-bottom-color: var(--color-primary, #2563eb);
}

/* Results Grid */
.search-results-grid {
    margin-bottom: 3rem;
}

/* Result Card */
.search-result-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #ffffff;
    transition: all var(--transition-speed, 0.3s) ease;
    height: 100%;
}

.search-result-card.has-border {
    border: 1px solid #e5e7eb;
}

.search-result-card.rounded {
    border-radius: 8px;
}

.search-result-card.has-shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.search-result-card.has-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.08);
}

/* Card Media */
.search-card-media {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    overflow: hidden;
    background-color: #f3f4f6;
}

.search-card-media a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.search-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform var(--transition-speed, 0.3s) ease;
}

.search-result-card.has-hover:hover .search-card-image {
    transform: scale(1.05);
}

/* Post Type Label */
.search-card-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 1;
}

.search-card-label-only {
    padding: 0.75rem;
}

.search-card-label-only .search-card-label {
    position: static;
    display: inline-block;
}

/* Card Body */
.search-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.search-card-title {
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.search-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed, 0.3s) ease;
}

.search-card-title a:hover {
    color: var(--color-primary, #2563eb);
}

.search-card-date {
    font-size: 0.813rem;
    color: #6b7280;
    margin: 0 0 0.75rem 0;
}

.search-card-excerpt {
    font-size: 0.938rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    color: inherit;
    opacity: 0.9;
}

/* Card Footer */
.search-card-footer {
    margin-top: auto;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 0.938rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-pagination .page-numbers:hover {
    border-color: var(--color-primary, #2563eb);
    color: var(--color-primary, #2563eb);
}

.search-pagination .page-numbers.current {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary, #2563eb);
    color: #fff;
}

.search-pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* No Results */
.search-no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: #f9fafb;
    border-radius: 12px;
}

.search-no-results h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
}

.search-no-results p {
    color: #6b7280;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .search-title {
        font-size: 1.5rem;
    }

    .search-results-form .search-input-group {
        flex-direction: column;
    }

    .search-results-form .search-field {
        border-radius: 6px;
        margin-bottom: 0.5rem;
    }

    .search-results-form .search-submit {
        border-radius: 6px;
        border-left: 1px solid var(--color-primary, #2563eb);
    }

    .sort-controls {
        flex-wrap: wrap;
    }

    .search-tabs {
        gap: 0.25rem;
    }

    .search-tab {
        padding: 0.375rem 0.75rem;
        font-size: 0.813rem;
    }

    .search-card-title {
        font-size: 1rem;
    }

    .search-card-body {
        padding: 1.25rem;
    }
}

/* Print Styles */
@media print {
    .search-form-wrapper,
    .search-controls,
    .search-tabs,
    .search-pagination,
    .search-card-footer {
        display: none;
    }

    .search-result-card {
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* Disable animations if requested */
.disable-animations .search-result-card,
.disable-animations .search-card-image {
    transition: none !important;
}

.disable-animations .search-result-card.has-hover:hover {
    transform: none;
}

.disable-animations .search-result-card.has-hover:hover .search-card-image {
    transform: none;
}
