/* Shared look for the visitor page and the editor.
   One typeface, a warm white ground, black ink and one orange.
   See design/mockups/discover-mode-screens-round-two.html. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #F4F2EE;
  --card: #FBFAF7;
  --side: #EEECE7;
  --ink: #151515;
  --ink2: #3A3936;
  --mute: #6B6862;
  --faint: #A19D96;
  --line: #E4E1DB;
  --line2: #D3CFC8;
  --acc: #EE6A1F;
  --acc-ink: #B84A14;
  --acc-soft: #FBE5D7;
  --hl: #F3D4C0;
  --good: #3F7A30;
  --good-dot: #6AA457;
  --warn: #8A6400;
  --warn-dot: #E3AE24;
  --danger: #A8321E;
  --map: #E8E6E1;
  --shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Icons */

.i {
  width: 20px;
  height: 20px;
  flex: none;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i.small {
  width: 16px;
  height: 16px;
}

.i.chev {
  width: 16px;
  height: 16px;
  color: var(--faint);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.btn .i {
  width: 18px;
  height: 18px;
}

.btn.full {
  display: flex;
  width: 100%;
}

.btn.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line2);
}

.btn.danger {
  background: var(--danger);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: #E7E4DE;
  color: var(--mute);
  box-shadow: none;
  cursor: default;
}

.btn.ghost:disabled {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.link {
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--ink);
}

.round {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.round.plain {
  box-shadow: inset 0 0 0 1.5px var(--line2);
  background: transparent;
}

/* Form fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
}

.optional {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--mute);
}

.needed {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--acc-ink);
}

.help {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--mute);
}

input[type="text"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line2);
  font-size: 15px;
  line-height: 1.45;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* iPhone zooms the page in when a text box with text smaller than 16px is
   tapped, and does not zoom back out, so the page seems too wide. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

input.short {
  width: 88px;
  text-align: center;
}

/* Choice between two or three options, built on real radio buttons. */

.seg {
  display: flex;
  padding: 3px;
  border: 0;
  margin: 0;
  border-radius: 999px;
  background: var(--ink);
  min-width: 0;
}

.seg label {
  flex: 1;
  position: relative;
  min-width: 0;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.seg .i {
  width: 15px;
  height: 15px;
}

.seg input:checked + span {
  background: var(--card);
  color: var(--ink);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--acc);
  outline-offset: 1px;
}

/* On and off switch */

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--line2);
  flex: none;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: left 0.15s ease;
}

.switch[aria-checked="true"] {
  background: var(--ink);
}

.switch[aria-checked="true"]::after {
  left: 21px;
}

/* Ready and unfinished */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.dot.good {
  background: var(--good-dot);
}

.dot.warn {
  background: var(--warn-dot);
}

.dot.acc {
  background: var(--acc);
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--good);
}

.state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good-dot);
}

.state.unfinished {
  color: var(--warn);
}

.state.unfinished::before {
  background: var(--warn-dot);
}

.state.draft {
  color: var(--ink2);
}

.state.draft::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink2);
}

/* Publish turns orange once everything needed is filled in */
.btn.publish-ready {
  background: var(--acc);
  color: var(--ink);
  box-shadow: none;
}

.btn.publish-ready:hover {
  background: #F27D38;
}

/* Tick in an orange circle, and the empty dashed circle */

.tick {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--acc);
  color: #FFFFFF;
  flex: none;
}

.tick .i {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.tick.good {
  background: var(--good-dot);
}

.empty-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px dashed var(--faint);
  flex: none;
}

/* Notes and messages */

.note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink2);
  background: var(--acc-soft);
  border-radius: 12px;
  padding: 10px 13px;
}

.problem {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 3000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: var(--shadow);
}

.toast[data-kind="error"] {
  background: var(--danger);
}

/* Dialogs */

dialog.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 22px;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4);
}

dialog.dialog::backdrop {
  background: rgba(21, 21, 21, 0.4);
}

.dialog h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.dialog p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink2);
}

.dialog .actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* The map credit OpenStreetMap asks for, kept small and readable */

.leaflet-container {
  font-family: var(--font);
  background: var(--map);
}

.leaflet-control-attribution {
  font-size: 10px;
  background: rgba(251, 250, 247, 0.85) !important;
  border-radius: 6px 0 0 0;
}

/* OpenStreetMap turned warm grey so it does not compete with the place */
.leaflet-tile-pane {
  filter: grayscale(1) sepia(0.12) brightness(1.04) contrast(0.88);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
