/* ============================================================
   Day Timeline — Visual Proportional Session Timeline
   Used by Components::DayTimeline in the builder
   ============================================================ */

/*
 * Two-column layout:
 *   left  — time labels (fixed width)
 *   right — proportional coloured blocks
 *
 * Both columns use matching inline flex values so labels
 * stay aligned with their blocks without absolute positioning.
 */
.timing-track {
  display: flex;
  flex-direction: row;
  gap: 0.625rem;
  flex: 1;
  min-height: 0;
}

/* ── Left column: time labels ────────────────────────────── */

.timing-track-labels {
  display: flex;
  flex-direction: column;
  width: 2.5rem;
  flex-shrink: 0;
}

/*
 * Each label cell gets `flex: N` via inline style (where N =
 * the section's duration_minutes). This keeps it in sync with
 * the matching block on the right — no pixel math needed.
 */
.timing-label-cell {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 0.2rem;
  min-height: 0;
  overflow: hidden;
}

.timing-label-time {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.6875rem;
  color: var(--medium-gray);
  line-height: 1;
  white-space: nowrap;
}

/* ── Right column: coloured section blocks ───────────────── */

.timing-track-blocks {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-radius: 0.375rem;
  overflow: hidden;
  gap: 1px; /* 1px hairline between sections */
  background-color: var(--medium-gray-dark); /* shows through gap */
}

/*
 * Each block gets `flex: N` via inline style.
 * `min-height: 0` allows blocks to compress below content size.
 */
.timing-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 0.75rem;
  gap: 0.5rem;
  min-height: 0;
  overflow: hidden;
}

.timing-block-label {
  font-size: 0.8125rem;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.timing-block-duration {
  font-size: 0.6875rem;
  opacity: 0.7;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Block colour variants ───────────────────────────────── */

.timing-block--gathering,
.timing-block--cleanup {
  background-color: var(--medium-gray-dark);
  color: var(--light-gray);
}

.timing-block--warmup {
  background-color: color-mix(in oklch, var(--primary-color) 22%, var(--dark-gray));
  color: var(--primary-color-light);
}

.timing-block--workout {
  background-color: color-mix(in oklch, var(--success-color) 22%, var(--dark-gray));
  color: var(--success-color);
}

.timing-block--transition {
  background-color: var(--dark-gray);
  color: var(--medium-gray);
}

/* Fallback for browsers without color-mix support */
@supports not (background-color: color-mix(in oklch, red, blue)) {
  .timing-block--warmup {
    background-color: #1a2e4a;
    color: var(--primary-color-light);
  }

  .timing-block--workout {
    background-color: #1a3326;
    color: var(--success-color);
  }
}
