/* src/style.css — Naturkarta green-theme overrides
   ──────────────────────────────────────────────────
   Loaded AFTER Origo's own css/style.css.
   Only overrides colors — does not touch layout, position, or sizing.
   Origo manages all map sizing internally.
   ────────────────────────────────────────────────── */

/* ── Page background (visible if Origo hasn't filled the viewport yet) ── */
body {
  background-color: #1b4332;  /* deep forest green */
}

/* ── Legend / layer panel header accent ── */
.o-legend-header {
  background-color: #2d6a4f !important;
  color: #d8f3dc !important;
}

/* ── Layer group titles in the legend panel ── */
.o-legend-group-header {
  color: #1b4332;
  font-weight: 600;
}

/* ── Active / checked layer rows ── */
.o-legend-layer.active {
  border-left: 3px solid #52b788;
}

/* ── Slightly rounder controls for a modern feel ── */
.o-zoom,
.o-scaleline,
.o-legend {
  border-radius: 4px;
}

/* ── Coordinate display — slightly smaller text ── */
.o-position {
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}


/* ── Map title + county selector overlay ── */
#map-title {
  position: fixed;
  top: 12px;
  left: 8px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.93);
  padding: 8px 14px 10px;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  text-align: left;
  max-width: 260px;
  box-sizing: border-box;
}
#map-title > span {
  display: block;
  font-family: sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1b4332;
  line-height: 1.3;
  margin-bottom: 6px;
}

/* ── County selector dropdown ── */
#county-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  justify-content: flex-start;
  margin-top: 4px;
}
#data-source-hint {
  font-family: sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #40916c;
  letter-spacing: 0.02em;
}
#share-view-link {
  margin-left: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #2d6a4f;
  text-decoration: none;
  border-bottom: 1px dashed #52b788;
}
#share-view-link:hover {
  color: #1b4332;
}
#county-select {
  font-family: sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 28px 4px 12px;
  border-radius: 14px;
  border: 1.5px solid #52b788;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%232d6a4f'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none;
  appearance: none;
  color: #2d6a4f;
  cursor: pointer;
  outline: none;
  min-width: 200px;
  transition: border-color 0.15s, background-color 0.15s;
}
#county-select:hover,
#county-select:focus {
  border-color: #2d6a4f;
  background-color: #f0fdf4;
}

/* ── Reservat search input ── */
#reservat-search-wrap {
  margin-top: 6px;
  display: flex;
  justify-content: flex-start;
}
#reservat-search {
  font-family: sans-serif;
  font-size: 11px;
  padding: 3px 10px;
  border: 1.5px solid #52b788;
  border-radius: 12px;
  outline: none;
  color: #1b4332;
  background: transparent;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
#reservat-search::placeholder { color: #95c9aa; }
#reservat-search:focus {
  border-color: #2d6a4f;
  background: #f0fdf4;
}

/* ── Year filter slider ── */
#year-filter-wrap {
  margin-top: 6px;
}
.year-filter-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 3px;
}
.year-filter-title {
  font-size: 10px;
  color: #95c9aa;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#year-label {
  font-size: 12px;
  font-weight: 700;
  color: #1b4332;
}
#year-count {
  font-size: 10px;
  color: #52b788;
}
#year-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #2d6a4f 100%, #d8f3dc 100%);
  outline: none;
  cursor: pointer;
  padding: 6px 0;
  box-sizing: content-box;
}
#year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2d6a4f;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}
#year-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2d6a4f;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  border: none;
}

/* ── Featureinfo popup polish ── */

/* Attribute rows */
.o-identify-content li {
  list-style: none;
  padding: 3px 0;
  font-size: 12px;
  line-height: 1.5;
  border-bottom: 1px solid #f0fdf4;
}
.o-identify-content li:last-child { border-bottom: none; }

/* Label (bold part) */
.o-identify-content li b {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2d6a4f;
}

/* NV link — styled as a pill button */
.o-identify-content a {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1.5px solid #52b788;
  background: transparent;
  color: #2d6a4f;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.o-identify-content a:hover {
  background: #2d6a4f;
  color: #fff;
}

/* ── Statistics panel — bottom-left, clears Origo's right-side legend ── */
#stats-panel {
  position: fixed;
  bottom: 44px;
  left: 8px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.93);
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  min-width: 170px;
  pointer-events: none;
  font-family: sans-serif;
  overflow: hidden;
}
#stats-panel a {
  pointer-events: auto;
}
.stats-header {
  background: #2d6a4f;
  color: #d8f3dc;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-section {
  padding: 8px 12px 10px;
}
.stats-section-title {
  font-size: 9px;
  font-weight: 700;
  color: #95c9aa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.stats-row:last-child { margin-bottom: 0; }
.stats-label {
  font-size: 11px;
  color: #555;
}
.stats-value {
  font-size: 12px;
  font-weight: 700;
  color: #1b4332;
  white-space: nowrap;
}

/* ── Artobservationer — stats panel link row ── */
.stats-row-link { justify-content: flex-start; margin-top: 2px; }
.stats-row-link a {
  font-size: 10px;
  font-weight: 600;
  color: #52b788;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.stats-row-link a:hover { text-decoration: underline; }

/* Stats hint text (small, muted) */
.stats-hint {
  color: #52796f;
  font-size: 11px;
  line-height: 1.35;
  font-style: normal;
  padding: 2px 0 4px;
}

/* ── IUCN mini bar chart ── */
.iucn-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.iucn-row:last-child { margin-bottom: 0; }
.iucn-cat {
  font-size: 10px;
  font-weight: 700;
  color: #2d6a4f;
  width: 24px;
  flex-shrink: 0;
  text-align: right;
  cursor: default;
}
.iucn-bar-outer {
  flex: 1;
  background: #e8f5e9;
  border-radius: 3px;
  height: 7px;
  overflow: hidden;
}
.iucn-bar-inner {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.iucn-ia   { background: #1b4332; }
.iucn-ib   { background: #2d6a4f; }
.iucn-iii  { background: #74c69d; }
.iucn-iv   { background: #52b788; }
.iucn-v    { background: #95d5b2; }
.iucn-zero { background: #b7c4b1; }
.iucn-num {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* Popup artobs loading text */
.artobs-loading { color: #95c9aa; font-style: italic; font-size: 11px; }

/* ── Om kartan modal — match stats panel / popup theme ── */
.o-map .o-modal:has(.about-body) {
  width: min(420px, 92vw);
  max-width: 420px;
  border-radius: 12px;
  font-family: sans-serif;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
/* Origo modal header (not .o-modal-title) */
.o-map .o-modal:has(.about-body) > .grey-lightest.draggable {
  background: #2d6a4f !important;
  padding: 10px 10px 10px 16px;
  align-items: center;
}
.o-map .o-modal:has(.about-body) > .grey-lightest.draggable .text-weight-bold {
  font-family: sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #d8f3dc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.o-map .o-modal:has(.about-body) > .grey-lightest.draggable .button.grey-lightest {
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.o-map .o-modal:has(.about-body) > .grey-lightest.draggable .button.grey-lightest:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}
.o-map .o-modal:has(.about-body) > .grey-lightest.draggable svg {
  fill: #d8f3dc;
}
.o-map .o-modal:has(.about-body) .o-modal-content {
  font-family: sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: #333;
  padding: 16px 18px 14px;
}
.o-map .o-modal-content .about-body {
  margin: 0;
}
.o-map .o-modal-content .about-lead {
  margin: 0 0 14px;
  color: #1b4332;
  font-size: 13px;
  line-height: 1.5;
}
.o-map .o-modal-content .about-lead strong {
  font-weight: 700;
  color: #1b4332;
}
.o-map .o-modal-content .about-section {
  margin-bottom: 14px;
}
.o-map .o-modal-content .about-section:last-of-type {
  margin-bottom: 10px;
}
.o-map .o-modal-content .about-heading {
  margin: 0 0 6px;
  font-size: 9px;
  font-weight: 700;
  color: #95c9aa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.o-map .o-modal-content .about-list {
  margin: 0;
  padding: 0 0 0 18px;
}
.o-map .o-modal-content .about-list li {
  margin: 0 0 4px;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #444;
  list-style: disc;
}
.o-map .o-modal-content .about-list--ordered {
  padding-left: 20px;
}
.o-map .o-modal-content .about-list--ordered li {
  list-style: decimal;
}
.o-map .o-modal-content .about-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.o-map .o-modal-content .about-link-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.4;
}
.o-map .o-modal-content .about-link-list span {
  color: #666;
  font-size: 11px;
}
.o-map .o-modal-content .about-footer {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #e8f5e9;
  font-size: 11px;
  color: #777;
  line-height: 1.4;
}
.o-map .o-modal-content .about-body a {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  border: 1.5px solid #52b788;
  background: transparent;
  color: #2d6a4f;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.o-map .o-modal-content .about-body a:hover {
  background: #2d6a4f;
  color: #fff;
}

/* ── Mobile: tighten everything below 520 px ── */
@media (max-width: 520px) {
  #stats-panel { min-width: 140px; bottom: 36px; left: 6px; }
  .stats-header { font-size: 10px; padding: 5px 10px; }
  .stats-label  { font-size: 10px; }
  .stats-value  { font-size: 11px; }
  #map-title {
    top: 6px;
    left: 6px;
    padding: 6px 10px 8px;
    max-width: calc(100vw - 70px);
  }
  #map-title span {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .county-btn {
    font-size: 10px;
    padding: 2px 8px;
  }
  #reservat-search {
    width: 150px;
    font-size: 10px;
  }
}
