/* ===== PUBLIC WORM FOODS PAGE STYLING ===== */

.wormchat-public-foods {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Section titles */
.wormchat-foods-section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1E4026;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid #1E4026;
  padding-bottom: 0.5rem;
}

.wormchat-foods-section-title.wormchat-unsuitable {
  color: #dc3545;
  border-bottom-color: #dc3545;
}

/* Color group sections */
.wormchat-color-group {
  margin-bottom: 2rem;
}

.wormchat-color-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 4px solid #A68051;
}

/* Food grid */
.wormchat-food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(0.5rem, 2.5vw, 2rem);
  margin-bottom: 1.5rem;
}

/* Individual food item */
.wormchat-food-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.wormchat-food-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Food card - contains image and name */
.wormchat-food-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Food link - makes entire item clickable */
.wormchat-food-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Food image container - square aspect ratio */
.wormchat-food-image {
  aspect-ratio: 1;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.wormchat-food-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

/* Food suitability badge */
.wormchat-food-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Suitable food badge - green */
.wormchat-food-badge--suitable {
  background-color: #63a68d;
  color: #fff;
}

/* Unsuitable food badge - red */
.wormchat-food-badge--unsuitable {
  background-color: #e33745;
  color: #fff;
}

/* Badge icon */
.badge-icon {
  display: block;
  line-height: 1;
}

/* Food name - accessibility text below image */
.wormchat-food-name {
  flex-shrink: 0;
  padding: 0.75rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 500;
  color: #212529;
  border-top: 1px solid #dee2e6;
  word-break: break-word;
}

/* Unsuitable foods styling */
.grid-unsuitable .wormchat-food-item {
  border: 2px solid #dc3545;
}

.grid-unsuitable .wormchat-food-image {
  background-color: #fff5f7;
  opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .wormchat-food-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .wormchat-foods-section-title {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
  }

  .wormchat-color-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .wormchat-food-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .wormchat-foods-section-title {
    font-size: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
  }

  .wormchat-color-title {
    font-size: 1rem;
  }

  .wormchat-food-name {
    padding: 0.5rem;
    font-size: 1rem;
  }
}

/* Color-based visual cues */
.color-red .wormchat-food-item {
  border-top: 3px solid #dc3545;
}

.color-green .wormchat-food-item {
  border-top: 3px solid #28a745;
}

.color-yellow .wormchat-food-item {
  border-top: 3px solid #ffc107;
}

.color-orange .wormchat-food-item {
  border-top: 3px solid #fd7e14;
}

.color-brown .wormchat-food-item {
  border-top: 3px solid #8B4513;
}

.color-white .wormchat-food-item {
  border-top: 3px solid #999;
}

.color-purple .wormchat-food-item {
  border-top: 3px solid #6f42c1;
}

.color-unknown .wormchat-food-item {
  border-top: 3px solid #868e96;
}
