/* Grant-stacking calculator section on city pages.
   Matches the city-page look: white cards, blue accents, green dollar figures,
   the shared --radius-lg corners and --font stack. Mobile-first; the layout is
   single-column at 375px with no horizontal overflow. Color tokens come from
   the :root block in city.css (loaded before this file). */

.stack-funding {
  padding: 8px 0 48px;
  background: var(--bg);
}

.stacker-card {
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
}

.stacker-heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--heading, #000);
  margin-bottom: 6px;
  line-height: 1.25;
}

.stacker-intro {
  font-size: 0.9rem;
  color: var(--text-faint, #6b7280);
  line-height: 1.55;
  margin-bottom: 18px;
  max-width: 640px;
}

/* Picker */
.stacker-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.stacker-project-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
}

.stacker-select {
  width: 100%;
  max-width: 420px;
  background: var(--bg-alt, #f0f4f8);
  border: 1.5px solid var(--border, #d1d9e0);
  border-radius: 8px;
  color: var(--text, #221f20);
  font-size: 0.92rem;
  font-family: var(--font, 'Work Sans', system-ui, sans-serif);
  padding: 12px 14px;
  cursor: pointer;
}

.stacker-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(64, 126, 201, 0.18);
}

/* Refine-for-your-household row */
.stacker-refine {
  border: 1.5px solid var(--border, #d1d9e0);
  border-radius: var(--radius, 10px);
  padding: 16px 18px 18px;
  margin: 0 0 18px;
  background: var(--bg-alt, #f0f4f8);
}

.stacker-refine-legend {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  padding: 0 6px;
}

.stacker-refine-hint {
  font-size: 0.82rem;
  color: var(--text-faint, #6b7280);
  line-height: 1.5;
  margin-bottom: 12px;
  max-width: 560px;
}

.stacker-refine-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.stacker-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text, #221f20);
  line-height: 1.4;
  cursor: pointer;
  min-height: 28px;
}

.stacker-check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.stacker-check input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.stacker-refine-income {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stacker-income-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
}

/* The honest note under the default full-taxonomy total. */
.stacker-maxnote {
  font-size: 0.82rem;
  color: var(--text-faint, #6b7280);
  line-height: 1.5;
  margin: -8px 0 16px;
  max-width: 560px;
}

/* Result region */
.stacker-result {
  margin-top: 4px;
}

.stacker-empty {
  font-size: 0.9rem;
  color: var(--text-faint, #6b7280);
  background: var(--bg-alt, #f0f4f8);
  border-radius: var(--radius, 10px);
  padding: 18px 20px;
  line-height: 1.55;
}

.stacker-headline {
  font-size: clamp(1.25rem, 3.6vw, 1.7rem);
  font-weight: 800;
  color: var(--green, #2a9d3e);
  line-height: 1.25;
  margin-bottom: 16px;
}

.stacker-breakdown {
  background: rgba(42, 157, 62, 0.06);
  border: 1px solid rgba(42, 157, 62, 0.2);
  border-radius: var(--radius, 10px);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.stacker-breakdown-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint, #6b7280);
  margin-bottom: 10px;
}

.stacker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stacker-item {
  border-bottom: 1px solid rgba(42, 157, 62, 0.18);
}

.stacker-item:last-child {
  border-bottom: none;
}

.stacker-item-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  text-decoration: none;
  color: inherit;
}

.stacker-item-link:hover .stacker-item-name,
.stacker-item-link:focus-visible .stacker-item-name {
  color: var(--blue);
  text-decoration: underline;
}

.stacker-item-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.stacker-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #221f20);
  line-height: 1.4;
  min-width: 0;
}

.stacker-item-amount {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green, #2a9d3e);
  white-space: nowrap;
  flex-shrink: 0;
}

/* "check income limits" note on an income-deranked program in the total. */
.stacker-item-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a5a00;
  background: rgba(214, 158, 46, 0.18);
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Collapsed "Not included for your household (M)" section. */
.stacker-excluded {
  border: 1px solid var(--border, #d1d9e0);
  border-radius: var(--radius, 10px);
  padding: 0;
  margin-bottom: 16px;
  background: #fff;
}

.stacker-excluded-summary {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text, #221f20);
  padding: 12px 16px;
  cursor: pointer;
  list-style: revert;
}

.stacker-excluded-summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--radius, 10px);
}

.stacker-ex-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stacker-ex-item {
  border-top: 1px solid var(--border, #d1d9e0);
}

.stacker-ex-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 8px;
  text-decoration: none;
  color: inherit;
}

.stacker-ex-link:hover .stacker-ex-name,
.stacker-ex-link:focus-visible .stacker-ex-name {
  color: var(--blue);
  text-decoration: underline;
}

.stacker-ex-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.stacker-ex-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-faint, #6b7280);
  line-height: 1.4;
  min-width: 0;
}

.stacker-ex-why {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-faint, #6b7280);
  white-space: nowrap;
  flex-shrink: 0;
}

/* No-match state */
.stacker-none {
  background: var(--bg-alt, #f0f4f8);
  border-radius: var(--radius, 10px);
  padding: 18px 20px;
}

.stacker-none-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading, #000);
  margin-bottom: 6px;
}

.stacker-none-body {
  font-size: 0.88rem;
  color: var(--text-faint, #6b7280);
  line-height: 1.55;
}

/* Honesty line */
.stacker-honesty {
  font-size: 0.78rem;
  color: var(--text-faint, #6b7280);
  line-height: 1.55;
  margin-top: 4px;
}

/* Share */
.stacker-share {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.stacker-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font, 'Work Sans', system-ui, sans-serif);
  cursor: pointer;
}

.stacker-copy-btn:hover {
  background: var(--blue-dark, #2d5f9e);
}

.stacker-copy-btn:focus-visible {
  outline: 2px solid var(--blue-dark, #2d5f9e);
  outline-offset: 2px;
}

.stacker-copy-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green, #2a9d3e);
  min-height: 1em;
}

/* Off-screen textarea used by the clipboard fallback. */
.stacker-copy-buffer {
  position: absolute;
  left: -9999px;
  top: 0;
  opacity: 0;
}

@media (max-width: 480px) {
  .stacker-card { padding: 20px; }
  .stacker-item-link { padding: 10px 2px; }
}
