.patterns-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.pattern-item {
  width: 20%; /* 20% of the container width */
  box-sizing: border-box;
  text-align: center;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  transition: transform 0.2s;
  background-color: #f9f9f9;
  text-decoration: none; /* Remove underline from links */
  color: inherit; /* Inherit text color */
}

.pattern-item:hover {
  transform: scale(1.05);
}

.pattern-thumbnail {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover; /* Ensures the image covers the container without distortion */
}

.patterns-grid p {
  margin-top: 10px;
  font-size: 1.1em;
  color: #333;
}

/* Responsive Design */
@media (max-width: 900px) {
  .pattern-item {
    width: 50%; /* 50% width on medium screens */
  }
}

@media (max-width: 600px) {
  .pattern-item {
    width: 100%; /* Full width on small screens */
  }
}

/* Tooltip CSS */
.tooltip {
  position: absolute;
  text-align: center;
  padding: 4px;
  font: 12px sans-serif;
  background: lightsteelblue;
  border: 1px solid gray;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

.label {
  user-select: none; /* Prevent text selection */
}