/* ===========================================================
   The Civic Stoop — components
   ===========================================================
   Editorial restyles of the existing class names so legacy JS
   keeps working. No card shadows, no rounded pills, no
   gradients. Rules and whitespace separate elements.
   =========================================================== */

/* ---------- "Your CB doesn't post a calendar" notice ---------- */

.cb-notice {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  background: var(--paper-deep);
  border-left: 3px solid var(--accent);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.cb-notice strong { font-weight: 600; }

.cb-notice a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.cb-notice a:hover { color: var(--accent); }

/* ---------- Generic block (replaces .card) ---------- */

.card {
  background: transparent;
  border: none;
  padding: 0.25rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.25rem;
  box-shadow: none;
  border-radius: 0;
  transition: none;
}
.card:hover { box-shadow: none; }
.card:last-child { border-bottom: none; margin-bottom: 0; }

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.4rem;
  margin-bottom: 0.85rem;
}

.card-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.card-body {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- Meeting "card" → editorial entry ---------- */

.meeting-card {
  border-left: none;
  background: transparent;
  padding: 0.85rem 0 1rem;
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--rule-soft);
}
.meeting-card:last-child { border-bottom: none; }

.meeting-card .meeting-committee {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  line-height: 1.25;
}

.meeting-card .meeting-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}
.meeting-card .meeting-meta span { display: inline; }
.meeting-card .meeting-meta span + span::before {
  content: " · ";
  color: var(--rule);
  margin: 0 0.4rem;
}

.meeting-card .meeting-actions {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.8rem;
}

/* ---------- Bill "card" → editorial entry ---------- */

.bill-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule-soft);
  border-radius: 0;
  padding: 0.85rem 0 1rem;
  margin-bottom: 0;
  box-shadow: none;
}
.bill-card:last-child { border-bottom: none; }

.bill-card .bill-number {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bill-card .bill-title {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  margin: 0.15rem 0 0.4rem;
  line-height: 1.3;
  font-size: 1.05rem;
}

.bill-card .bill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}
.bill-card .bill-meta span + span::before {
  content: " · ";
  color: var(--rule);
  margin: 0 0.4rem;
}

.bill-card .bill-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.8rem;
}

/* ---------- Status mark (replaces pill badge) ---------- */

.status-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0;
  border-radius: 0;
  border-bottom: 2px solid currentColor;
}
.status-badge.introduced { color: var(--accent); }
.status-badge.committee { color: #9C7A14; }
.status-badge.passed,
.status-badge.enacted   { color: var(--positive); }
.status-badge.vetoed    { color: var(--negative); }
.status-badge.hearing   { color: #6B21A8; }
.status-badge.calendar  { color: #075985; }
.status-badge.filed,
.status-badge.deferred  { color: var(--ink-muted); }

/* ---------- Buttons (editorial actions) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transform: none;
}
.btn:active { transform: none; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule);
}
.btn-secondary:hover {
  background: var(--paper-deep);
  color: var(--ink);
  border-color: var(--ink);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.7rem; }
.btn-lg { padding: 0.7rem 1.3rem; font-size: 0.85rem; }

/* Inline link-button (used for "Read more →" type actions) */
.link-action {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  text-decoration: none;
}
.link-action:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* ---------- Forms ---------- */

.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  border-radius: 0;
  font-size: 1rem;
  font-family: var(--sans);
  color: var(--ink);
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: none;
}

.form-input::placeholder { color: var(--ink-muted); }

.form-input:disabled {
  color: var(--ink-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---------- Search bar ---------- */

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}
.search-bar .form-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 1.5rem;
  gap: 0;
  flex-wrap: wrap;
}

.tab {
  padding: 0.65rem 1rem 0.65rem 0;
  margin-right: 1.25rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Filter panel ---------- */

.filter-panel {
  background: transparent;
  border: none;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.filter-panel h3 {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.65rem;
}

.filter-group { margin-bottom: 0.85rem; }
.filter-group:last-child { margin-bottom: 0; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
  border: none;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
}
.checkbox-label:hover { color: var(--ink); }
.checkbox-label input { display: none; }
.checkbox-label.checked {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* ---------- Toggle switch ---------- */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.toggle-track {
  width: 36px;
  height: 18px;
  background: var(--rule);
  border-radius: 0;
  position: relative;
  transition: background 0.2s;
  border: 1px solid var(--ink);
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: transform 0.2s;
}

.toggle input { display: none; }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: var(--paper);
  border-color: var(--paper);
}

/* ---------- Council member card (editorial) ---------- */

.member-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: transparent;
  border: none;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 1rem 0 1.1rem;
  box-shadow: none;
}

.member-card .member-photo {
  width: 64px;
  height: 64px;
  border-radius: 0;
  object-fit: cover;
  background: var(--paper-deep);
  flex-shrink: 0;
  border: 1px solid var(--ink);
}

.member-card .member-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.2;
}

.member-card .member-district {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

.member-card .member-contact {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.member-card .member-contact a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  align-self: flex-start;
}
.member-card .member-contact a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.65rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.78rem;
}

.pagination button {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.pagination button:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}
.pagination button:disabled { opacity: 0.4; cursor: default; }

.pagination .page-info {
  font-size: 0.78rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .meeting-card .meeting-meta { flex-direction: column; gap: 0.15rem; }
  .meeting-card .meeting-meta span + span::before { content: ""; margin: 0; }
  .bill-card .bill-meta { flex-direction: column; gap: 0.15rem; }
  .bill-card .bill-meta span + span::before { content: ""; margin: 0; }

  .member-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .search-bar { flex-direction: column; }
}

/* ---------- Right-rail district sections (council / state reps) ---------- */

.rail-section {
  padding: 0.9rem 0.95rem 1rem;
  margin-bottom: 0.85rem;
  border-left: 3px solid var(--rule);
}

.rail-section:last-child {
  margin-bottom: 0;
}

.rail-section .subsection-head {
  margin-top: 0;
}

/* Council member: warm cream-deep tint with brownstone-red accent strip */
.rail-council {
  background: rgba(162, 62, 44, 0.04);
  border-left-color: var(--accent);
}

/* NY State reps: cool ink tint with deep-teal accent strip */
.rail-staterep {
  background: rgba(44, 95, 122, 0.05);
  border-left-color: #2C5F7A;
}

/* Community board: neutral sand tint with muted-gold accent strip */
.rail-community-board {
  background: rgba(122, 95, 44, 0.05);
  border-left-color: #7A6B2C;
}

/* ---------- ZIP-to-district map modal (multi-district picker) ---------- */

.zipmap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.zipmap-dialog {
  background: var(--paper);
  width: min(960px, 100%);
  max-height: 92vh;
  border: 1px solid var(--rule);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  /* Whole dialog scrolls naturally when content is taller than 92vh — easier
   * to discover than a nested-only scroll area. The footer below stays pinned
   * at the bottom of the visible area via position: sticky so the Save button
   * is always reachable without finding an inner scrollbar. */
  overflow-y: auto;
}

/* The "scroll" wrapper is purely a content container now — actual scrolling
 * is handled by the dialog above. Keep the class so existing markup works. */
.zipmap-scroll {
  /* no special layout; result section flows naturally */
}

/* Sticky footer with the Save button. position: sticky keeps it pinned at
 * the bottom of whatever portion of the dialog is currently visible, so the
 * Save button is reachable without scrolling once the rep list is populated. */
.zipmap-footer {
  position: sticky;
  bottom: 0;
  padding: 0.6rem 1.25rem;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  display: flex;
  justify-content: flex-end;
  z-index: 1;
}

.zipmap-footer:empty {
  display: none;
}

.zipmap-save {
  /* Override any default top-margin from .btn so it sits flush in the footer. */
  margin-top: 0 !important;
}

.zipmap-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 1.25rem 0.4rem;
  border-bottom: 2px solid var(--ink);
}

.zipmap-header h2 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.zipmap-close {
  font-family: var(--sans);
  font-size: 1.75rem;
  line-height: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0 0.25rem;
}

.zipmap-close:hover {
  color: var(--ink);
}

.zipmap-subhead {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.4rem 1.25rem 0.3rem;
}

.zipmap-canvas {
  flex: 0 0 auto;
  height: 240px;
  margin: 0 1.25rem;
  border: 1px solid var(--rule);
}

.zipmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  flex-shrink: 0;
}

.zipmap-legend:empty {
  display: none;
}

.zipmap-chip {
  font-family: var(--sans);
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem 0.4rem 0.6rem;
  border: 1px solid var(--rule);
  border-left-width: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.zipmap-chip:hover {
  background: var(--paper-deep, #ECE6D8);
}

.zipmap-chip strong {
  margin-right: 0.4rem;
}

.zipmap-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem 0.5rem;
}

.zipmap-result {
  padding: 0.5rem 1.25rem 0;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.zipmap-result-heading {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.zipmap-result-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem;
  padding: 0.25rem 0;
  align-items: baseline;
}

.zipmap-result-row .k {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.zipmap-result-row .v {
  color: var(--ink);
}

/* Two-row, two-column rep grid. Council | Comm. Board on top,
 * NY Senate | NY Assembly below. Collapses to a single column on phones. */
.zipmap-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.25rem;
  padding: 0.4rem 0 0.2rem;
}

.zipmap-result-cell .k {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.1rem;
}

.zipmap-result-cell .v {
  color: var(--ink);
  font-size: 0.95rem;
}

@media (max-width: 520px) {
  .zipmap-result-grid {
    grid-template-columns: 1fr;
  }
}

.zipmap-result .btn {
  margin-top: 0.6rem;
}

.zipmap-error {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.875rem;
}

@media (max-width: 600px) {
  .zipmap-overlay { padding: 0; }
  .zipmap-dialog { max-height: 100vh; }
  .zipmap-canvas { height: 200px; margin: 0; }
}

/* ---------- AI agenda summary (homepage Today + meetings calendar) ---------- */

.agenda-summary {
  margin: 0.5rem 0 0.6rem;
  padding: 0.5rem 0 0.5rem 0.75rem;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  font-style: italic;
}

.agenda-summary::before {
  content: "Summary: ";
  font-style: normal;
  font-weight: 600;
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 0.25rem;
}

/* ---------- Topic browser (semantic-ranked matters per concept) ---------- */

.topics-rail {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.topics-rail h3 {
  font-family: var(--serif);
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.75rem;
}

.topic-chip {
  font-family: var(--sans);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.02em;
}

.topic-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.topic-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-hit {
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.topic-hit:last-child {
  border-bottom: none;
}

.topic-hit a {
  color: var(--ink);
  text-decoration: none;
}

.topic-hit a:hover {
  color: var(--accent);
}

.topic-hit-meta {
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--sans);
}

.topic-empty {
  color: var(--muted);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}
