/* =================================================================
   33 – Inline-Suche Overlay
   Prefix: suche-overlay
   ================================================================= */

/* Such-Button im Header ------------------------------------------ */
.haupt-navigation__suche {
    background: none;
    border: none;
    color: var(--farbe-weiss);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.3s ease, background 0.3s ease;
    position: relative;
}

.haupt-navigation__suche svg {
    fill: none;
}

.haupt-navigation__suche:hover {
    color: var(--farbe-kupfer);
    background: rgba(200, 111, 39, 0.1);
}

/* Kupfer-Farbe beim Scrollen */
.haupt-navigation.ist-gescrollt-hover .haupt-navigation__suche {
    color: var(--farbe-kupfer);
}

/* Kupfer-Farbe bei Pill-Hover (weißer Hintergrund) */
.haupt-navigation:has(.haupt-navigation__link:hover) .haupt-navigation__suche,
.haupt-navigation:has(.haupt-navigation__cta:hover) .haupt-navigation__suche,
.haupt-navigation:has(.haupt-navigation__punkt.pill-aktiv) .haupt-navigation__suche {
    color: var(--farbe-kupfer);
}

.haupt-navigation.ist-gescrollt-hover .haupt-navigation__suche:hover {
    background: rgba(200, 111, 39, 0.15);
}

/* Overlay -------------------------------------------------------- */
.suche-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: min(15vh, 8rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.suche-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.suche-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

/* Panel ---------------------------------------------------------- */
.suche-overlay__panel {
    position: relative;
    width: min(42rem, 92vw);
    max-height: 70vh;
    background: var(--farbe-schwarz-soft, #1A1A1A);
    border: 1px solid rgba(200, 111, 39, 0.2);
    border-radius: 1rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-1rem) scale(0.97);
    transition: transform 0.3s ease;
}

.suche-overlay[aria-hidden="false"] .suche-overlay__panel {
    transform: translateY(0) scale(1);
}

/* Kopf / Eingabefeld --------------------------------------------- */
.suche-overlay__kopf {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.suche-overlay__form {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    gap: 0.8rem;
}

.suche-overlay__icon {
    color: var(--farbe-kupfer);
    flex-shrink: 0;
    fill: none;
}

.suche-overlay__input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--farbe-weiss);
    font-size: 1.1rem;
    font-family: var(--schrift-text);
    outline: none;
    padding: 0.5rem 0;
}

.suche-overlay__input::placeholder {
    color: var(--farbe-grau-dunkel, #666);
}

/* Browser-eigenes X bei type="search" unterdrücken */
.suche-overlay__input::-webkit-search-cancel-button,
.suche-overlay__input::-webkit-search-decoration,
.suche-overlay__input::-webkit-search-results-button,
.suche-overlay__input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.suche-overlay__input::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.suche-overlay__schliessen {
    background: none;
    border: none;
    color: var(--farbe-grau-dunkel, #666);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}

.suche-overlay__schliessen:hover {
    color: var(--farbe-weiss);
    background: rgba(255, 255, 255, 0.08);
}

/* Ergebnisbereich ------------------------------------------------ */
.suche-overlay__ergebnisse {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 111, 39, 0.3) transparent;
}

.suche-overlay__ergebnisse::-webkit-scrollbar {
    width: 4px;
}

.suche-overlay__ergebnisse::-webkit-scrollbar-thumb {
    background: rgba(200, 111, 39, 0.3);
    border-radius: 2px;
}

/* Kategorien */
.suche-kategorie {
    padding: 0.2rem 1.2rem;
}

.suche-kategorie__titel {
    font-family: var(--schrift-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--farbe-kupfer);
    padding: 0.6rem 0 0.3rem;
    margin: 0;
}

/* Einzelnes Ergebnis */
.suche-ergebnis {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0.8rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--farbe-weiss);
    transition: background 0.15s ease;
    cursor: pointer;
}

.suche-ergebnis:hover,
.suche-ergebnis[data-aktiv="true"] {
    background: rgba(200, 111, 39, 0.1);
}

.suche-ergebnis__icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.375rem;
    color: var(--farbe-kupfer);
}

.suche-ergebnis__icon svg {
    width: 14px;
    height: 14px;
}

.suche-ergebnis__inhalt {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.suche-ergebnis__titel {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--farbe-weiss);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suche-ergebnis__titel mark {
    background: rgba(200, 111, 39, 0.3);
    color: var(--farbe-weiss);
    border-radius: 2px;
    padding: 0 2px;
}

.suche-ergebnis__auszug {
    font-size: 0.78rem;
    color: var(--farbe-grau-dunkel, #666);
    line-height: 1.4;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.suche-ergebnis__auszug mark {
    background: rgba(200, 111, 39, 0.2);
    color: var(--farbe-grau-dunkel, #999);
    border-radius: 2px;
    padding: 0 1px;
}

.suche-ergebnis__pfeil {
    color: var(--farbe-grau-dunkel, #666);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.suche-ergebnis:hover .suche-ergebnis__pfeil,
.suche-ergebnis[data-aktiv="true"] .suche-ergebnis__pfeil {
    opacity: 1;
}

/* Zustände */
.suche-overlay__leer,
.suche-overlay__laden {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--farbe-grau-dunkel, #666);
    font-size: 0.9rem;
}

.suche-overlay__laden::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(200, 111, 39, 0.3);
    border-top-color: var(--farbe-kupfer);
    border-radius: 50%;
    animation: suche-spinner 0.6s linear infinite;
    margin-left: 0.6rem;
    vertical-align: middle;
}

@keyframes suche-spinner {
    to { transform: rotate(360deg); }
}

.suche-overlay__start {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.suche-overlay__start-text {
    color: var(--farbe-grau-dunkel, #666);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.suche-overlay__schnelllinks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.suche-overlay__schnelllink {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(200, 111, 39, 0.08);
    border: 1px solid rgba(200, 111, 39, 0.2);
    border-radius: 2rem;
    color: var(--farbe-kupfer);
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.suche-overlay__schnelllink:hover {
    background: rgba(200, 111, 39, 0.2);
    color: var(--farbe-weiss);
}

/* Footer --------------------------------------------------------- */
.suche-overlay__fuss {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.6rem 1.2rem;
    display: flex;
    gap: 1.2rem;
    justify-content: center;
}

.suche-overlay__shortcut {
    font-size: 0.72rem;
    color: var(--farbe-grau-dunkel, #666);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.suche-overlay__shortcut kbd {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 0.68rem;
    color: var(--farbe-grau-dunkel, #888);
}

/* Responsive ----------------------------------------------------- */
@media (max-width: 48em) {
    .suche-overlay {
        padding-top: 0;
        align-items: stretch;
    }
    
    .suche-overlay__panel {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    .suche-overlay__fuss {
        display: none;
    }
}

/* search.php Fallback -------------------------------------------- */
.suchergebnisse {
    padding: 10rem 0 var(--abstand-sektion);
    background: var(--farbe-schwarz);
    color: var(--farbe-weiss);
    min-height: 100vh;
}

.suchergebnisse__container {
    max-width: var(--container-md);
    margin: 0 auto;
    padding: 0 var(--abstand-md);
}

.suchergebnisse__titel {
    font-family: var(--schrift-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: var(--abstand-lg);
}

.suchergebnisse__titel span {
    color: var(--farbe-kupfer);
}

.suchergebnisse__liste {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--abstand-xl);
}

.suchergebnisse__eintrag {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: var(--abstand-md) 0;
}

.suchergebnisse__eintrag-link {
    text-decoration: none;
    color: var(--farbe-weiss);
    display: block;
    transition: color 0.2s ease;
}

.suchergebnisse__eintrag-link:hover {
    color: var(--farbe-kupfer);
}

.suchergebnisse__eintrag-typ {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--farbe-kupfer);
    margin-bottom: 0.3rem;
}

.suchergebnisse__eintrag-name {
    font-family: var(--schrift-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.suchergebnisse__eintrag-auszug {
    font-size: 0.88rem;
    color: var(--farbe-grau-dunkel, #666);
    line-height: 1.5;
}

.suchergebnisse__leer {
    text-align: center;
    padding: var(--abstand-xl) 0;
    color: var(--farbe-grau-dunkel, #666);
}

.suchergebnisse__leer-titel {
    font-family: var(--schrift-display);
    font-size: 1.3rem;
    color: var(--farbe-weiss);
    margin-bottom: var(--abstand-sm);
}
