/*
 Theme Name:   Newsblock Child
 Description:  Child theme for Newsblock (Alvinology)
 Author:       Alvinology
 Template:     newsblock
 Version:      1.0.3
*/

/* Full-width Typesense autocomplete bar matching Newsblock's search overlay */
.cs-search__typesense-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cs-search__typesense-bar .cm-autocomplete,
.cs-search__typesense-bar .aa-Autocomplete {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.cs-search__typesense-bar .aa-Form {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.cs-search__typesense-bar .aa-Form:focus-within {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.cs-search__typesense-bar .aa-InputWrapperPrefix,
.cs-search__typesense-bar .aa-InputWrapperSuffix {
    background: transparent !important;
}

.cs-search__typesense-bar .aa-Input {
    width: 100% !important;
    background: transparent !important;
    color: var(--cs-color-contrast-900, #ffffff) !important;
    font-size: 1.5rem !important;
    padding: 0.5rem 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.cs-search__typesense-bar .aa-Input::placeholder {
    color: var(--cs-color-contrast-500, rgba(255, 255, 255, 0.5)) !important;
}

.cs-search__typesense-bar .aa-SubmitButton,
.cs-search__typesense-bar .aa-ClearButton,
.cs-search__typesense-bar .cs-search__close {
    background: transparent !important;
    border: 0 !important;
    color: var(--cs-color-contrast-900, #ffffff) !important;
    cursor: pointer;
    padding: 0.5rem;
}

.cs-search__typesense-bar .aa-SubmitIcon,
.cs-search__typesense-bar .aa-ClearIcon {
    color: var(--cs-color-contrast-900, #ffffff) !important;
    fill: currentColor !important;
}

/* Collapse "The Latest" & tags so live Typesense results take over that exact space */
.cs-search:has(.aa-Panel) .cs-search__posts,
.cs-search:has(.aa-Panel) .cs-search__tags,
.cs-search.cs-search--ts-open .cs-search__posts,
.cs-search.cs-search--ts-open .cs-search__tags {
    display: none !important;
}

/* Render Typesense .aa-Panel full-width inline inside .cs-search-live-result */
.cs-search-live-result {
    width: 100%;
}

.cs-search-live-result .aa-Panel,
.aa-Panel {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: transparent !important;
    color: var(--cs-color-contrast-900, #ffffff) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.aa-Panel .aa-PanelLayout {
    max-height: 65vh;
    overflow-y: auto;
    padding: 1.25rem 0 0.5rem 0 !important;
    background: transparent !important;
}

.aa-Panel .aa-SourceHeaderTitle {
    color: var(--cs-color-contrast-900, #ffffff) !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem !important;
    background: transparent !important;
}

.aa-Panel .aa-SourceHeaderLine {
    display: none !important;
}

.aa-Panel .aa-List {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.aa-Panel .aa-Item {
    background: transparent !important;
    border-radius: 6px;
    padding: 0.5rem !important;
    transition: background-color 0.15s ease;
}

.aa-Panel .aa-Item[aria-selected="true"],
.aa-Panel .aa-Item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.aa-Panel .aa-ItemIcon {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    overflow: hidden;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    flex-shrink: 0;
}

.aa-Panel .aa-ItemIcon img {
    width: 64px !important;
    height: 64px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.aa-Panel .aa-ItemContentTitle {
    color: var(--cs-color-contrast-900, #ffffff) !important;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.aa-Panel .aa-ItemContentTitle mark {
    background: rgba(255, 255, 255, 0.22) !important;
    color: inherit !important;
    padding: 0 2px;
    border-radius: 2px;
}

.aa-Panel .aa-ItemContentDescription {
    color: var(--cs-color-contrast-600, rgba(255, 255, 255, 0.72)) !important;
    font-size: 0.82rem;
    line-height: 1.45;
}
