/* ==========================================================================
   Home action center — "Your tools"

   The full-bleed tinted band on the home page that gathers the six things a
   visitor can actually DO. Every tile is an <a> styled to be unmistakably
   interactive: a 3px accent bar along the top in a colour from the thermal
   ramp, an icon, a verb-first title, and an arrow that moves on hover.

   The ramp assignment follows the site's legend rather than taste:
     teal    = the map-adjacent tools (how close, the numbers behind the map)
     amber   = the county's pipeline (alerts about filings)
     violet  = the record of what was proposed (the story, your own reports)
     signal  = a resident reporting — the loudest, as everywhere on the site.

   Linked from index.html only. Tokens from css/tokens.css only.
   ========================================================================== */

.tool-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  margin-top: var(--space-5);
}

@media (min-width: 640px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

/* ---- The tile ----------------------------------------------------------- */

.tool-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: var(--bg-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

/* The 3px accent bar. Same device as the concern cards, so a reader who has
   met one has met the other. */
.tool-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tool-accent, var(--teal));
  transition: height var(--duration-base) var(--ease-out);
}

.tool-tile:hover {
  transform: translateY(-3px);
  border-color: var(--tool-accent, var(--teal));
  box-shadow: var(--shadow-md);
  color: inherit;
}

.tool-tile:hover::before {
  height: 6px;
}

.tool-tile:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Ramp assignments ---------------------------------------------------- */

.tool-tile--teal {
  --tool-accent: var(--teal);
  --tool-accent-text: var(--teal-deep);
  --tool-accent-soft: var(--teal-soft);
}

.tool-tile--amber {
  --tool-accent: var(--amber);
  --tool-accent-text: var(--amber-deep);
  --tool-accent-soft: var(--amber-soft);
}

.tool-tile--violet {
  --tool-accent: var(--violet);
  --tool-accent-text: var(--violet-deep);
  --tool-accent-soft: var(--violet-soft);
}

/* Report an issue — the loudest tile, as everywhere on the site. */
.tool-tile--signal {
  --tool-accent: var(--signal);
  --tool-accent-text: var(--signal-deep);
  --tool-accent-soft: var(--signal-soft);
  border-color: var(--border-strong);
}

/* ---- Inside the tile ------------------------------------------------------ */

.tool-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--tool-accent-soft, var(--teal-soft));
  color: var(--tool-accent-text, var(--teal-deep));
  margin-bottom: var(--space-1);
}

.tool-tile__icon svg {
  width: 22px;
  height: 22px;
}

.tool-tile__title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  font-stretch: var(--width-normal);
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.01em;
  line-height: var(--leading-snug);
  color: var(--text);
  transition: color var(--duration-fast) var(--ease-out);
}

.tool-tile:hover .tool-tile__title {
  color: var(--tool-accent-text, var(--teal-deep));
}

/* Live unread count on "Track your reports", filled by js/home.js when a
   session exists. Signal, because it is about YOUR reports. */
.tool-tile__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--signal-deep);
  color: var(--text-on-accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.tool-tile__badge[hidden] {
  display: none;
}

.tool-tile__body {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-muted);
  margin: 0;
}

/* The computed line under "Get alerts" — filled from data/activity.json by
   js/home.js, hidden until the number is real. Mono, because it is data. */
.tool-tile__stat {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--tool-accent-text, var(--teal-deep));
  margin: 0;
}

.tool-tile__stat[hidden] {
  display: none;
}

/* The arrow affordance. Always visible — the tile must read as a link before
   the pointer arrives — and it slides right on hover. */
.tool-tile__go {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--tool-accent-text, var(--teal-deep));
}

.tool-tile__go svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-base) var(--ease-out);
}

.tool-tile:hover .tool-tile__go svg {
  transform: translateX(4px);
}

/* ---- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .tool-tile,
  .tool-tile::before,
  .tool-tile__go svg,
  .tool-tile__title {
    transition: none;
  }

  .tool-tile:hover {
    transform: none;
  }

  .tool-tile:hover .tool-tile__go svg {
    transform: none;
  }
}
