/* The drawn lot map: the park drawing from the sign at the entrance, with a pin on every lot.
   Shared by Nora's dashboard (app.css) and the booking page (site.css), so the two always look the same --
   both stylesheets define the colour and font variables this file uses. Linked by the pages that need it.
   See public/assets/js/lot-map.js. */
/* The drawn lot map with the guests on it (Chief, Oct 18). The drawing is wide, so the box scrolls sideways and the
   labels keep a readable size; it opens on the lot she came from. */
.lotmap-scroll { overflow: auto hidden; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
/* The drawing fills the width it's given, so a computer shows the whole park with no sideways scrolling (Chief,
   Oct 18). On a narrow phone it stops shrinking at min-width and scrolls sideways instead, so the labels stay
   readable. The stage keeps the drawing's shape itself, so the labels sit on their lots whatever the width. */
.lotmap-stage { position: relative; width: 100%; min-width: 640px; aspect-ratio: 2480 / 1080; }
.lotmap-stage img, .lotmap-stage > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 13px; }
/* The lot's own circle on the drawing, outlined in its colour (Chief, Oct 18: "I meant the outer circle, the one on
   the map itself"): black somebody staying, red somebody behind on rent, grey here with no profile yet, yellow
   booked, green open, grey dotted closed. The widths are in the drawing's own units, so they hold at any size. */
.lotmap-stage .lot { stroke-width: 8; }
.lotmap-stage .lot.is-taken { stroke: var(--pin); }
.lotmap-stage .lot.is-owing { stroke: #b3261e; stroke-width: 10; }
.lotmap-stage .lot.is-clearing { stroke: #e8ae00; stroke-width: 10; }
.lotmap-stage .lot.is-due { stroke: #e8ae00; stroke-width: 10; }
/* The drawn map's circle for the same lot, wearing the same hazard stripes as the photo map's pin. A
   stroke can't be a CSS gradient, but it can be a pattern, and lot-map.js puts one into the drawing as it
   reads it (#lot-hazard). Wider than the others so the stripes are big enough to read as stripes. */
.lotmap-stage .lot.is-review { stroke: url(#lot-hazard); stroke-width: 13; }
.lotmap-stage .lot.is-unknown { stroke: #8b938d; }
.lotmap-stage .lot.is-booked { stroke: #d79a24; }
.lotmap-stage .lot.is-open { stroke: #1f7a3f; }
.lotmap-stage .lot.is-out, .lotmap-stage .lot.is-none { stroke: #8b938d; stroke-dasharray: 12 9; }
/* A pin sits on each lot, exactly over the circle the drawing already has there, with the guest's first name hung
   underneath. The circle is sized as a share of the drawing (r=31 in a 2480-wide drawing), so pin and circle stay
   on each other at any width. */
.lotmap-pin {
  --lot: var(--pin);
  position: absolute; transform: translate(-50%, -50%);
  width: 2.5%; min-width: 22px; aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 50%; background: none; box-shadow: none;
  font: 800 .7rem/1.05 var(--font-body); white-space: nowrap; cursor: default; color: var(--pin);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
/* Only while the drawing is still a flat picture: a circle of its own so the map is readable from the first paint.
   Once the drawing itself is in, its circle is the one carrying the number and the colour. */
.lotmap-pin b {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: var(--pin); border: 3px solid var(--lot);
  font: 800 .78rem/1 var(--font-head); text-shadow: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.lotmap-stage.has-drawing .lotmap-pin b { display: none; }
/* The name hangs below the circle instead of sharing its box, so the circle itself never shifts off its lot.
   It is a chip, not loose text (Chief, Oct 26: "this looks sloppy"). Before, the name was drawn straight onto
   the drawing with a white glow behind it, so names sat in the middle of roads and the pond and ran into each
   other, and the badge underneath made every label two lines tall -- which is what pushed one lot's label into
   the lot below. A solid chip with the badge ON THE SAME LINE is half the height, reads as one thing belonging
   to one lot, and covers the road cleanly instead of blurring into it. */
.lotmap-label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; z-index: 2;
  display: flex; align-items: center; gap: 3px; max-width: 96px;
  padding: 1px 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); box-shadow: 0 1px 2px rgba(20, 48, 31, .28);
  text-shadow: none;
}
/* Down the right-hand road the lots are stacked close together, so their names sit beside the circle rather than
   under it, pointing away from the road (Chief, Oct 18: the names overlap sometimes). */
.lotmap-pin.beside-l .lotmap-label { top: 50%; left: auto; right: 100%; transform: translateY(-50%); margin: 0 5px 0 0; }
.lotmap-pin.beside-r .lotmap-label { top: 50%; left: 100%; transform: translateY(-50%); margin: 0 0 0 5px; }
/* The row of lots along the curving road runs down and to the RIGHT, so a label hanging straight down from one
   lands on the next lot along -- which is what was covering lots 6 and 8 (Chief, Oct 26). These hang down and to
   the left instead, into the grass, where there is nothing to cover. */
.lotmap-pin.beside-bl .lotmap-label { left: 50%; transform: translateX(-100%); margin-left: -4px; }
/* The name can be shortened, the badge never: a clipped "WEE" would be worse than no badge at all. */
.lotmap-label > span { font-size: .6rem; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lotmap-label > .lotmap-stay { flex: 0 0 auto; }
/* The one being looked at comes out from under its neighbours. */
.lotmap-pin.is-focus .lotmap-label, button.lotmap-pin:hover .lotmap-label, button.lotmap-pin:focus-visible .lotmap-label { z-index: 4; }
/* By the week or the night: the stays that aren't the park's usual monthly.
   Two colours, not one (Chief, Oct 26). A week and a night mean different things to her -- a week is nearly a
   tenant, a night is gone tomorrow -- and one badge colour made her read the word every time.
   Teal for the week, purple for the night. The rust it started as read as red (Chief, Oct 26), and red already
   means somebody is behind on their rent -- the one colour on this map that has to mean only that. Neither of
   these is any of the lot-ring colours: dark green, red, amber, blue, grey, gold, green. */
.lotmap-stay {
  font: 800 .54rem/1.2 var(--font-body); font-style: normal; letter-spacing: .04em; text-transform: uppercase;
  padding: 0 4px; border-radius: 999px; background: #0f766e; color: #fff; text-shadow: none;
}
.lotmap-stay.is-week { background: #0f766e; }
.lotmap-stay.is-night { background: #6b3fa0; }
button.lotmap-pin { cursor: pointer; }
button.lotmap-pin:hover b, button.lotmap-pin:focus-visible b { border-color: var(--sun); }
.lotmap-stage.has-drawing button.lotmap-pin:hover,
.lotmap-stage.has-drawing button.lotmap-pin:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.lotmap-pin.is-taken { --lot: var(--pin); }
.lotmap-pin.is-owing { --lot: #b3261e; }
.lotmap-pin.is-clearing, .lotmap-pin.is-due { --lot: #e8ae00; color: #6f4906; }
/* A stay nobody has confirmed yet: somebody has claimed this lot and Nora hasn't looked at it (Chief,
   Oct 30). It was a plain blue ring, which on a map of eight colours reads as just another status -- and
   this one is the only one that is a QUESTION rather than a fact. So it gets hazard stripes instead: the
   ring is the one thing on the map that isn't a solid colour, which is what makes it findable at a glance.

   Drawn as two backgrounds rather than a border, because a border can't be striped and still be round:
   the white fill covers the padding box, the stripes fill the border box underneath, and border-radius
   clips both. The border stays 3px and transparent so the pin keeps exactly the size it had. */
.lotmap-pin.is-review { --lot: transparent; color: #7a1d16; }
.lotmap-pin.is-review b {
  background-image: linear-gradient(rgba(255, 255, 255, .94), rgba(255, 255, 255, .94)),
    repeating-linear-gradient(45deg, #e8ae00 0 5px, #b3261e 5px 10px);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
/* The badge under a waiting sign-up says what it is, in the red of its stripes. */
.lotmap-pin.is-review .lotmap-stay { background: #b3261e; }
.lotmap-pin.is-unknown { --lot: #8b938d; color: #43504a; }
.lotmap-pin.is-booked { --lot: #d79a24; color: #7a5207; }
.lotmap-pin.is-open { --lot: #1f7a3f; color: #0f5527; }
.lotmap-pin.is-out, .lotmap-pin.is-none { --lot: #8b938d; color: #6c746e; }
.lotmap-pin.is-focus { z-index: 2; outline: 3px solid var(--sun); outline-offset: 2px; }
.lotmap-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 2px 0; font-weight: 700; color: var(--ink); font-size: .95rem; }
.lotmap-key i { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--pin); box-sizing: border-box; margin-right: 6px; vertical-align: -2px; }
.lotmap-key .k-open i { border-color: #1f7a3f; }
.lotmap-key .k-taken i { border-color: var(--pin); }
/* Her phone and tablet are what she actually uses (Chief, Oct 18). On a phone the whole park fits the screen and the
   labels drop to their numbers; a tablet gets the names back. */
@media (max-width: 760px) {
  /* The drawing keeps its width and the map scrolls sideways: squeezed onto a phone screen the 33 lots sit on top
     of each other (Chief, Oct 18). The list is what her phone opens on; the map is there when she wants the picture. */
  .lotmap-stage { min-width: 900px; }
  .lotmap-pin { min-width: 20px; }
  .lotmap-pin b { font-size: .68rem; border-width: 2.5px; }
  .lotmap-label { display: none; }
  .lotmap-key { font-size: .88rem; gap: 6px 12px; }
}
/* A tablet keeps the names, with enough width that they don't run into each other on the curve; it scrolls a little
   sideways instead, which is natural on a touch screen (Chief, Oct 18). */
/* On a computer her page column is only about 700px, which is too narrow for 33 names. The map steps outside the
   column and uses the window, so the whole park fits with nothing overlapping (Chief, Oct 18). */
@media (min-width: 1061px) {
  /* Only on her dashboard: its page column is narrow, and the booking page's is not. */
  .owner .lotmap-scroll { margin-inline: calc(50% - 50vw + 20px); }
  .lotmap-stage { min-width: 1000px; }
  /* The MAP steps outside the column. The key and the line under it do not (Chief, Nov 1: "the rubric
     needs to be put into the box, not like how they are").
     They used to get the same breakout so their left edge lined up with the map's. The cost was that each
     became as wide as the window: the key stopped wrapping, ran out past the right-hand edge of the card,
     and lost its last entries off the screen -- "By the night" was simply cut in half. Left in the column
     they wrap inside the card, which is where a key belongs, and nothing is ever clipped. */
}
@media (min-width: 761px) and (max-width: 1060px) {
  .lotmap-stage { min-width: 1220px; }
  .lotmap-label > span { max-width: 54px; }
  .lotmap-pin b { font-size: .82rem; }
}
/* The key's dot wears the same stripes, or the map shows one thing and the key says another. */
.lotmap-key .k-review i { border-color: transparent;
  background-image: linear-gradient(#fff, #fff), repeating-linear-gradient(45deg, #e8ae00 0 3px, #b3261e 3px 6px);
  background-origin: border-box; background-clip: padding-box, border-box; }
.lotmap-key .k-unknown i { border-color: #8b938d; }
.lotmap-key .k-owing i { border-color: #b3261e; }
.lotmap-key .k-out i { border-color: #8b938d; border-style: dotted; }
.lotmap-key .k-booked i { border-color: #d79a24; }
.lotmap-key .k-due i { border-color: #e8ae00; }
/* The two badge colours in the key, shaped like the badges themselves rather than like the lot rings. */
.lotmap-key .k-week i, .lotmap-key .k-night i { border-radius: 999px; width: 18px; height: 11px; border: 0; box-shadow: none; }
.lotmap-key .k-week i { background: #0f766e; }
.lotmap-key .k-night i { background: #6b3fa0; }
/* On her front page the map carries the sites, so it gets a little room above the key. */
.lotmap-scroll + .lotmap-key { margin-top: 12px; }
