/* Suchergebnisseite (Fragment redd/search-page.php) – UIkit-Stil der Website, Dark Mode wie die Spotlight-Suche */

.redd-search-page {
    --rsp-bg: transparent;
    --rsp-card: #fff;
    --rsp-fg: #1f2626;
    --rsp-muted: #5f6b6b;
    --rsp-line: #e3e8e8;
    --rsp-soft: #f3f6f6;
    --rsp-accent: #1d6f74;
    --rsp-accent-fg: #fff;
    --rsp-mark: rgba(245, 196, 0, 0.4);
    --rsp-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin: 30px 0 60px;
    color: var(--rsp-fg);
}

@media (prefers-color-scheme: dark) {
    .redd-search-page {
        --rsp-bg: #161b1b;
        --rsp-card: #1f2626;
        --rsp-fg: #e8eeee;
        --rsp-muted: #a3b0b0;
        --rsp-line: #34403f;
        --rsp-soft: #252d2d;
        --rsp-accent: #7fd0d5;
        --rsp-accent-fg: #102020;
        --rsp-mark: rgba(245, 196, 0, 0.35);
        --rsp-shadow: none;
        padding: 24px;
        border-radius: 14px;
        background: var(--rsp-bg);
    }
}

.redd-search-page__form { margin: 0; }

.redd-search-page .redd-search-page__heading {
    margin: 0 0 16px;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.2;
    color: var(--rsp-fg);
}

.redd-search-page__heading span { color: var(--rsp-accent); }

/* Suchfeld */
.redd-search-page__bar {
    position: relative;
    display: flex;
    gap: 8px;
    max-width: 860px;
    margin-bottom: 18px;
}

.redd-search-page__bar-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--rsp-muted);
    pointer-events: none;
}

.redd-search-page .redd-search-page__input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 16px 0 48px;
    border: 2px solid var(--rsp-line);
    border-radius: 10px;
    background: var(--rsp-card);
    color: var(--rsp-fg);
    font: inherit;
    font-size: 1.15rem;
}

.redd-search-page .redd-search-page__input:focus { border-color: var(--rsp-accent); outline: 3px solid #f5c400; outline-offset: 1px; }
.redd-search-page .redd-search-page__submit { height: 52px; border-radius: 10px; }

/* Typ-Reiter */
.redd-search-page__types { margin-bottom: 22px; border-bottom: 1px solid var(--rsp-line); }
.redd-search-page__types ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }

.redd-search-page__types a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1px;
    padding: 9px 14px;
    border-bottom: 3px solid transparent;
    color: var(--rsp-fg) !important;
    font-weight: 600;
    text-decoration: none !important;
}

.redd-search-page__types a:hover { border-bottom-color: var(--rsp-line); }
.redd-search-page__types a[aria-current="page"] { border-bottom-color: var(--rsp-accent); color: var(--rsp-accent) !important; }
.redd-search-page__types a.is-empty { color: var(--rsp-muted) !important; font-weight: 400; }

.redd-search-page__count {
    display: inline-block;
    min-width: 1.6em;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--rsp-soft);
    color: var(--rsp-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

.redd-search-page a:focus-visible,
.redd-search-page button:focus-visible,
.redd-search-page select:focus-visible { outline: 3px solid #f5c400; outline-offset: 2px; }

/* Raster: Filter links, Treffer rechts */
.redd-search-page__layout.has-filters {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 32px;
}

.redd-search-page__filters {
    align-self: start;
    position: sticky;
    top: 90px;
    padding: 16px;
    border: 1px solid var(--rsp-line);
    border-radius: 10px;
    background: var(--rsp-card);
}

.redd-search-page .redd-search-page__label {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rsp-muted);
}

.redd-search-page__filter { margin-bottom: 14px; }
.redd-search-page__filter label,
.redd-search-page__sort label { display: block; margin-bottom: 4px; font-size: 0.85rem; font-weight: 600; }
.redd-search-page select.uk-select { border-radius: 6px; background-color: var(--rsp-card); color: var(--rsp-fg); border-color: var(--rsp-line); }
.redd-search-page__reset { margin: 12px 0 0; font-size: 0.9rem; }

/* mit JavaScript schicken die Auswahlfelder selbst ab */
.redd-search-page__form.is-enhanced .redd-search-page__apply { display: none; }

/* Kopfzeile der Treffer */
.redd-search-page__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 16px;
}

.redd-search-page__summary [role="status"] { margin: 0; color: var(--rsp-muted); }
.redd-search-page__summary strong { color: var(--rsp-fg); }
.redd-search-page__sort { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.redd-search-page__sort label { margin: 0; white-space: nowrap; }
.redd-search-page__sort select { width: auto; }

.redd-search-page__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.redd-search-page__chips a,
.redd-search-page__pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border: 1px solid var(--rsp-line);
    border-radius: 999px;
    background: var(--rsp-soft);
    color: var(--rsp-fg) !important;
    font-size: 0.88rem;
    text-decoration: none !important;
}

.redd-search-page__chips a { border-color: var(--rsp-accent); }
.redd-search-page__chips a:hover,
.redd-search-page__pill:hover { background: var(--rsp-line); }

/* Abschnitte der Ansicht „All“ */
.redd-search-page__section { margin-bottom: 34px; }
.redd-search-page .redd-search-page__section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 1.3rem;
    color: var(--rsp-fg);
}
.redd-search-page__more { margin: 6px 0 0; }
.redd-search-page__more .uk-button-text { color: var(--rsp-accent); font-weight: 600; }

/* Trefferkarten */
.redd-search-page__list { display: grid; gap: 14px; }

.redd-result {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid var(--rsp-line);
    border-radius: 10px;
    background: var(--rsp-card);
    box-shadow: var(--rsp-shadow);
}

.redd-result--news,
.redd-result--pages { grid-template-columns: 180px minmax(0, 1fr); }

.redd-result__media { min-width: 0; }

.redd-result__image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    object-fit: cover;
    background: var(--rsp-soft);
}

.redd-result__flag { display: block; width: 72px; height: auto; border: 1px solid var(--rsp-line); border-radius: 4px; }

.redd-result__icon,
.redd-result__doc,
.redd-result__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 72px;
    height: 84px;
    border-radius: 8px;
    background: var(--rsp-soft);
    color: var(--rsp-accent);
}

.redd-result--news .redd-result__icon,
.redd-result--pages .redd-result__icon { width: 100%; height: auto; aspect-ratio: 4 / 3; }

.redd-result__doc span:last-child { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; }
.redd-result__doc--pdf { background: #fbe9e7; color: #b3261e; }
.redd-result__doc--word { background: #e3edfb; color: #1d4f9c; }
.redd-result__doc--excel { background: #e3f4e8; color: #1b6b3a; }
.redd-result__doc--powerpoint { background: #fdeee2; color: #b3541e; }
.redd-result__doc--archive { background: #f1ecdf; color: #6d5a2a; }

@media (prefers-color-scheme: dark) {
    .redd-result__doc--pdf { background: #3a2321; color: #ff9b8f; }
    .redd-result__doc--word { background: #1f2c40; color: #9cc0ff; }
    .redd-result__doc--excel { background: #1d3326; color: #8fd6a8; }
    .redd-result__doc--powerpoint { background: #3a2a1d; color: #ffb98a; }
    .redd-result__doc--archive { background: #322c1e; color: #e0cc95; }
}

.redd-result__date span:first-child { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.redd-result__date span:nth-child(2) { font-weight: 700; text-transform: uppercase; }
.redd-result__date span:last-child { font-size: 0.78rem; color: var(--rsp-muted); }

.redd-result__body > :last-child { margin-bottom: 0; }

.redd-result__kicker {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rsp-accent);
}

.redd-search-page .redd-result__title { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.35; }
.redd-search-page .redd-result__title a { color: var(--rsp-fg) !important; text-decoration: none; }
.redd-search-page .redd-result__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.redd-result__crumbs ol { display: flex; flex-wrap: wrap; margin: 0 0 4px; padding: 0; list-style: none; font-size: 0.82rem; }
.redd-result__crumbs li + li::before { content: "›"; margin: 0 6px; color: var(--rsp-muted); }
.redd-result__crumbs a { color: var(--rsp-accent) !important; }

.redd-result__meta { margin: 0 0 6px; font-size: 0.9rem; color: var(--rsp-muted); }
.redd-result__meta a { color: var(--rsp-fg) !important; }
.redd-result__text { margin: 0 0 10px; font-size: 0.95rem; color: var(--rsp-fg); }
.redd-result__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.redd-result__actions .uk-button { border-radius: 6px; }
.redd-result__file { font-weight: 400; text-transform: none; }
.redd-search-page .uk-button-default { border-color: var(--rsp-line); background: var(--rsp-card); color: var(--rsp-fg); }
.redd-search-page .uk-button-default:hover { border-color: var(--rsp-accent); color: var(--rsp-accent); }
.redd-search-page__reset a { color: var(--rsp-accent); }

.redd-search-page mark { padding: 0 1px; border-radius: 2px; background: var(--rsp-mark); color: inherit; }

/* keine Treffer, Einstiege */
.redd-search-page__empty {
    padding: 22px;
    border: 1px dashed var(--rsp-line);
    border-radius: 10px;
    background: var(--rsp-card);
}

.redd-search-page .redd-search-page__empty h2 { margin: 0 0 12px; font-size: 1.25rem; color: var(--rsp-fg); }
.redd-search-page__empty p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.redd-search-page__tips { margin: 12px 0 0; padding-left: 20px; color: var(--rsp-muted); }

.redd-search-page__shortcuts { margin-top: 28px; }
.redd-search-page__shortcuts ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.redd-search-page .uk-pagination { margin-top: 26px; }

/* Tablet/Handy */
@media (max-width: 959px) {
    .redd-search-page__layout.has-filters { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .redd-search-page__filters { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .redd-search-page__filters .redd-search-page__label,
    .redd-search-page__reset { grid-column: 1 / -1; margin: 0; }
    .redd-search-page__filter { margin: 0; }
}

@media (max-width: 639px) {
    .redd-search-page { margin-top: 16px; }
    @media (prefers-color-scheme: dark) { .redd-search-page { padding: 14px; } }
    .redd-search-page .redd-search-page__input { height: 46px; font-size: 1rem; }
    .redd-search-page .redd-search-page__submit { height: 46px; padding: 0 14px; }
    .redd-search-page__types ul { flex-wrap: nowrap; overflow-x: auto; }
    .redd-search-page__types a { padding: 8px 10px; white-space: nowrap; }
    .redd-search-page__sort { margin-left: 0; }
    .redd-result,
    .redd-result--news,
    .redd-result--pages { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px; }
    .redd-result__icon,
    .redd-result__doc,
    .redd-result__date { width: 56px; height: 64px; }
    .redd-result--news .redd-result__icon,
    .redd-result--pages .redd-result__icon { width: 64px; height: 48px; aspect-ratio: auto; }
    .redd-result__flag { width: 56px; }
    .redd-result__image { aspect-ratio: 1; }
    .redd-search-page .redd-result__title { font-size: 1.02rem; }
}
