/* Livett Migration Model
   Shared site stylesheet for counties, districts, and data pages */

body {
  background: #f7f7f7;
  color: #222;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  margin: 0;
}

main {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  padding: 2rem 1.5rem 3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

h1, h2, h3 {
  color: #111;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.subtitle {
  text-align: center;
  margin: 0 0 1.5rem 0;
  color: #444;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.25rem;
}

h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem 0;
}

p {
  margin: 0 0 1rem 0;
}

ul {
  margin: 0.35rem 0 1rem 1.2rem;
  padding: 0;
}

li {
  margin-bottom: 0.15rem;
}

nav {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e2e2;
}

nav a {
  color: #1a4d8f;
  text-decoration: none;
  margin: 0 0.6rem;
  font-weight: bold;
}

nav a:hover,
nav .active {
  text-decoration: underline;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: flex-start;
}

.county-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.county-grid li {
  margin-bottom: 0.25rem;
}

.download-list {
  list-style: none;
  margin: 1rem 0 2rem 0;
  padding: 0;
}

.download-list li {
  background: #f9fbff;
  border: 1px solid #dbe6f2;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
  border-radius: 6px;
}

.download-list a {
  font-weight: bold;
  color: #1a4d8f;
  text-decoration: none;
}

.download-list a:hover {
  text-decoration: underline;
}

.download-list small {
  display: block;
  margin-top: 0.25rem;
  color: #555;
}

#email a {
  font-weight: bold;
  color: #1a4d8f;
  text-decoration: none;
}

#email a:hover {
  text-decoration: underline;
}

.county-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.county-columns li {
  padding: 0 0.15rem;
}

/*.county-columns li:hover {
  background: #fff3a0;
  border-radius: 3px;
}*/
.letter-highlight {
  background: #fff3a0;
  border-radius: 2px;
  padding: 0 1px;
}



.county-columns li {
  margin: 0 0 0.2rem 0;
}
.letter-highlight {
  background: #fff3a0;
  border-radius: 2px;
  padding: 0 1px;
}

.district-columns {
  column-count: 3;
  column-gap: 40px;
}

.district-group {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 0.9rem;
}

.district-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.district-group li {
  margin: 0 0 0.12rem 0;
}

.search-box {
  margin: 1rem 0 1.5rem 0;
  padding: 1rem;
  background: #f9fbff;
  border: 1px solid #dbe6f2;
  border-radius: 6px;
}

.search-box label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.search-box input {
  width: 100%;
  max-width: 420px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  border: 1px solid #bbb;
  border-radius: 4px;
  box-sizing: border-box;
}

.search-note {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #555;
}

.no-results {
  display: none;
  margin: 1rem 0 0 0;
  font-style: italic;
  color: #666;
}

@media (max-width: 800px) {
  main {
    padding: 1rem;
    box-shadow: none;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .district-columns {
    column-count: 1;
  }
  .timeline {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .step {
    min-width: 0;
  }

  .step::after {
    content: "↓";
    right: 50%;
    top: auto;
    bottom: -0.5rem;
    transform: translateX(50%);
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  main {
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: #fff;
  }

  nav,
  .search-box,
  .no-results {
    display: none !important;
  }

  .district-columns {
    column-count: 3;
    column-gap: 24px;
  }

  .district-group {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  @page {
    size: A4 portrait;
    margin: 14mm 12mm 14mm 12mm;
  }
}
.timeline {
  display: grid;
  grid-template-columns: repeat(6, max-content);
  gap: 1rem;
  align-items: center;
  justify-content: flex-start;
}
.step {
  background: #f5f7fa;
  border: 1px solid #e2e6ec;
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  text-align: center;
  position: relative;
  white-space: nowrap;
}
.step:first-child {
  background: #e8f1fb;
  border-color: #cddff5;
}
.step span {
  display: block;
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.step p {
  margin: 0;
  font-size: 0.85rem;
}

.step::after {
  content: "→";
  position: absolute;
  right: -0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 0.9rem;
}

.step:last-child::after {
  content: "";
}

.step.final {
  background: #e6f4ea;
  border-color: #b7e0c2;
}

.step.final p {
  color: #1e7a3b;
  font-weight: bold;
}

.highlight {
  background: #fff3a0;
  padding: 0 2px;
  border-radius: 2px;
}
.note {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  background: #f9fbff;
  border-left: 3px solid #1a4d8f;
  color: #444;
  font-size: 0.95rem;
}
.search-box .match {
  border-color: #4caf50;
  background: #f3fbf4;
}

.search-box .no-match {
  border-color: #e57373;
  background: #fff5f5;
}
.journal-entry {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;
  background: #f9fbff;
  border: 1px solid #dbe6f2;
  border-left: 4px solid #1a4d8f;
  border-radius: 6px;
}

.journal-entry h3 {
  margin-top: 0;
}

.journal-meta {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.8rem;
}

.journal-entry h4 {
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

/* DCC shape, size, and density map layout - 2026-05-06
   Uses the flat-file index.html sidebar layout supplied by the user. */

html,
body.dcc-page {
  height: 100%;
  min-height: 100%;
}

body.dcc-page {
  margin: 0;
  overflow: hidden;
  background: #eef2f6;
  color: #1f2933;
}

body.dcc-page .app-shell {
  display: grid;
  grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-height: 0;
}

body.dcc-page .app-shell.filters-hidden {
  grid-template-columns: 1fr;
}

body.dcc-page .app-shell.filters-hidden .sidebar {
  display: none;
}

body.dcc-page .sidebar {
  box-sizing: border-box;
  min-height: 0;
  overflow-y: auto;
  padding: 0.9rem 0.95rem 1.2rem;
  background: #ffffff;
  border-right: 1px solid #cbd6e2;
  box-shadow: 1px 0 5px rgba(0,0,0,0.05);
  z-index: 900;
}

body.dcc-page .sidebar-header h1 {
  margin: 0 0 0.35rem 0;
  text-align: left;
  font-size: 1.18rem;
  line-height: 1.18;
}

body.dcc-page .sidebar-header p,
body.dcc-page .note-text,
body.dcc-page .load-status {
  margin: 0.35rem 0 0.65rem;
  color: #4d5a66;
  font-size: 0.86rem;
  line-height: 1.35;
}

body.dcc-page .control-row,
body.dcc-page .compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0;
}

body.dcc-page button,
body.dcc-page select,
body.dcc-page input {
  font: inherit;
}

body.dcc-page button {
  border: 1px solid #b8c6d4;
  background: #f8fbff;
  color: #1f3652;
  border-radius: 5px;
  padding: 0.32rem 0.52rem;
  cursor: pointer;
  font-size: 0.84rem;
}

body.dcc-page button:hover {
  background: #eaf3ff;
}

body.dcc-page .status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0;
}

body.dcc-page .status-grid div {
  background: #f7f9fc;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
}

body.dcc-page .status-grid strong {
  display: block;
  color: #111;
  font-size: 1rem;
  line-height: 1.1;
}

body.dcc-page .status-grid span {
  display: block;
  color: #5b6773;
  font-size: 0.72rem;
  line-height: 1.15;
  margin-top: 0.16rem;
}

body.dcc-page details {
  background: #fff;
  border: 1px solid #d8e2ee;
  border-radius: 7px;
  margin: 0.55rem 0;
  padding: 0.45rem 0.55rem;
}

body.dcc-page details[open] {
  background: #fbfdff;
}

body.dcc-page summary {
  cursor: pointer;
  font-weight: bold;
  color: #1f3652;
  font-size: 0.94rem;
}

body.dcc-page .filter-block {
  padding-top: 0.5rem;
}

body.dcc-page .mode-list,
body.dcc-page .checkbox-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.28rem;
}

body.dcc-page label {
  font-size: 0.86rem;
  line-height: 1.25;
}

body.dcc-page .checkbox-list label,
body.dcc-page .mode-list label,
body.dcc-page .check-line {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

body.dcc-page .select-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.18rem;
  margin-top: 0.45rem;
}

body.dcc-page .select-line select,
body.dcc-page .select-line input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bfcbd8;
  border-radius: 4px;
  padding: 0.34rem 0.42rem;
  background: #fff;
}

body.dcc-page .slider-label {
  display: block;
  margin-top: 0.55rem;
}

body.dcc-page input[type="range"] {
  width: 100%;
  box-sizing: border-box;
}

body.dcc-page .range-pair {
  display: none;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid #d8e2ee;
}

body.dcc-page .range-pair.active {
  display: grid;
}

body.dcc-page section h2 {
  margin: 0.8rem 0 0.4rem;
  padding-bottom: 0.2rem;
  font-size: 0.98rem;
  border-bottom: 1px solid #d8e2ee;
  text-align: left;
}

body.dcc-page .legend-list {
  display: grid;
  gap: 0.35rem;
  font-size: 0.83rem;
}

body.dcc-page .legend-row-sidebar {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

body.dcc-page .legend-row-sidebar svg {
  display: block;
}

body.dcc-page .legend-subhead {
  margin-top: 0.55rem;
  font-weight: bold;
  color: #1f3652;
}

body.dcc-page .density-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 12px;
  border: 1px solid #778;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.25rem 0;
}

body.dcc-page .density-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: #5b6773;
  font-size: 0.74rem;
}

body.dcc-page .top-districts {
  margin: 0.25rem 0 0 1.2rem;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.25;
}

body.dcc-page .top-districts li {
  margin-bottom: 0.22rem;
}

body.dcc-page main.map-stage {
  max-width: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
  background: #e6ecf2;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

body.dcc-page #map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #dce6ef;
}

body.dcc-page .sidebar-toggle {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Prevent generic site CSS from scrambling Leaflet tiles, markers, controls, and popups. */
body.dcc-page .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.35;
}

body.dcc-page .leaflet-container img,
body.dcc-page .leaflet-container .leaflet-tile,
body.dcc-page .leaflet-container .leaflet-marker-icon,
body.dcc-page .leaflet-container .leaflet-marker-shadow {
  max-width: none !important;
  max-height: none !important;
}

body.dcc-page .leaflet-container a {
  color: #1a4d8f;
}

body.dcc-page .leaflet-control-attribution {
  font-size: 0.68rem;
}

body.dcc-page .dcc-shape-marker {
  background: transparent !important;
  border: 0 !important;
}

body.dcc-page .dcc-shape-marker svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.30));
}

body.dcc-page .dcc-label {
  background: rgba(255,255,255,0.88);
  border: 1px solid #9aa7b3;
  border-radius: 3px;
  padding: 0.08rem 0.25rem;
  font-size: 0.72rem;
  color: #111;
}

body.dcc-page .popup-table {
  border-collapse: collapse;
  margin-top: 0.35rem;
  font-size: 0.86rem;
}

body.dcc-page .popup-table td,
body.dcc-page .popup-table th {
  border-bottom: 1px solid #e0e0e0;
  padding: 0.12rem 0.35rem 0.12rem 0;
  text-align: left;
}

body.dcc-page .popup-small {
  color: #555;
  font-size: 0.82rem;
}

body.dcc-page .load-status.error-box {
  padding: 0.65rem 0.75rem;
  background: #fff5f5;
  border-left: 4px solid #d44;
  color: #5b1111;
}

@media (max-width: 900px) {
  body.dcc-page {
    overflow: auto;
  }

  body.dcc-page .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  body.dcc-page .sidebar {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #cbd6e2;
  }

  body.dcc-page main.map-stage {
    height: 70vh;
    min-height: 440px;
  }

  body.dcc-page .app-shell.filters-hidden main.map-stage {
    height: 100vh;
  }
}
