.kb-searchbar-header {
    display: flex;
    justify-content: center;
}

.kb-searchbar-header * {
    box-sizing: border-box;
}

.kb-searchbar-header-inner {
    width: 100%;
    max-width: 1200px;
}

.kb-searchbar-title {
    padding: 0.75rem 0 0.25rem 0;
    max-width: 500px;
    color: var(--brand-primary);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.kb-searchbar-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.9375rem, 2vw, 1.0625rem);
    font-weight: 400;
    padding-bottom: 1rem;
}

#kb-search-form {
    display: flex;
    justify-content: center;
}

.searchbar-wrapper {
    display: flex;
    width: 100%;
    max-width: 1200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-accent);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.searchbar-wrapper:hover {
    border-color: var(--text-primary);
}

.searchbar-wrapper.input-focused {
    border-color: var(--brand-primary);
}

#kb-search-input {
    flex: 1;
    padding: 1rem 1rem 1rem 0;
    border: none;
    font-size: 1rem;
    font-weight: 400;
    outline: none;
    margin: 0;
    height: 3.25rem;
    width: auto;
    border-radius: 0;
}

#kb-search-submit,
#kb-search-submit:hover {
    border: none;
    outline: none;
    border-radius: 0;
}

#kb-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 0.75rem;
    transition: all 0.2s ease;
}

#kb-search-submit span {
    font-weight: 900;
    font-size: 1.5rem;
}

@media screen and (max-width: 768px) {
    .kb-searchbar-subtitle {
        padding-bottom: 0.75rem;
    }
}

@media screen and (max-width: 600px) {
    .searchbar-wrapper {
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .kb-searchbar-title {
        padding: 0.5rem 0 0.25rem 0;
    }

    .kb-searchbar-subtitle {
        padding-bottom: 0.625rem;
    }

    #kb-search-input {
        height: 3rem;
        padding: 0.875rem 0.875rem 0.875rem 0;
        font-size: 0.9375rem;
    }

    #kb-search-submit {
        padding: 0 0.625rem;
    }

    #kb-search-submit span {
        font-size: 1.25rem;
    }
}

/* Search results */
.search-results--header {
    margin-bottom: 1rem;
}

.search-results--header-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.search-results--header-title b {
    font-weight: 800;
}

.search-results--header-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Search Bar Colors */
#kb-search-input,
#kb-search-submit {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

#kb-search-input::placeholder,
#kb-search-input::-webkit-input-placeholder,
#kb-search-input::-moz-placeholder,
#kb-search-input:-ms-input-placeholder {
    color: var(--text-muted);
}

#kb-search-submit span {
    color: var(--text-primary);
}

/* Focus State */
#kb-search-input:focus::placeholder,
#kb-search-input:focus::-webkit-input-placeholder,
#kb-search-input:focus::-moz-placeholder,
#kb-search-input:focus:-ms-input-placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
    transition-timing-function: linear;
    transition-duration: .15s;
}

/* ========================================
   LIGHTMODE OVERRIDES
   ======================================== */

/* Flat brand-primary is dull on light bg;
   gradient matching HeaderLogoOnLight.svg adds dimension */
.lightmode .kb-searchbar-title {
    background: linear-gradient(135deg, #549d48, #6ab85c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* --bg-tertiary blends into the light page bg;
   white bar with soft shadow floats above the page */
.lightmode #kb-search-input,
.lightmode #kb-search-submit {
    background-color: var(--bg-secondary);
}

.lightmode .searchbar-wrapper {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-md);
}

.lightmode .searchbar-wrapper:hover {
    border-color: var(--border-accent);
}

.lightmode #kb-search-submit span {
    color: var(--text-secondary);
}

