/**
 * ReplyBridge Knowledge Base - Shared component styles.
 * These rules consume the foundation tokens and stay theme-agnostic.
 */

.rb-kb-shell--hero-card .rb-knowledge-base {
    padding-top: 32px;
}

.rb-kb-shell--hero-flush .rb-knowledge-base {
    padding-top: 0;
}

.rb-knowledge-base a {
    color: var(--rb-kb-primary);
}

.rb-knowledge-base .rb-kb-region + .rb-kb-region {
    margin-top: 32px;
}

.rb-knowledge-base .rb-kb-region--hero + .rb-kb-region--header {
    margin-top: 18px;
}

.rb-knowledge-base .rb-kb-region--hero + .rb-kb-region--header .rb-kb-breadcrumbs {
    margin-top: 0;
}

.rb-knowledge-base .rb-kb-hero {
    background: var(--rb-kb-hero-bg);
    color: var(--rb-kb-hero-text);
    border-radius: var(--rb-kb-radius);
    padding: clamp(48px, 6vw, 84px);
    text-align: center;
    box-shadow: 0 25px 65px rgba(15, 23, 42, 0.15);
    margin: 0;
    position: relative;
    overflow: hidden;
    --rb-kb-hero-bg-image: none;
    --rb-kb-hero-overlay-image: none;
}

.rb-kb-hero__inner {
    position: relative;
    z-index: 1;
}

.rb-kb-hero--has-image::before,
.rb-kb-hero--has-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.rb-kb-hero--has-image::before {
    background-image: var(--rb-kb-hero-bg-image);
    opacity: 0.9;
}

.rb-kb-hero--has-overlay::after {
    background-image: var(--rb-kb-hero-overlay-image);
    opacity: 0.4;
    mix-blend-mode: screen;
}

.rb-knowledge-base .rb-kb-hero__headline {
    font-size: var(--rb-kb-font-size-h1);
    margin: 0 0 16px;
    color: var(--rb-kb-hero-text);
}

.rb-knowledge-base .rb-kb-hero__subheadline {
    font-size: calc(var(--rb-kb-font-size-body) * 1.1);
    margin: 0 0 24px;
    color: var(--rb-kb-hero-text);
    opacity: 0.85;
}

.rb-knowledge-base .rb-kb-hero + .rb-kb-breadcrumbs {
    margin-top: 18px;
}

.rb-kb-hero--variant-flush {
    border-radius: 0;
    box-shadow: none;
    width: 100vw;
    max-width: none;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    padding-left: clamp(24px, 5vw, 96px);
    padding-right: clamp(24px, 5vw, 96px);
}

.rb-knowledge-base .rb-kb-search-form {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    gap: 12px;
}

.rb-kb-search-form__inner {
    position: relative;
    width: 100%;
    max-width: 520px;
}

.rb-knowledge-base .rb-kb-search-form input[type="search"] {
    flex: 1 1 320px;
    max-width: 520px;
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    color: var(--rb-kb-hero-text);
    border-radius: 999px;
}

.rb-knowledge-base .rb-kb-search-form input[type="search"]::placeholder {
    color: var(--rb-kb-placeholder);
}

.rb-knowledge-base .rb-kb-search-form button {
    padding: 14px 28px;
    border-radius: 999px;
    border: none;
    background: rgba(0,0,0,0.3);
    color: var(--rb-kb-hero-text);
    font-size: 16px;
    cursor: pointer;
}

.rb-kb-search-form--shape-boxed input[type="search"] {
    background: #fff;
    color: #0f172a;
    border-radius: 8px;
    border: 1px solid rgba(15,23,42,0.12);
    box-shadow: inset 0 1px 1px rgba(15,23,42,0.05);
    padding: 14px 18px;
}

.rb-kb-search-form--shape-boxed .rb-kb-search-form__inner {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.rb-kb-search-form--shape-boxed button {
    border-radius: 8px;
}

.rb-kb-search-form--submit-stacked {
    flex-direction: column;
    align-items: stretch;
    max-width: 520px;
    margin: 0 auto;
    gap: 10px;
}

.rb-kb-search-form--submit-stacked input[type="search"] {
    max-width: none;
}

.rb-kb-search-form--submit-stacked button {
    width: 100%;
}

.rb-kb-search-form--submit-icon {
    flex-direction: column;
    align-items: stretch;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    gap: 0;
}

.rb-kb-search-form--submit-icon .rb-kb-search-form__inner {
    width: 100%;
}

.rb-kb-search-form--submit-icon input[type="search"] {
    padding-right: 48px;
    width: 100%;
    max-width: none;
}

.rb-kb-search-form__icon-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--rb-kb-hero-text);
}

.rb-kb-search-form__icon {
    display: inline-flex;
}

.rb-kb-search-form__icon-button--solid {
    background: rgba(0,0,0,0.25);
    border-radius: 999px;
    width: 42px;
    height: 42px;
    color: #fff;
}

.rb-knowledge-base .rb-kb-region:not(.rb-kb-region--hero) .rb-kb-search-form__icon-button--solid {
    background: var(--rb-kb-primary);
}

.rb-kb-search-form--submit-icon button {
    padding: 0;
}

.rb-kb-search-form--submit-button {
    align-items: center;
}

.rb-knowledge-base .rb-kb-region:not(.rb-kb-region--hero) .rb-kb-search-form input[type="search"] {
    background: var(--rb-kb-surface);
    border: 1px solid var(--rb-kb-border);
    color: var(--rb-kb-text);
}

.rb-knowledge-base .rb-kb-region:not(.rb-kb-region--hero) .rb-kb-search-form input[type="search"]::placeholder {
    color: var(--rb-kb-muted);
}

.rb-knowledge-base .rb-kb-region:not(.rb-kb-region--hero) .rb-kb-search-form:not(.rb-kb-search-form--submit-icon) button {
    background: var(--rb-kb-primary);
    color: #fff;
}

.rb-knowledge-base .rb-kb-region:not(.rb-kb-region--hero) .rb-kb-search-form--submit-icon .rb-kb-search-form__icon-button {
    color: var(--rb-kb-text);
}

.rb-knowledge-base .rb-kb-region--header {
    padding-top: 18px;
}

.rb-kb-categories {
    padding-bottom: 20px;
}

.rb-knowledge-base .rb-kb-categories__grid,
.rb-knowledge-base .rb-kb-featured__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.rb-knowledge-base .rb-kb-card,
.rb-knowledge-base .rb-kb-featured__item {
    border: 1px solid var(--rb-kb-border);
    border-radius: var(--rb-kb-radius);
    padding: 22px;
    background: var(--rb-kb-surface);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    outline: none;
}

.rb-knowledge-base .rb-kb-card {
    display: block;
}

.rb-knowledge-base .rb-kb-card:focus-visible,
.rb-knowledge-base .rb-kb-featured__item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

@media (max-width: 520px) {
    .rb-knowledge-base .rb-kb-categories__grid,
    .rb-knowledge-base .rb-kb-featured__grid {
        grid-template-columns: 1fr;
    }
}

.rb-knowledge-base .rb-kb-card__title {
    color: inherit;
}

.rb-knowledge-base .rb-kb-featured__item h3 a {
    color: inherit;
    text-decoration: none;
}

.rb-knowledge-base .rb-kb-card:hover,
.rb-knowledge-base .rb-kb-featured__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

.rb-knowledge-base .rb-kb-breadcrumbs {
    display: flex;
    gap: 6px;
    font-size: 13px;
    color: var(--rb-kb-muted);
    flex-wrap: wrap;
}

.rb-knowledge-base .rb-kb-articles__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.rb-knowledge-base .rb-kb-articles__list li {
    padding: 20px;
    border: 1px solid var(--rb-kb-border);
    border-radius: var(--rb-kb-radius);
    background: var(--rb-kb-surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.rb-knowledge-base .rb-kb-columns {
    display: flex;
    gap: 40px;
}

.rb-knowledge-base .rb-kb-columns--sidebar-left {
    flex-direction: row-reverse;
}

.rb-knowledge-base .rb-kb-column--content {
    flex: 1 1 0;
    min-width: 0;
}

.rb-knowledge-base .rb-kb-column--sidebar {
    width: min(320px, 100%);
}

@media (max-width: 960px) {
    .rb-knowledge-base .rb-kb-columns {
        flex-direction: column;
    }

    .rb-knowledge-base .rb-kb-column--sidebar {
        width: 100%;
    }
}

.rb-knowledge-base .rb-kb-sidebar {
    background: var(--rb-kb-surface);
    border-radius: var(--rb-kb-radius);
    border: 1px solid var(--rb-kb-border);
    padding: 20px;
    box-shadow: 0 10px 25px rgba(15,23,42,0.07);
}

.rb-knowledge-base .rb-kb-sidebar__section + .rb-kb-sidebar__section {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--rb-kb-border);
}

.rb-knowledge-base .rb-kb-sidebar__categories,
.rb-knowledge-base .rb-kb-sidebar__articles {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rb-knowledge-base .rb-kb-sidebar__categories li.is-active > a,
.rb-knowledge-base .rb-kb-sidebar__articles li.is-current-article > a {
    font-weight: 600;
    color: var(--rb-kb-primary);
}

.rb-knowledge-base .rb-kb-sidebar__snippet {
    margin: 6px 0 0;
    color: var(--rb-kb-muted);
    font-size: 13px;
}

.rb-knowledge-base .rb-kb-section-header {
    margin: 0 0 20px;
}

.rb-knowledge-base .rb-kb-section-header h2 {
    margin: 0;
    font-size: var(--rb-kb-font-size-h2);
}

.rb-knowledge-base .rb-kb-article {
    background: var(--rb-kb-surface);
    border-radius: var(--rb-kb-radius);
    border: 1px solid var(--rb-kb-border);
    padding: 32px;
    box-shadow: 0 18px 36px rgba(15,23,42,0.08);
}

.rb-knowledge-base .rb-kb-article h1 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: var(--rb-kb-font-size-h1);
}

.rb-knowledge-base .rb-kb-article__content {
    font-size: var(--rb-kb-font-size-body);
}

.rb-knowledge-base .rb-kb-article__content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 18px 0;
}

.rb-knowledge-base .rb-kb-article__content figure {
    max-width: 100%;
    margin: 18px 0;
}

.rb-knowledge-base .rb-kb-article__content h2,
.rb-knowledge-base .rb-kb-article__content h3,
.rb-knowledge-base .rb-kb-article__content h4 {
    margin-top: 1.4em;
    margin-bottom: 0.6em;
}

.rb-knowledge-base .rb-kb-article__content h2 {
    font-size: var(--rb-kb-font-size-h2);
}

.rb-knowledge-base .rb-kb-article__content h3 {
    font-size: var(--rb-kb-font-size-h3);
}

.rb-knowledge-base .rb-kb-article__content h4 {
    font-size: var(--rb-kb-font-size-h4);
}

.rb-knowledge-base .rb-kb-feedback {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--rb-kb-border);
    border-radius: var(--rb-kb-radius);
    background: var(--rb-kb-surface);
}

.rb-knowledge-base .rb-kb-feedback__actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.rb-knowledge-base .rb-kb-feedback__actions button {
    border: 1px solid var(--rb-kb-border);
    background: var(--rb-kb-surface);
    border-radius: 999px;
    padding: 6px 18px;
    cursor: pointer;
    color: var(--rb-kb-text);
}

.rb-knowledge-base .rb-kb-empty {
    margin: 0;
    padding: 24px;
    border: 1px dashed var(--rb-kb-border);
    border-radius: var(--rb-kb-radius);
    text-align: center;
    color: var(--rb-kb-muted);
}

@media (max-width: 768px) {
    .rb-knowledge-base .rb-kb-region {
        flex-direction: column;
    }
}

.rb-kb-hero-banner {
    position: relative;
    background: var(--rb-kb-hero-bg, #1d4ed8);
    color: var(--rb-kb-hero-text, #fff);
    border-radius: var(--rb-kb-radius);
    padding: clamp(32px, 5vw, 72px);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
    margin-bottom: 32px;
    overflow: hidden;
    --rb-kb-hero-banner-bg: none;
}

.rb-kb-hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--rb-kb-hero-banner-bg);
    background-size: cover;
    background-position: center;
    opacity: 0.2;
}

.rb-kb-hero-banner__inner {
    position: relative;
    z-index: 1;
}

.rb-kb-hero-banner__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: var(--rb-kb-font-size-xs);
    margin: 0 0 8px;
    opacity: 0.85;
}

.rb-kb-hero-banner__headline {
    margin: 0 0 12px;
    font-size: var(--rb-kb-font-size-h1);
}

.rb-kb-hero-banner__subheadline {
    margin: 0;
    font-size: calc(var(--rb-kb-font-size-body) * 1.1);
    opacity: 0.85;
}

.rb-kb-hero-banner--align-left {
    text-align: left;
}

.rb-kb-hero-banner--align-center {
    text-align: center;
}

.rb-kb-hero-banner--align-right {
    text-align: right;
}

.rb-kb-search-section {
    margin: 32px 0;
}

.rb-kb-search-section__title {
    margin: 0 0 12px;
    font-size: var(--rb-kb-font-size-h3);
}

.rb-kb-search-form--full {
    justify-content: flex-start;
}

.rb-kb-search-form--full .rb-kb-search-form__inner,
.rb-kb-search-form--full .rb-kb-search-input {
    max-width: 100%;
}

.rb-kb-search-form__submit {
    padding: 12px 18px;
    border-radius: var(--rb-kb-radius);
    border: none;
    background: var(--rb-kb-primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.rb-kb-cta {
    background: var(--rb-kb-surface, #fff);
    border-radius: var(--rb-kb-radius);
    border: 1px solid var(--rb-kb-border, #e2e8f0);
    padding: 24px;
    margin: 32px 0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.rb-kb-cta__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: var(--rb-kb-font-size-xs);
    margin: 0 0 8px;
    color: var(--rb-kb-muted, #475569);
}

.rb-kb-cta__headline {
    margin: 0 0 12px;
    font-size: var(--rb-kb-font-size-h3);
}

.rb-kb-cta__body {
    margin: 0 0 16px;
    color: var(--rb-kb-text, #0f172a);
}

.rb-kb-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--rb-kb-radius);
    text-decoration: none;
    font-weight: 600;
}

.rb-kb-cta__button--primary {
    background: var(--rb-kb-primary);
    color: #fff;
}

.rb-kb-cta__button--secondary {
    background: var(--rb-kb-muted-bg, #e2e8f0);
    color: var(--rb-kb-text, #0f172a);
}

.rb-kb-cta__button--link {
    background: transparent;
    color: var(--rb-kb-primary);
    padding: 0;
}

.rb-kb-section-empty {
    margin: 32px 0;
    padding: 16px;
    border: 1px dashed var(--rb-kb-border, #e2e8f0);
    border-radius: var(--rb-kb-radius);
    text-align: center;
    color: var(--rb-kb-muted, #64748b);
}
