/* Sloop Koala — Identity & Movement Browser. Green & white, matches imsearch/index. */

:root {
  --forest:      #103527;
  --green:       #1f7a3d;
  --green-dark:  #17652f;
  --green-bright:#2d8a3e;
  --ink:         #1f2933;
  --muted:       #6b7280;
  --line:        #e6ece7;
  --surface:     #ffffff;
  --shadow-sm:   0 1px 2px rgba(16, 53, 39, 0.06);
  --shadow:      0 1px 2px rgba(16, 53, 39, 0.06), 0 12px 30px rgba(16, 53, 39, 0.07);
  --radius:      14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: #f4f8f5;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* Hero band */
.hero {
  position: relative;
  background: linear-gradient(135deg, #0d2d21 0%, #134232 100%);
  color: #fff;
  text-align: center;
  padding: 30px 40px 40px;
}
.hero-back {
  position: absolute;
  top: 16px;
  right: 24px;
  z-index: 3;
  font-size: 14px;
  font-weight: 600;
  color: #d8ecdb;
  padding: 7px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.hero-back:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.hero-inner { position: relative; z-index: 1; }
.hero-title {
  font-size: 27px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

/* Main */
.im-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 40px 70px;
}
.im-sub {
  color: var(--muted);
  font-size: 15.5px;
  margin: 0 auto 22px;
  max-width: 820px;
  text-align: center;
}
.im-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 22px;
  margin-bottom: 28px;
}
.im-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.im-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green);
}

/* Next button */
.button {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 10px 34px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.1s;
}
.button:hover { background: var(--green-dark); }
.button:active { transform: translateY(1px); }

.button-sm {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
}

.map-controls {
  display: flex;
  gap: 8px;
}

/* Film strip: horizontal scroll, an identity may have many sightings */
.film-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.thumbnail {
  flex: 0 0 170px;
  min-width: 0;
  text-align: center;
  cursor: pointer;
}
.thumbnail img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #eef3ef;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.thumbnail:hover img {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: var(--shadow-sm);
}
.thumbnail p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* First tile is the reference sighting */
.film-strip .thumbnail:first-child img { border: 2px solid var(--green); }
.film-strip .thumbnail:first-child p {
  color: var(--green);
  font-weight: 700;
}

/* Lightbox: enlarged photo over the page; click anywhere to close */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 45, 33, 0.88);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.im-empty { color: var(--muted); font-size: 14px; }

.cohort-summary {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.cohort-summary strong {
  color: var(--green);
  font-weight: 700;
}

.im-hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
}

/* Map */
#map {
  height: 480px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #eef3ef;
}
#map.map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 640px) {
  .im-main { padding: 28px 16px 56px; }
  .hero { padding-left: 18px; padding-right: 18px; }
  #map { height: 360px; }
  .stats-grid { grid-template-columns: 1fr; }
}
