:root {
  --ink: #161c24;
  --muted: #5d6b7a;
  --line: #dfe5ec;
  --bg: #f6f8fa;
  --panel: #ffffff;
  --accent: #1f6feb;
  --accent-dark: #1a5cc4;
  --good: #17794d;
  --bad: #b42318;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  width: min(820px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Header / footer ---------------------------------------------------------- */

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}

.tagline { color: var(--muted); font-size: 0.9rem; }

main.wrap { padding: 2rem 0 3rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Messages ----------------------------------------------------------------- */

.messages { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 0.5rem;
}

.message--success { border-color: #a9d8bf; background: #eaf7f0; color: var(--good); }
.message--error { border-color: #f0b4ae; background: #fdeeec; color: var(--bad); }

/* Cards and lists ---------------------------------------------------------- */

h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 0.75rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }

.petition-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h2 { margin: 0 0 0.4rem; font-size: 1.25rem; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }

.summary { color: var(--muted); margin: 0 0 1rem; }

.meta { font-size: 0.9rem; color: var(--muted); margin: 0.5rem 0 1rem; }

.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #eceff3;
  color: var(--muted);
  font-size: 0.75rem;
}

.breadcrumb { margin: 0 0 1rem; font-size: 0.9rem; }
.breadcrumb a, .pagination a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover, .pagination a:hover { text-decoration: underline; }

.empty { color: var(--muted); }

/* Progress bar ------------------------------------------------------------- */

.progress {
  height: 10px;
  background: #e7ecf2;
  border-radius: 999px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Petition body ------------------------------------------------------------ */

.petition {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.petition-body { margin-top: 1rem; }

/* Form --------------------------------------------------------------------- */

.sign {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.sign h2 { margin-top: 0; }

.field { margin-bottom: 1rem; }

.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }

.field-input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.field-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.checkbox { font-weight: 400 !important; display: flex !important; align-items: center; gap: 0.5rem; }

.help { color: var(--muted); font-size: 0.8rem; margin: 0.3rem 0 0; }
.error { color: var(--bad); font-size: 0.85rem; margin: 0.3rem 0 0; }
.errors { color: var(--bad); padding-left: 1.2rem; }
.closed { color: var(--muted); }

.button {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { border-color: var(--muted); }

.button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.button--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Signatures --------------------------------------------------------------- */

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

.signature-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.signature__name { font-weight: 600; }
.signature__city, .signature__date { color: var(--muted); font-size: 0.875rem; margin-left: 0.5rem; }

.signature__comment {
  margin: 0.4rem 0 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.pagination { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; font-size: 0.9rem; }

/* Privacy policy / long-form pages ------------------------------------------ */

.prose h2 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.prose p, .prose li { color: #2b3540; }
.prose ul { padding-left: 1.15rem; }
.prose li { margin-bottom: 0.35rem; }
.prose a { color: var(--accent); }

.callout {
  border-left: 3px solid var(--accent);
  background: #f2f7ff;
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
}

.consent {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: var(--muted); }


/* Campaign page ------------------------------------------------------------- */

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.hero h1 { font-size: 2rem; margin-bottom: 0.6rem; }

.lede {
  font-size: 1.075rem;
  color: #2b3540;
  margin: 0 0 1.25rem;
}

.hero .button { margin-top: 0.25rem; }

.borough-tally {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.borough-tally li {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

.borough-tally strong { color: var(--ink); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.panel > h2 { margin-top: 0; }

/* The "this is not rent control" panel has to be impossible to skim past. */
.panel--flag {
  border-left: 4px solid var(--accent);
  background: #f2f7ff;
}

.addressed {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
}

.petition-body { font-size: 1rem; }

/* FAQ ----------------------------------------------------------------------- */

.faq { margin: 0; }

.faq dt {
  font-weight: 650;
  margin-top: 1.25rem;
  color: var(--ink);
}

.faq dt:first-child { margin-top: 0; }

.faq dd {
  margin: 0.35rem 0 0;
  color: #2b3540;
}

/* Form layout --------------------------------------------------------------- */

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-row .field { margin-bottom: 1rem; }

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .hero h1 { font-size: 1.6rem; }
}

select.field-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 13px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}


/* Destructive action -------------------------------------------------------- */

.button--danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
  font-weight: 600;
  margin-right: 0.5rem;
}

.button--danger:hover { background: #93140d; border-color: #93140d; }

/* Section navigation -------------------------------------------------------- */

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgb(22 28 36 / 6%);
}

.section-nav .wrap {
  overflow-x: auto;
  scrollbar-width: none;
}

.section-nav .wrap::-webkit-scrollbar { display: none; }

.section-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.section-nav a {
  display: block;
  padding: 0.7rem 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.section-nav a:hover { color: var(--ink); }

.section-nav a[aria-current="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.section-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Keep anchored sections clear of the sticky bar. */
[id="top"],
.panel[id] {
  scroll-margin-top: 3.75rem;
}

/* Photography ---------------------------------------------------------------
   Bands are generated by bin/process_images.py and included via
   petitions/_photo_band.html. */

.photo-band {
  display: block;
  background: #e7ecf2;
}

.photo-band img {
  display: block;
  width: 100%;
  height: auto;
}

/* Bleed a band to the edges of the panel it opens. */
.panel > .photo-band:first-child {
  margin: -1.5rem -1.5rem 1.5rem;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
}

/* Photo hero ---------------------------------------------------------------- */

.hero--photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  border: none;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
}

.hero--photo .photo-band {
  position: absolute;
  inset: 0;
  background: none;
}

.hero--photo .photo-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scrim: light over the sky, heavy where the text sits. */
.hero--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgb(8 12 18 / 20%) 0%,
    rgb(8 12 18 / 55%) 45%,
    rgb(8 12 18 / 88%) 100%
  );
}

.hero__body {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 2rem 1.75rem 1.75rem;
  color: #fff;
}

.hero--photo h1 {
  color: #fff;
  text-shadow: 0 1px 12px rgb(0 0 0 / 45%);
}

.hero--photo .lede { color: rgb(255 255 255 / 92%); }
.hero--photo .meta { color: rgb(255 255 255 / 82%); }
.hero--photo .meta strong { color: #fff; }

.hero--photo .progress { background: rgb(255 255 255 / 28%); }

.hero--photo .button--primary {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

.hero--photo .button--primary:hover { background: #e9eef5; border-color: #e9eef5; }

.hero--photo .borough-tally { border-top-color: rgb(255 255 255 / 25%); }

.hero--photo .borough-tally li {
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 25%);
  color: rgb(255 255 255 / 85%);
}

.hero--photo .borough-tally strong { color: #fff; }

/* Closing photo above the footer -------------------------------------------- */

.closing-photo { padding-bottom: 2rem; }

.closing-photo .photo-band {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

@media (max-width: 560px) {
  .hero--photo { min-height: 260px; }
  .hero__body { padding: 1.5rem 1.25rem 1.25rem; }
  .panel > .photo-band:first-child { margin: -1.5rem -1.5rem 1.25rem; }
}

/* Reporting a comment ------------------------------------------------------- */

.report { margin: 0.3rem 0 0; }

.report button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  opacity: 0.65;
}

.report button:hover { color: var(--bad); opacity: 1; }

.report button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
  opacity: 1;
}

.signature__comment--hidden {
  font-style: italic;
  font-size: 0.85rem;
  border-left-color: #e7ecf2;
}
