/* ==========================================================================
   OpenShare — Knowledge Hub PRO
   A distinct, premium SaaS-product visual system.
   Palette: near-black ink, porcelain surfaces, indigo→violet brand gradient,
   amber highlight accent. Display face: Fraunces. UI face: Inter.
   ========================================================================== */

:root {
  /* --- surfaces --- */
  --kp-bg: #f3f3f7;
  --kp-canvas: #eeedf5;
  --kp-surface: #ffffff;
  --kp-surface-soft: #f8f8fb;
  --kp-line: #e4e3ee;
  --kp-line-soft: #edecf5;

  /* --- ink --- */
  --kp-ink: #0d0d14;
  --kp-body: #40404f;
  --kp-muted: #6d6d7d;
  --kp-faint: #9a99a8;

  /* --- brand --- */
  --kp-indigo: #4338ca;
  --kp-violet: #7c3aed;
  --kp-blue: #2563eb;
  --kp-brand-grad: linear-gradient(135deg, #4338ca 0%, #6d28d9 55%, #7c3aed 100%);
  --kp-brand-soft: #eeecfd;
  --kp-ink-on-brand: #f5f3ff;
  --kp-amber: #d97706;
  --kp-amber-soft: #fdf1dd;
  --kp-mint: #16a34a;

  /* --- geometry --- */
  --kp-radius-sm: 10px;
  --kp-radius-md: 16px;
  --kp-radius-lg: 24px;
  --kp-radius-xl: 30px;
  --kp-container: 1200px;

  /* --- elevation --- */
  --kp-shadow-xs: 0 1px 2px rgba(13, 13, 20, .05);
  --kp-shadow-sm: 0 6px 20px rgba(13, 13, 20, .06);
  --kp-shadow-md: 0 16px 40px rgba(13, 13, 20, .09);
  --kp-shadow-lg: 0 30px 70px rgba(13, 13, 20, .14);
  --kp-shadow-brand: 0 18px 40px rgba(67, 56, 202, .30);
  --kp-shadow-dark: 0 30px 80px rgba(13, 10, 30, .45);

  /* --- type --- */
  --kp-font-ui: "Inter", "Segoe UI", sans-serif;
  --kp-font-display: "Fraunces", "Inter", serif;
  --kp-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --kp-ease: cubic-bezier(.19, 1, .22, 1);
}

/* ==========================================================================
   0. Base
   ========================================================================== */
html[data-theme="light"] { color-scheme: light; }

html body.theme-knowledge-hub-pro {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% -8%, rgba(124, 58, 237, .10), transparent 32rem),
    radial-gradient(circle at 100% 4%, rgba(37, 99, 235, .09), transparent 30rem),
    var(--kp-bg);
  color: var(--kp-body);
  font-family: var(--kp-font-ui);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.theme-knowledge-hub-pro *,
body.theme-knowledge-hub-pro *::before,
body.theme-knowledge-hub-pro *::after {
  box-sizing: border-box;
}

body.theme-knowledge-hub-pro a { color: inherit; }
body.theme-knowledge-hub-pro img { max-width: 100%; display: block; }

body.theme-knowledge-hub-pro h1,
body.theme-knowledge-hub-pro h2,
body.theme-knowledge-hub-pro h3 {
  margin: 0;
  font-family: var(--kp-font-display);
  font-weight: 570;
  font-optical-sizing: auto;
  letter-spacing: -.015em;
  color: var(--kp-ink);
}

.kh-container {
  width: min(var(--kp-container), calc(100% - 48px));
  margin-inline: auto;
}

.alert {
  border-radius: var(--kp-radius-sm);
  padding: 14px 18px;
  margin: 20px 0 0;
  font-weight: 650;
  border: 1px solid var(--kp-line);
  background: var(--kp-surface);
}
.alert-success { border-color: #b9e4c6; background: #eefaf1; color: #146c34; }
.alert-error, .alert-danger { border-color: #f1c2c2; background: #fdf0f0; color: #9c2b2b; }

/* ==========================================================================
   1. Header / nav
   ========================================================================== */
.kh-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid var(--kp-line);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
}
.kh-nav {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.kh-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: .96rem;
  font-family: var(--kp-font-ui);
  font-weight: 800;
  color: var(--kp-ink);
  min-width: 0;
}
.kh-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; letter-spacing: -.01em; }
.kh-brand-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--kp-brand-grad);
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: -.02em;
  box-shadow: var(--kp-shadow-brand), inset 0 1px 0 rgba(255,255,255,.35);
}
.kh-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--kp-surface-soft);
  border: 1px solid var(--kp-line-soft);
}
.kh-menu a {
  padding: 8px 15px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--kp-muted);
  font-weight: 600;
  font-size: .89rem;
  transition: background .15s var(--kp-ease), color .15s var(--kp-ease);
}
.kh-menu a:hover { color: var(--kp-ink); }
.kh-menu a[aria-current="page"] { color: #fff; background: var(--kp-ink); font-weight: 650; }
.kh-mobile-actions { display: none; }

.kh-actions { display: flex; align-items: center; gap: 4px; }
.kh-actions > a {
  padding: 9px 13px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--kp-body);
  font-weight: 600;
  font-size: .88rem;
  transition: background .15s var(--kp-ease), color .15s var(--kp-ease);
}
.kh-actions > a:hover { background: var(--kp-brand-soft); color: var(--kp-indigo); }
.kh-admin {
  background: var(--kp-brand-grad) !important;
  color: #fff !important;
  margin-left: 4px;
  font-weight: 700;
  box-shadow: var(--kp-shadow-brand);
}
.kh-admin:hover { filter: brightness(1.06); color: #fff !important; }

.kh-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--kp-line);
  border-radius: 999px;
  background: var(--kp-surface);
}
.kh-lang-switch a {
  min-width: 30px;
  padding: 6px 9px !important;
  border-radius: 999px;
  font-size: .76rem !important;
  font-weight: 800 !important;
  text-align: center;
  color: var(--kp-muted);
}
.kh-lang-switch a[aria-current="true"] { background: var(--kp-ink); color: #fff !important; }

.kh-nav-toggle {
  display: none;
  border: 1px solid var(--kp-line);
  border-radius: 12px;
  background: var(--kp-surface);
  padding: 10px 12px;
  gap: 5px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.kh-nav-toggle span { display: block; width: 20px; height: 2px; border-radius: 99px; background: var(--kp-ink); }

/* ==========================================================================
   2. Buttons
   ========================================================================== */
.kh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--kp-brand-grad);
  color: #fff !important;
  font-weight: 650;
  font-size: .96rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--kp-shadow-brand), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .16s var(--kp-ease), box-shadow .16s var(--kp-ease), filter .16s var(--kp-ease);
}
.kh-button:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 22px 46px rgba(67, 56, 202, .34); }
.kh-button:active { transform: translateY(0); }
.kh-button-secondary {
  background: var(--kp-surface);
  color: var(--kp-ink) !important;
  border: 1px solid var(--kp-line);
  box-shadow: var(--kp-shadow-xs);
}
.kh-button-secondary:hover { background: var(--kp-surface-soft); box-shadow: var(--kp-shadow-sm); }
.kh-button-small { min-height: 38px; padding: 0 16px; font-size: .85rem; }

/* ==========================================================================
   3. Hero
   ========================================================================== */
.kh-hero { padding: clamp(30px, 5vw, 58px) 0 clamp(26px, 4.5vw, 46px); }

.kh-hero-grid {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
  align-items: stretch;
  gap: clamp(32px, 5vw, 60px);
  padding: clamp(30px, 4.4vw, 54px);
  border-radius: var(--kp-radius-xl);
  border: 1px solid var(--kp-line);
  background: var(--kp-surface);
  box-shadow: var(--kp-shadow-lg);
}
.kh-hero-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 78% -10%, rgba(124, 58, 237, .12), transparent 20rem),
    linear-gradient(rgba(13,13,20,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,13,20,.028) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  mask-image: radial-gradient(ellipse 68% 60% at 18% 12%, #000 0%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 68% 60% at 18% 12%, #000 0%, transparent 74%);
  z-index: -1;
}

.kh-hero-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; max-width: 660px; }
.kh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 18px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  background: var(--kp-brand-soft);
  color: var(--kp-indigo);
  font-family: var(--kp-font-ui);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 750;
}
.kh-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--kp-amber);
}

.kh-hero-title, .kh-hero h1 {
  display: grid;
  gap: .04em;
  max-width: 100%;
  font-size: clamp(2.2rem, 3.7vw, 3.7rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -.025em !important;
  font-weight: 580;
}
.kh-hero-title span { display: block; white-space: normal; text-wrap: balance; }
.kh-hero-title span:last-child {
  background: var(--kp-brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kh-hero-copy > p:not(.kh-eyebrow),
.kh-hero-statement,
.kh-page-hero > p:not(.kh-eyebrow) {
  max-width: 560px !important;
  margin: 20px 0 0 !important;
  color: var(--kp-muted) !important;
  font-size: 1.06rem !important;
  line-height: 1.7 !important;
  font-weight: 460;
  text-align: left !important;
  font-family: var(--kp-font-ui);
}
.kh-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* --- hero image slider --- */
.kh-hero-grid-slider {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: clamp(26px, 4vw, 44px);
}
.kh-hero-slider {
  position: relative;
  isolation: isolate;
  min-height: clamp(340px, 34vw, 450px);
  overflow: hidden;
  border-radius: calc(var(--kp-radius-xl) - 6px);
  background: #171126;
  box-shadow: var(--kp-shadow-md);
}
.kh-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity .7s var(--kp-ease), transform 1.2s var(--kp-ease);
  pointer-events: none;
}
.kh-hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.kh-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: none;
}
.kh-hero-slide-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(9, 9, 16, 0) 0%, rgba(9, 9, 16, .34) 100%);
  pointer-events: none;
}
.kh-hero-slide-copy {
  position: absolute;
  inset: auto auto 0 0;
  width: min(620px, 100%);
  padding: clamp(24px, 4vw, 44px);
  color: #fff;
}
.kh-hero-slide-copy .kh-eyebrow {
  margin-bottom: 14px;
  background: rgba(255,255,255,.14);
  color: #ebe8ff;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(12px);
}
.kh-hero-slide-copy h1 {
  max-width: 11ch;
  color: #fff !important;
  font-size: clamp(2.1rem, 4vw, 4.1rem) !important;
  line-height: .98 !important;
  text-shadow: 0 18px 44px rgba(0,0,0,.34);
}
.kh-hero-slide-copy > p:not(.kh-eyebrow) {
  max-width: 48ch !important;
  margin: 16px 0 0 !important;
  color: rgba(255,255,255,.84) !important;
  font-size: 1rem !important;
  line-height: 1.65 !important;
  text-align: left !important;
}
.kh-hero-slide-copy .kh-button {
  margin-top: 22px;
  background: #fff;
  color: #241454 !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.22);
}
.kh-hero-slider-controls {
  position: absolute;
  z-index: 3;
  left: clamp(24px, 4vw, 44px);
  bottom: 18px;
  display: flex;
  gap: 8px;
}
.kh-hero-slider-controls button {
  width: 28px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  cursor: pointer;
  transition: width .18s var(--kp-ease), background .18s var(--kp-ease);
}
.kh-hero-slider-controls button.is-active {
  width: 46px;
  background: #fff;
}

/* --- hero side card --- */
.kh-hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 16px;
  min-height: 330px;
  padding: 28px;
  border-radius: var(--kp-radius-lg);
  color: var(--kp-ink-on-brand);
  background:
    radial-gradient(circle at 15% -5%, rgba(255, 255, 255, .16), transparent 15rem),
    linear-gradient(165deg, #241a55 0%, #3d1f7a 46%, #241454 100%);
  box-shadow: var(--kp-shadow-dark), inset 0 1px 0 rgba(255,255,255,.14);
}
.kh-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.kh-hero-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -80px;
  top: -80px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(124, 58, 237, .55), transparent 70%);
  filter: blur(4px);
}
.kh-hero-card-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kh-hero-card-top span,
.kh-hero-card > span:first-child {
  color: #c9bcfa;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .7rem;
}
.kh-hero-card-top small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e5defb;
  font-size: .7rem;
  font-weight: 650;
}
.kh-hero-card-top small::before {
  content: "";
  width: 6px; height: 6px; border-radius: 999px;
  background: #b9a4ff;
  box-shadow: 0 0 0 4px rgba(185, 164, 255, .2);
}
.kh-hero-card-main { position: relative; align-self: center; }
.kh-hero-card strong {
  display: block;
  margin: 0;
  font-family: var(--kp-font-display);
  font-size: 2.05rem;
  font-weight: 560;
  letter-spacing: -.02em;
  color: #fff;
}
.kh-hero-card p { margin: 8px 0 0; max-width: 250px; color: #d9d0fb; line-height: 1.6; font-size: .94rem; }
.kh-hero-meter { position: relative; height: 8px; overflow: hidden; margin: 4px 0; border-radius: 999px; background: rgba(255,255,255,.14); }
.kh-hero-meter i { display: block; width: 68%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b9a4ff, #f2c98a); }

.kh-hero-card-stats { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; }
.kh-hero-card-stats div { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.07); }
.kh-hero-card-stats dt { margin: 0; color: #c9bcfa; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.kh-hero-card-stats dd { margin: 0; color: #fff; font-size: 1.28rem; font-weight: 800; line-height: 1; }

.kh-hero-topics { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.kh-hero-card a {
  color: #241454 !important;
  background: #f3edff;
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  transition: transform .15s var(--kp-ease), background .15s var(--kp-ease);
}
.kh-hero-card a:hover { background: #fff; transform: translateY(-1px); }

/* ==========================================================================
   4. Section headers / grids
   ========================================================================== */
.kh-section { padding: clamp(34px, 4.5vw, 52px) 0; }
.kh-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.kh-section-head h2, .kh-page-hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  line-height: 1.1;
  font-weight: 560;
  letter-spacing: -.02em;
}
.kh-section-head a {
  flex: 0 0 auto;
  color: var(--kp-indigo);
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
  font-family: var(--kp-font-ui);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kh-section-head a::after { content: "→"; transition: transform .15s var(--kp-ease); }
.kh-section-head a:hover::after { transform: translateX(3px); }

.kh-topic-grid, .kh-app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kh-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.kh-app-grid-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --- card base --- */
.kh-topic-card, .kh-post-card, .kh-app-card, .kh-toc-card, .kh-progress-card, .kh-post-nav a {
  min-width: 0;
  border: 1px solid var(--kp-line);
  border-radius: var(--kp-radius-md);
  background: var(--kp-surface);
  box-shadow: var(--kp-shadow-sm);
  transition: transform .18s var(--kp-ease), box-shadow .18s var(--kp-ease), border-color .18s var(--kp-ease);
}
.kh-topic-card:hover, .kh-post-card:hover, .kh-app-card:hover, .kh-post-nav a:hover {
  transform: translateY(-3px);
  box-shadow: var(--kp-shadow-md);
  border-color: #d5d1ee;
}

.kh-topic-card {
  padding: 20px;
  text-decoration: none;
  display: grid;
  gap: 8px;
  min-height: 116px;
  position: relative;
  overflow: hidden;
}
.kh-topic-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--kp-brand-grad);
  opacity: 0;
  transition: opacity .18s var(--kp-ease);
  z-index: -1;
}
.kh-topic-card:hover::before { opacity: .04; }
.kh-topic-card span, .kh-app-card > span {
  color: var(--kp-indigo);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 750;
  font-family: var(--kp-font-ui);
}
.kh-topic-card strong { font-family: var(--kp-font-display); font-size: 1.28rem; color: var(--kp-ink); font-weight: 570; }
.kh-topic-card small, .kh-post-card p, .kh-app-card p, .kh-meta { color: var(--kp-muted); line-height: 1.62; }

.kh-post-card, .kh-app-card { overflow: hidden; padding: 20px; display: flex; flex-direction: column; }
.kh-post-card h2, .kh-post-card h3, .kh-app-card h2, .kh-app-card h3 {
  margin: 4px 0 8px;
  font-size: 1.24rem;
  line-height: 1.3;
  font-weight: 580;
  overflow-wrap: anywhere;
}
.kh-post-card h2 a, .kh-post-card h3 a, .kh-app-card h3 a { text-decoration: none; }
.kh-post-card h2 a:hover, .kh-post-card h3 a:hover { color: var(--kp-indigo); }
.kh-post-card p, .kh-app-card p { flex: 1; margin: 0; font-size: .94rem; font-family: var(--kp-font-ui); }

.kh-card-image, .kh-app-image {
  display: block;
  margin: -20px -20px 18px;
  aspect-ratio: 16 / 9;
  background: var(--kp-surface-soft);
  overflow: hidden;
}
.kh-card-image img, .kh-app-image img, .kh-cover, .kh-article-body img {
  width: 100%; height: 100%; object-fit: cover; display: block; background: var(--kp-surface-soft);
}
.kh-home-app-image {
  margin: -20px -20px 16px;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--kp-brand-soft), var(--kp-amber-soft));
  overflow: hidden;
}
.kh-app-image-placeholder { display: grid; place-items: center; }
.kh-app-image-placeholder span {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 15px;
  background: var(--kp-brand-grad);
  color: #fff !important;
  font-size: 1.02rem !important;
  font-weight: 800;
  letter-spacing: -.02em !important;
  box-shadow: var(--kp-shadow-brand);
}

.kh-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; font-weight: 650; margin: 0 0 4px; font-family: var(--kp-font-ui); }
.kh-read-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  color: var(--kp-indigo);
  font-weight: 700;
  font-size: .88rem;
  font-family: var(--kp-font-ui);
  text-decoration: none;
}
.kh-read-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.kh-app-featured { border-color: #c9bcfa; background: linear-gradient(170deg, #fff, var(--kp-brand-soft)); }
.kh-card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.kh-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--kp-line-soft);
}
.kh-card-foot span { color: var(--kp-muted); font-size: .8rem; font-weight: 650; font-family: var(--kp-font-ui); }

/* ==========================================================================
   5. Page hero / filters / pagination / search / empty state
   ========================================================================== */
.kh-page-hero { padding: clamp(46px, 6vw, 64px) 0 22px; max-width: var(--kp-container); margin-inline: auto; }
.kh-page-hero h1 { font-size: clamp(2rem, 3.6vw, 3.2rem); }

.kh-page-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; color: var(--kp-muted); font-family: var(--kp-font-ui); }
.kh-page-tools span, .kh-page-tools strong {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px;
  border: 1px solid var(--kp-line); border-radius: 999px; background: var(--kp-surface);
  font-size: .83rem;
}
.kh-page-tools strong { color: var(--kp-indigo); font-weight: 700; }

.kh-filter-row, .kh-pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; font-family: var(--kp-font-ui); }
.kh-filter-row { padding: 10px; border: 1px solid var(--kp-line); border-radius: 999px; background: var(--kp-surface-soft); }
.kh-filter-row a, .kh-pagination a {
  border: 1px solid var(--kp-line);
  border-radius: 999px;
  padding: 9px 15px;
  background: var(--kp-surface);
  color: var(--kp-body);
  text-decoration: none;
  font-weight: 650;
  font-size: .87rem;
  transition: background .16s var(--kp-ease), color .16s var(--kp-ease), transform .16s var(--kp-ease);
}
.kh-filter-row a:hover, .kh-pagination a:hover { transform: translateY(-1px); }
.kh-filter-row a.active, .kh-pagination a.active {
  background: var(--kp-ink); color: #fff; border-color: var(--kp-ink);
}

.kh-empty {
  border: 1px dashed var(--kp-line);
  border-radius: var(--kp-radius-md);
  padding: 32px;
  color: var(--kp-muted);
  background: var(--kp-surface-soft);
  text-align: center;
  font-family: var(--kp-font-ui);
}

.kh-search-hero { padding-bottom: 4px; }
.kh-search-form { display: flex; max-width: 720px; gap: 10px; margin-top: 22px; }
.kh-search-form input {
  flex: 1;
  border: 1px solid var(--kp-line);
  border-radius: 999px;
  padding: 0 22px;
  min-height: 52px;
  font: inherit;
  background: var(--kp-surface);
  box-shadow: var(--kp-shadow-xs);
}
.kh-search-form input:focus { outline: 2px solid var(--kp-indigo); outline-offset: 2px; }

/* ==========================================================================
   6. Reader / article
   ========================================================================== */
.kh-reading-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 100; background: transparent; }
.kh-reading-progress span { display: block; width: 0; height: 100%; background: var(--kp-brand-grad); }

.kh-reader { padding: clamp(38px, 6vw, 60px) 0 70px; }
.kh-reader-head { max-width: 760px; margin: 0 auto 40px; text-align: left; }
.kh-reader-head h1 {
  max-width: 720px;
  font-size: clamp(2rem, 3.4vw, 3.05rem);
  line-height: 1.16;
  letter-spacing: -.02em;
  font-weight: 580;
}
.kh-reader-lead { max-width: 720px; margin: 18px 0 0; color: var(--kp-muted); font-size: clamp(1.02rem, 1.3vw, 1.16rem); line-height: 1.72; font-family: var(--kp-font-ui); }
.kh-reader-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 18px 0 0; color: var(--kp-muted); font-size: .89rem; font-family: var(--kp-font-ui); }
.kh-reader-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.kh-reader-tags, .kh-article-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.kh-reader-tags a, .kh-article-tags a {
  border: 1px solid var(--kp-line);
  border-radius: 999px;
  background: var(--kp-surface);
  color: var(--kp-indigo) !important;
  padding: 7px 13px;
  text-decoration: none;
  font-size: .81rem;
  font-weight: 650;
  font-family: var(--kp-font-ui);
}
.kh-reader-tags a:hover, .kh-article-tags a:hover { background: var(--kp-brand-soft); }

.kh-cover { width: 100%; margin-top: 28px; border-radius: var(--kp-radius-lg); box-shadow: var(--kp-shadow-md); aspect-ratio: 16/8; }

.kh-reader-grid { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 740px); justify-content: center; align-items: start; gap: clamp(28px, 4vw, 56px); }
.kh-reader-aside { position: sticky; top: 92px; display: grid; gap: 14px; }
.kh-progress-card, .kh-toc-card { padding: 18px; font-family: var(--kp-font-ui); }
.kh-progress-card span, .kh-toc-card > span {
  color: var(--kp-indigo); text-transform: uppercase; letter-spacing: .09em; font-size: .7rem; font-weight: 750;
}
.kh-progress-card strong { display: block; margin: 8px 0; font-family: var(--kp-font-display); font-size: 1.7rem; }
.kh-progress-card i { display: block; height: 6px; border-radius: 999px; background: var(--kp-line-soft); overflow: hidden; }
.kh-progress-card i span { display: block; width: 0; height: 100%; background: var(--kp-brand-grad); }
.kh-toc-card strong { display: block; margin: 6px 0 12px; font-family: var(--kp-font-ui); font-size: 1.02rem; font-weight: 700; }
.kh-toc-link {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 9px 0;
  color: var(--kp-muted); text-decoration: none; border-top: 1px solid var(--kp-line-soft); line-height: 1.4; font-size: .9rem;
}
.kh-toc-link:hover, .kh-toc-link.is-active { color: var(--kp-indigo); }
.kh-toc-link small { color: var(--kp-amber); font-weight: 800; }
.kh-toc-l3 { padding-left: 12px; font-size: .86rem; }

.kh-reader-note {
  padding: 18px; border: 1px solid var(--kp-line); border-radius: var(--kp-radius-md);
  background: linear-gradient(175deg, var(--kp-surface), var(--kp-brand-soft));
  box-shadow: var(--kp-shadow-sm);
}
.kh-reader-note span { display: block; color: var(--kp-indigo); font-size: .7rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.kh-reader-note strong { display: block; margin-top: 7px; color: var(--kp-ink); line-height: 1.35; font-family: var(--kp-font-ui); }
.kh-reader-note p { margin: 8px 0 0; color: var(--kp-muted); font-size: .85rem; }

.kh-reader-main { min-width: 0; }
.kh-article-body { max-width: 740px; margin: 0 auto; padding-top: 20px; border-top: 1px solid var(--kp-line-soft); font-size: 1.06rem; line-height: 1.82; color: var(--kp-body); }
.kh-article-body > *:first-child { margin-top: 0; }
.kh-article-body p { margin: 1.1em 0; color: #2c2c3a; }
.kh-article-body li { color: #2c2c3a; }
.kh-article-body h2, .kh-article-body h3, .kh-article-body h4 {
  scroll-margin-top: 110px; position: relative; margin: 1.85em 0 .6em; line-height: 1.2; font-weight: 570;
}
.kh-article-body h2 { font-size: clamp(1.55rem, 2.5vw, 2.15rem); }
.kh-article-body h3 { font-size: 1.4rem; }
.kh-heading-anchor { margin-left: .4em; color: var(--kp-amber); opacity: 0; text-decoration: none; font-family: var(--kp-font-ui); font-size: .64em; transition: opacity .15s; }
.kh-article-body h2:hover .kh-heading-anchor, .kh-article-body h3:hover .kh-heading-anchor, .kh-article-body h4:hover .kh-heading-anchor { opacity: 1; }
.kh-article-body a { color: var(--kp-indigo); font-weight: 650; text-underline-offset: 4px; }
.kh-article-body blockquote {
  margin: 26px 0; padding: 20px 24px; border-left: 4px solid var(--kp-violet); border-radius: 0 var(--kp-radius-sm) var(--kp-radius-sm) 0;
  background: var(--kp-brand-soft); color: #34255e; font-style: italic;
}
.kh-article-body pre {
  position: relative; overflow: auto; padding: 22px; border-radius: var(--kp-radius-md);
  background: #14121f; color: #ece9f7; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.kh-copy-code {
  position: absolute; top: 10px; right: 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px;
  padding: 6px 12px; background: rgba(255,255,255,.12); color: #fff; font-weight: 650; font-size: .78rem; cursor: pointer; font-family: var(--kp-font-ui);
}
.kh-copy-code:hover { background: rgba(255,255,255,.2); }
.kh-article-body code { font-family: var(--kp-font-mono); font-size: .9em; }
.kh-article-body :not(pre) > code { background: var(--kp-surface-soft); border: 1px solid var(--kp-line-soft); border-radius: 6px; padding: .12em .4em; }
.kh-article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 26px 0; white-space: nowrap; border-radius: var(--kp-radius-sm); }
.kh-article-body th, .kh-article-body td { border: 1px solid var(--kp-line); padding: 11px 14px; }
.kh-article-body th { background: var(--kp-surface-soft); color: var(--kp-ink); font-weight: 700; }

.kh-post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 46px auto 0; max-width: 740px; }
.kh-post-nav a {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--kp-line);
  border-radius: var(--kp-radius-md);
  background: linear-gradient(135deg, var(--kp-surface), rgba(255,255,255,.76));
  box-shadow: var(--kp-shadow-sm);
  text-decoration: none;
  transition: transform .18s var(--kp-ease), border-color .18s var(--kp-ease), box-shadow .18s var(--kp-ease);
}
.kh-post-nav a:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.28);
  box-shadow: 0 22px 52px rgba(17,24,39,.1);
}
.kh-post-nav a:only-child { grid-column: 1 / -1; }
.kh-post-nav-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 84px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 20%, rgba(245,158,11,.5), transparent 34%),
    linear-gradient(135deg, var(--kp-indigo), var(--kp-violet));
  color: #fff !important;
  font-family: var(--kp-font-display);
  font-size: 1.8rem !important;
  font-weight: 640 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.kh-post-nav-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kh-post-nav-thumb b { position: relative; z-index: 1; }
.kh-post-nav-copy { min-width: 0; }
.kh-post-nav-copy small { color: var(--kp-indigo); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; font-family: var(--kp-font-ui); }
.kh-post-nav-copy strong { display: block; margin-top: 6px; color: var(--kp-ink); font-family: var(--kp-font-ui); font-size: .98rem; font-weight: 750; line-height: 1.36; }

/* ==========================================================================
   7. Homepage widgets
   ========================================================================== */
.homepage-widgets-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.widget-block {
  background: var(--kp-surface) !important;
  border: 1px solid var(--kp-line) !important;
  border-radius: var(--kp-radius-md) !important;
  box-shadow: var(--kp-shadow-sm) !important;
  color: var(--kp-body) !important;
  padding: 22px !important;
  font-family: var(--kp-font-ui);
}
.widget-title, .widget-entry-title, .widget-content h1, .widget-content h2, .widget-content h3 { color: var(--kp-ink) !important; }
.widget-content, .widget-content p, .widget-entry-excerpt, .widget-entry-date, .widget-cta-description { color: var(--kp-muted) !important; }
.widget-entries { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.widget-entry-link {
  display: flex; gap: 12px; align-items: center;
  color: var(--kp-body) !important; background: transparent !important;
  border: 1px solid var(--kp-line-soft) !important; border-radius: var(--kp-radius-sm);
  padding: 10px; text-decoration: none; transition: background .15s var(--kp-ease);
}
.widget-entry-link:hover { background: var(--kp-surface-soft) !important; }
.widget-entry-thumb { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--kp-surface-soft); }
.widget-entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-entry-body { display: grid; gap: 2px; min-width: 0; }
.widget-entry-title { font-weight: 700; font-size: .94rem; }
.widget-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.widget-chip {
  background: var(--kp-brand-soft) !important; color: var(--kp-indigo) !important;
  border: 1px solid var(--kp-line) !important; border-radius: 999px; padding: 7px 13px; text-decoration: none;
  font-size: .83rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
}
.tag-mini { color: var(--kp-muted); font-weight: 600; }

/* ==========================================================================
   8. Footer
   ========================================================================== */
.kh-footer { margin-top: 60px; padding: 40px 0; border-top: 1px solid var(--kp-line); color: var(--kp-muted); font-family: var(--kp-font-ui); }
.kh-footer-grid, .kh-footer-inner { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.kh-footer .kh-brand strong { color: var(--kp-ink); }
.kh-footer p { margin: 10px 0 0; max-width: 340px; color: var(--kp-muted); font-size: .91rem; line-height: 1.6; }
.kh-footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.kh-footer-links a { color: var(--kp-muted); text-decoration: none; font-weight: 600; font-size: .91rem; }
.kh-footer-links a:hover { color: var(--kp-indigo); }

/* ==========================================================================
   9. Responsive
   ========================================================================== */
@media (max-width: 1120px) {
  .kh-hero-title span { white-space: normal; }
}

@media (max-width: 980px) {
  .kh-hero-grid, .kh-reader-grid { grid-template-columns: 1fr; }
  .kh-hero-card { min-height: 0; }
  .kh-reader-aside { position: static; order: 2; margin-top: 34px; }
  .kh-topic-grid, .kh-app-grid, .kh-post-grid, .kh-app-grid-page, .homepage-widgets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kh-menu { border-radius: 22px; background: var(--kp-surface); }
  .kh-container, .kh-reader { width: min(100% - 32px, 760px); }
}

@media (max-width: 720px) {
  .kh-container { width: min(100% - 24px, 1200px); }
  .kh-reader { width: min(100% - 24px, 460px); }

  .kh-nav-toggle { display: inline-flex; }
  .kh-menu {
    display: none; position: absolute; left: 12px; right: 12px; top: 68px; padding: 14px;
    border: 1px solid var(--kp-line); border-radius: var(--kp-radius-md); background: var(--kp-surface);
    box-shadow: var(--kp-shadow-lg); flex-direction: column; align-items: stretch; gap: 2px;
    max-height: min(70vh, 520px); overflow-y: auto; z-index: 60;
  }
  .kh-menu.is-open { display: flex; }
  .kh-menu a { padding: 12px 14px; text-align: left; }
  .kh-mobile-actions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--kp-line-soft);
  }
  .kh-mobile-actions .kh-lang-switch {
    width: 100%;
    justify-content: center;
    background: var(--kp-surface-soft);
  }
  .kh-mobile-actions > a {
    display: flex;
    justify-content: center;
    border: 1px solid var(--kp-line);
    background: var(--kp-surface);
    font-weight: 800;
  }
  .kh-mobile-actions > a.kh-admin {
    background: var(--kp-brand-grad);
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(99,102,241,.22);
  }
  .kh-actions { display: none; }

  .kh-hero { padding: 24px 0 18px; }
  .kh-hero-grid { padding: 22px; border-radius: 24px; }
  .kh-hero-grid::before { display: none; }
  .kh-hero-slider {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-radius: 20px;
    background: #0b1220;
  }
  .kh-hero-slide img {
    object-fit: contain;
    background: #0b1220;
  }
  .kh-hero-slide-copy { padding: 22px; }
  .kh-hero-slide-copy h1 { max-width: 12ch; font-size: clamp(1.8rem, 8vw, 2.7rem) !important; line-height: 1.05 !important; }
  .kh-hero-slide-copy > p:not(.kh-eyebrow) { font-size: .95rem !important; }
  .kh-hero-slider-controls { left: 22px; bottom: 14px; }
  .kh-hero-title, .kh-hero h1 { font-size: clamp(1.9rem, 8.6vw, 2.6rem) !important; line-height: 1.16 !important; }
  .kh-hero-copy > p:not(.kh-eyebrow), .kh-hero-statement { font-size: 1rem !important; }
  .kh-hero-actions .kh-button { flex: 1 1 100%; }
  .kh-hero-card strong { font-size: 1.55rem; }
  .kh-hero-card-stats { grid-template-columns: 1fr 1fr; }

  .kh-section-head { align-items: flex-start; flex-direction: column; }
  .kh-topic-grid, .kh-app-grid, .kh-post-grid, .kh-app-grid-page, .homepage-widgets-grid, .kh-post-nav { grid-template-columns: 1fr; }

  .kh-page-hero { padding-top: 32px; }
  .kh-reader { padding-top: 30px; }
  .kh-reader-head { text-align: left; }
  .kh-reader-head h1 { font-size: clamp(1.75rem, 8vw, 2.3rem); line-height: 1.22; }
  .kh-reader-lead { font-size: .98rem; }
  .kh-reader-aside { display: none; }
  .kh-article-body { font-size: 1rem; }
  .kh-search-form { flex-direction: column; }

  .kh-footer-grid { flex-direction: column; }
}

/* ==========================================================================
   10. Compact home rhythm (v1.0.1)
   Keeps the Pro visual system, but removes the large empty vertical gaps on
   the homepage so the knowledge map reads as one continuous product surface.
   ========================================================================== */
.kh-hero {
  padding: clamp(18px, 3vw, 34px) 0 clamp(14px, 2.3vw, 24px);
}

.kh-hero-grid {
  min-height: 0;
  padding: clamp(28px, 4.4vw, 54px);
}

.kh-hero-actions {
  margin-top: clamp(18px, 2.2vw, 24px);
}

.kh-section {
  padding: clamp(18px, 2.8vw, 30px) 0;
}

.kh-hero + .kh-section {
  padding-top: clamp(14px, 2vw, 22px);
}

.kh-section + .kh-section {
  padding-top: clamp(18px, 2.6vw, 28px);
}

.kh-section-head {
  margin-bottom: clamp(14px, 1.8vw, 20px);
}

.kh-section-head h2,
.kh-page-hero h1 {
  line-height: 1.05;
}

.kh-topic-grid,
.kh-app-grid {
  gap: 14px;
}

.kh-post-grid {
  gap: 18px;
}

.homepage-widgets-grid {
  gap: 16px;
}

.kh-footer {
  margin-top: clamp(22px, 3vw, 36px);
}

@media (min-width: 981px) {
  .kh-hero-card {
    min-height: clamp(300px, 24vw, 360px);
  }
}

@media (max-width: 720px) {
  .kh-hero {
    padding: 16px 0 10px;
  }

  .kh-hero-grid {
    padding: 20px;
  }

  .kh-section {
    padding: 18px 0;
  }

  .kh-section-head {
    margin-bottom: 12px;
  }
}

/* OpenShare core professional code blocks */
.kh-article-body .code-block {
  font-family: var(--kp-font-ui);
}
.kh-article-body .code-block pre {
  margin: 0;
  padding: .85rem 0;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 16px 16px, rgba(255, 255, 255, .035) 0 1px, transparent 1px) 0 0 / 24px 24px, #0b1020;
  box-shadow: none;
}
.kh-article-body .code-block code,
.kh-article-body .code-block :not(pre) > code {
  background: transparent !important;
  border: 0;
  padding: 0;
  color: #dbeafe;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, ui-monospace, monospace;
}

/* Reader ads + plugin slots inside Knowledge Hub Pro reader sidebar */
.theme-knowledge-hub-pro .kh-reader-aside .reader-ad-stack {
  display: grid;
  gap: 12px;
}

.theme-knowledge-hub-pro .kh-reader-aside .reader-ad-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(99, 102, 241, .16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(99, 102, 241, .14), transparent 34%),
    linear-gradient(135deg, #fff, rgba(248, 250, 252, .95));
  box-shadow: 0 18px 42px rgba(17, 24, 39, .08);
  color: var(--kp-ink);
  text-decoration: none;
  transition: transform .18s var(--kp-ease), border-color .18s var(--kp-ease), box-shadow .18s var(--kp-ease);
}

.theme-knowledge-hub-pro .kh-reader-aside .reader-ad-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, .34);
  box-shadow: 0 24px 56px rgba(79, 70, 229, .14);
}

.theme-knowledge-hub-pro .kh-reader-aside .reader-ad-card span {
  color: var(--kp-indigo);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.theme-knowledge-hub-pro .kh-reader-aside .reader-ad-card strong {
  color: var(--kp-ink);
  font-size: 1rem;
  line-height: 1.28;
}

.theme-knowledge-hub-pro .kh-reader-aside .reader-ad-card small {
  color: var(--kp-muted);
  font-size: .88rem;
  line-height: 1.5;
}

.theme-knowledge-hub-pro .kh-reader-aside .reader-ad-card em {
  color: var(--kp-indigo);
  font-style: normal;
  font-weight: 900;
}

/* ==========================================================================
   11. Hero Slider final polish (v1.0.11)
   Keep designed banner artwork crisp, predictable and readable on every width.
   ========================================================================== */
.kh-hero-grid-slider {
  align-items: center;
}

.kh-hero-slider {
  aspect-ratio: 16 / 9;
  min-height: clamp(320px, 30vw, 430px);
  background:
    radial-gradient(circle at 22% 18%, rgba(124, 58, 237, .18), transparent 34%),
    linear-gradient(135deg, #08111f 0%, #111827 55%, #211044 100%);
}

.kh-hero-slide {
  background: #08111f;
}

.kh-hero-slide img {
  object-position: center center;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.kh-hero-slide-copy {
  z-index: 2;
}

.kh-hero-slider-controls {
  z-index: 4;
}

@media (max-width: 980px) {
  .kh-hero-grid-slider {
    gap: 18px;
  }

  .kh-hero-slider {
    width: 100%;
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .kh-hero-grid-slider {
    padding: 14px;
  }

  .kh-hero-slider {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-radius: 20px;
  }

  .kh-hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center center !important;
    background: #08111f;
  }

  .kh-hero-slide-overlay {
    height: 36%;
    background: linear-gradient(180deg, rgba(8, 17, 31, 0) 0%, rgba(8, 17, 31, .28) 100%);
  }

  .kh-hero-slide-copy {
    inset: auto auto 18px 18px;
    width: calc(100% - 36px);
    padding: 0;
  }

  .kh-hero-slide-copy h1,
  .kh-hero-slide-copy > p:not(.kh-eyebrow),
  .kh-hero-slide-copy .kh-button {
    display: none;
  }

  .kh-hero-slide-copy .kh-eyebrow {
    display: inline-flex;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(15, 23, 42, .58);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  }

  .kh-hero-slider-controls {
    left: 18px;
    bottom: 12px;
  }

  .kh-hero-slider-controls button {
    width: 24px;
    height: 6px;
  }

  .kh-hero-slider-controls button.is-active {
    width: 42px;
  }
}

/* ==========================================================================
   12. Hero Slider collision guard (v1.0.12)
   Prevent the right knowledge card from overlapping the slider on wide screens.
   ========================================================================== */
@media (min-width: 981px) {
  .kh-hero-grid.kh-hero-grid-slider {
    grid-template-columns: minmax(0, 700px) minmax(320px, 360px);
    justify-content: center;
    gap: clamp(34px, 4.2vw, 64px);
  }

  .kh-hero-grid.kh-hero-grid-slider .kh-hero-slider {
    width: min(100%, 700px);
    justify-self: end;
  }

  .kh-hero-grid.kh-hero-grid-slider .kh-hero-card {
    width: min(100%, 360px);
    justify-self: start;
    transform: none;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .kh-hero-grid.kh-hero-grid-slider {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 30px;
    padding-inline: clamp(24px, 3vw, 36px);
  }

  .kh-hero-grid.kh-hero-grid-slider .kh-hero-slider {
    width: 100%;
  }

  .kh-hero-grid.kh-hero-grid-slider .kh-hero-card {
    width: 100%;
  }
}

/* ==========================================================================
   13. Compact slider caption
   Keep designed artwork unobstructed and move editorial text/CTA below it.
   ========================================================================== */
.kh-hero-slider {
  aspect-ratio: auto;
  height: clamp(390px, 32vw, 468px);
  min-height: 0;
}

.kh-hero-slide {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--kp-surface);
}

.kh-hero-slide-visual {
  min-height: 0;
  overflow: hidden;
  background: #08111f;
}

.kh-hero-slide-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.kh-hero-slide-copy {
  position: relative;
  inset: auto;
  z-index: 5;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 13px;
  color: var(--kp-ink);
  background: var(--kp-surface);
  background: color-mix(in srgb, var(--kp-surface) 94%, transparent);
  border-top: 1px solid var(--kp-line);
  backdrop-filter: blur(16px);
}

.kh-hero-slide-text {
  min-width: 0;
}

.kh-hero-slide-copy h2 {
  margin: 0;
  overflow: hidden;
  color: var(--kp-ink);
  font-family: var(--kp-font-ui);
  font-size: clamp(.96rem, 1.35vw, 1.12rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kh-hero-slide-copy > .kh-hero-slide-text > p {
  margin: 4px 0 0 !important;
  overflow: hidden;
  color: var(--kp-muted) !important;
  font-family: var(--kp-font-ui);
  font-size: .8rem !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kh-hero-slide-copy .kh-button {
  position: relative;
  z-index: 6;
  margin: 0;
  min-height: 38px;
  padding-inline: 16px;
  color: #fff !important;
  background: var(--kp-brand-grad);
  box-shadow: var(--kp-shadow-brand);
  pointer-events: auto;
}

.kh-hero-slider-controls {
  left: 16px;
  bottom: 88px;
}

@media (max-width: 720px) {
  .kh-hero-slider {
    aspect-ratio: auto;
    height: clamp(300px, 82vw, 380px);
  }

  .kh-hero-slide {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .kh-hero-slide-visual img {
    object-fit: contain !important;
    background: #08111f;
  }

  .kh-hero-slide-copy {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .kh-hero-slide-copy h2 {
    display: block;
    font-size: .92rem;
  }

  .kh-hero-slide-copy > .kh-hero-slide-text > p {
    display: none;
  }

  .kh-hero-slide-copy .kh-button {
    display: inline-flex;
    min-height: 36px;
    padding-inline: 13px;
    font-size: .78rem;
  }

  .kh-hero-slider-controls {
    left: 12px;
    bottom: 78px;
  }
}
