/* Ultra Category Grid - Frontend Styles */

.ucg-all-categories {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.ucg-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2rem;
  font-weight: 600;
}

/* Responsive grid layout */
.ucg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  justify-items: center;
}

/* Individual Card */
.ucg-card {
  display: block;
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.ucg-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.ucg-inner {
  display: flex;
  flex-direction: column;
}

/* Thumbnail Wrapper - CLS Safe */
.ucg-thumb-wrapper {
  position: relative;
  width: 100%;
}

.ucg-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--bg-color, #eee);
}

/* Fallback gradient when no image */
.ucg-thumb.ucg-no-thumb {
  background-image: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(0,0,0,0.05));
}

/* Info block */
.ucg-info {
  padding: 16px;
  text-align: center;
}

.ucg-name {
  font-size: 1.1rem;
  margin: 0;
  color: var(--themify-color, #0073aa);
}

.ucg-count {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-top: 6px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .ucg-all-categories {
    padding: 30px 16px;
  }
  .ucg-title {
    font-size: 1.7rem;
    margin-bottom: 30px;
  }
  .ucg-grid {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .ucg-card {
    max-width: 100%;
  }
  .ucg-name {
    font-size: 1rem;
  }
}
