/* ==========================================================================
   Amendments — public record of proposals, deliberations, and outcomes.
   Shares the tenets-page aesthetic (Cardo + Cormorant SC, dark base).
   ========================================================================== */

:root {
  /* Cream/brown deliberation palette. Matches motion-desk. The
     tenets page stays dark on purpose -- the constitution and the
     room where it's deliberated should not look the same. */
  --am-bg: #f0e6cc;            /* page background */
  --am-bg-soft: #e6dcbf;       /* cards, panels, modal */
  --am-ink: #3d2a18;           /* body text */
  --am-ink-bright: #2a1c0e;    /* headings */
  --am-ink-dim: #7a5a3a;       /* chrome, meta, italic copy */
  --am-rule: #b09269;          /* borders */
  --am-gold: #a07a2a;          /* gold accent deepened for cream */
  --am-proposed: #1e5fb0;
  --am-deliberating: #966619;
  --am-ratified: #1f8a3a;
  --am-covered: #6f5635;
  --am-rejected: #b02824;

  /* Type stacks. Cormorant SC is reserved for actual heading titles
     only (page H1, group H2s, modal H2). All other chrome uses the
     system sans stack. */
  --am-font-title: 'Cormorant SC', serif;
  --am-font-chrome: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--am-bg);
  color: var(--am-ink);
}

body {
  font-family: 'Cardo', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}


/* ─── Header ──────────────────────────────────────────────────────── */

.am-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--am-rule);
  background: var(--am-bg);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--am-ink);
  text-decoration: none;
  font-family: var(--am-font-chrome);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  transition: color 0.2s;
}
.back-link:hover { color: var(--am-ink-bright); }
.back-link svg { display: block; }

/* ─── Main layout ─────────────────────────────────────────────────── */

.am-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 32px 120px;
}

/* ─── Hero ────────────────────────────────────────────────────────── */

.am-hero {
  max-width: 720px;
  margin: 0 auto 80px;
  text-align: center;
}

.am-title {
  font-family: var(--am-font-title);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  letter-spacing: 0.16em;
  color: var(--am-ink-bright);
  margin: 0 0 12px;
  line-height: 1.1;
}

.am-under-dev {
  display: block;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  letter-spacing: 0.38em;
  color: var(--am-gold);
  margin: 20px auto 28px;
  padding: 12px 0;
  max-width: 560px;
  border-top: 2px solid var(--am-gold);
  border-bottom: 2px solid var(--am-gold);
}

.am-kicker {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: 1.35rem;
  color: var(--am-ink-dim);
  margin: 0 0 32px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.am-preamble {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--am-ink);
  margin: 0 auto 40px;
  max-width: 620px;
  text-align: left;
}

.am-cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.am-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--am-rule);
  border-radius: 2px;
  background: var(--am-bg-soft);
  color: var(--am-ink-bright);
  text-decoration: none;
  font-family: var(--am-font-chrome);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
}
.am-cta:hover {
  border-color: var(--am-gold);
  color: var(--am-gold);
}
.am-cta-note {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--am-ink-dim);
  margin: 14px 0 0;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Thresholds ──────────────────────────────────────────────────── */

.am-thresholds {
  max-width: 820px;
  margin: 0 auto 100px;
}

.am-thresh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.am-thresh {
  padding: 22px 20px;
  border: 1px solid var(--am-rule);
  background: var(--am-bg-soft);
  text-align: center;
}

.am-thresh-value {
  font-family: var(--am-font-chrome);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--am-ink-bright);
  line-height: 1;
  margin: 0 0 6px;
}

.am-thresh-label {
  font-family: var(--am-font-chrome);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--am-ink-dim);
  margin: 0;
  text-transform: uppercase;
}

/* ─── Venue modal ─────────────────────────────────────────────────── */

.am-modal[hidden] { display: none; }

.am-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.am-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 14, 0.78);
  cursor: pointer;
}

.am-modal-card {
  position: relative;
  z-index: 1;
  max-width: 460px;
  width: 100%;
  background: var(--am-bg-soft);
  border: 1px solid var(--am-gold);
  border-radius: 2px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
  animation: am-modal-in 0.18s ease-out;
}

@keyframes am-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.am-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--am-ink-dim);
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.2s;
}
.am-modal-close:hover,
.am-modal-close:focus-visible {
  color: var(--am-ink-bright);
  outline: none;
}

.am-modal-title {
  font-family: var(--am-font-title);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--am-gold);
  margin: 0 0 14px;
}

.am-modal-body {
  font-family: 'Cardo', serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--am-ink);
  margin: 0;
}

body.am-modal-open {
  overflow: hidden;
}

/* ─── Examples toggle + banner ────────────────────────────────────── */

.am-toggle-row {
  max-width: 820px;
  margin: 0 auto 40px;
  text-align: center;
}

.am-toggle-btn {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--am-rule);
  border-radius: 2px;
  background: transparent;
  color: var(--am-ink-dim);
  font-family: var(--am-font-chrome);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.am-toggle-btn:hover,
.am-toggle-btn:focus-visible {
  border-color: var(--am-gold);
  color: var(--am-gold);
  outline: none;
}
.am-toggle-btn[aria-pressed="true"] {
  color: var(--am-gold);
  border-color: var(--am-gold);
}

.am-examples-banner {
  max-width: 820px;
  margin: 0 auto 40px;
  padding: 16px 22px;
  border: 1px solid var(--am-gold);
  border-radius: 2px;
  background: var(--am-bg-soft);
}

.am-examples-banner p {
  font-family: 'Cardo', serif;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--am-ink);
  margin: 0;
}

.am-examples-banner strong {
  font-family: var(--am-font-chrome);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--am-gold);
  margin-right: 8px;
}

/* ─── Sections (status groups) ────────────────────────────────────── */

.am-sections {
  display: flex;
  flex-direction: column;
  gap: 80px;
  max-width: 820px;
  margin: 0 auto;
}

.am-group {
  position: relative;
  padding-left: 32px;
  border-left: 1px solid var(--status-color, var(--am-rule));
}

.am-group-header {
  margin: 0 0 24px;
}

.am-group-label {
  font-family: var(--am-font-title);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: 0.18em;
  color: var(--am-ink-bright);
  margin: 0 0 4px;
  line-height: 1;
}

.am-group-count {
  font-family: var(--am-font-chrome);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--status-color, var(--am-ink-dim));
  margin: 0;
  text-transform: uppercase;
}

.am-group-description {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--am-ink-dim);
  margin: 0 0 24px;
  max-width: 620px;
}

.am-empty {
  font-family: 'Cardo', serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--am-ink-dim);
  margin: 0;
  padding: 16px 0;
}

/* ─── Amendment card ──────────────────────────────────────────────── */

.am-card {
  position: relative;
  padding: 22px 24px;
  margin: 0 0 18px;
  background: var(--am-bg-soft);
  border: 1px solid var(--am-rule);
  border-radius: 2px;
}

.am-card-id {
  font-family: var(--am-font-chrome);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--status-color, var(--am-ink-dim));
  margin: 0 0 6px;
  text-transform: uppercase;
}

.am-card-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--am-ink-bright);
  margin: 0 0 12px;
}

.am-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: 'Cardo', serif;
  font-size: 0.92rem;
  color: var(--am-ink-dim);
  margin: 0 0 14px;
}
.am-card-meta b {
  font-weight: 700;
  color: var(--am-ink);
}

.am-card-section {
  margin: 14px 0 0;
}
.am-card-section h4 {
  font-family: var(--am-font-chrome);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--am-ink-dim);
  margin: 0 0 4px;
  text-transform: uppercase;
}
.am-card-section p {
  font-family: 'Cardo', serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--am-ink);
  margin: 0;
}

.am-progress {
  margin: 14px 0 6px;
}
.am-progress-bar {
  position: relative;
  height: 6px;
  background: var(--am-rule);
  border-radius: 3px;
  overflow: hidden;
}
.am-progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--status-color, var(--am-proposed));
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.am-progress-label {
  font-family: var(--am-font-chrome);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--am-ink-dim);
  margin: 6px 0 0;
  text-transform: uppercase;
}

.am-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--status-color, var(--am-ink));
  font-family: var(--am-font-chrome);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.am-card-cta:hover { border-bottom-color: var(--status-color, var(--am-ink)); }

/* ─── Footer ──────────────────────────────────────────────────────── */

.am-footer {
  margin: 120px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--am-rule);
  text-align: center;
  max-width: 820px;
}

.footer-note {
  font-family: var(--am-font-chrome);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--am-ink-dim);
  margin: 0;
}

/* ─── Mobile ──────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .am-main { padding: 48px 20px 80px; }
  .am-hero { margin-bottom: 56px; }
  .am-thresh-grid { grid-template-columns: 1fr; gap: 14px; }
  .am-thresholds { margin-bottom: 64px; }
  .am-sections { gap: 56px; }
  .am-group { padding-left: 20px; }
  .am-card { padding: 18px 16px; }
  .am-card-meta { gap: 12px; font-size: 0.88rem; }
}
