/* ===== Formula Cards: a row of small cards, each with a figure and a formula ===== */

:root {
  --fcard_bg: #ffffff;
  --fcard_border: #cffafe;
  --fcard_accent: #0E7490;
  --fcard_title: #0E7490;
  --fcard_text: #1F2A44;
  --fcard_radius: 12px;
  --fcard_shadow: rgba(31, 42, 68, 0.12);
}

/* ---------- Row of cards ---------- */
.lesson_formula_cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 14px -7px;
}

/* ---------- Single card ---------- */
.lesson_formula_card {
  display: flex;
  flex-direction: column;
  flex: 1 1 170px;
  max-width: 230px;
  margin: 7px;
  background: var(--fcard_bg);
  border: 1px solid var(--fcard_border);
  border-top: 5px solid var(--fcard_accent);
  border-radius: var(--fcard_radius);
  padding: 12px 14px 14px;
  text-align: center;
  box-shadow: 0 2px 8px var(--fcard_shadow);
}

/* small figure (inline SVG) on top of the card */
.lesson_formula_card_figure {
  display: block;
  width: 130px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 6px;
}

.lesson_formula_card_title {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fcard_title);
}

/* the formula itself */
.lesson_formula_card_expr {
  margin: auto 0 0 0; /* pushes the formula to the bottom so all formulas line up */
  padding: 6px 8px;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--fcard_text);
  background: #f0f9ff;
  border-radius: 8px;
}

/* ---------- Mobile adaptation ---------- */
@media (max-width: 480px) {
  .lesson_formula_card {
    flex-basis: 100%;
    max-width: none;
    margin: 7px 7px;
  }
}
