/* ===================================================
   KAMICKA — Ingredient cards
   ---------------------------------------------------
   Reusable "Key Ingredients" card with a colour-coded
   accent bar. Each card sets its own colour via the
   `--bar` custom property (inline style), so the same
   markup works on any page.

   Markup contract:
     <div class="ing-card" style="--bar:#89935f;">
       <div class="ing-bar"></div>
       <div class="ing-body"> ...name / origin / conc... </div>
     </div>

   Falls back to brand blue if --bar is not set.
   =================================================== */

.ing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .ing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .ing-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Opt-in: 4 cards in a row on desktop */
  .ing-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ing-card {
  --bar: #3d4988;
  /* default / fallback */
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #fff;
  border: 1px solid rgba(61, 73, 136, .1);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

/* On hover, tint the border with the ingredient's own colour */
.ing-card:hover {
  border-color: color-mix(in srgb, var(--bar) 45%, transparent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--bar) 14%, transparent);
  transform: translateY(-2px);
}

/* The colour-coded accent bar */
.ing-bar {
  width: 3px;
  border-radius: 9999px;
  background: var(--bar);
  align-self: stretch;
  flex-shrink: 0;
  margin-top: 4px;
}

.ing-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ing-name {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  color: var(--bar);
  /* name matches the accent colour */
  margin: 0;
  text-transform: capitalize;
}

.ing-origin {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ing-origin img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ing-origin p {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.6;
  color: #5e5e5e;
  letter-spacing: .3px;
  margin: 0;
  text-transform: capitalize;
}

.ing-conc {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 4px;
}

.ing-conc-label {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.6;
  color: #5e5e5e;
  letter-spacing: .3px;
}

.ing-conc-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.6;
  color: #1c1c1c;
  letter-spacing: .3px;
}

/* Browsers without color-mix() still get a clean hover */
@supports not (color: color-mix(in srgb, red, blue)) {
  .ing-card:hover {
    border-color: var(--bar);
    box-shadow: 0 6px 20px rgba(61, 73, 136, .12);
  }
}
