@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap");

:root {
  --navy-900: #0b3c5d;
  --navy-800: #0d4a73;
  --navy-700: #135a82;
  --navy-600: #1a6f9e;
  --gold-500: #f2a900;
  --gold-600: #c48a00;
  --white: #ffffff;
  --ink: #0a2538;
  --gray-100: #f4f7fb;
  --gray-200: #e6edf5;
  --gray-300: #d6e1ed;
  --gray-500: #7890a8;
  --gray-700: #32485f;
  --danger-600: #8f2730;
  --shadow: 0 10px 28px rgba(11, 60, 93, 0.12);
  --shadow-soft: 0 4px 12px rgba(11, 60, 93, 0.09);
  --radius: 14px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(242, 169, 0, 0.1), transparent 45%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 35%);
  line-height: 1.6;
}

.container {
  width: min(1080px, 92%);
  margin-inline: auto;
}

.site-header {
  background: rgba(11, 60, 93, 0.97);
  border-bottom: 2px solid var(--gold-500);
  box-shadow: 0 6px 16px rgba(11, 60, 93, 0.25);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  text-decoration: none;
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1.1rem;
  display: inline-block;
  padding: 6px 0;
}

.brand-logo {
  display: block;
  height: 56px;
  width: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a {
  text-decoration: none;
  color: #d7e6f7;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.menu-toggle {
  display: none;
}

.page-top {
  padding: 24px 0 6px;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 8px;
}

.page-links a {
  text-decoration: none;
  color: var(--navy-800);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow-soft);
}

.page-links a:hover,
.page-links a:focus-visible {
  border-color: #9cb5d3;
  background: #f3f8ff;
}

.hero {
  background: transparent;
  padding: 64px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--navy-700);
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--navy-900);
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 10px 0 16px;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 700;
  color: var(--navy-700);
  margin: -4px 0 18px;
  letter-spacing: 0.03em;
}

h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  margin-top: 0;
  margin-bottom: 14px;
}

.lead {
  font-size: 1.08rem;
  max-width: 62ch;
  line-height: 1.65;
  color: #233c57;
}

.lead-sm {
  margin-top: 0;
  color: #35516d;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--navy-800);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy-800);
  border-color: #9cb5d3;
}

.btn-danger {
  background: var(--danger-600);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  border-color: var(--gray-200);
  color: var(--white);
}

.section {
  padding: 56px 0;
}

.section.alt {
  background: #f7fbff;
  border-top: 1px solid #ecf2f9;
  border-bottom: 1px solid #ecf2f9;
}

.card {
  background: linear-gradient(180deg, #ffffff, #fcfdff);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.hero-card {
  border-top: 4px solid var(--gold-500);
}

.hero-card h2 {
  margin-bottom: 12px;
}

.hero-card p {
  line-height: 1.65;
}

.hero-card .badge-row {
  margin-top: 18px;
}

.badge-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge-row.wrap {
  flex-wrap: wrap;
}

.badge {
  background: #fffaea;
  color: #604400;
  border: 1px solid #f3de9f;
  border-radius: 999px;
  padding: 5px 11px;
  font-weight: 700;
  font-size: 0.8rem;
}

.badge.level {
  background: #eef4ff;
  color: #16355f;
  border-color: #bfd5ff;
}

.chip {
  background: var(--navy-800);
  color: var(--white);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.84rem;
}

.office-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.branch-card ul,
.card ul {
  padding-left: 18px;
  margin: 4px 0 0;
}

.process-list {
  margin: 0;
  padding-left: 22px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c4d3e4;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  background: #fbfdff;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.menu-toggle:focus-visible {
  outline: 3px solid #88b3ff;
  outline-offset: 1px;
}

.section-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.issue-card,
.bill-card,
.candidate-card {
  position: relative;
  overflow: hidden;
}

.issue-card::before,
.bill-card::before,
.candidate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold-500));
}

.issue-card h4,
.bill-card h4,
.candidate-card h4 {
  margin: 4px 0 8px;
}

.candidate-card .meta {
  margin-bottom: 10px;
}

.candidate-card p:last-child {
  margin-bottom: 0;
  line-height: 1.55;
}

.meta {
  color: var(--gray-700);
  font-size: 0.9rem;
}

.status {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
}

.status-Draft { background: #ecf2ff; color: #18436f; }
.status-PassedHouse { background: #f7ebff; color: #5e2378; }
.status-PassedSenate { background: #e9fff4; color: #0d5a37; }
.status-SenttoPresident { background: #fff7df; color: #6a4900; }
.status-Adopted { background: #e8fff0; color: #0f6c3d; }
.status-Vetoed { background: #ffe9eb; color: #7c2128; }

.vote-results ul {
  margin: 14px 0 0;
  padding-left: 20px;
  line-height: 1.55;
}

.vote-card {
  margin-top: 32px;
  padding: 26px 28px;
}

.vote-card h3 {
  margin-top: 0;
  margin-bottom: 4px;
}

.vote-card .stack {
  gap: 14px;
  margin-top: 8px;
}

.prose-block #candidateCards {
  margin-bottom: 4px;
}

.prose-block > h2 {
  margin-top: 0;
  margin-bottom: 14px;
}

.prose-block > * ~ h2 {
  margin-top: 36px;
}

.prose-block > h3 {
  margin-top: 32px;
  margin-bottom: 16px;
}

.branch-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.branch-card p {
  margin: 0 0 14px;
  line-height: 1.65;
}

.branch-card ul {
  margin: 4px 0 0;
  line-height: 1.55;
}

/* Branches page: full-width stacked bands; each card is title | body (horizontal), not 3 narrow columns */
.branches-row {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 28px;
  max-width: none;
}

.branches-row .branch-card {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  column-gap: 28px;
  row-gap: 0;
  align-items: start;
}

.branches-row .branch-card h3 {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin: 0;
  padding-top: 2px;
  line-height: 1.3;
}

.branches-row .branch-card p {
  grid-column: 2;
  grid-row: 1;
  margin: 0 0 12px;
}

.branches-row .branch-card ul {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
}

@media (max-width: 640px) {
  .branches-row .branch-card {
    grid-template-columns: 1fr;
  }

  .branches-row .branch-card h3 {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 10px;
  }

  .branches-row .branch-card p {
    grid-column: 1;
    grid-row: 2;
  }

  .branches-row .branch-card ul {
    grid-column: 1;
    grid-row: 3;
  }
}

.grid.grid-3 > a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 22px 24px;
}

.grid.grid-3 > a.card h3 {
  margin: 0 0 10px;
}

.grid.grid-3 > a.card p {
  margin: 0;
  line-height: 1.55;
}

.grid.grid-3 > a.card:focus-visible {
  outline: 3px solid rgba(19, 90, 130, 0.45);
  outline-offset: 3px;
}

.bill-card p {
  margin: 0;
  line-height: 1.6;
}

.section .container > h2 {
  margin-bottom: 20px;
}

.prose-block > h1 {
  margin-bottom: 18px;
}

.home-action-list {
  margin: 10px 0 0;
  padding-left: 24px;
  line-height: 1.7;
}

.home-action-list li {
  margin-bottom: 12px;
}

.home-action-list li:last-child {
  margin-bottom: 0;
}

.home-extra-note {
  margin-top: 22px;
  max-width: 68ch;
  line-height: 1.65;
}

.disclaimer {
  margin-top: 12px;
  padding: 12px;
  border-left: 4px solid var(--gold-600);
  background: #fff9ed;
}

.constitution-identity {
  margin: 0 0 22px;
  max-width: 72ch;
  font-weight: 600;
  font-size: 1.04rem;
  line-height: 1.55;
  color: var(--navy-800);
}

.constitution h2 {
  margin: 28px 0 12px;
  font-size: clamp(1.08rem, 2vw, 1.32rem);
}

.constitution h2:first-child {
  margin-top: 0;
}

.constitution h3 {
  margin: 20px 0 10px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--navy-800);
}

.constitution-rule {
  border: none;
  border-top: 1px solid var(--gray-300);
  margin: 22px 0;
}

.constitution p {
  margin: 0 0 12px;
  line-height: 1.65;
}

.constitution ul,
.constitution ol {
  margin: 4px 0 16px;
  padding-left: 22px;
  line-height: 1.6;
}

.constitution li + li {
  margin-top: 4px;
}

.site-footer {
  background: var(--navy-900);
  color: var(--white);
  padding: 22px 0;
  margin-top: 18px;
  border-top: 2px solid var(--gold-500);
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.site-footer .footer-org {
  margin: 0;
}

.site-footer .footer-tagline {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

@media (max-width: 950px) {
  .hero-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Supabase setup banner (injected by supabaseClient.js) */
.config-warning {
  background: linear-gradient(90deg, #fff4e0, #fff9ed);
  border-bottom: 2px solid var(--gold-600);
  padding: 12px 0;
  font-size: 0.92rem;
  color: #4a3a12;
}

.config-warning-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.config-warning code {
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.prose-block {
  max-width: 72ch;
}

.prose-block p,
.prose-block ul {
  margin-top: 0;
}

.prose-block > p + p {
  margin-top: 1rem;
}

.prose-block > .card {
  margin-top: 24px;
  margin-bottom: 24px;
}

.prose-block > .lead-sm + .card {
  margin-top: 22px;
}

.muted {
  color: var(--gray-700);
  font-size: 0.95rem;
}

.small-print {
  font-size: 0.88rem;
  margin-top: 10px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.footer-nav a {
  color: #d7e6f7;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 6px;
}

.footer-nav .footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.footer-nav .social-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  text-decoration: underline;
  color: var(--white);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.88rem;
}

.error-text {
  color: #c41e3a;
  font-weight: 600;
  margin: 0 0 8px;
}

.status-Signed { background: #e8fff0; color: #0f6c3d; }
.status-VetoOverridden { background: #eef6ff; color: #1a4a7a; }

/* Staff dashboard */
.staff-main .section {
  padding-top: 32px;
}

.staff-login-card,
.staff-signup-card {
  max-width: none;
}

.staff-auth-wrap {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.staff-auth-grid {
  align-items: start;
}

.staff-dashboard {
  margin-top: 24px;
}

.staff-dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.staff-dash-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  line-height: 1.25;
}

.staff-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.staff-panel {
  min-width: 0;
}

.staff-panel > h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

.staff-panel > h4 {
  margin: 16px 0 10px;
  font-size: 1rem;
}

.staff-panel.full-width {
  grid-column: 1 / -1;
}

.staff-card {
  margin-bottom: 12px;
}

.staff-card h4 {
  margin-top: 0;
  margin-bottom: 6px;
}

.staff-card .meta {
  margin: 0 0 10px;
  font-size: 0.88rem;
}

.staff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 10px;
}

.staff-row .app-review-notes,
.staff-row .candidacy-review-notes {
  flex: 1 1 200px;
  min-width: 0;
}

@media (max-width: 640px) {
  .staff-dashboard .staff-card .staff-row {
    flex-direction: column;
    align-items: stretch;
  }

  .staff-dashboard .staff-card .staff-row .btn,
  .staff-dashboard .staff-card .staff-row .btn-sm {
    width: 100%;
    text-align: center;
  }
}

.inline-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-800);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.checkbox-label input {
  width: auto;
}

/* Public home: staff-posted banner (latest published) */
.site-announcement-banner {
  background: linear-gradient(105deg, var(--navy-900) 0%, #0d5a82 100%);
  color: #f4f8fc;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-announcement-banner .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-announcement-banner p,
.site-announcement-banner .banner-message-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  flex: 1 1 220px;
  white-space: pre-wrap;
}

.site-announcement-banner .banner-dismiss {
  flex-shrink: 0;
}

/* Staff: banner announcement list */
.staff-banner-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.staff-banner-card {
  border: 1px solid var(--border-subtle, #d8e0ea);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f7fafd;
}

.staff-banner-body {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.staff-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.staff-banner-actions .meta {
  margin: 0;
}

.staff-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Member portal: spacing and overflow (palette unchanged) */
.member-portal .error-text:empty {
  display: none;
}

.member-portal .member-logged-out-shell > h1 {
  margin-bottom: 8px;
}

.member-portal .member-logged-out-shell > .lead-sm {
  max-width: 65ch;
  margin-top: 0;
  margin-bottom: 20px;
}

.member-portal #member-auth-section .card.stack > h2 {
  margin-top: 0;
}

.member-portal .staff-auth-grid {
  align-items: stretch;
}

.member-application-card {
  margin-top: 0;
}

.member-portal #memberIssuesList .staff-card:last-child {
  margin-bottom: 0;
}

/* Logged-out shell stacks title, intro, and auth blocks */
.member-portal .member-logged-out-shell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Must beat .member-portal .member-logged-out-shell { display: flex } (higher specificity than [hidden] alone) */
.member-portal .member-logged-out-shell[hidden],
.staff-main .staff-logged-out-shell[hidden] {
  display: none !important;
}

.staff-logged-out-shell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.staff-main.staff-page--signed-in .section {
  padding-top: 28px;
  padding-bottom: 40px;
}

.staff-main.staff-page--signed-in .staff-dashboard {
  margin-top: 0;
}

.staff-main.staff-page--signed-in .staff-dash-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-300);
}

/* Signed in: only tools visible — tighten main rhythm and grid */
.member-portal.member-portal--signed-in .section {
  padding-top: 28px;
  padding-bottom: 40px;
}

.member-portal.member-portal--signed-in .staff-dashboard {
  margin-top: 0;
}

.member-portal.member-portal--signed-in .staff-dash-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-300);
}

.member-portal .staff-grid {
  gap: 20px;
}

.member-portal .staff-panel form.stack,
.member-portal .staff-panel .stack {
  gap: 10px;
}

@media (min-width: 960px) {
  .member-portal.member-portal--signed-in .staff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-portal.member-portal--signed-in .staff-panel.full-width {
    grid-column: 1 / -1;
  }
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  border: 1px solid var(--gray-300);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.data-table thead {
  background: var(--gray-100);
}

.details-cell {
  max-width: 220px;
  word-break: break-word;
}

.site-footer .btn-ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 760px) {
  .nav-wrap {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }

  .site-nav {
    gap: 6px;
  }

  .site-nav a {
    font-size: 0.84rem;
    padding: 5px 7px;
  }

  body {
    line-height: 1.55;
  }

  .hero {
    padding-top: 40px;
  }

  .card {
    padding: 15px;
  }

  .page-links {
    gap: 8px;
  }

  .page-links a {
    font-size: 0.82rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
