/* Figures in tasks (maps, windrose), core/figures/. Docs: docs/dev/task-figures.md.
   The figure is an SVG scaled to the container; the marks are separate HTML boxes of a fixed 24 px placed
   by percentages, so they stay readable at the phone width where the map shrinks to ~343 px.
   Black and white on purpose: the same picture is printed and the child works on the paper. */

.task-figure {
  --tf-ink: #111;
  --tf-halo: #fff;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  line-height: 1;
  font-family: inherit;
  /* the picture stays the same in a dark theme: it is a paper sheet */
  color: var(--tf-ink);
}

.task-figure--windrose {
  max-width: 420px;
}

.task-figure__svg {
  display: block;
  width: 100%;
  height: auto;
}

.task-figure__mark {
  position: absolute;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--tf-ink);
}

.task-figure__mark--circle {
  background: var(--tf-ink);
  color: #fff;
  border-radius: 50%;
}

.task-figure__mark--square {
  background: #fff;
  border: 2px solid var(--tf-ink);
  border-radius: 4px;
}

/* A point by coordinates: an open dot at the exact place; its label is a separate tag next to it. */
.task-figure__mark--dot {
  width: 11px;
  height: 11px;
  background: #fff;
  border: 2.5px solid var(--tf-ink);
  border-radius: 50%;
}

/* The label of a point (a leader joins it to the dot when it had to move off). */
.task-figure__mark--tag {
  width: auto;
  min-width: 24px;
  text-shadow: 0 0 3px var(--tf-halo), 0 0 3px var(--tf-halo), 0 0 3px var(--tf-halo);
}

/* The dot where a leader meets a small object. */
.task-figure__anchor {
  position: absolute;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  background: var(--tf-ink);
  border-radius: 50%;
}

.task-figure__line-label,
.task-figure__name {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 0 3px var(--tf-halo), 0 0 3px var(--tf-halo), 0 0 3px var(--tf-halo);
}

.task-figure__name {
  font-size: 13px;
}

@media print {
  .task-figure {
    break-inside: avoid;
  }
}

/* Around a figure on a task screen (templates/includes/task_content.html). */
.task-figure-wrap {
  margin: 0 0 14px;
}

.task-figure-note {
  margin: 0 0 8px;
  font-size: 14px;
  opacity: 0.8;
}
