/*
  The Free Range (spec §5.5, decision 017; design/screens/free-range/).
  Loads after fonts.css, tokens.css and base.css (.btn--lg lives in base.css).
  No inline styles: the Content Security Policy blocks style="" attributes.
*/


/* ---------- Type colors (kinds of play) ---------- */
.type-tile--playground, .type-chip--playground { --type-bg: var(--wc-lantern); --type-fg: var(--wc-spy-pond); }
.type-tile--water, .type-chip--water { --type-bg: var(--wc-bubbler); --type-fg: var(--wc-spy-pond); }
.type-tile--skate, .type-chip--skate { --type-bg: var(--wc-bunsen); --type-fg: var(--wc-spy-pond); }
.type-tile--pump, .type-chip--pump { --type-bg: var(--wc-bunsen-tint); --type-fg: var(--wc-spy-pond); }
.type-tile--bikeway, .type-chip--bikeway { --type-bg: var(--wc-bubbler-tint); --type-fg: var(--wc-spy-pond); }
.type-tile--table-tennis, .type-chip--table-tennis { --type-bg: var(--wc-white); --type-fg: var(--wc-spy-pond); }
.type-tile--mini-golf, .type-chip--mini-golf { --type-bg: var(--wc-lantern-tint); --type-fg: var(--wc-spy-pond); }
.type-tile--sledding, .type-chip--sledding { --type-bg: var(--wc-pond-panel); --type-fg: var(--wc-graph-paper); }
.type-tile--swimming, .type-chip--swimming { --type-bg: var(--wc-spy-pond); --type-fg: var(--wc-bubbler); }
.type-tile--woods, .type-chip--woods { --type-bg: var(--wc-bunsen-deep); --type-fg: var(--wc-graph-paper); }
.type-tile--ice-skating, .type-chip--ice-skating { --type-bg: var(--wc-mist); --type-fg: var(--wc-spy-pond); }

.type-tile {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: var(--wc-border-width) solid var(--wc-spy-pond);
  border-radius: 14px;
  background: var(--type-bg);
  color: var(--type-fg);
}
.type-tile svg { width: 28px; height: 28px; }

/* ---------- Hero: title and the kinds of play ---------- */
.fr-hero { padding-block: var(--wc-space-12) var(--wc-space-8); }
.fr-hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 56px;
}
.fr-hero__title {
  flex: 0 1 auto;
  font-size: clamp(3.5rem, 8.5vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.fr-hero__lede { flex: 1 1 360px; max-width: 32em; font-size: 1.1875rem; color: var(--wc-text-muted); padding-bottom: 8px; }

/* Three tiles a row on phones, six from tablets up; a short last row is centred. */
.kinds {
  --kinds-cols: 3;
  --kinds-gap: 8px;
  margin-top: var(--wc-space-8);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--kinds-gap);
  list-style: none;
  padding: 0;
}
.kinds > li { flex: 0 0 calc((100% - (var(--kinds-cols) - 1) * var(--kinds-gap)) / var(--kinds-cols)); min-width: 0; }
.kind {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 10px;
  border-radius: 18px;
  color: var(--wc-text);
  text-align: center;
  text-decoration: none;
}
.kind__art { width: 100%; max-width: 150px; height: auto; margin-bottom: 4px; }
.kind__name { font-family: var(--wc-font-display); font-size: 1.0625rem; font-weight: 700; line-height: 1.15; }
.kind__count { font-family: var(--wc-font-label); font-size: 0.75rem; color: var(--wc-text-muted); }
.kind:hover .kind__name { text-decoration: underline; }
.kinds__caption { margin-top: 8px; font-size: var(--wc-size-small); color: var(--wc-text-muted); }
@media (min-width: 40rem) {
  .kinds { --kinds-cols: 6; }
}

.right-now {
  margin-top: var(--wc-space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.right-now__title { font-family: var(--wc-font-display); font-weight: 800; font-size: 1.375rem; letter-spacing: -0.02em; }
.right-now__list { flex: 1 1 600px; display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.right-now__item {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--wc-surface);
  border: var(--wc-border-width) solid var(--wc-border);
  border-radius: var(--wc-radius-pill);
  font-size: var(--wc-size-small);
  font-weight: 700;
}
.right-now__art { flex-shrink: 0; width: 56px; height: 42px; }
.right-now__item.is-off { border-style: dashed; color: var(--wc-text-muted); }
.right-now__item.is-off .right-now__art { filter: grayscale(1); opacity: 0.55; }

/* ---------- Filters ---------- */
.fr-filters {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: 14px;
  background: var(--wc-bg);
  border-block: var(--wc-border-width) solid var(--wc-hairline);
}
.fr-filters__inner { display: flex; flex-direction: column; gap: 12px; }
.fr-filters__types {
  min-width: 0;
  min-inline-size: 0; /* fieldsets default to min-content, which stops the row scrolling */
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 0 2px;
  border: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.type-chip {
  position: relative; /* keeps the visually hidden checkbox inside the scrolling row */
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--wc-touch-min);
  padding: 0 14px 0 6px;
  border: var(--wc-border-width) solid var(--wc-spy-pond);
  border-radius: var(--wc-radius-pill);
  background: var(--wc-white);
  color: var(--wc-spy-pond);
  font-weight: 700;
  font-size: var(--wc-size-small);
  cursor: pointer;
  white-space: nowrap;
}
.type-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-chip__icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--type-bg);
  color: var(--type-fg);
  border: 1.5px solid var(--wc-spy-pond);
}
.type-chip__icon svg { width: 18px; height: 18px; }
.type-chip__count {
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: var(--wc-radius-pill);
  background: var(--wc-graph-paper);
  font-family: var(--wc-font-label);
  font-size: 12px;
  text-align: center;
}
.type-chip:has(input:checked) { background: var(--wc-spy-pond); color: var(--wc-graph-paper); }
.type-chip:has(input:checked) .type-chip__count { background: var(--wc-pond-panel); color: var(--wc-graph-paper); }
.type-chip:has(input:focus-visible) { outline: var(--wc-focus-ring); outline-offset: var(--wc-focus-offset); }

.fr-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.fr-select { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--wc-size-small); }
.fr-select select {
  min-height: var(--wc-touch-min);
  padding: 0 12px;
  border: var(--wc-border-width) solid var(--wc-spy-pond);
  border-radius: var(--wc-radius-input);
  background: var(--wc-white);
  color: var(--wc-spy-pond);
  font-weight: 700;
}
.fr-check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--wc-touch-min); font-weight: 700; font-size: var(--wc-size-small); cursor: pointer; }
.fr-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--wc-spy-pond); }
.fr-filters__reset { font-weight: 700; font-size: var(--wc-size-small); }
.fr-filters__count {
  margin-left: auto;
  font-family: var(--wc-font-label);
  font-size: var(--wc-size-label);
  font-weight: 700;
  letter-spacing: var(--wc-tracking-label);
  text-transform: uppercase;
  color: var(--wc-text-muted);
}
.js .fr-filters__apply { display: none; }

/* ---------- Directory ---------- */
.fr-directory { display: flex; flex-direction: column; gap: 56px; padding-block: 48px 72px; }

.type-section { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 140px; }
.type-section__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.type-section__text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.type-section__text h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.025em; }
.type-section__text p { color: var(--wc-text-muted); }
.type-section__meta { display: flex; gap: 8px; }
.type-section__meta span {
  padding: 3px 10px;
  border: var(--wc-border-width) solid var(--wc-border);
  border-radius: var(--wc-radius-pill);
  font-family: var(--wc-font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.type-section__none { color: var(--wc-text-muted); font-style: italic; }

.spot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  list-style: none;
  padding: 0;
}
.spot {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 14px;
  background: var(--wc-surface);
  border: var(--wc-border-width) solid var(--wc-border);
  border-radius: var(--wc-radius-card);
  scroll-margin-top: 150px;
}
.spot:target { outline: 4px solid var(--wc-lantern); outline-offset: 3px; }
.spot__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.spot__name { font-size: 1.375rem; font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; }
.spot__code {
  flex-shrink: 0;
  padding: 2px 8px;
  border: 2px dashed currentColor;
  border-radius: var(--wc-radius-pill);
  rotate: -4deg;
  font-family: var(--wc-font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--wc-link);
}
.spot__where { display: flex; align-items: flex-start; gap: 6px; font-size: var(--wc-size-small); font-weight: 700; }
.spot__where svg { flex-shrink: 0; margin-top: 2px; }
.spot__about { font-size: var(--wc-size-small); line-height: var(--wc-leading-small); }
.spot__owner { font-size: 13px; color: var(--wc-text-muted); }
.spot__tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.tag {
  padding: 1px 10px;
  border: var(--wc-border-width) solid var(--wc-border);
  border-radius: var(--wc-radius-pill);
  font-family: var(--wc-font-label);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag--access { background: var(--wc-spy-pond); border-color: var(--wc-spy-pond); color: var(--wc-graph-paper); }
.spot__also { font-size: 13px; font-weight: 700; color: var(--wc-link); }
.spot__foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  padding-top: 8px;
  border-top: 1.5px dashed var(--wc-hairline);
}
.spot__foot a { display: inline-flex; align-items: center; gap: 5px; min-height: var(--wc-touch-min); font-weight: 700; font-size: var(--wc-size-small); }
.spot__passport {
  margin-left: auto;
  font-family: var(--wc-font-label);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wc-text-muted);
}

.spot-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border: 2.5px dashed var(--wc-mist);
  border-radius: var(--wc-radius-card);
}
.spot-empty p { flex: 1 1 380px; max-width: 46em; }

.fr-nothing {
  padding: 32px;
  border: 2.5px dashed var(--wc-mist);
  border-radius: var(--wc-radius-card);
  text-align: center;
}

/* ---------- Section art, badges and card strips ---------- */
.type-section__art { flex-shrink: 0; width: 150px; height: 112px; }
.type-section__head { align-items: flex-end; }
.type-section__text .type-section__meta { margin-top: 6px; }
.type-section__note { font-size: var(--wc-size-small); }
.type-section__note a { font-weight: 700; }

.sticker-badge {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 13rem;
  padding: 12px 18px;
  background: var(--type-bg);
  color: var(--type-fg);
  border: 3px solid var(--wc-spy-pond);
  outline: 3px dashed var(--wc-spy-pond);
  outline-offset: -9px;
  border-radius: 999px;
  font-family: var(--wc-font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
  text-align: center;
  rotate: -4deg;
}
.sticker-badge__small { font-family: var(--wc-font-body); font-weight: 700; font-size: 11px; opacity: 0.85; }
.type-section:nth-of-type(even) .sticker-badge { rotate: 3deg; }
.sticker-badge--playground { --type-bg: var(--wc-lantern); --type-fg: var(--wc-spy-pond); }
.sticker-badge--water { --type-bg: var(--wc-bubbler); --type-fg: var(--wc-spy-pond); }
.sticker-badge--skate { --type-bg: var(--wc-bunsen); --type-fg: var(--wc-spy-pond); }
.sticker-badge--pump { --type-bg: var(--wc-bunsen-tint); --type-fg: var(--wc-spy-pond); }
.sticker-badge--bikeway { --type-bg: var(--wc-bubbler-tint); --type-fg: var(--wc-spy-pond); }
.sticker-badge--table-tennis { --type-bg: var(--wc-white); --type-fg: var(--wc-spy-pond); }
.sticker-badge--mini-golf { --type-bg: var(--wc-lantern-tint); --type-fg: var(--wc-spy-pond); }
.sticker-badge--sledding { --type-bg: var(--wc-pond-panel); --type-fg: var(--wc-graph-paper); outline-color: var(--wc-graph-paper); }

/* Ticket strip across the top of each card, patterned by kind of play */
.spot { position: relative; overflow: hidden; padding-top: 30px; }
.spot__strip { position: absolute; inset: 0 0 auto; height: 14px; border-bottom: var(--wc-border-width) solid var(--wc-spy-pond); }
.spot--playground .spot__strip { background: repeating-linear-gradient(-45deg, var(--wc-lantern) 0 8px, #FFDC7A 8px 16px); }
.spot--water .spot__strip { background: radial-gradient(circle, var(--wc-white) 2.5px, transparent 3px) 0 0 / 12px 12px, var(--wc-bubbler); }
.spot--skate .spot__strip {
  background: conic-gradient(var(--wc-spy-pond) 25%, var(--wc-white) 0 50%, var(--wc-spy-pond) 0 75%, var(--wc-white) 0) 0 0 / 14px 14px;
}
.spot--pump .spot__strip { background: radial-gradient(circle at 50% 120%, #FFC9B0 9px, transparent 10px) 0 0 / 20px 14px, var(--wc-bunsen-tint); }
.spot--bikeway .spot__strip { background: repeating-linear-gradient(90deg, var(--wc-lantern) 0 12px, transparent 12px 22px) 0 5px / 100% 3px no-repeat, var(--wc-bubbler-tint); }
.spot--sledding .spot__strip { background: radial-gradient(circle, var(--wc-white) 1.6px, transparent 2px) 0 0 / 9px 9px, var(--wc-pond-panel); }
/* Swimming: a lane rope across deep water */
.spot--swimming .spot__strip {
  background:
    radial-gradient(circle, var(--wc-bunsen) 3px, transparent 3.5px) 0 50% / 16px 14px repeat-x,
    radial-gradient(circle, var(--wc-white) 3px, transparent 3.5px) 8px 50% / 16px 14px repeat-x,
    linear-gradient(var(--wc-bubbler), var(--wc-bubbler)) 0 50% / 100% 1px no-repeat,
    var(--wc-spy-pond);
}
/* Woods and trails: a treeline */
.spot--woods .spot__strip { background: conic-gradient(from 155deg at 50% 1px, var(--wc-bunsen-deep) 0 50deg, transparent 0) 0 0 / 12px 14px, var(--wc-bunsen-tint); }
/* Ice skating: blade scratches on the ice */
.spot--ice-skating .spot__strip {
  background:
    repeating-linear-gradient(60deg, transparent 0 9px, var(--wc-white) 9px 10.5px),
    repeating-linear-gradient(-30deg, transparent 0 14px, rgba(255, 255, 255, 0.7) 14px 15px),
    var(--wc-mist);
}

/* Surprise me */
.fr-surprise { min-height: var(--wc-touch-min); }
.spot.is-picked { outline: 5px solid var(--wc-bunsen); outline-offset: 4px; }
.spot.is-picked::after {
  content: "Curio picked this one";
  position: absolute;
  top: 22px;
  right: -36px;
  padding: 4px 40px;
  background: var(--wc-bunsen);
  color: var(--wc-spy-pond);
  font-family: var(--wc-font-display);
  font-weight: 800;
  font-size: 12px;
  rotate: 35deg;
  border-block: 2px solid var(--wc-spy-pond);
}
@media (prefers-reduced-motion: no-preference) {
  .spot.is-picked { animation: wiggle 0.6s ease 2; }
  .kind__art { transition: transform 0.2s ease; }
  .kind:hover .kind__art, .kind:focus-visible .kind__art { transform: translateY(-6px); }
}
@keyframes wiggle {
  0%, 100% { rotate: 0deg; }
  25% { rotate: -1.5deg; }
  75% { rotate: 1.5deg; }
}

/* ---------- Index (atlas style) ---------- */
.fr-index { padding-block: 64px; background: var(--wc-surface); border-block: var(--wc-border-width) solid var(--wc-border); }
.fr-index__inner { display: flex; flex-wrap: wrap; gap: 32px 64px; }
.fr-index__head { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }
.fr-index__head h2 { font-size: clamp(2.5rem, 5vw, 3.5rem); letter-spacing: -0.035em; }
.fr-index__head > p { color: var(--wc-text-muted); }
.fr-index__legend { display: flex; gap: 28px; }
.fr-index__legend ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.fr-index__legend b { display: inline-block; min-width: 2.4em; font-family: var(--wc-font-label); font-size: 12px; }

.ix {
  flex: 3 1 560px;
  min-width: 0;
  columns: 2 300px;
  column-gap: 48px;
  list-style: none;
  padding: 0;
}
.ix li { break-inside: avoid; }
.ix__letter {
  margin: 14px 0 4px;
  font-family: var(--wc-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--wc-link);
}
.ix__letter:first-child { margin-top: 0; }
.ix__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-block: 5px;
  color: var(--wc-text);
  text-decoration: none;
}
.ix__row:hover .ix__name { text-decoration: underline; text-underline-offset: 0.15em; }
.ix__name { font-weight: 700; }
.ix__dots { flex: 1; min-width: 20px; border-bottom: 2px dotted var(--wc-mist); transform: translateY(-4px); }
.ix__ref { flex-shrink: 0; font-family: var(--wc-font-label); font-size: 12.5px; letter-spacing: 0.04em; color: var(--wc-text-muted); }
.ix__ref b { color: var(--wc-text); }

/* ---------- Passport band ---------- */
.fr-passport { padding-block: 72px 0; }
.fr-passport__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 56px; }
.passport-art { flex: 1 1 420px; max-width: 520px; height: auto; rotate: -3deg; }
.fr-passport__text { flex: 1 1 340px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.fr-passport__text h2 { font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 0.95; letter-spacing: -0.035em; }
.fr-passport__text p { color: var(--wc-text-muted); max-width: 32em; }

/* ---------- Suggest a spot ---------- */
.fr-suggest { padding-block: 72px 32px; }
.fr-suggest__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 56px;
  padding: clamp(24px, 4vw, 48px);
  background: var(--wc-bubbler-tint);
  color: var(--wc-spy-pond);
  border: var(--wc-border-width) solid var(--wc-spy-pond);
  border-radius: 28px;
}
.fr-suggest__text { flex: 1 1 340px; display: flex; flex-direction: column; gap: 12px; }
.fr-suggest__text .label { color: var(--wc-bunsen-deep); }
.fr-suggest__text h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); line-height: 1.04; letter-spacing: -0.03em; }
.fr-suggest__form { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.fr-suggest__form .btn { align-self: flex-start; }
.fr-suggest__pair { display: flex; flex-wrap: wrap; gap: 12px; }
.fr-suggest__pair .field { flex: 1 1 180px; }
.fr-suggest .field__hint { font-weight: 400; color: var(--wc-slate); }
.fr-textarea { min-height: 96px; padding-block: 10px; resize: vertical; }

.fr-data-note { padding-block: 8px 48px; font-size: 13px; color: var(--wc-text-muted); }

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  .type-tile, .type-chip__icon { border-color: var(--wc-mist); }
  .type-chip { border-color: var(--wc-mist); }
  .fr-select select { border-color: var(--wc-mist); }
  .kind__art, .passport-art { filter: brightness(0.96); }
  .fr-index { background: var(--wc-pond-panel); border-color: var(--wc-mist); }
  .spot__code { color: var(--wc-lantern); }
}

/* ---------- Small screens ---------- */
@media (max-width: 40rem) {
  .fr-filters { position: static; }
  .fr-filters__count { margin-left: 0; width: 100%; }
  .type-section__art { width: 120px; height: 90px; }
  .sticker-badge { align-self: flex-start; }
  .fr-directory { gap: 44px; padding-top: 36px; }
  .kinds { --kinds-gap: 4px; }
  .kind { padding-inline: 0; }
  .kind__name { font-size: 0.875rem; }
  .kind__count { font-size: 0.6875rem; }
}

/* ---------- App additions ---------- */
/* Wide screens: the kind-of-play chips wrap instead of scrolling sideways. */
@media (min-width: 64rem) {
  .fr-filters__types { flex-wrap: wrap; overflow-x: visible; }
}
/* The suggestion form's honeypot: off screen for people, still in the form for bots. */
.fr-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fr-suggest__thanks { margin-bottom: var(--wc-space-4); }
