/* The graffiti survey's map of marks (js/mark-map.js, templates/projects/viewers/mark-map.php).
   The plan and the door drawing are white scans in both themes, so the pins keep the light theme's colours. */
.mark-map { margin: 1.5rem 0 2.25rem; --mason: #2a6b69; --text: #b5842a; --other: #8d3c2c; }
.js .mark-map__fallback { display: none; }

/* Areas */
.mark-map__bar { display: flex; gap: .4rem; overflow-x: auto; padding: 0 0 .5rem; margin: 0 0 .5rem; scrollbar-width: thin; }
@media (min-width: 720px) { .mark-map__bar { flex-wrap: wrap; overflow: visible; } }
.mark-map__chip {
  flex: none; font: 500 var(--fs-0)/1 var(--sans); padding: .5rem .75rem; border: 1px solid var(--rule-strong);
  border-radius: 999px; background: var(--white); color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.mark-map__chip b { font-family: var(--mono); font-weight: 500; color: var(--verdigris); margin-right: .15em; }
.mark-map__chip:hover { border-color: var(--verdigris); }
.mark-map__chip[aria-pressed="true"] { background: var(--verdigris); border-color: var(--verdigris); color: #fff; }
.mark-map__chip[aria-pressed="true"] b { color: #fff; }

/* The frame: the plan with the door drawn below it (--canvas is their shape, set by the script), the north
   point, the zoom buttons and the hint */
.mark-map__frame {
  position: relative; aspect-ratio: var(--canvas, 1442 / 1132); background: #fff; border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
}
.mark-map__scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.mark-map__scene.is-dragging { cursor: grabbing; }
.mark-map__scene:focus { outline: none; }

.mark-map__north { position: absolute; left: .5rem; top: .5rem; width: 2.6rem; height: 2.6rem; pointer-events: none; transition: opacity .2s; }
.mark-map__north.is-hidden { opacity: 0; }
.mark-map__dial { fill: rgba(255, 255, 255, .92); stroke: rgba(27, 34, 38, .25); stroke-width: 1; }
.mark-map__needle { fill: #1b2226; }
.mark-map__n { font: 700 9px/1 var(--sans); fill: #1b2226; text-anchor: middle; dominant-baseline: central; }

.mark-map__tools { position: absolute; right: .5rem; top: .5rem; display: flex; flex-direction: column; gap: .3rem; }
.mark-map__tool {
  width: 2.2rem; height: 2.2rem; border-radius: 999px; border: 1px solid rgba(27, 34, 38, .25); background: rgba(255, 255, 255, .94);
  color: #1b2226; font: 600 1.05rem/1 var(--sans); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.mark-map__tool:hover { border-color: #2a6b69; color: #2a6b69; }
.mark-map__hint {
  position: absolute; left: 50%; bottom: .6rem; transform: translateX(-50%); margin: 0; padding: .35rem .8rem;
  border-radius: 999px; background: rgba(27, 34, 38, .78); color: #fff; font: var(--fs-0)/1.3 var(--sans);
  opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap;
}
.mark-map__hint.is-shown { opacity: 1; }

/* Pins on the plan: drawn at a fixed screen size (the script scales each one), numbered when close */
.pin { cursor: pointer; }
.pin--mason { --pin: var(--mason); }
.pin--text { --pin: var(--text); }
.pin--other { --pin: var(--other); }
.pin__dot { fill: var(--pin); stroke: #fff; stroke-width: 1.5; transition: stroke-width .15s; }
.pin__halo { fill: none; stroke: none; }
.pin__label { display: none; font: 600 9px/1 var(--sans); fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.is-close .pin__label { display: block; }
.pin:hover .pin__dot, .pin:focus-visible .pin__dot { stroke: #1b2226; stroke-width: 2; }
.pin:focus { outline: none; }
.pin.is-kin .pin__dot { stroke: #1b2226; stroke-width: 2; }
.pin.is-faded { opacity: .28; }
.pin.is-faded .pin__label { display: none; }
.pin.is-selected .pin__dot { stroke: #1b2226; stroke-width: 2.5; }
.pin.is-selected .pin__halo { stroke: var(--pin); stroke-width: 3; opacity: .55; }
.door-pin { cursor: pointer; }
.door-pin rect { fill: #1b2226; stroke: #fff; stroke-width: 1.5; }
.door-pin text { font: 600 9px/1 var(--sans); fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.door-pin:hover rect, .door-pin:focus-visible rect { fill: #2a6b69; }
.door-pin:focus { outline: none; }

/* The north tower door, set in below the plan: a panel, its title, and a line up to the doorway */
.mark-map__door-frame { fill: #fff; stroke: #b9ae9b; stroke-width: 1; vector-effect: non-scaling-stroke; }
.mark-map__leader { stroke: #1b2226; stroke-width: 1.25; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; opacity: .6; }
.mark-map__door-title { font: 600 15px/1 var(--sans); fill: #1b2226; letter-spacing: .02em; }

/* Spots on the door drawing: its own numbered circles, made clickable */
.spot { cursor: pointer; }
.spot circle { fill: transparent; stroke: transparent; stroke-width: 2.5; transition: fill .15s, stroke .15s; }
.spot:hover circle, .spot:focus-visible circle { stroke: var(--text); fill: rgba(181, 132, 42, .12); }
.spot:focus { outline: none; }
.spot.is-kin circle { stroke: rgba(181, 132, 42, .55); }
.spot.is-selected circle { stroke: var(--text); fill: rgba(181, 132, 42, .25); stroke-width: 3; }

/* Legend */
.mark-map__legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; align-items: center; font: var(--fs-0)/1.4 var(--sans); color: var(--muted); margin: .65rem 0 1.25rem; }
.mark-map__key::before {
  content: ""; display: inline-block; width: .72rem; height: .72rem; border-radius: 50%; margin-right: .4rem;
  vertical-align: -.08rem; background: var(--key); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--rule-strong);
}
.mark-map__key--mason { --key: var(--mason); }
.mark-map__key--text { --key: var(--text); }
.mark-map__key--other { --key: var(--other); }
.mark-map__total { margin-left: auto; }

/* The chosen mark: its photograph and its record */
.mark-map .mark-card {
  display: grid; gap: 1.25rem; padding: 1.15rem 1.25rem; border: 1px solid var(--rule); border-left: 3px solid var(--verdigris);
  border-radius: var(--radius); background: var(--white);
}
@media (min-width: 720px) { .mark-map .mark-card--photo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } }
.mark-map .mark-card__photos { display: grid; gap: .6rem; }
.mark-map .mark-card__photo { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 2px; }
.mark-map .mark-card__photo img { display: block; width: 100%; height: auto; border-radius: 2px; }
.mark-map .mark-card__photo:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
.mark-map .mark-card__credit { margin: 0; font: var(--fs-0)/1.45 var(--sans); color: var(--ink-2); }
.mark-map .mark-card__caption { margin: -.2rem 0 .3rem; font: italic var(--fs-0)/1.45 var(--sans); color: var(--muted); }
.mark-map .mark-card__kicker { margin: 0 0 .35rem; font: 600 var(--fs-0)/1.35 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--verdigris); }
.mark-map .mark-card__title { margin: 0 0 .8rem; font: 500 var(--fs-3)/1.25 var(--serif); color: var(--ink); }
.mark-map .mark-card__lede { margin: 0 0 1rem; font: var(--fs-1)/1.55 var(--sans); color: var(--ink-2); }
.mark-map .mark-card__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1rem; margin: 0 0 .8rem; font: var(--fs-1)/1.45 var(--sans); }
.mark-map .mark-card__facts dt { color: var(--muted); }
.mark-map .mark-card__facts dd { margin: 0; color: var(--ink); }
.mark-map .mark-card__notes, .mark-map .mark-card__placing { margin: 0 0 .6rem; font: var(--fs-0)/1.5 var(--sans); color: var(--muted); }
.mark-map .mark-card__placing { font-style: italic; }
.mark-map .mark-card__kin { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0 0 1rem; font: var(--fs-0)/1 var(--sans); color: var(--muted); }
.mark-map .mark-card__kin button {
  font: 500 var(--fs-0)/1 var(--mono); padding: .32rem .55rem; border: 1px solid var(--rule-strong); border-radius: 999px;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.mark-map .mark-card__kin button:hover { border-color: var(--verdigris); color: var(--verdigris); }
.mark-map .mark-card__nav {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .8rem;
  border-top: 1px solid var(--rule); font: var(--fs-0)/1 var(--sans); color: var(--muted);
}
.mark-map .mark-card__nav button {
  font: 500 var(--fs-0)/1 var(--sans); padding: .5rem .8rem; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.mark-map .mark-card__nav button:hover:not(:disabled) { border-color: var(--verdigris); color: var(--verdigris); }
.mark-map .mark-card__nav button:disabled { opacity: .4; cursor: default; }

/* The photographic index, folded away beneath the map */
.index-fold { margin: 1rem 0 2rem; }
.index-fold > summary { cursor: pointer; font: 500 var(--fs-1)/1.4 var(--sans); color: var(--verdigris); }
.index-fold[open] > summary { margin-bottom: .5rem; }

@media print { .mark-map__bar, .mark-map__tools, .mark-map__hint { display: none; } }
