/* ============================================================================
   Template 3 — WORKS & PROJECTS

   For delivery agencies: Works, Housing, Power, Water, Physical Planning.
   The distinguishing need is PROGRESS — a citizen comes here to find out
   whether the road outside their house is actually being built. So this is the
   only template with a persistent sidebar and a project tracker, and the only
   one where the body is a two-column document rather than stacked bands.

   Palette: engineering slate with a hi-vis amber accent — the colours of a
   works site, and legible in bright sun on a cheap phone.
   ========================================================================= */

:root {
  --primary:      #243447;
  --primary-dark: #16202c;
  --accent:       #e08900;
}

/* ---- typography ---------------------------------------------------------
   Works & Projects: a tighter grotesque, and a MONO-leaning display for the
   project figures. Engineering signage, not brochure type. */
:root {
  --font-body: "Helvetica Neue", Helvetica, Arial, Roboto, system-ui, -apple-system, sans-serif;
  --font-display: "Arial Black", "Helvetica Neue", Impact, Haettenschweiler, system-ui, sans-serif;
}

/* ---- hero -------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate;
  background: var(--primary-dark); color: #fff;
  padding-block: clamp(3rem, 8vw, 6rem);
  border-bottom: 6px solid var(--accent);
}
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  /* Set per-site by the builder via --hero (the MDA's uploaded photo).
     Falls back to the template gradient when no photo was supplied. */
  background-image: var(--hero, none);
  background-size: cover; background-position: center 40%;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(92deg, rgb(22 32 44 / .95) 0%, rgb(22 32 44 / .8) 55%, rgb(22 32 44 / .55) 100%);
}
.hero .eyebrow { color: var(--accent); }
.hero h1 { color: #fff; font-size: var(--t-3xl); max-width: 18ch; margin-bottom: var(--s-3); }
.hero .lede { font-size: var(--t-lg); color: rgb(255 255 255 / .88); max-width: 56ch; margin-bottom: var(--s-4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---- two-column layout ------------------------------------------------- */
.layout { display: grid; gap: var(--s-5); padding-block: var(--s-5); }
@media (min-width: 1000px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
  .sidebar { position: sticky; top: calc(var(--nav-h) + var(--s-3)); }
}
.sidebar { display: grid; gap: var(--s-3); }
.content { display: grid; gap: var(--s-5); min-width: 0; }
.block > .eyebrow { margin-bottom: .3rem; }
.block h2 { margin-bottom: var(--s-2); }
.lead-p { font-size: var(--t-lg); color: var(--ink); font-weight: 600; margin-bottom: var(--s-2); }

/* ---- sidebar ----------------------------------------------------------- */
.side-nav h2 {
  font-size: var(--t-xs); font-weight: 800; letter-spacing: .15em;
  text-transform: uppercase; color: var(--soft); margin-bottom: var(--s-2);
}
.side-nav ul { display: grid; gap: .15rem; }
.side-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .85rem; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 650; font-size: var(--t-sm); color: var(--body);
  border-left: 3px solid transparent;
}
.side-nav a:hover, .side-nav a[aria-current="page"] {
  background: var(--ground); color: var(--primary); border-left-color: var(--accent);
}
.side-nav .i { width: 18px; height: 18px; color: var(--soft); }
.side-nav a:hover .i, .side-nav a[aria-current="page"] .i { color: var(--accent); }

.side-card {
  background: var(--ground); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s-3);
}
.side-card h3 { font-size: var(--t-lg); margin-bottom: .35rem; }
.side-card p { font-size: var(--t-sm); margin-bottom: var(--s-2); }
.side-card .btn { width: 100%; }

.side-facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fact { background: var(--panel); padding: var(--s-2) var(--s-3); }
.fact .value {
  font-family: var(--font-display); font-size: var(--t-xl); font-weight: 800;
  color: var(--primary); line-height: 1.1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.fact .label {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--soft);
}

/* ---- commissioner ------------------------------------------------------ */
.lead-card { display: grid; gap: var(--s-3); }
@media (min-width: 700px) {
  .lead-card { grid-template-columns: 260px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
}
.lead-card img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top;
  border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow-1);
}
.lead-role { color: var(--accent); font-weight: 800; font-size: var(--t-md); margin-top: .25rem; }
.lead-card blockquote {
  margin: var(--s-2) 0;
  padding-left: var(--s-2);
  border-left: 4px solid var(--accent);
  font-size: var(--t-lg); font-weight: 600; font-style: italic; color: var(--ink);
  text-wrap: pretty;
}

/* ---- project tracker --------------------------------------------------- */
/* The reason this template exists. State is encoded in FORM as well as text —
   a badge and a filled bar — so progress reads at a glance. */
.projects { display: grid; gap: var(--s-2); }
.project {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s-3);
}
.project-head {
  display: flex; flex-wrap: wrap; gap: .6rem;
  align-items: baseline; justify-content: space-between; margin-bottom: .3rem;
}
.project h3 { font-size: var(--t-lg); }
.project p { font-size: var(--t-sm); }
.badge {
  font-size: var(--t-xs); font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; padding: .28rem .7rem; border-radius: 100px; flex: none;
}
.badge.on-track { background: #e3f3ea; color: #14663f; }
.badge.at-risk  { background: #fdf0dd; color: #8a5300; }

.bar {
  height: 9px; border-radius: 100px; background: var(--line);
  margin-top: var(--s-2); overflow: hidden;
}
.bar span { display: block; height: 100%; border-radius: 100px; background: var(--accent); }
.project:has(.at-risk) { border-left-color: var(--accent); }
.progress-label {
  font-family: var(--font-mono); font-size: var(--t-xs);
  color: var(--soft); margin-top: .45rem; font-variant-numeric: tabular-nums;
}

/* ---- departments ------------------------------------------------------- */
.dept-grid {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.dept-grid li {
  display: flex; align-items: center; gap: .7rem;
  background: var(--ground); border-radius: var(--radius-sm);
  padding: .85rem 1rem; font-weight: 650; color: var(--ink); font-size: var(--t-sm);
}
.dept-grid .i { color: var(--accent); width: 19px; height: 19px; flex: none; }

/* ---- news list --------------------------------------------------------- */
.news-list { display: grid; }
.news-row {
  display: grid; gap: .3rem var(--s-3);
  padding-block: var(--s-3);
  border-top: 1px solid var(--line);
}
.news-row:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 640px) {
  .news-row { grid-template-columns: 160px minmax(0, 1fr); }
}
.news-row h3 { font-size: var(--t-lg); margin-bottom: .2rem; }
.news-row p { font-size: var(--t-sm); }
