:root {
  --deep-blue: #02007a;
  --ink: #4b392b;
  --muted: #7d6a59;
  --school: #d86d57;
  --production: #688c63;
  --white: #fff9ef;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
  background: var(--deep-blue);
  color: var(--ink);
}
button { font: inherit; cursor: pointer; }

.map-app {
  min-height: 100vh;
  padding: 0;
  background: var(--deep-blue);
}

.map-stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: var(--deep-blue);
  box-shadow: none;
}

.map-stage::before { display: none; }

.italy-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.map-background {
  fill: var(--deep-blue);
}

.region-path {
  fill: #009914;
  stroke: #642000;
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.region-path:nth-child(2n) { fill: #009914; }
.region-path:nth-child(3n) { fill: #009914; }
.region-path:hover { fill: #00ff22; }

/* Markers live inside the same SVG viewBox as the GeoJSON map.
   This keeps them locked to the correct cities on every layout/device. */
.svg-markers-layer {
  pointer-events: all;
}

.marker {
  cursor: pointer;
}

.marker-hit {
  fill: transparent;
  pointer-events: all;
}

.marker-pin {
  stroke: var(--white);
  stroke-width: 4;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.28));
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.15s ease;
}

.marker-highlight {
  fill: rgba(255,255,255,0.9);
}

.marker.school .marker-pin { fill: var(--school); }
.marker.production .marker-pin { fill: var(--production); }

.marker.active .marker-pin,
.marker:hover .marker-pin,
.marker:focus-visible .marker-pin {
  transform: translateY(-4px) scale(1.12);
}

.marker:focus-visible .marker-pin {
  stroke: #ffe7a9;
}

.marker-label-bg {
  fill: rgba(255,248,234,0.96);
  stroke: rgba(76,59,43,0.18);
  stroke-width: 2;
}

.marker-label {
  fill: var(--ink);
  font-size: 12px;
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.mini-card {
  position: absolute;
  z-index: 6;
  width: min(400px, calc(100% - 28px));
  padding: 14px;
  background: rgba(255,248,234,0.985);
  border: 3px solid rgba(98, 76, 58, 0.84);
  border-radius: 14px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.16);
}
.mini-card.hidden { display: none; }
.mini-card h4 {
  margin: 6px 0 0;
  font-size: 22px;
  font-family: Georgia, "Times New Roman", serif;
}
.mini-card p {
  margin: 10px 0 0;
  line-height: 1.55;
  color: var(--ink);
}
.mini-card .mini-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.mini-card .tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}
.mini-card .tag {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 2px solid rgba(0,0,0,0.08);
}
.tag.school { background: rgba(216,109,87,0.13); color: #9d4738; }
.tag.production { background: rgba(104,140,99,0.14); color: #466b40; }
.tag.city { background: rgba(111,143,192,0.14); color: #47628d; }

.mini-list {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 680px) {
  .mini-card {
    left: 14px !important;
    right: 14px;
    top: auto !important;
    bottom: 14px;
    width: auto;
  }
  .marker-label { font-size: 10px; }
  .marker-pin { stroke-width: 3; }
}
