/* What the share pages have of their own (docs/StyleGuide.md); everything else is in geo.css.
   The controls of the heat's style are drawn as on the Monitor's heat page, whose rules these
   follow. */

label.check {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--ink);
}

label.inline {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.2rem 0.75rem;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
}

.grid2 input,
.grid2 select {
  width: 100%;
}

.share-controls {
  display: grid;
  gap: 0.5rem;
}

/* The page's input box, padding and border, on a slider shortens the track the thumb can travel
   inside the box that is drawn. */
.share-controls input[type='range'] {
  margin: 0.35rem 0;
}

.stops {
  display: grid;
  gap: 0.35rem;
}

.stop {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.stop input[type='color'] {
  width: 2.5rem;
  height: 1.8rem;
}

.ramp {
  height: 1rem;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.ramp-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.wheel-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.wheel-row p {
  margin: 0;
  font-size: 0.85rem;
}

.wheel {
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.copy-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* ── the admin page ─────────────────────────────────────────────────────── */

.share-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.share-editor {
  display: grid;
  gap: 0.75rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.share-editor h2 {
  margin: 0;
}

/* The map beside the fields where there is room, above them where there is not. */
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 48rem) {
  .editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.editor-map-block {
  display: grid;
  gap: 0.5rem;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.editor-map {
  height: min(70vh, 40rem);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-map-block .row {
  justify-content: space-between;
  align-items: center;
}

.zoom-note {
  margin: 0;
}

.editor-fields {
  display: grid;
  gap: 0.9rem;
}

.editor-fields fieldset {
  margin: 0;
  padding: 0.6rem 0.75rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-fields legend {
  padding: 0 0.3rem;
  font-weight: 600;
}

/* Whether the viewer may change a choice is said apart from the choice. */
label.check.open {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

/* Every digit as wide as the next. */
.day-field {
  width: 9em;
  font-variant-numeric: tabular-nums;
}

.share-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 48rem) {
  .share-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.share-card {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.75rem;
  margin: 0;
}

.share-card.ended {
  opacity: 0.75;
}

.share-mini {
  height: 8rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.share-mini .leaflet-control-attribution {
  font-size: 0.55rem;
}

.share-about {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.share-about p {
  margin: 0;
  font-size: 0.85rem;
}

.share-title {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.share-ended {
  margin-top: 1.25rem;
}

/* A corner of the area, the first one to close it, and the handle in the middle of an edge. */
.area-handle {
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--raised);
  cursor: grab;
}

.area-handle.first {
  background: var(--accent);
  cursor: pointer;
}

/* Smaller by its icon's size, never by a transform: Leaflet places a marker by its transform. */
.area-handle.middle {
  border-width: 1px;
  opacity: 0.7;
}

/* ── the viewer's map ───────────────────────────────────────────────────── */

.share-view {
  --side-width: 22rem;
}

.share-view .map-stage:not(.side-open) {
  --credit-right: 0px;
}

/* The stage goes full screen with its boxes; the page's own colour stays behind them. */
.map-stage:fullscreen {
  background: var(--ground);
}

.share-tools {
  overflow: visible;
}

.float.share-tools {
  right: calc(var(--credit-right, 0px) + var(--float-gap));
  transition: right var(--motion) var(--motion-ease);
}

.share-side.sliding {
  transition:
    transform var(--motion) var(--motion-ease),
    opacity var(--motion) var(--motion-ease);
}

.share-side.slid-out {
  transform: translateX(calc(100% + var(--float-gap)));
  opacity: 0;
}

/* Too narrow for that, the buttons keep the corner and the filters take the top beside them. */
@media (max-width: 48rem) {
  .float.share-tools {
    left: auto;
  }

  .float.share-side {
    right: calc(2 * var(--float-gap) + 34px);
    width: auto;
    bottom: auto;
    max-height: 60%;
  }
}

.share-tools button {
  display: block;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
}

.share-tools button + button {
  border-top: 1px solid var(--line);
}

.share-tools button:where(:enabled:hover) {
  background: var(--tint);
  color: var(--ink);
}

.share-tools svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

.share-note {
  font-size: 0.85rem;
}

/* The legend sits on the map, above the scale, as narrow as it can be read. */
.heat-legend {
  width: 16rem;
  padding: 0.4rem 0.6rem;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
