/**
 * ReplyBridge Knowledge Base - Foundation tokens and structural resets.
 * Defines the design tokens (colors, typography, radius) that components consume.
 */

.rb-knowledge-base-shell {
	--rb-kb-shell-gutter: 24px;
	background: var(--rb-kb-bg, transparent);
	padding: 0 0 64px;
	width: 100%;
}

@media (max-width: 640px) {
    .rb-knowledge-base-shell {
        --rb-kb-shell-gutter: 16px;
    }
}

.rb-knowledge-base {
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
	padding: 0 var(--rb-kb-shell-gutter, 24px);
	--rb-kb-primary: #2563eb;
	--rb-kb-accent: #7c3aed;
	--rb-kb-bg: transparent;
    --rb-kb-surface: #ffffff;
    --rb-kb-surface-alt: #eef2ff;
    --rb-kb-text: #0f172a;
    --rb-kb-muted: #475569;
    --rb-kb-border: #e2e8f0;
    --rb-kb-radius-rounded: 22px;
    --rb-kb-radius-soft: 12px;
    --rb-kb-radius-sharp: 0px;
    --rb-kb-radius: var(--rb-kb-radius-rounded);
    --rb-kb-hero-bg: var(--rb-kb-primary);
    --rb-kb-hero-text: #ffffff;
    --rb-kb-placeholder: rgba(255,255,255,0.75);
    --rb-kb-font-family: var(--replybridge-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    --rb-kb-font-size-base: 1rem;
    --rb-kb-font-size-body: 1rem;
    --rb-kb-font-size-h1: clamp(1.8rem, 2.8vw, 2.6rem);
    --rb-kb-font-size-h2: clamp(1.35rem, 2.2vw, 1.8rem);
    --rb-kb-font-size-h3: 1.15rem;
    --rb-kb-font-size-h4: 1rem;
    background: var(--rb-kb-bg);
    font-family: var(--rb-kb-font-family);
    color: var(--rb-kb-text);
    display: flex;
    flex-direction: column;
    gap: 36px;
    line-height: 1.6;
    font-size: var(--rb-kb-font-size-base);
    box-sizing: border-box;
}

.rb-kb-font-system {
    --rb-kb-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.rb-kb-font-theme {
    --rb-kb-font-family: var(--replybridge-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

.rb-kb-font-serif {
    --rb-kb-font-family: 'Georgia', 'Times New Roman', serif;
}

.rb-kb-font-mono {
    --rb-kb-font-family: 'SFMono-Regular', 'Courier New', monospace;
}

.rb-kb-type-standard {
    --rb-kb-font-size-base: 1rem;
    --rb-kb-font-size-body: 1rem;
    --rb-kb-font-size-h1: clamp(1.8rem, 2.8vw, 2.6rem);
    --rb-kb-font-size-h2: clamp(1.35rem, 2.2vw, 1.8rem);
    --rb-kb-font-size-h3: 1.15rem;
    --rb-kb-font-size-h4: 1rem;
}

.rb-kb-type-compact {
    --rb-kb-font-size-base: 0.94rem;
    --rb-kb-font-size-body: 0.94rem;
    --rb-kb-font-size-h1: clamp(1.65rem, 2.3vw, 2.2rem);
    --rb-kb-font-size-h2: clamp(1.2rem, 1.8vw, 1.5rem);
    --rb-kb-font-size-h3: 1.05rem;
    --rb-kb-font-size-h4: 0.95rem;
}

.rb-kb-type-prominent {
    --rb-kb-font-size-base: 1.08rem;
    --rb-kb-font-size-body: 1.08rem;
    --rb-kb-font-size-h1: clamp(2.1rem, 3.2vw, 3rem);
    --rb-kb-font-size-h2: clamp(1.5rem, 2.4vw, 2.1rem);
    --rb-kb-font-size-h3: 1.3rem;
    --rb-kb-font-size-h4: 1.1rem;
}

.rb-kb-shape-rounded {
    --rb-kb-radius: var(--rb-kb-radius-rounded);
}

.rb-kb-shape-soft {
    --rb-kb-radius: var(--rb-kb-radius-soft);
}

.rb-kb-shape-sharp {
    --rb-kb-radius: var(--rb-kb-radius-sharp);
}

.rb-knowledge-base h1,
.rb-knowledge-base h2,
.rb-knowledge-base h3,
.rb-knowledge-base h4 {
    font-family: var(--rb-kb-font-family);
    color: var(--rb-kb-text);
    line-height: 1.25;
    font-weight: 600;
    margin: 0 0 0.65em;
}

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

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

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

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

.rb-knowledge-base input,
.rb-knowledge-base button,
.rb-knowledge-base textarea {
    font-family: var(--rb-kb-font-family);
}

.rb-kb-palette-emerald {
    --rb-kb-primary: #059669;
    --rb-kb-accent: #10b981;
    --rb-kb-surface-alt: #d1fae5;
    --rb-kb-muted: #065f46;
    --rb-kb-border: #bbf7d0;
}

.rb-kb-palette-sunset {
    --rb-kb-primary: #fb7185;
    --rb-kb-accent: #f97316;
    --rb-kb-surface-alt: #ffe4e6;
    --rb-kb-muted: #7c2d12;
    --rb-kb-border: #fed7aa;
}

.rb-kb-palette-steel {
	--rb-kb-primary: #93c5fd;
	--rb-kb-accent: #38bdf8;
	--rb-kb-bg: #0f172a;
	--rb-kb-surface: #1f2937;
	--rb-kb-surface-alt: #111827;
	--rb-kb-text: #f8fafc;
	--rb-kb-muted: #cbd5f5;
	--rb-kb-border: rgba(255,255,255,0.15);
	--rb-kb-hero-bg: #1f2b3f;
	--rb-kb-hero-text: #e2e8f0;
	--rb-kb-placeholder: rgba(226,232,240,0.8);
}

.rb-kb-shell--palette-steel {
	background-color: #0f172a;
}

.rb-kb-active .has-global-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.rb-kb-active .wp-block-group {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

.rb-kb-active .is-layout-constrained .rb-knowledge-base-shell,
.rb-kb-active .is-layout-constrained > .rb-knowledge-base-shell {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
}

#rb-kb-minimal-header,
#rb-kb-minimal-footer {
    background: #fff;
    padding: 18px 20px;
    border-bottom: 1px solid var(--rb-kb-border);
}

#rb-kb-minimal-headerimg {
    max-width: 1100px;
    margin: 0 auto;
}

.rb-kb-minimal-brand {
    display: inline-block;
    font-size: 22px;
    font-weight: 600;
    text-decoration: none;
    color: var(--rb-kb-text);
}

.rb-kb-minimal-description {
    font-size: 13px;
    color: var(--rb-kb-muted);
    margin-top: 4px;
}

#rb-kb-minimal-footer {
    border-top: 1px solid var(--rb-kb-border);
    border-bottom: 0;
    margin-top: 40px;
    text-align: center;
}

:where(.entry-content, .wp-block-post-content) > .rb-knowledge-base-shell {
    margin-top: 0;
    margin-bottom: 0;
}

:where(.entry-content, .wp-block-post-content) > .rb-kb-shell--hero-flush {
    margin-top: calc(var(--wp--style--root--padding-top, 0px) * -1);
    padding-top: 0;
}
