/* Interactive map (ZikaronMap plugin). Colors and fonts are the theme's
   own variables from style.css. */
.zmap {
  --zmap-pin: #cc4b37;
  --zmap-camp: #4a3f8f;
  --zmap-muted: #5b6368;
  --zmap-height: calc(100vh - 80px); /* the map nearly fills the window, as in the demo */
  margin: 0;
}
/* The map page uses the whole window width (as the demo does), not the
   site's 1240px page width */
body.zikaron-map #content {
  max-width: none;
  padding: 16px 16px 24px;
}
.zmap-title {
  margin: 0 0 12px;
  font-family: var(--pz-serif);
  font-size: 1.75rem;
  color: var(--pz-teal);
}
.zmap-layout {
  display: grid;
  grid-template-columns: 340px 1fr; /* as in the demo */
  gap: 12px;
}
.zmap-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: var(--zmap-height);
  min-height: 520px;
  overflow: auto;
  font-family: var(--pz-sans);
}
.zmap-section {
  padding: 12px 14px; /* as in the demo */
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius);
}
.zmap-section[hidden] {
  display: none;
}
.zmap-section h2 {
  margin: 0 0 8px;
  font-family: var(--pz-serif);
  font-size: 1.15rem; /* as in the demo */
  font-weight: 600;
  line-height: 1.25;
  color: var(--pz-teal);
}
.zmap-section input[type=text],
.zmap-section select {
  width: 100%;
  margin: 0;
  font-size: 0.875rem; /* panel text: 14px throughout */
}
/* "Find a town or country": grey boxes and grey default text, as in the
   demo; white with dark text while in use */
#zmap-q,
#zmap-country {
  height: auto;
  font-size: 0.875rem;
  padding: 8px 10px;
  color: var(--pz-text);
  background-color: #f1f1ef;
  border: 1px solid #c9bda3;
  border-radius: 0.625rem;
  box-shadow: none;
}
#zmap-country {
  padding-right: 28px; /* room for the arrow */
}
#zmap-q::placeholder {
  color: #8a8f93;
  opacity: 1;
}
#zmap-country option {
  color: var(--pz-text);
}
#zmap-q:focus,
#zmap-country:focus {
  background-color: #fff;
  border-color: var(--pz-teal);
  box-shadow: none;
  outline: none;
}
.zmap-muted {
  font-size: 0.875rem; /* panel text: 14px throughout */
  color: var(--zmap-muted);
}
.zmap-section p {
  margin: 4px 0 8px;
}
label.zmap-muted {
  display: block;
  margin-top: 8px;
}
.zmap-inline {
  display: block;
  margin: 8px 0 4px;
  font-size: 0.875rem; /* panel text: 14px throughout */
}
/* A label and a small list on one line ("Minimum resources [1]"), as in
   the demo */
.zmap-inline-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  font-size: 0.875rem;
}
.zmap-inline-row label {
  margin: 0;
  font-size: inherit;
  white-space: nowrap;
}
.zmap-section .zmap-inline-row select {
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 4px 24px 4px 6px;
  font-size: 0.875rem; /* panel text: 14px throughout */
  background-color: #fff;
  border: 1px solid #c9bda3;
  border-radius: 0.625rem;
  box-shadow: none;
}
.zmap-section .zmap-inline-row #zmap-lang {
  flex: 1; /* the language names are long: the rest of the line */
}
.zmap-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 9px 0; /* roomy, so each choice is easy to pick */
  font-size: 0.875rem;
  line-height: 1.3;
}
.zmap-check input {
  flex: none; /* keeps its size when the label wraps */
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

/* Search suggestions */
.zmap-suggest {
  position: relative;
}
#zmap-sug {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 280px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: 0.625rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
#zmap-sug li {
  padding: 8px 10px;
  font-size: 0.875rem; /* panel text: 14px throughout */
  border-bottom: 1px solid var(--pz-border);
  cursor: pointer;
}
#zmap-sug li:hover,
#zmap-sug li.is-active {
  background: var(--pz-teal-light);
}
.zmap-k {
  margin-left: 6px;
  font-size: 0.75rem;
  color: var(--zmap-muted);
}

/* Buttons */
.zmap button {
  font-family: var(--pz-sans);
  cursor: pointer;
}
.zmap-small {
  padding: 4px 9px;
  font-size: 0.8125rem; /* demo: 13px */
  font-weight: 600;
  color: var(--pz-text);
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: 0.625rem;
}
.zmap-small.is-on {
  color: #fff;
  background: var(--pz-teal);
  border-color: var(--pz-teal);
}
.zmap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.zmap-sort {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* Town details */
#zmap-detail {
  position: relative;
}
#zmap-detail h2 {
  padding-right: 28px;
}
.zmap-x {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 6px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--zmap-muted);
  background: none;
  border: 0;
}
.zmap-badge {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 1px 8px;
  font-size: 0.75rem;
  background: var(--pz-teal-light);
  border: 1px solid var(--pz-border);
  border-radius: 9px;
}
#zmap-detail a {
  color: var(--pz-teal);
  text-decoration: underline;
}
#zmap-radius {
  width: 100%;
}
.zmap-books {
  max-height: 300px;
  margin-top: 8px;
  overflow: auto;
  border-top: 1px solid var(--pz-border);
}
#zmap-detail a.zmap-book {
  display: block;
  padding: 6px 2px;
  color: var(--pz-text);
  text-decoration: none;
  border-bottom: 1px solid var(--pz-border);
}
#zmap-detail a.zmap-book:hover {
  background: var(--pz-teal-light);
}
.zmap-bt {
  display: block;
  font-size: 0.875rem; /* demo: 14px */
  line-height: 1.3;
}
.zmap-by {
  display: block;
  font-size: 0.75rem;
  color: var(--zmap-muted);
}

/* Towns in an area */
#zmap-results-list {
  max-height: 300px;
  margin: 6px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border-top: 1px solid var(--pz-border);
}
#zmap-results-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 2px;
  font-size: 0.875rem; /* panel text: 14px throughout */
  text-align: left;
  color: var(--pz-text);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--pz-border);
}
#zmap-results-list button:hover {
  background: var(--pz-teal-light);
}
.zmap-c {
  font-weight: 700;
  color: var(--pz-teal);
  white-space: nowrap;
}

/* The map */
.zmap-mapwrap {
  position: relative;
  min-height: 520px;
  height: var(--zmap-height);
  border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius);
  overflow: hidden;
}
#zmap-map {
  width: 100%;
  height: 100%;
  background: #e6eff0; /* the sea colour, while the map draws */
}
/* Numbers in the town groups, and town names beside the pins (as in the demo) */
#zmap-map .zmap-cl-label {
  letter-spacing: .2px;
  text-shadow: 0 0 1.5px rgba(0, 0, 0, .35);
}
#zmap-map .zmap-pin-label {
  white-space: nowrap;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
/* Map buttons as in the demo: + − ⌂ and the area tool, top right */
.zmap-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zmap-tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  font: 600 20px/1 var(--pz-sans);
  color: var(--pz-text);
  background: #fff;
  border: 1px solid #c9bda3;
  border-radius: 0.625rem;
  cursor: pointer;
}
.zmap-tools button.zmap-home {
  font-size: 14px;
}
.zmap-tools button[hidden] {
  display: none;
}
.zmap-tools button.is-on {
  color: #fff;
  background: var(--pz-teal);
}
#zmap-toolhint {
  position: absolute;
  top: 144px; /* beside the area tool, the 4th button */
  right: 62px;
  z-index: 4;
  padding: 6px 10px;
  font-size: 0.8125rem;
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius);
}
/* A country's name beside the pointer while it is over the country */
#zmap-country-tip {
  position: absolute;
  z-index: 5;
  padding: 3px 8px;
  font-size: 0.8125rem;
  white-space: pre; /* one line per town (towns at the same spot) */
  color: var(--pz-text);
  background: #fff;
  border: 1px solid #c9bda3;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  pointer-events: none;
}
#zmap-country-tip[hidden] {
  display: none;
}
#zmap-border-name {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 4;
  max-width: 60%;
  padding: 4px 10px;
  font-size: 0.875rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: 2px;
  transform: translateX(-50%);
  pointer-events: none;
}
/* Bottom left: the how-to note, with the borders credit above it */
.zmap-bottomleft {
  position: absolute;
  left: 12px;
  bottom: 24px; /* clear of Google's logo and terms line */
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 60%;
  pointer-events: none;
}
.zmap-bottomleft > * {
  pointer-events: auto;
}
.zmap-hint {
  padding: 6px 10px;
  font-size: 0.8125rem;
  color: var(--zmap-muted);
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius);
}
#zmap-credit {
  padding: 2px 6px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
}
#zmap-border-name[hidden],
#zmap-credit[hidden],
#zmap-toolhint[hidden],
#zmap-loading[hidden] {
  display: none;
}
#zmap-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius);
}
.zmap-legend {
  position: absolute;
  right: 12px; /* bottom right, as in the demo */
  bottom: 24px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.8125rem;
  background: #fff;
  border: 1px solid var(--pz-border);
  border-radius: var(--pz-radius);
}
.zmap-sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid #fff;
  border-radius: 50%;
}
.zmap-sw--cluster,
.zmap-sw--pin { background: var(--zmap-pin); }
.zmap-sw--camp { background: var(--zmap-camp); }
.zmap-sw--region { border: 2px solid var(--pz-teal); }
.zmap-sw--border { border: 2px dashed #805700; }

/* Phones and narrow tablets: the map on top, the panel below */
@media screen and (max-width: 53.75em) {
  .zmap-layout {
    grid-template-columns: 1fr;
  }
  .zmap-mapwrap {
    order: 1;
    height: 60vh;
    min-height: 360px;
  }
  .zmap-panel {
    order: 2;
    max-height: none;
    overflow: visible;
  }
  .zmap-legend {
    display: none;
  }
  .zmap-bottomleft {
    max-width: 75%;
  }
  /* 16px: iPhones zoom the page into a smaller text box or list */
  #zmap-q,
  #zmap-country,
  .zmap-section select,
  .zmap-section .zmap-inline-row select {
    font-size: 1rem;
  }
}
