/* /search/ - site-wide search results, grouped by content type. Plain
   line-text rows (no card/box chrome) with a divider between results,
   large enough type to read as the page's primary content rather than
   a secondary list. Shares tokens with account.css/topics-tree.css
   instead of introducing new colors/radii/timings. */

.search-results-page {
    max-width: 820px;
}

.search-section {
    margin-bottom: 40px;
}

.search-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-navy, #0f3c58);
    margin-bottom: 6px;
}

/* Topic matches are grouped by top-level category (Сандар, Пропорция, ...)
   so the page reads as sectioned topics, not one flat undifferentiated
   list - same idea as /topics/, just limited to what matched the query. */
.search-category-group {
    margin-top: 28px;
}
.search-category-group:first-of-type {
    margin-top: 12px;
}

.search-category-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.search-result-list {
    display: flex;
    flex-direction: column;
}

.search-result-row {
    display: block;
    padding: 18px 4px;
    border-bottom: 1px solid var(--border-subtle, #e6ebf1);
    text-decoration: none;
    transition: background-color var(--transition-fast, 150ms ease);
}

.search-result-list .search-result-row:first-child {
    border-top: 1px solid var(--border-subtle, #e6ebf1);
}

.search-result-row:hover,
.search-result-row:focus-visible {
    background-color: var(--surface-alt, #f8f7f4);
}

.search-result-breadcrumb {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 4px;
}

.search-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-navy, #0f3c58);
}

.search-result-grade {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
    vertical-align: 2px;
    color: var(--text-muted, #475569);
    border: 1px solid var(--border-subtle, #e6ebf1);
    border-radius: 999px;
}

.search-grade-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
}

.search-grade-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-subtle, #e6ebf1);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--text, #1a1a2e);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition-fast, 150ms ease), color var(--transition-fast, 150ms ease);
}

.search-grade-chip:hover,
.search-grade-chip:focus-visible {
    background: var(--surface-alt, #f8f7f4);
    color: var(--text, #1a1a2e);
}

.search-grade-chip.is-active {
    background: var(--color-menu-active, #e5f2ff);
    border-color: var(--color-navy, #0f3c58);
    color: var(--text, #1a1a2e);
}

.search-grade-chip__count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #475569);
}

.search-result-snippet {
    margin-top: 6px;
    font-size: 1rem;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    .search-result-row,
    .search-grade-chip {
        transition: none;
    }
}

/* Class pages (/4-klass/): one line pointing to the test maker. */
.grade-page-cta {
    margin: 0 0 28px;
    color: var(--text-muted, #475569);
}

.grade-page-cta a {
    font-weight: 600;
    color: var(--color-navy, #0f3c58);
}
