/* =====================================================================
   Brewery + Dairy (DAF + EC + AOP + RO) case study
   Page-scoped layout. Process train shown as a 4-up grid of self-
   contained step cards (min 2 per row, never a full-width single
   column). Each card carries a metric strip pulled from the data.
   ===================================================================== */

/* ---- Treatment train: 4 in a row, min 2 ---------------------------- */
.bd-train {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin-top: 2rem;
}
.bd-step {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-top: 4px solid var(--primary-blue);
  border-radius: 14px;
  padding: 1.4rem 1.35rem;
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.bd-step:hover {
  transform: translateY(-4px);
  border-color: #c7d8e8;
  box-shadow: 0 16px 32px rgba(10, 37, 64, 0.12);
}
.bd-step-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}
.bd-step .bd-num {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-navy));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.bd-step h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
  color: var(--primary-navy);
}
.bd-step h3 a { color: var(--primary-navy); text-decoration: none; }
.bd-step h3 a:hover { color: var(--primary-blue); text-decoration: underline; }
.bd-step > p {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-medium);
}
.bd-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
.bd-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  background: linear-gradient(160deg, #f1f7fd, #e6f1fb);
  border: 1px solid #d6e6f5;
  border-radius: 9px;
  padding: 0.4rem 0.6rem;
}
.bd-chip .k { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary-blue); }
.bd-chip .v { font-size: 0.82rem; font-weight: 700; color: var(--primary-navy); }

/* COD reduction running tally band */
.bd-cod-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1000px;
  margin: 2.25rem auto 0;
}
.bd-cod {
  background: linear-gradient(160deg, #ffffff 0%, #eef6f1 100%);
  border: 1px solid #cfe9db;
  border-radius: 14px;
  padding: 1.3rem 1rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.06);
}
.bd-cod .v { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.1; color: #0f8a5f; letter-spacing: -0.01em; }
.bd-cod .l { display: block; margin-top: 0.35rem; font-size: 0.78rem; color: var(--text-medium); line-height: 1.4; }

/* ---- Equipment & process cards: enforce min-2, scale to 4 ---------- */
.bd-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
.bd-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: 0 4px 14px rgba(10, 37, 64, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
}
.bd-card:hover {
  transform: translateY(-4px);
  border-color: #c7d8e8;
  box-shadow: 0 14px 30px rgba(10, 37, 64, 0.12);
}
.bd-card .bd-ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--primary-blue);
  background: linear-gradient(160deg, #e8f3fd, #d4e9fb);
  margin-bottom: 0.85rem;
}
.bd-card h3, .bd-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  color: var(--primary-navy);
}
.bd-card p {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-medium);
  flex-grow: 1;
}
.bd-card .bd-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-blue);
  text-decoration: none;
}
.bd-card .bd-link i { font-size: 0.72rem; margin-left: 0.25rem; }

/* ---- Responsive: 4 -> 2 (never 1 on tablet); 2 floor on mobile ----- */
@media (max-width: 1024px) {
  .bd-train, .bd-cod-band, .bd-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  /* keep a minimum of 2 in a row per the design rule */
  .bd-train, .bd-cod-band, .bd-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .bd-step, .bd-card { padding: 1rem 0.9rem; }
  .bd-step h3, .bd-card h3, .bd-card h4 { font-size: 0.9rem; }
  .bd-step > p, .bd-card p { font-size: 0.8rem; }
}
