/* Recipe-domain styles: recipe card, recipe list, tag pills
   (shared base also used by .flag-tag in 80_admin.css), ingredient row. */

.component--recipe-card {
  display: flex;
  flex-direction: column;
  width: 300px;
  flex-wrap: wrap;
  padding: 0rem;
}

.recipe-card-content {
  padding: 1rem;
}

.recipe-card-image {
  height: 200px;
  width: 100%;
  object-fit: cover;
  border-radius: 0.5rem 0.5rem 0 0;
  margin: 0;
}

.recipe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.recipe-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Pill base shared across recipe, dietary, variant, and (admin) flag tags.
   Modifiers (background/color) live with each tag's domain. */
.recipe-tag,
.dietary-tag,
.variant-badge,
.flag-tag {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
}

.recipe-tag {
  background: var(--neutral-colour);
}

.dietary-tag {
  background: var(--medium-grey);
  color: var(--white);
}

.variant-badge {
  background: var(--primary-colour);
  color: var(--white);
  font-weight: normal;
}

/* Star rating meter: encodes quality two ways so it reads at a glance without
   reading the number. The `--rating` (1–5) is set inline per recipe.
     - Fill amount: stars fill proportionally to the score.
     - Colour: filled stars shift hue by score, staying warm/on-brand
       (low = amber, high = green — never an alarming red).
   The numeric value sits alongside, smaller, for exact reads + accessibility. */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.star-rating {
  --pct: calc(var(--rating) / 5 * 100%);
  --hue: calc(40 + (var(--rating) - 1) / 4 * 80); /* 40=amber … 120=green */
  display: inline-block;
  line-height: 1;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.star-rating::before {
  content: "★★★★★";
  background: linear-gradient(
    90deg,
    hsl(var(--hue) 70% 45%) var(--pct),
    var(--neutral-colour) var(--pct)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rating-value {
  font-weight: 700;
  font-size: 0.85rem;
  color: hsl(var(--hue) 70% 38%);
}

/* Number of ratings sits beside the star meter but stays quiet so the score leads. */
.rating-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-left: 0.35rem;
}

/* Cook time sits beside the rating but stays quiet so the rating leads. */
.recipe-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.recipe-card-meta .recipe-card-time {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Ingredient row inside recipes/show */
.ingredient-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--neutral-colour);
}

/* Component (ingredient group) header inside recipes/show */
.ingredient-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--light-grey);
  border-left: 4px solid var(--primary-colour);
  border-radius: 0.25rem;
}

.ingredient-group-header h5 {
  margin: 0;
  color: var(--primary-colour);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ingredient-group-header--other {
  border-left-color: var(--medium-grey);
}

.ingredient-group-header--other h5 {
  color: var(--medium-grey);
}
