/* ============================================================
   SITE SEARCH — portal.opus.org.pl
   ============================================================ */

/* Trigger button w navbarze — ghost (bez ramki, lekki) */
.btn-site-search {
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    padding: 7px 10px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}
.btn-site-search:hover,
.btn-site-search:focus {
    background: rgba(240, 130, 27, 0.08);
    color: #F0821B;
    outline: none;
}
.btn-site-search .bi { font-size: 17px; }

/* Modal overlay */
.site-search-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 9998;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    animation: sdSearchFade 0.15s ease;
}
.site-search-backdrop.open { display: flex; }
@keyframes sdSearchFade { from { opacity: 0; } to { opacity: 1; } }

.site-search-modal {
    width: 100%;
    max-width: 640px;
    margin: 0 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: sdSearchSlide 0.18s ease;
}
@keyframes sdSearchSlide { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.site-search-input-row {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}
.site-search-input-row .bi-search {
    font-size: 20px;
    color: #9ca3af;
}
.site-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 6px 0;
    color: #111827;
    background: transparent;
}
.site-search-input::placeholder { color: #9ca3af; }
.site-search-close {
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}
.site-search-close:hover { background: #e5e7eb; }

.site-search-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px 0 16px;
}

.site-search-status {
    padding: 32px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}
.site-search-status .bi { font-size: 32px; margin-bottom: 8px; display: block; opacity: 0.5; }

.site-search-group {
    padding: 6px 0;
}
.site-search-group-title {
    padding: 8px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.site-search-group-title .bi { color: #F0821B; font-size: 13px; }

.site-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}
.site-search-item:hover,
.site-search-item.active {
    background: #fff7ed;
    border-left-color: #F0821B;
    color: inherit;
    text-decoration: none;
}
.site-search-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.site-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.site-search-thumb.icon-only {
    background: linear-gradient(135deg, #fef5eb 0%, #fee5c7 100%);
    color: #F0821B;
    font-size: 22px;
}
.site-search-item-body {
    flex: 1;
    min-width: 0;
}
.site-search-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}
.site-search-item-title mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0 2px;
    border-radius: 2px;
}
.site-search-item-excerpt {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-search-footer {
    padding: 10px 20px;
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
    font-size: 11.5px;
    color: #9ca3af;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-search-footer .kbd {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 10.5px;
    color: #6b7280;
    margin: 0 3px;
}

@media (max-width: 768px) {
    .site-search-btn .hint { display: none; }
    .site-search-btn { padding: 6px 10px; }
    .site-search-modal { margin: 0 12px; max-width: 100%; }
    .site-search-backdrop { padding-top: 5vh; }
}
