:root {
  --navy: #1a1a2e;
  --navy-light: #242442;
  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --blue: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --bg: #f8fafc;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --text: #1a1a2e;
  --text-secondary: #555555;
  --text-muted: #9ca3af;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --gradient: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6);
  --content-width: 720px;
  --sidebar-width: 260px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.post-type-archive-knowledge_updates,
body.single-knowledge_updates,
body.soais-knowledge-update {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.top-bar {
  background: var(--navy);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.logo span {
  color: var(--indigo-light);
}

.top-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.top-nav a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.top-nav a:hover,
.top-nav a.active {
  color: var(--white);
}

.page-wrapper {
  display: flex;
  max-width: 1080px;
  margin: 0 auto;
  min-height: calc(100vh - 52px);
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 32px 24px;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.sidebar-promo {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--white);
}

.sidebar-promo h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.sidebar-promo p {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.5;
  margin-bottom: 14px;
}

.sidebar-promo a {
  display: inline-block;
  color: var(--indigo-light);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.past-issues-list {
  list-style: none;
}

.past-issues-list li {
  margin-bottom: 6px;
}

.past-issues-list a {
  font-size: 14px;
  color: var(--gray-600);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.past-issues-list a:hover {
  background: var(--gray-100);
  color: var(--indigo);
}

.past-issues-list a.current {
  background: var(--indigo);
  color: var(--white);
  font-weight: 500;
}

.issue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
}

.current .issue-dot {
  background: var(--white);
}

.main-content {
  flex: 1;
  max-width: var(--content-width);
  padding: 40px 40px 80px;
}

.issue-header {
  margin-bottom: 36px;
}

.issue-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.issue-meta .dot {
  color: var(--gray-300);
}

.issue-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--indigo);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.issue-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.issue-editorial {
  font-size: 16px;
  color: var(--gray-700);
  line-height: 1.7;
  border-left: 3px solid var(--indigo);
  padding-left: 20px;
}

.newsletter-philosophy {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.philosophy-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.philosophy-text {
  font-size: 14px;
  color: var(--gray-300);
  line-height: 1.65;
}

.philosophy-text strong {
  color: var(--white);
  font-weight: 600;
}

.theme-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

.filter-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.theme-section,
.newsletter-content > section {
  margin-bottom: 48px;
}

.theme-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--navy);
}

.theme-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.theme-icon.erp,
.theme-icon.vendor {
  background: #eef2ff;
}

.theme-icon.ai {
  background: #fef3c7;
}

.theme-icon.tools,
.theme-icon.platforms {
  background: #ecfdf5;
}

.theme-icon.strategy {
  background: #fce7f3;
}

.theme-icon.quick {
  background: #f3f4f6;
}

.theme-icon.cyber {
  background: #fef2f2;
}

.theme-icon.compliance {
  background: #f5f3ff;
}

.theme-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.theme-count {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  margin-left: auto;
}

.k-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.k-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.k-item.tier1 {
  border-left: 4px solid var(--indigo);
}

.k-item.tier2 {
  border-left: 4px solid var(--blue);
}

.k-item.tier3 {
  border-left: 4px solid var(--gray-300);
}

.k-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  user-select: none;
}

.k-number {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: var(--indigo);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tier2 .k-number {
  background: var(--blue);
}

.tier3 .k-number {
  background: var(--gray-400);
  font-size: 12px;
}

.k-info {
  flex: 1;
  min-width: 0;
}

.k-headline {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 6px;
}

.k-teaser {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.k-chevron {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  flex-shrink: 0;
  margin-top: 6px;
  transition: transform 0.3s ease;
}

.k-item.open .k-chevron {
  transform: rotate(180deg);
}

.k-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.k-body-inner {
  padding: 0 24px 24px 72px;
}

.k-body-inner h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 8px;
}

.k-body-inner h4:first-child {
  margin-top: 0;
}

.k-body-inner p,
.newsletter-content p {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 8px;
}

.newsletter-content > * + * {
  margin-top: 20px;
}

.newsletter-content h2,
.newsletter-content h3 {
  color: var(--navy);
  line-height: 1.3;
}

.newsletter-content ul,
.newsletter-content ol {
  padding-left: 1.25rem;
  color: var(--gray-700);
}

.k-source {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}

.k-source a,
.newsletter-content a,
.footer-links a {
  color: var(--indigo);
  text-decoration: none;
}

.k-source a:hover,
.newsletter-content a:hover,
.footer-links a:hover {
  text-decoration: underline;
}

.quick-hit {
  padding: 16px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gray-300);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.quick-hit .k-headline {
  font-size: 14px;
  margin-bottom: 4px;
}

.quick-hit p {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

.quick-hit .k-source {
  margin-top: 8px;
  padding-top: 8px;
}

.countdown-section {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 48px;
  color: var(--white);
}

.countdown-days {
  font-family: "JetBrains Mono", monospace;
  font-size: 48px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}

.countdown-label {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.countdown-body {
  font-size: 14px;
  color: var(--gray-300);
  line-height: 1.7;
}

.page-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: 32px;
  text-align: center;
}

.footer-philosophy {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto 16px;
}

.footer-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-stat {
  text-align: center;
}

.footer-stat-number {
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--indigo);
}

.footer-stat-label {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.footer-text {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.7;
}

.k-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}

.k-share-btn:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: #eef2ff;
}

.k-share-btn svg {
  width: 14px;
  height: 14px;
}

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.k-item.highlighted {
  animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4);
  }
  100% {
    box-shadow: none;
  }
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s;
  z-index: 50;
}

.back-to-top:hover {
  transform: translateY(-2px);
}

.back-to-top.visible {
  display: flex;
}

.next-issue {
  text-align: center;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.next-issue-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.next-issue-body {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .main-content {
    max-width: 100%;
    padding: 24px 20px 60px;
  }

  .issue-title {
    font-size: 24px;
  }

  .k-body-inner {
    padding: 0 16px 16px 24px;
  }

  .countdown-days {
    font-size: 36px;
  }
}

@media (max-width: 640px) {
  .top-bar {
    padding: 12px 16px;
  }

  .top-nav {
    gap: 16px;
  }

  .top-nav a {
    font-size: 13px;
  }

  .main-content {
    padding-inline: 16px;
  }

  .issue-meta {
    font-size: 12px;
  }

  .theme-filter {
    gap: 6px;
  }

  .filter-btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  .k-header {
    padding: 16px;
    gap: 12px;
  }

  .k-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .k-headline {
    font-size: 15px;
  }

  .k-body-inner {
    padding: 0 16px 16px;
  }

  .k-body-inner p {
    font-size: 14px;
  }

  .newsletter-philosophy {
    padding: 16px;
    gap: 12px;
  }

  .philosophy-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .philosophy-text {
    font-size: 13px;
  }

  .footer-stats {
    gap: 20px;
  }

  .footer-stat-number {
    font-size: 18px;
  }
}
