/*
 * NexCore Starter Theme
 * Search
 * Version: 1.0.0
 * ============================================================================
 */

/* ==========================================================================
   1. Search Form
   ========================================================================== */

.search-page > .container > .breadcrumbs {
    margin-bottom: 2rem;
}

.search-page__form {
    max-width: 760px;
}

.search-page__form form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.search-page__form input {
    width: 100%;
    min-width: 0;
}


/* ==========================================================================
   2. Search Summary
   ========================================================================== */

.search-page__summary {
    margin-top: 2rem;
}

.search-page__summary p {
    margin: 0;
    color: var(--color-text-muted);
}

.search-page__summary strong {
    color: var(--color-text);
}


/* ==========================================================================
   3. Results Grid
   ========================================================================== */

/*
 * Search owns its grid configuration.
 *
 * It deliberately does not inherit the homepage Articles section column
 * setting. Homepage content can therefore change independently without
 * unexpectedly changing the Search archive.
 */

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    margin-top: 2rem;
}


/* ==========================================================================
   4. Result Card
   ========================================================================== */

/*
 * Search cards follow the same visual language as the Starter theme's
 * article cards while remaining a separate component because Search can
 * contain both Pages and Articles.
 */

.search-result-card {
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;

    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);

    background: var(--color-background);

    box-shadow: 0 2px 8px rgba(23, 32, 51, 0.04);

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.search-result-card:hover {
    transform: translateY(-3px);
    border-color: rgba(35, 87, 216, 0.25);
    box-shadow: var(--shadow-small);
}

.search-result-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.5rem;
}

.search-result-card__type {
    display: block;
    margin-bottom: 0.75rem;

    color: var(--color-text-muted);

    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.5;

    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.search-result-card__title {
    margin: 0;

    font-size: clamp(1.25rem, 2vw, 1.5rem);
    line-height: 1.3;
}

.search-result-card__title a {
    color: inherit;
    text-decoration: none;
}

.search-result-card__title a:hover {
    color: var(--color-primary);
}

.search-result-card__excerpt {
    margin: 0.85rem 0 0;

    color: var(--color-text-muted);

    line-height: 1.7;
}

.search-result-card__actions {
    margin-top: auto;
    padding-top: 1.5rem;
}

.search-result-card__actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    color: var(--color-primary);

    font-weight: 700;
    text-decoration: none;
}

.search-result-card__actions a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ==========================================================================
   5. Pagination
   ========================================================================== */

.search-page__pagination {
    margin-top: 2.5rem;
}


/* ==========================================================================
   6. Responsive Layout
   ========================================================================== */

@media (max-width: 1000px) {
    .search-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .search-page__form form {
        grid-template-columns: 1fr;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-result-card__content {
        padding: 1.25rem;
    }

    .search-result-card__actions {
        padding-top: 1.25rem;
    }
}