/* Research map (Research page). Colours follow styles.css. */
#research-map {
  background: #ffffff;
  border: 1px solid #ece3bf;
  border-radius: 10px;
  padding: 20px 22px 18px;
  margin: 18px 0 28px;
  scroll-margin-top: 70px;
}
.rm-intro { margin: 0 0 12px; }

.rm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.rm-chip, .rm-pill, .rm-reset {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rm-chip {
  min-height: 40px;
  padding: 6px 16px;
  border: 1px solid #d8cfa8;
  background: #fffde7;
  color: #33691e;
}
.rm-chip:hover { background: #dcedc8; }
.rm-chip[aria-pressed="true"] { background: #33691e; border-color: #33691e; color: #ffffff; }
.rm-chip[aria-pressed="true"] .rm-dot { box-shadow: 0 0 0 2px #ffffff; }
.rm-chip:focus-visible, .rm-pill:focus-visible, .rm-reset:focus-visible { outline: 3px solid #ffd54f; outline-offset: 2px; }

.rm-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

.rm-body { display: flex; flex-wrap: wrap; gap: 20px 36px; align-items: flex-start; }
.rm-figure { flex: 1 1 420px; min-width: 0; }
.rm-genome { font-size: 15px; font-weight: 700; color: #6d5f3a; margin-bottom: 8px; }
.rm-karyotype {
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-bottom: 22px;
  position: relative;
  overflow-x: clip; /* a label near the right edge must not widen the page on phones */
}
.rm-chrom { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.rm-barwrap { position: relative; width: 100%; }
.rm-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 18px;
  border-radius: 9px;
  background: #e4dec8;
  overflow: hidden;
  transition: background-color .2s, box-shadow .2s;
}
/* Layers: chromosome bar < CRISPR ticks (1) < published loci (2) < their labels (3) */
.rm-mark { position: absolute; left: 0; right: 0; min-height: 5px; z-index: 2; transition: background-color .2s; }
/* Genes we are editing with CRISPR (not yet published): a thin tick across the chromosome */
.rm-target {
  position: absolute;
  left: -4px;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  transform: translateY(-50%);
  z-index: 1;
  transition: background-color .2s;
}
.rm-tag {
  position: absolute;
  left: 24px;
  z-index: 3; /* above the next chromosome's bar, which would otherwise cover the label */
  transform: translateY(-50%);
  font-size: 16px;
  line-height: 1.15;
  white-space: nowrap;
  color: #2a3122;
  background: #ffffff;
  border: 1px solid #d8cfa8;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(62, 58, 44, .15);
  pointer-events: none;
}
.rm-num { position: absolute; bottom: -22px; left: 0; width: 18px; text-align: center; font-size: 14px; color: #6d5f3a; }

.rm-caption { flex: 1 1 260px; min-width: 0; }
.rm-caption p { margin: 0 0 8px; }
.rm-title { font-weight: 700; font-size: 21px; display: flex; align-items: center; gap: 8px; }
.rm-loci { font-size: 17px; }
.rm-status { margin: 14px 0 0; font-size: 17px; }
.rm-status:empty { display: none; }
.rm-reset {
  border: none;
  background: none;
  padding: 6px 2px;
  color: #1a5fb4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(26, 95, 180, .35);
  text-underline-offset: .2em;
}

/* Space between the project sections. Padding, not margin: rmarkdown gives section headings a
   negative top margin (to clear the fixed navbar on anchor links), which would cancel a margin.
   scroll-margin-top (75px - padding) keeps anchor links landing below the navbar as before. */
#research-map ~ .section.level3 { padding-top: 34px; scroll-margin-top: 41px; }

/* Theme tags under each project heading */
.rm-section-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }
.rm-pill {
  min-height: 30px;
  padding: 2px 12px;
  font-size: 15px;
  border: 1px solid #d8cfa8;
  background: #ffffff;
  color: #3e3a2c;
}
.rm-pill:hover { background: #dcedc8; }

@media (max-width: 600px) {
  #research-map { padding: 16px 14px; }
  .rm-bar, .rm-num { width: 14px; }
  .rm-tag { left: 17px; font-size: 14px; padding: 1px 4px; }
  .rm-target { left: -3px; width: 20px; }
}

/* "Genes we are editing with CRISPR" boxes under the projects (crispr_targets in research_map.yml) */
.crispr-box {
  margin: 16px 0 14px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #ece3bf;
  border-left: 4px solid #4E7D2B;
  border-radius: 8px;
}
.crispr-title { margin: 0 0 4px; font-weight: 700; }
.crispr-flag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  vertical-align: 2px;
  color: #6b4a00;
  background: #fff3cd;
  border: 1px solid #e2c15a;
  border-radius: 999px;
}
.crispr-intro { margin: 0 0 8px; font-size: 17px; }
.crispr-genes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.crispr-genes li { margin: 0; }
