/* ============================================================
   Mathematics — Bar Graph Styles
   Dark notebook theme · Ratio, Proportion & Bar Graphs chapter
   ============================================================ */

/* ── Bar Graph Container ── */
.bar-graph-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 18px 14px;
  margin: 16px 0;
}

.bar-graph-title {
  text-align: center;
  font-family: var(--font-sub);
  font-size: 1.1rem;
  color: var(--accent-lav);
  margin-bottom: 14px;
  font-weight: 600;
}

.bar-graph-x-label {
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin-top: 6px;
}

/* ── Graph Layout ── */
.bar-graph {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-height: 200px;
  position: relative;
}

/* ── Y-Axis ── */
.bar-graph-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 200px;
  padding-right: 8px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-dim);
  min-width: 36px;
  text-align: right;
}

/* ── Bars Area ── */
.bar-graph-bars {
  display: flex;
  align-items: flex-end;
  flex: 1;
  height: 200px;
  gap: 6px;
  padding: 0 8px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
}

/* ── Each Bar Column ── */
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

/* ── The Bar Itself ── */
.bar {
  width: 70%;
  max-width: 56px;
  min-width: 28px;
  background: linear-gradient(180deg, rgba(126, 206, 193, 0.7) 0%, rgba(126, 206, 193, 0.35) 100%);
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height 0.4s ease;
  border: 1px solid rgba(126, 206, 193, 0.35);
  border-bottom: none;
}

/* ── Bar Color Variants ── */
.bar.bar-lav {
  background: linear-gradient(180deg, rgba(184, 169, 212, 0.7) 0%, rgba(184, 169, 212, 0.35) 100%);
  border-color: rgba(184, 169, 212, 0.35);
}

.bar.bar-peach {
  background: linear-gradient(180deg, rgba(244, 166, 160, 0.7) 0%, rgba(244, 166, 160, 0.35) 100%);
  border-color: rgba(244, 166, 160, 0.35);
}

.bar.bar-yellow {
  background: linear-gradient(180deg, rgba(255, 224, 130, 0.7) 0%, rgba(255, 224, 130, 0.35) 100%);
  border-color: rgba(255, 224, 130, 0.35);
}

/* ── Value Label on Top of Bar ── */
.bar-value {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-mint);
  white-space: nowrap;
}

.bar.bar-lav .bar-value { color: var(--accent-lav); }
.bar.bar-peach .bar-value { color: var(--accent-peach); }
.bar.bar-yellow .bar-value { color: #ffe082; }

/* ── Bar Label (x-axis) ── */
.bar-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--ink-dim);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .bar-graph-container { padding: 14px 10px 10px; }
  .bar-graph, .bar-graph-bars { min-height: 160px; height: 160px; }
  .bar-graph-y-axis { height: 160px; font-size: 0.6rem; min-width: 28px; }
  .bar-value { font-size: 0.62rem; top: -18px; }
  .bar-label { font-size: 0.62rem; }
  .bar { min-width: 20px; }
}
