/* ===================================================================
   worldmap.css — สไตล์เฉพาะหน้าแผนที่โลก (hotspot + popup)
   =================================================================== */

:root {
  --map-blue: #4f9fdb;
  --map-blue-deep: #2f6fa8;
}

/* ---------- Toolbar (โหมดปักหมุด) ---------- */
.map-toolbar {
  max-width: 1400px;
  margin: 0 auto var(--space-2);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.dev-toggle {
  background: var(--ink-800);
  border: 1px solid var(--ink-700);
  color: var(--parchment-dim);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.dev-toggle:hover { color: var(--parchment); border-color: var(--gold); }
.dev-toggle[aria-pressed="true"] {
  color: var(--ink-950);
  background: var(--gold);
  border-color: var(--gold);
}
.map-toolbar-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--parchment-dim);
}
.map-toolbar-hint code {
  color: var(--gold);
}
.map-toolbar {
  display: none;
}

/* ---------- Map wrap ---------- */
.worldmap-body {
  max-width: 1400px;
  margin: 0 auto var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.worldmap-wrap {
  position: relative;
  width: 100%;
  line-height: 0;
  border: 1px solid var(--ink-700);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-900);
  user-select: none;
}
.worldmap-wrap.is-dev-mode { cursor: crosshair; }

.worldmap-wrap img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
}

.hotspot {
  position: absolute;
  border: 1px dashed transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.hotspot:hover,
.hotspot.is-active {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.select-rect {
  position: absolute;
  border: 2px dashed var(--map-blue);
  background: rgba(79, 159, 219, 0.18);
  pointer-events: none;
}

/* ---------- Dev panel ---------- */
.dev-panel {
  background: var(--ink-800);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius);
  padding: var(--space-2);
}
.dev-panel-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--parchment-dim);
}
.dev-panel textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: var(--ink-950);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.6rem;
}
.dev-copy {
  margin-top: 0.6rem;
  background: var(--gold);
  color: var(--ink-950);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.dev-copy:hover { filter: brightness(1.08); }
.dev-copy.is-copied { background: var(--moss); }

/* ---------- Popup ---------- */
.map-popup {
  position: fixed;
  z-index: 60;
  width: 220px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--parchment);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.map-popup-header {
  background: linear-gradient(135deg, var(--map-blue), var(--map-blue-deep));
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.map-popup-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: 0.03em;
}
.map-popup-name {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #eaf4ff;
  line-height: 1.3;
}

.map-popup-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--ink-700);
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 680px) {
  .map-popup { width: 170px; }
}
