/* ========================================
   KENNISBANK - Knowledge Base Styles
   ======================================== */

/* ========================================
   KB LAYOUT - Main Grid Layout
   ======================================== */

.kb-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--header-height));
  background: var(--bg-light);
}

/* ========================================
   KB SIDEBAR
   ======================================== */

.kb-sidebar {
  background: rgba(129, 112, 55, 0.08);
  padding: 0;
  border-right: 1px solid var(--border-light);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.kb-sidebar-header {
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.kb-sidebar-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color var(--transition);
}

.kb-sidebar-logo:hover {
  color: var(--accent);
}

.kb-sidebar-section {
  padding: var(--space-lg) var(--space-lg) var(--space-sm);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.kb-sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kb-sidebar-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.kb-sidebar-link:hover {
  background: rgba(0,0,0,0.03);
  color: var(--primary);
  border-left-color: rgba(0,0,0,0.1);
}

.kb-sidebar-link.active {
  background: rgba(201, 162, 39, 0.08);
  color: var(--primary);
  border-left-color: var(--accent);
  font-weight: 600;
}

.kb-sidebar-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.kb-sidebar p {
  font-size: 0.7rem;
  color: black;
}

/* ========================================
   KB MAIN CONTENT
   ======================================== */

.kb-main {
  padding-top: 12vh;
  background: var(--bg-light);
  max-width: 1400px;
  margin: 0 auto;
}

/* Content wrapper for centering */
.kb-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero is full width */

/* ========================================
   KB HERO - Search & Title Area
   ======================================== */

.kb-hero {
  background: linear-gradient(145deg, #0f0f0f 0%, #1a1a1a 50%, #0a0a0a 100%);
  padding: 15rem 2rem;
  position: relative;
  overflow: hidden;
  text-align: center;
    border-radius: 80%;
    opacity: 0.95;

}

.kb-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a227' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.kb-hero h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 var(--space-sm);
  position: relative;
  letter-spacing: -0.5px;
}

.kb-hero p {
  color: rgba(255,255,255,0.7);
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0 0 var(--space-xl);
  position: relative;
  letter-spacing: 0.3px;
}

/* Search Box - Modern & Beautiful */
.kb-search {
  display: flex;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.kb-search input {
  flex: 1;
  padding: 1.25rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  outline: none;
  box-shadow: 0 4px 30px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.98);
  color: var(--primary);
  transition: all 0.3s ease;
}

.kb-search input::placeholder {
  color: #999;
  font-weight: 400;
}

.kb-search input:focus {
  background: var(--white);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 2px var(--accent);
  transform: scale(1.01);
}

.kb-search button {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  padding: 0 2rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.kb-search button:hover {
  background: var(--accent);
  transform: translateX(2px);
}

/* ========================================
   KB SECTIONS
   ======================================== */

.kb-section {
  padding: var(--space-xl) var(--space-lg);
}

.kb-section-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 1000;
  font-size: medium;
  color: var(--primary);
  margin: 0 auto var(--space-lg) auto;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
  text-align: center;
  max-width: fit-content;
}

/* Category Grid */
.kb-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin: auto;

}

.kb-category-card {
  background: var(--white);
  padding: 1.5rem 1.25rem;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
}

.kb-category-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.15);
  transform: translateY(-3px);
}

.kb-category-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.2px;
}

.kb-category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   KB CARD GRID
   ======================================== */

.kb-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin: 5vh auto;
}

@media (min-width: 1200px) {
  .kb-card-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1280px;
  }
}

/* Card */
.kb-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}

.kb-card:hover {
  border-color: rgba(201, 162, 39, 0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.06);
  transform: translateY(-6px);
}

/* Card Image */
.kb-card-image {
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.kb-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.kb-card:hover .kb-card-image img {
  transform: scale(1.03);
}

/* Card Body */
.kb-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.kb-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.75rem;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.kb-card-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

/* ========================================
   KB MENU LIST (Detail View)
   ======================================== */

.kb-menu-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.kb-menu-item {
  display: flex;
  align-items: center;
  padding: var(--space-lg);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition);
}

.kb-menu-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(201, 162, 39, 0.1);
}

.kb-menu-title {
  padding-right: 25px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
  padding-bottom: 0.15rem;
}

.kb-menu-desc {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-light);
  padding-right: var(--space-md);
}

.kb-menu-arrow {
  color: var(--accent);
  font-size: 1.2rem;
  transition: transform var(--transition);
}

.kb-menu-item:hover .kb-menu-arrow {
  transform: translateX(4px);
}

/* ========================================
   KB HEADER (Category Page)
   ======================================== */

.kb-header {
  background: var(--white);
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.kb-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.5px;
}

.kb-header p {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
}

/* ========================================
   KB DETAIL PAGE
   ======================================== */

.kb-back {
  display: inline-block;
  padding: var(--space-lg) var(--space-lg) 0;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.kb-back:hover {
  color: var(--primary);
}

.kb-detail {
  padding: 0 var(--space-lg) var(--space-xl);
}


.kb-detail-image {
  width: 70%;
  max-height: 500px;
  margin: 30px auto var(--space-xl) auto;   /* hou je boven-marge als je wilt, of maak 0 auto ... auto */
  display: grid;                             /* of inline-grid als je wilt */
  place-content: center;                     /* centreert inhoud in beide richtingen */
  justify-content: center;                   /* extra fallback */
  align-content: center;
  border-radius: var(--radius-lg);
  overflow: hidden;                          /* hou overflow netjes */
}

.kb-detail-image img {                       /* als je img apart wilt stylen, maar meestal niet nodig */
  max-width: 80%;
  max-height: 100%;
  object-fit: contain;                       /* hele foto zichtbaar, geen vervorming */
}

.kb-detail-header {
  margin-bottom: var(--space-xl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.kb-detail-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding-left: 15px;
}

.kb-detail-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  padding-left: 50px;
}

.kb-detail-body {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.kb-detail-section {
  background: var(--white);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.kb-detail-section h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.kb-detail-section p {
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

.kb-detail-section ol,
.kb-detail-section ul {
  margin: 0;
  padding-left: var(--space-lg);
}

.kb-detail-section li {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

/* Tags */
.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.kb-tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--bg-offset);
  color: var(--text-light);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Ingrediënten */
.kb-ingredienten {
  columns: 2;
  column-gap: var(--space-xl);
}

.kb-ingredienten li {
  break-inside: avoid;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-light);
}

.kb-ingredienten li:last-child {
  border-bottom: none;
}

/* Bereiding */
.kb-bereiding li {
  padding: var(--space-md);
  background: var(--bg-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  border-left: 3px solid var(--accent);
}

/* Geschiedenis */
.kb-geschiedenis {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%);
  border: 1px solid var(--border);
}

.kb-geschiedenis p {
  margin-bottom: var(--space-sm);
  line-height: 1.8;
}

.kb-geschiedenis p:empty {
  display: none;
}

.kb-geschiedenis br + br {
  display: block;
  content: '';
  margin: var(--space-md) 0;
}

/* ========================================
   KB LEGEND CARDS (Empty Categories)
   ======================================== */

.kb-legend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition);
}

.kb-legend-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.kb-legend-content {
  flex: 1;
}

.kb-legend-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 var(--space-xs);
}

.kb-legend-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
}

.kb-legend-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-left: var(--space-md);
  transition: all var(--transition);
}

.kb-legend-card:hover .kb-legend-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ========================================
   KB EMPTY/ERROR STATES
   ======================================== */

.kb-empty,
.kb-error {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.kb-empty p,
.kb-error h1 {
  color: var(--text-light);
  margin-bottom: var(--space-lg);
}

.kb-error h1 {
  font-size: 1.5rem;
  color: var(--primary);
}

/* ========================================
   RESPONSIVE KB - Complete Responsive Design
   ======================================== */

/* Tablet and below */
@media (max-width: 1024px) {
  .kb-layout {
    grid-template-columns: 1fr;
  }

  .kb-sidebar {
    display: none;
  }
  
  /* Mobile Category Chips - Horizontal Scroll */
  .kb-mobile-categories {
    display: block;
    padding: 1.25rem 1rem;
    background: linear-gradient(180deg, var(--white) 0%, var(--bg-light) 100%);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 60px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  }
  
  .kb-mobile-chips {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.25rem 0.5rem;
    margin: 0 -0.5rem;
  }
  
  .kb-mobile-chips::-webkit-scrollbar {
    display: none;
  }
  
  .kb-mobile-chip {
    flex-shrink: 0;
    padding: 0.7rem 1.4rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
  }
  
  .kb-mobile-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1) 0%, rgba(201, 162, 39, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .kb-mobile-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.15);
  }
  
  .kb-mobile-chip:hover::before {
    opacity: 1;
  }
  
  .kb-mobile-chip.active {
    background: linear-gradient(135deg, var(--accent) 0%, #b8941f 100%);
    border-color: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
    font-weight: 600;
  }
  
  .kb-mobile-chip.active::before {
    display: none;
  }
  
  /* Visual indicator for scroll */
  .kb-mobile-categories::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0.8;
  }
  
  /* Hide on desktop */
  .kb-desktop-only {
    display: none;
  }

  /* Mobile-friendly header */
  .kb-hero {

    padding: 3rem 1.5rem;
  }

  .kb-hero h1 {
    font-size: 2rem;
  }

  .kb-hero p {
    font-size: 1rem;
  }
}

/* Hide mobile elements on desktop */
@media (min-width: 1025px) {
  .kb-mobile-categories {
    display: none !important;
  }
}

/* Large mobile */
@media (max-width: 768px) {
  .kb-hero {
    padding: 2.5rem 1.25rem;
  }

  .kb-hero h1 {
    font-size: 1.75rem;
  }

  .kb-search input {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .kb-search button {
    padding: 0 1.5rem;
    font-size: 0.85rem;
  }

  .kb-section {
    padding: 1.5rem;
  }

  .kb-section-title {
    font-size: 1rem;
  }

  .kb-header {
    padding: 1.5rem;
  }

  .kb-header h1 {
    font-size: 1.5rem;
  }

  .kb-card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .kb-category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .kb-category-card {
    padding: 1rem;
  }

  .kb-category-name {
    font-size: 0.9rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .kb-hero {
    padding: 2rem 1rem;
  }

  .kb-hero h1 {
    font-size: 1.5rem;
  }

  .kb-hero p {
    font-size: 0.9rem;
  }

  .kb-search {
    width: 100%;
  }

  .kb-search input {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
  }

  .kb-search button {
    padding: 0 1.25rem;
  }

  .kb-category-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .kb-category-card {
    margin: auto;
    padding: 0.875rem 0.5rem;
  }

  .kb-category-name {
    font-size: 0.8rem;
  }

  .kb-category-count {
    font-size: 0.65rem;
  }

  .kb-card-body {
    padding: 1.25rem;
  }

  .kb-card-title {
    font-size: 1rem;
  }

  .kb-card-desc {
    font-size: 0.85rem;
  }

  .kb-menu-item {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .kb-menu-title {
    min-width: auto;
    font-size: 0.95rem;
  }

  .kb-menu-desc {
    font-size: 0.8rem;
  }

  .kb-detail {
    padding: 0 1rem 1rem;
  }

  .kb-detail-section {
    padding: 1.25rem;
  }

  .kb-detail-header h1 {
    font-size: 1.5rem;
  }

  .kb-back {
    padding: 1rem 1rem 0;
  }
}
