/* Calderwood Village Centre: grouped "pie" marker and list group (see village-centre.js) */

.vc-runtime-hidden { display: none !important; }

.vc-pie {
  width: 0;
  height: 0;
  pointer-events: none;
}
.vc-pie > * { position: absolute; left: 0; top: 0; }

/* Ring / pie: wedges are drawn by the script; cream strokes make the dividers */
.vc-ring {
  overflow: visible;
  filter: drop-shadow(0 1px 3px rgba(17, 27, 19, .28));
}
.vc-wedge { cursor: pointer; outline: none; }
.vc-wedge > path {
  fill: var(--pin);
  stroke: var(--pin-ring);
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: visiblePainted;
  transition: fill .2s linear;
}
.vc-wedge__icon { color: var(--pin-ink); pointer-events: none; transition: color .2s linear; }
/* Selected: gold segment. Hover/focus: cream wedge with the icon inverted to dark. */
.vc-wedge.is-active > path { fill: var(--pin-selected); }
.vc-wedge.is-active .vc-wedge__icon { color: var(--pin-selected-ink); }
.vc-pie.is-open .vc-wedge.is-hover:not(.is-active) > path { fill: var(--pin-ring); }
.vc-pie.is-open .vc-wedge.is-hover:not(.is-active) .vc-wedge__icon { color: var(--pin); } /* the selected wedge stays gold */
.vc-wedge:focus-visible > path { stroke: var(--focus); stroke-width: 2.5; }

.vc-centre {
  --c: var(--pin-size);
  width: var(--c);
  height: var(--c);
  margin: calc(var(--c) / -2) 0 0 calc(var(--c) / -2);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pin);
  color: var(--pin-ink);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1.5px var(--pin-ring);
  cursor: pointer;
  pointer-events: auto;
  transition: background-color .3s linear, color .3s linear;
}
.vc-pie.is-centre-active .vc-centre {
  background: var(--pin-selected);
  color: var(--pin-selected-ink);
}
.vc-centre:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Numbered pins: the same faint cream lift as hovering a row in the list (--hairline-soft, 10%) */
.poi.is-hover:not(.is-active),
.vc-pie:not(.is-centre-active) .vc-centre.is-hover {
  background: color-mix(in srgb, var(--pin-colour, var(--pin)), var(--ink) 10%);
}
/* Zoomed too far out: pins just fade (the runtime also shrank them, which read as the map reflowing) */
.is-far .poi:not(.is-active) { transform: none; }
/* ...except the selected pin and its card, which stay with its route */
.is-far .poi.is-active { transform: scale(1.25); opacity: 1; pointer-events: auto; }
.is-far .card.is-locked.is-in { opacity: 1; }

@media (hover: hover) {
  .poi:not(.is-active):hover { background: color-mix(in srgb, var(--pin-colour, var(--pin)), var(--ink) 10%); }
  .vc-pie:not(.is-centre-active) .vc-centre:hover { background: color-mix(in srgb, var(--pin), var(--ink) 10%); }
}

/* While the pie is open, move the runtime's card for the centre out past the pie's edge */
#map.vc-card-pushed .card[data-side="top"] { margin-top: calc(var(--vc-push) * -1); }
#map.vc-card-pushed .card[data-side="bottom"] { margin-top: var(--vc-push); }
#map.vc-card-pushed .card[data-side="left"] { margin-left: calc(var(--vc-push) * -1); }
#map.vc-card-pushed .card[data-side="right"] { margin-left: var(--vc-push); }

/* Hidden by the category filter, or zoomed too far out (matches the runtime's pins) */
/* MapLibre writes an inline opacity on the marker element itself, so fade its parts instead */
.vc-pie > * { transition: opacity .3s linear, background-color .3s linear, color .3s linear; }
.vc-pie.is-hidden > *, .is-far .vc-pie:not(.has-selection) > * { opacity: 0; }
.vc-pie.is-hidden *, .is-far .vc-pie:not(.has-selection) * { pointer-events: none !important; }

.reduced-motion .vc-pie *, .reduced-motion .vc-sub { transition-duration: 0s !important; animation: none !important; }

/* ---- List group (open by default; the chevron collapses it) ---- */
.vc-row { display: flex; align-items: stretch; width: calc(100% + 16px); margin: 0 -8px; transition: opacity .3s linear; }
.vc-row > .item { width: auto; flex: 1; margin: 0; min-width: 0; }
.vc-row.is-dimmed { opacity: .4; }
.vc-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color .3s linear, color .3s linear;
}
.vc-toggle svg { width: 12px; height: 12px; transition: transform .25s var(--ease); }
.vc-group.is-expanded .vc-toggle svg { transform: rotate(180deg); }
.vc-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (hover: hover) { .vc-toggle:hover { background: var(--hairline-soft); color: var(--ink); } }

/* A tree on the list's own columns: the rail runs under the "1" for the full height of the rows,
   each icon sits where the parent's name starts (the list's 28px number column + 4px gap = 32px),
   and the names share one column after the icons. Row highlights start 8px before the icon (the
   same inner padding the parent row has before its number), so they never cover the rail, and end
   on the same right edge as every other row. */
.vc-sub { --name-x: 32px; --icon: 16px; --icon-gap: 10px; position: relative; list-style: none; margin: 0 0 6px; padding: 0; } /* open/close motion is in village-centre.js */
.vc-sub::before { content: ""; position: absolute; left: 1.7px; top: 0; bottom: 0; width: 1px; background: var(--hairline); }
.vc-sub .item {
  grid-template-columns: var(--icon) 1fr;
  column-gap: var(--icon-gap);
  align-items: center;
  width: calc(100% - var(--name-x) + 16px);
  margin: 0 0 0 calc(var(--name-x) - 8px);
  padding-left: 8px;
}
.vc-sub .item__name { font-size: calc(var(--size-body) - 1px); }
.vc-icon { display: grid; place-items: center; width: var(--icon); height: var(--icon); }
.vc-icon svg { width: var(--icon); height: var(--icon); }

/* ---- Phone sheet: the list scrolls straight away after opening ----
   The runtime turns off scrolling in the sheet's list while it animates (.is-animating, cleared after
   the 0.5 s height animation or a 900 ms fallback) to stop a desktop scrollbar flashing. On a phone that
   meant a scroll started right after opening had nothing to scroll, so an embedded map handed it to the
   host page. Phones use overlay scrollbars, so keep the list scrollable while it opens; it still can't
   scroll while the sheet is collapsed or being dragged. */
@media (max-width: 760px) {
  .panel.is-animating:not(.is-dragging):not(.is-collapsed) .panel__body { overflow-y: auto; }
}

/* Legend callout on a place that is also a numbered pin (Shellharbour Marina, Wollongong CBD; set by
   village-centre.js): no dot on the pin's number, and the callout stands 12 px further out, so its
   arrow tip stops 4 px clear of the pin's ring (6 px on phones, where pins are smaller).
   The runtime's rise-in (3 px) is kept on top of the offset. */
.dest-marker.is-on-pin .dest-dot { display: none; }
.dest-marker.is-on-pin .dest-callout[data-side="top"] { translate: 0 -9px; }
.dest-marker.is-on-pin .dest-callout[data-side="top"].is-visible { translate: 0 -12px; }
.dest-marker.is-on-pin .dest-callout[data-side="bottom"] { translate: 0 15px; }
.dest-marker.is-on-pin .dest-callout[data-side="bottom"].is-visible { translate: 0 12px; }
.dest-marker.is-on-pin .dest-callout[data-side="left"] { translate: -12px 3px; }
.dest-marker.is-on-pin .dest-callout[data-side="left"].is-visible { translate: -12px 0; }
.dest-marker.is-on-pin .dest-callout[data-side="right"] { translate: 12px 3px; }
.dest-marker.is-on-pin .dest-callout[data-side="right"].is-visible { translate: 12px 0; }
