/* ==========================================================
   VQ Intelligence Map: demo-store renderer
   Compact visualization of a store's catalog categories + shopper-demand
   density. Rendered on each demo's homepage from server-injected data.

   Colors are hard-coded VeryQuery brand values (not CSS vars) on purpose:
   the four demo stores each define their own conflicting token palette
   (--ink, --paper, etc.). This section is a VQ-branded island inside
   each store and must render identically across all of them.
========================================================== */

.vq-map-section {
  margin-top: 6rem;
  padding: 4rem 1.5rem 5rem;
  background: #EEE5CE;
  border-top: 1px solid #BBAA82;
  color: #17140E;
}
.vq-map-section__inner {
  max-width: 68rem;
  margin: 0 auto;
}
.vq-map-section__eyebrow {
  font-family: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5E564A;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
}
.vq-map-section__eyebrow::before {
  content: "§";
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  color: #B24718;
  font-size: 1rem;
}
.vq-map-section__title {
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: #17140E;
  margin: 0 0 0.5rem;
  max-width: 42rem;
}
.vq-map-section__lede {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #2F2A20;
  max-width: 44rem;
  margin: 0 0 2.5rem;
}

.vq-map {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 620px;
  background: #EEE5CE;
  border: 1px solid #BBAA82;
  overflow: hidden;
}
.vq-map__canvas,
.vq-map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.vq-map__canvas { z-index: 1; }
.vq-map__svg    { z-index: 2; pointer-events: none; }

.vq-map__node-dot {
  fill: #17140E;
  stroke: #EEE5CE;
  stroke-width: 1.5;
  transition: r 120ms ease-out, fill 120ms ease-out;
}
.vq-map__node-dot.is-hovered {
  r: 8;
  fill: #B24718;
}
.vq-map__node-label {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  fill: #17140E;
  paint-order: stroke;
  stroke: #EEE5CE;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* `.vq-map__empty` is shown only when the map has nothing to render.
   Toggled via the `hidden` HTML attribute; the :not([hidden]) selector
   defers the flex layout so it doesn't fight the attribute's display:none. */
.vq-map__empty:not([hidden]) {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: #5E564A;
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  z-index: 3;
}

/* Anchor hover tooltip. Positioned by JS inside the map frame (cursor
   + offset, flipped to stay inside the edges). Hard-coded paper-ink
   palette so it survives any theme it's dropped into. */
.vq-map__tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: #F4EBD6;
  border: 1px solid #BBAA82;
  padding: 0.6rem 0.75rem;
  max-width: 20rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #17140E;
}
.vq-map__tooltip[hidden] { display: none; }
.vq-map__tooltip-name {
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.15;
}
.vq-map__tooltip-meta {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5E564A;
  margin-top: 0.15rem;
}
.vq-map__tooltip-desc {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #2F2A20;
}

/* Dimension selector. Sits between the lede and the map frame; a
   small mono-caps eyebrow ("VIEW") next to a quietly-styled select.
   Hidden when the property has only one dimension (no choice to offer). */
.vq-map-section__controls {
  display: flex;
  gap: 1rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}
.vq-map-section__controls:empty { display: none; }
.vq-map-section__control {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.vq-map-section__control-label {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5E564A;
}
.vq-map-section__control select {
  appearance: none;
  -webkit-appearance: none;
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.95rem;
  color: #17140E;
  background-color: #FAF6EC;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2317140E' stroke-opacity='0.6' fill='none' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  border: 1px solid #D2C39A;
  border-radius: 0;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.vq-map-section__control select:hover {
  border-color: #5E564A;
}
.vq-map-section__control select:focus {
  outline: none;
  border-color: #17140E;
}

/* While a dimension switch is fetching, dim the map slightly so the
   user knows something's happening. */
.vq-map.vq-map--loading {
  opacity: 0.6;
  transition: opacity 0.15s ease-out;
}

.vq-map-section__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 1.25rem;
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5E564A;
}
.vq-map-section__legend-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.vq-map-section__legend-bar {
  width: 5rem;
  height: 0.5rem;
  background: linear-gradient(to right,
    rgba(44,78,122,0.25),
    rgba(80,130,160,0.55),
    rgba(160,150,100,0.7),
    rgba(210,110,60,0.85),
    rgba(178,71,24,0.95)
  );
  border: 1px solid #D2C39A;
}
.vq-map-section__legend-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.vq-map-section__footline {
  margin-top: 1.25rem;
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.875rem;
  color: #5E564A;
  max-width: 44rem;
  line-height: 1.55;
}
.vq-map-section__footline a {
  color: #17140E;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.vq-map-section__footline a:hover { color: #84310D; }
