/* ==========================================================================
   Base / reset
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #fefaf1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: #195795;
  text-decoration: underline;
}

a:hover,
a:focus {
  color: #134070;
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #195795;
  outline-offset: 2px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-header {
  background-color: #195795;
  border-bottom: 1px solid #134070;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: #ffffff;
}

.nav-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  min-height: 44px;
  cursor: pointer;
}

.site-nav {
  display: none;
  width: 100%;
  margin-top: 0.75rem;
}

.site-nav.nav-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.6rem 0.5rem;
  text-decoration: none;
  color: #e0e7ff;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-nav a:hover,
.site-nav a:focus {
  text-decoration: underline;
  color: #ffffff;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  color: #ffffff;
}

.site-header a:focus,
.nav-toggle:focus {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

main {
  padding: 1rem;
  max-width: 60rem;
  margin: 0 auto;
}

.site-footer {
  border-top: 1px solid #d6d3d1;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #44403c;
}

@media (min-width: 700px) {
  .site-header {
    padding: 1.5rem 2rem;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    width: auto;
    margin-top: 0;
  }

  main {
    padding: 2rem;
  }

  .site-footer {
    padding: 1.5rem 2rem;
  }
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.1rem;
}

@media (min-width: 700px) {
  h1 {
    font-size: 2.1rem;
  }

  h2 {
    font-size: 1.6rem;
  }
}

/* ==========================================================================
   Buttons / CTAs
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #e58342;
  border-radius: 4px;
  background-color: #e58342;
  color: #ffffff;
  cursor: pointer;
}

.btn:hover,
.btn:focus {
  background-color: #c96c2e;
  border-color: #c96c2e;
  color: #ffffff;
}

.btn-secondary {
  background-color: #ffffff;
  color: #e58342;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #fff5eb;
  color: #c96c2e;
}

.cta {
  margin: 1.5rem 0;
}

/* ==========================================================================
   Cards / boxes
   ========================================================================== */

.box {
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.who-we-are {
  border-left: 4px solid #f1bf38;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  margin: 1.5rem 0;
}

/* ==========================================================================
   Lists of demands
   ========================================================================== */

.demand-list {
  padding-left: 1.25rem;
}

.demand-list li {
  margin-bottom: 1rem;
}

/* ==========================================================================
   Tracker summary
   ========================================================================== */

.tracker-summary {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  background-color: #ffffff;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Status labels (color + text, never color alone)
   ========================================================================== */

.status {
  font-weight: 700;
  white-space: nowrap;
}

.status-not-yet-raised {
  color: #44403c;
}

.status-raised-no-response {
  color: #78350f;
}

.status-response-received {
  color: #195795;
}

.status-in-progress {
  color: #92400e;
}

.status-passed {
  color: #15803d;
}

.status-rejected {
  color: #c5392c;
}

/* ==========================================================================
   Tracker table (visible at wider widths)
   ========================================================================== */

.tracker-table-wrap {
  display: none;
}

.tracker-table {
  width: 100%;
  border-collapse: collapse;
}

.tracker-table caption {
  text-align: left;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tracker-table th,
.tracker-table td {
  border: 1px solid #d6d3d1;
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}

.tracker-table thead th {
  background-color: #ffffff;
}

.tracker-table th[scope="row"] {
  font-weight: 600;
}

.tracker-table .sources-list {
  margin-top: 0.35rem;
}

.tracker-table .sources-list .notes-link {
  font-size: 0.9rem;
}

/* ==========================================================================
   Tracker cards (visible at narrow widths, default for mobile-first)
   ========================================================================== */

.tracker-cards {
  display: block;
}

.jurisdiction-card {
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.jurisdiction-card h3 {
  margin-top: 0;
}

.jurisdiction-card dl {
  margin: 0;
}

.jurisdiction-card dt {
  font-weight: 600;
  margin-top: 1rem;
}

.jurisdiction-card dt:first-of-type {
  margin-top: 0;
}

.jurisdiction-card dd {
  margin: 0.25rem 0 0;
}

.jurisdiction-card .sources-list {
  margin-top: 0.25rem;
}

.jurisdiction-card .sources-list .notes-link {
  font-size: 0.9rem;
}

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

.sources-list li {
  margin-top: 0.15rem;
}

.sources-list li:first-child {
  margin-top: 0;
}

.sources-list .source-date {
  font-size: 0.85rem;
  color: #57534e;
}

@media (min-width: 700px) {
  .tracker-table-wrap {
    display: block;
    overflow-x: auto;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 2rem;
    padding-right: 2rem;
    box-sizing: border-box;
  }

  .tracker-cards {
    display: none;
  }
}

/* ==========================================================================
   Jurisdiction listing (find-your-government)
   ========================================================================== */

.jurisdiction {
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.jurisdiction-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.jurisdiction-header h2 {
  margin: 0;
  flex: 1;
}

.jurisdiction-toggle {
  flex-shrink: 0;
  background: none;
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  color: #195795;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  min-height: 36px;
  cursor: pointer;
}

.jurisdiction-body {
  margin-top: 0.75rem;
}

.jurisdiction-body.collapsed {
  display: none;
}

.jurisdiction .tip {
  background-color: #ffffff;
  border-left: 4px solid #195795;
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.jurisdiction .help-update {
  font-size: 0.85rem;
  color: #44403c;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

@media (min-width: 700px) {
  .jurisdiction-toggle {
    display: none;
  }

  .jurisdiction-body.collapsed {
    display: block;
  }

  .jurisdiction-header h2 {
    margin: 0 0 0.75rem;
  }
}

/* ==========================================================================
   Search filter
   ========================================================================== */

.search-filter {
  margin-bottom: 1.5rem;
  max-width: 30rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */

form {
  max-width: 40rem;
}

.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hint {
  font-size: 0.9rem;
  color: #44403c;
  margin: 0.25rem 0 0;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #78716c;
  border-radius: 4px;
  font-family: inherit;
  background-color: #ffffff;
  color: #1a1a1a;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input[type="file"] {
  width: 100%;
  padding: 0.5rem 0;
  font-size: 1rem;
}

fieldset {
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  padding: 1rem;
  margin: 0 0 1.25rem;
}

legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  min-height: auto;
  flex-shrink: 0;
}

.field-error {
  color: #c5392c;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
