/* Card Carousel Container - Allow to flow with floated TOC */
.dokuwiki div.wrap_card-carousel,
.dokuwiki span.wrap_card-carousel {
  display: block !important;
  width: 100% !important;
  clear: none !important;
  margin: 20px 0 !important;
  overflow: visible !important;
}

/* Ensure the UL inside becomes the flex container */
.dokuwiki .wrap_card-carousel ul {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  
  /* Enable horizontal scrolling */
  overflow-x: auto !important;
  overflow-y: hidden !important;
  
  /* Gap and Alignment */
  gap: 15px !important;
  padding: 15px 5px !important;
  margin: 0 !important;
  list-style: none !important;
  
  /* Carousel Snap */
  scroll-snap-type: x mandatory !important;
  -webkit-overflow-scrolling: touch;
  
  /* Background for better visibility */
  background: linear-gradient(to right, #f8f9fa 0%, #ffffff 5%, #ffffff 95%, #f8f9fa 100%) !important;
  border-radius: 10px !important;
}

/* Individual List Item (The Card) */
.dokuwiki .wrap_card-carousel ul li {
  /* Set fixed dimensions - compact height */
  flex: 0 0 280px !important;
  width: 280px !important;
  min-width: 280px !important;
  height: 70px !important;
  
  /* Card Look with gradient and shadow */
  background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%) !important;
  border: 2px solid #e1e8ed !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.3s ease !important;
  
  /* Behavior */
  scroll-snap-align: start !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  overflow: hidden !important;
}

/* Card hover effect */
.dokuwiki .wrap_card-carousel ul li:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  border-color: #428bca !important;
}

/* The Link inside the card - simple block with padding, parent li handles vertical centering */
.dokuwiki .wrap_card-carousel ul li a {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 1em !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  
  /* Font styling - improved colors and typography */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  color: #2c3e50 !important;
  letter-spacing: -0.01em !important;
  
  /* Single line with ellipsis - no wrapping */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  
  /* Remove word wrap */
  word-wrap: normal !important;
  overflow-wrap: normal !important;
  
  /* Ensure text doesn't break */
  word-break: keep-all !important;
  
  /* Text alignment - center the text */
  text-align: center !important;
  
  /* Ensure proper constraint for ellipsis to work */
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Link hover state */
.dokuwiki .wrap_card-carousel ul li a:hover {
  color: #428bca !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

/* Custom tooltip showing full link text on hover - uses title attribute */
.dokuwiki .wrap_card-carousel ul li a[title]:hover::before {
  content: attr(title) !important;
  position: absolute !important;
  bottom: calc(100% + 10px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(44, 62, 80, 0.95) !important;
  color: #ffffff !important;
  padding: 10px 15px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  white-space: normal !important;
  max-width: 320px !important;
  width: max-content !important;
  min-width: 200px !important;
  z-index: 1000 !important;
  pointer-events: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  line-height: 1.4 !important;
  text-align: center !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Tooltip arrow */
.dokuwiki .wrap_card-carousel ul li a[title]:hover::after {
  content: '' !important;
  position: absolute !important;
  bottom: calc(100% + 2px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  border: 6px solid transparent !important;
  border-top-color: rgba(44, 62, 80, 0.95) !important;
  z-index: 1001 !important;
  pointer-events: none !important;
}

/* Clean up the scrollbar with better styling */
.dokuwiki .wrap_card-carousel ul::-webkit-scrollbar {
  height: 10px !important;
}

.dokuwiki .wrap_card-carousel ul::-webkit-scrollbar-track {
  background: #e9ecef !important;
  border-radius: 10px !important;
  margin: 0 5px !important;
}

.dokuwiki .wrap_card-carousel ul::-webkit-scrollbar-thumb {
  background: linear-gradient(to right, #428bca, #5bc0de) !important;
  border-radius: 10px !important;
  border: 2px solid #e9ecef !important;
}

.dokuwiki .wrap_card-carousel ul::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to right, #357abd, #4cb3d2) !important;
}
