/* ============================================================
   PORTFOLIO ATLAS — markers.css
   CHART FURNITURE that sits over the Konva stage as plain DOM:
   the compass rose, the legend cartouche, the zoom control, and
   the first-load intro hint.

   (Waypoints, routes and signposts themselves are drawn inside
   the canvas by map.js — they are not styled here.)

   Consumes tokens from style.css :root.
   ============================================================ */

/* ── Compass rose (bottom-left) — old-school survey rose ─── */
.compass {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: var(--z-ui);
  width: 116px;
  height: 116px;
  pointer-events: none;
  opacity: 0.96;
  filter: drop-shadow(0 3px 7px rgba(44, 24, 16, 0.34));
}

/* disc + rings */
.cz-disc { fill: var(--parchment-panel); }
.cz-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
}
.cz-ring--accent {
  stroke: var(--seal);
  stroke-width: 0.7;
  opacity: 0.6;
}

/* graduated rim — tangential dashes read as compass graduations */
.cz-ticks { fill: none; stroke: var(--ink); }
.cz-ticks--minor {
  stroke-width: 3;
  stroke-dasharray: 0.5 3.03;   /* ~80 fine graduations */
  opacity: 0.5;
}
.cz-ticks--major {
  stroke-width: 5;
  stroke-dasharray: 1.3 34.0;   /* 8 cardinal/intercardinal marks */
  opacity: 0.85;
}

/* faceted two-tone star rays */
.cz-ray {
  stroke: var(--ink);
  stroke-width: 0.25;
  stroke-linejoin: round;
}
.cz-ray--light { fill: #e6d6ad; }      /* aged-cream gore */
.cz-ray--dark  { fill: var(--ink); }   /* shadow gore     */
.cz-ray--north { fill: var(--seal); }  /* north marked red */

/* hub */
.cz-hub {
  fill: var(--parchment-panel);
  stroke: var(--ink);
  stroke-width: 1;
}
.cz-hub-dot { fill: var(--seal); }

/* cardinal letters */
.cz-letter {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 9px;
  text-anchor: middle;
  dominant-baseline: central;
}
.cz-letter--n {
  fill: var(--seal);
  font-weight: 700;
}

/* ── Legend cartouche (bottom-right) ────────────────────── */
.legend {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-ui);
  min-width: 176px;
  padding: 12px 15px;
  background: var(--parchment-panel);
  background-image:
    repeating-linear-gradient(0deg, rgba(44,24,16,0.02) 0 1px, transparent 1px 3px);
  border: 1px solid rgba(139, 26, 26, 0.32);
  border-radius: 4px;
  box-shadow: 0 2px 14px rgba(44, 24, 16, 0.22);
}

.legend__title {
  margin: 0 0 9px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
  border-bottom: 1px solid rgba(139, 26, 26, 0.25);
  padding-bottom: 5px;
}

.legend__list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.legend__key {
  display: inline-block;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(44, 24, 16, 0.45);
  flex: 0 0 auto;
}
.legend__key--coastal        { background: var(--cat-coastal); }
.legend__key--remote-sensing { background: var(--cat-remote-sensing); }
.legend__key--gis            { background: var(--cat-gis); }
.legend__key--fieldwork      { background: var(--cat-fieldwork); }
.legend__key--page {
  background: var(--cat-page);
  border-radius: 2px;
  border-color: var(--seal-dark);
  transform: rotate(45deg);
}

/* ── Zoom control (right edge, vertically centred) ──────── */
.zoomctl {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-ui);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(139, 26, 26, 0.45);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(44, 24, 16, 0.25);
}

.zoomctl button {
  width: 38px;
  height: 38px;
  background: var(--parchment-panel);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, color 0.16s ease;
}
.zoomctl button + button { border-top: 1px solid rgba(139, 26, 26, 0.28); }
.zoomctl button:hover { background: var(--seal); color: var(--parchment); }
.zoomctl button:active { background: var(--seal-dark); color: var(--parchment); }

/* ── Intro hint pill (centred bottom; removed on first move) ── */
.map-hint {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: var(--z-ui);
  pointer-events: none;
  padding: 9px 18px;
  background: var(--parchment-panel);
  border: 1px solid rgba(139, 26, 26, 0.35);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(44, 24, 16, 0.22);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--ink);
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.map-hint.is-hidden { opacity: 0; }

/* ── Loading veil (hidden once Konva has drawn the chart) ── */
.atlas-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--parchment);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 1px;
  transition: opacity 0.6s ease;
}
.atlas-loading.is-hidden { opacity: 0; pointer-events: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .compass { width: 84px; height: 84px; left: 12px; bottom: 12px; }
  .legend  { right: 12px; bottom: 12px; min-width: 0; padding: 9px 11px; }
  .legend__title { font-size: 14px; }
  .legend__item  { font-size: 10px; }
  .zoomctl { right: 12px; }
  .zoomctl button { width: 34px; height: 34px; font-size: 20px; }
  .map-hint {
    font-size: 11px;
    padding: 8px 13px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
    bottom: 96px;            /* clear the compass / legend on mobile */
  }
}

/* Very small screens: drop the legend so the chart breathes. */
@media (max-width: 430px) {
  .legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .map-hint, .atlas-loading, .zoomctl button { transition: none !important; }
}
