/* budget.css — Budget Hub visual system.
   HaitiDocs theme (collection.css tokens): navy #002244, Inter (display), Source Sans 3 (body).

   Signature: ONE downward flow. The budget cycle is a real sequence, so it reads as a single
   numbered vertical timeline — big navy numerals on a connecting spine, each stage's documents
   listed in sequence beneath it. No phase colours, no shape language: the flow itself is the
   structure. Stages with nothing published render as a plain greyed box. */

:root {
  --hd-navy: #002244;
  --hd-bg: #f7f8fa;
  --hd-card: #ffffff;
  --hd-border: #e2e8f0;
  --hd-border-soft: #eef2f6;
  --hd-muted: #94a3b8;
  --hd-muted-text: #556170;   /* AA-readable muted text on light bg */
  --hd-ink: #334155;
  --hd-ink-soft: #475569;
  --hd-accent: #0369a1;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- FY hero (large wordmark) ---------- */

#budgetHero {
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--hd-border);
  margin-bottom: 18px;
}
.budget-fy-wordmark {
  display: inline-block;
  max-width: 100%;
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--hd-navy);
  padding-left: 18px;
  border-left: 6px solid var(--hd-navy);
  box-sizing: border-box;
  word-break: break-word;
}
@media (max-width: 480px) {
  .budget-fy-wordmark { padding-left: 12px; border-left-width: 4px; }
}

/* ---------- Year rail ---------- */

#yearRail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--hd-border-soft);
}
.year-link {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--hd-ink-soft);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hd-border);
  background: var(--hd-card);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.year-link:hover { background: #eef2f6; border-color: #cbd5e1; }
.year-link.active { color: #fff; background: var(--hd-navy); border-color: var(--hd-navy); }
.year-link:focus-visible { outline: 2px solid var(--hd-navy); outline-offset: 2px; }

/* ---------- The flow (signature): numbered vertical timeline ---------- */

.budget-flow { margin-top: 4px; }

.flow-stage {
  display: grid;
  grid-template-columns: 60px 1fr;
  column-gap: 20px;
  position: relative;
}

/* Number + the connecting spine */
.flow-marker { position: relative; display: flex; justify-content: center; }
.flow-num {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--hd-navy);
  color: #fff;
  box-sizing: border-box;
  z-index: 1;
}
/* the spine: a line from below this number down through the stage into the next */
.flow-stage:not(:last-child) .flow-marker::after {
  content: '';
  position: absolute;
  top: 52px;
  bottom: -2px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--hd-border);
}
.flow-stage.is-empty .flow-num { background: #e2e8f0; color: var(--hd-muted-text); }

.flow-body { min-width: 0; padding-top: 3px; padding-bottom: 30px; }
.flow-stage:last-child .flow-body { padding-bottom: 6px; }

.flow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.flow-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  color: var(--hd-navy);
}
.flow-stage.is-empty .flow-name { color: var(--hd-muted-text); }
.flow-entity {
  flex: 0 0 auto;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--hd-ink-soft);
  background: #f1f5f9;
  border: 1px solid var(--hd-border);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.flow-desc {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hd-ink-soft);
  margin: 2px 0 13px;
  max-width: 70ch;
}

/* Documents: a sequential list, one per row */
.flow-doclist { list-style: none; margin: 0; padding: 0; }
.flow-docitem { border-top: 1px solid var(--hd-border-soft); }
.flow-docitem:first-child { border-top: none; }
.flow-docitem a {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--hd-navy);
  text-decoration: none;
  padding: 9px 0 9px 2px;
  transition: color .12s ease, padding-left .12s ease;
}
.flow-docitem a:hover { color: var(--hd-accent); padding-left: 6px; }
.flow-docitem a:focus-visible { outline: 2px solid var(--hd-navy); outline-offset: 2px; }

/* Empty stage: a plain greyed box, no text */
.flow-empty {
  height: 38px;
  background: #f1f5f9;
  border: 1px dashed #dbe2ea;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .flow-stage { grid-template-columns: 44px 1fr; column-gap: 13px; }
  .flow-num { width: 40px; height: 40px; font-size: 20px; }
  .flow-stage:not(:last-child) .flow-marker::after { top: 40px; }
  .flow-name { font-size: 15.5px; }
  .flow-body { padding-bottom: 26px; }
}
