/*
 * subtexte.blog — Suche CSS (Dark Theme)
 * Datei: assets/css/search.css
 */

/* =============================================
   WRAPPER & FORM
   ============================================= */

.subtexte-search-wrap {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 0 2.5rem;
}

.subtexte-search-form { width: 100%; }

.subtexte-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.subtexte-search-icon {
    position: absolute;
    left: 14px;
    width: 15px;
    height: 15px;
    color: #555555;
    pointer-events: none;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.subtexte-search-input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 44px !important;
    font-size: 13px;
    font-family: var(--font-sans, sans-serif);
    color: #f0ece6;
    background: #161616;
    border: 0.5px solid #333333;
    border-radius: 3px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    letter-spacing: 0.01em;
}

.subtexte-search-input::placeholder { color: #444444; }

.subtexte-search-input::-webkit-search-cancel-button,
.subtexte-search-input::-webkit-search-decoration { -webkit-appearance: none; }

.subtexte-search-input:focus {
    border-color: #e8c97e;
    box-shadow: 0 0 0 2px rgba(232, 201, 126, 0.08);
}

.subtexte-search-input-wrap:focus-within .subtexte-search-icon { color: #e8c97e; }

.subtexte-search-clear {
    position: absolute;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 0.5px solid #333;
    background: #222222;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.subtexte-search-clear:hover { background: #2a2a2a; border-color: #555; }
.subtexte-search-clear svg { width: 11px; height: 11px; color: #888888; }
.subtexte-search-clear[hidden] { display: none; }

/* =============================================
   DROPDOWN
   ============================================= */

.subtexte-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 999;
    background: #111111;
    border: 0.5px solid #333333;
    border-radius: 3px;
    padding: 6px 0;
    max-height: 460px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.subtexte-search-results[hidden] { display: none; }

.subtexte-search-results::-webkit-scrollbar { width: 3px; }
.subtexte-search-results::-webkit-scrollbar-track { background: transparent; }
.subtexte-search-results::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.subtexte-search-meta {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #444444;
    padding: 8px 14px 4px;
    margin: 0;
}

.subtexte-search-list { list-style: none; margin: 0; padding: 0; }
.subtexte-search-item { margin: 0; }

.subtexte-search-link {
    display: block;
    padding: 9px 14px;
    text-decoration: none;
    transition: background 0.12s ease;
    border-bottom: 0.5px solid #1a1a1a;
}

.subtexte-search-link:hover { background: #161616; }

.subtexte-search-type {
    display: inline-block;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #555555;
    border: 0.5px solid #2a2a2a;
    border-radius: 2px;
    padding: 1px 5px;
    margin-bottom: 4px;
}

.subtexte-search-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #f0ece6;
    line-height: 1.35;
    margin-bottom: 2px;
    font-family: var(--font-serif, Georgia, serif);
}

.subtexte-search-excerpt {
    display: block;
    font-size: 11px;
    color: #555555;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Treffer-Highlight — Gold statt Hintergrundfarbe */
.subtexte-search-results mark {
    background: transparent;
    color: #e8c97e;
    font-style: normal;
    font-weight: 500;
}

.subtexte-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.subtexte-search-tag {
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #555555;
    border: 0.5px solid #2a2a2a;
    border-radius: 2px;
    padding: 1px 5px;
}

.subtexte-search-all {
    display: block;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #e8c97e;
    text-decoration: none;
    border-top: 0.5px solid #1e1e1e;
    margin-top: 2px;
    transition: color 0.15s ease, background 0.15s ease;
}

.subtexte-search-all:hover { background: #161616; color: #f0ece6; }

.subtexte-search-empty,
.subtexte-search-loading,
.subtexte-search-error {
    padding: 14px;
    font-size: 13px;
    margin: 0;
}

.subtexte-search-empty { color: #555555; }
.subtexte-search-empty strong { color: #888888; font-weight: 500; }
.subtexte-search-loading { color: #444444; font-size: 11px; letter-spacing: 0.04em; }
.subtexte-search-error { color: #7a3030; }

/* =============================================
   HEADER-SUCHE
   ============================================= */

.subtexte-header-search { max-width: 280px; }

@media (max-width: 768px) {
    .subtexte-header-search { max-width: 100%; margin: 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .subtexte-search-input,
    .subtexte-search-link,
    .subtexte-search-all { transition: none; }
}

/* =============================================
   SUCHERGEBNISSEITE (search.php)
   ============================================= */

.st-search-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 32px 80px;
}

.st-search-page__header {
    margin-bottom: 2rem;
}

.st-search-page__title {
    font-family: var(--font-serif, Georgia, serif);
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 500;
    color: var(--text-primary, #f0ece6);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0.5rem 0 0.5rem;
}

.st-search-page__title em {
    color: var(--accent, #e8c97e);
    font-style: italic;
}

.st-search-page__meta {
    font-size: 12px;
    color: var(--text-tertiary, #555555);
    letter-spacing: 0.04em;
    margin: 0;
}

/* Ergebnisliste */
.st-search-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.st-search-item {
    border-bottom: 0.5px solid var(--border, #222222);
}

.st-search-item:first-child {
    border-top: 0.5px solid var(--border, #222222);
}

.st-search-item__link {
    display: block;
    padding: 20px 0;
    text-decoration: none;
    position: relative;
    transition: padding-left 0.2s ease;
}

.st-search-item__link:hover {
    padding-left: 8px;
}

.st-search-item__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.st-search-item__type {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-tertiary, #555555);
    border: 0.5px solid var(--border, #222222);
    border-radius: 2px;
    padding: 2px 6px;
}

.st-search-item__tag {
    font-size: 9px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent, #e8c97e);
    opacity: 0.6;
}

.st-search-item__title {
    font-family: var(--font-serif, Georgia, serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary, #f0ece6);
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    transition: color 0.15s ease;
}

.st-search-item__link:hover .st-search-item__title {
    color: var(--accent, #e8c97e);
}

.st-search-item__title mark {
    background: transparent;
    color: var(--accent, #e8c97e);
    font-style: normal;
}

.st-search-item__excerpt {
    font-size: 13px;
    color: var(--text-secondary, #888888);
    line-height: 1.65;
    margin: 0;
}

.st-search-item__excerpt mark {
    background: transparent;
    color: var(--accent, #e8c97e);
    font-style: normal;
}

.st-search-item__arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-tertiary, #555555);
    opacity: 0;
    transition: opacity 0.15s ease, right 0.2s ease;
}

.st-search-item__link:hover .st-search-item__arrow {
    opacity: 1;
    right: 0;
}

/* Keine Ergebnisse */
.st-search-empty {
    padding: 3rem 0;
}

.st-search-empty__text {
    font-size: 15px;
    color: var(--text-secondary, #888888);
    margin-bottom: 0.5rem;
}

.st-search-empty__text strong {
    color: var(--text-primary, #f0ece6);
}

.st-search-empty__hint {
    font-size: 13px;
    color: var(--text-tertiary, #555555);
    margin-bottom: 1.5rem;
}

.st-search-empty__links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Pagination (gleicher Stil wie sonst im Theme) */
.st-pagination {
    display: flex;
    gap: 6px;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.st-pagination a,
.st-pagination span {
    font-size: 12px;
    color: var(--text-tertiary, #555555);
    border: 0.5px solid var(--border, #222222);
    border-radius: 2px;
    padding: 6px 12px;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.st-pagination a:hover {
    border-color: var(--border-hover, #444444);
    color: var(--text-primary, #f0ece6);
}

.st-pagination .current {
    color: var(--accent, #e8c97e);
    border-color: rgba(232, 201, 126, 0.3);
}

@media (max-width: 600px) {
    .st-search-page {
        padding: 40px 20px 60px;
    }

    .st-search-item__arrow {
        display: none;
    }
}

/* =============================================
   STATUS-ZEILE (DOM-Filter Modus)
   ============================================= */

.subtexte-search-status {
    font-size: 11px;
    color: var(--text-tertiary, #555555);
    letter-spacing: 0.04em;
    margin: -1.5rem 0 1.5rem;
    min-height: 1.2em;
}

.subtexte-search-status[hidden] {
    display: none;
}

/* Highlight im gefilterten Titel */
.st-glossar-item__title mark,
.st-archive-card__title mark,
.st-ressource-card__title mark,
.st-search-item__title mark {
    background: transparent;
    color: var(--accent, #e8c97e);
    font-style: normal;
    font-weight: inherit;
}

/* Versteckte Elemente */
.st-hidden {
    display: none !important;
}

/* =============================================
   FILTER UNTEN (nach den Einträgen)
   ============================================= */

.st-archive__filter--bottom,
.st-glossar-filter--bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 0.5px solid var(--border, #222222);
}

.st-filter-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary, #555555);
    margin: 0 0 12px;
}
