/* Postbyen Maps — front-end styles. Everything is scoped under .pbmap. */

.pbmap {
  position: relative;
  width: 100%;
  margin: 0 auto;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #46181d;
  -webkit-tap-highlight-color: transparent;
}

.pbmap__viewport {
  position: relative;
  width: 100%;
  min-height: 320px; /* fallback before the SVG sets its aspect ratio */
  overflow: hidden;
  border-radius: var(--radius-s);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}

.pbmap__viewport:active {
  cursor: grabbing;
}

.pbmap__host {
  width: 100%;
  height: 100%;
}

.pbmap__viewport svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pbmap__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-small);
  color: rgba(70, 24, 29, 0.5);
}

.pbmap__controls {
  position: absolute;
  top: 12px;
  left: 0;
  display: flex;
  align-items: center; 
  gap: 8px;
  z-index: 2;
  width: 194px;
}

.pbmap__zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid rgba(70, 24, 29, 0.14);
  border-radius: var(--radius-s);
  padding: 4px;
  box-shadow: 0 1px 3px rgba(70, 24, 29, 0.08);
}

.pbmap__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: var(--font-small);
  line-height: 1;
  color: #46181d;
  cursor: pointer;
  transition: background 0.12s ease;
}

.pbmap__btn:hover {
  background: rgba(70, 24, 29, 0.06);
}

.pbmap__btn:active {
  transform: translateY(1px);
}

.pbmap__reset {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  background: #ffffff;
  border: 1px solid rgba(70, 24, 29, 0.14);
  border-radius: var(--radius-s);
  font-size: var(--font-small);
  font-weight: 600;
}

.pbmap__reset:hover {
  background: #faf5ec;
}

.pbmap__hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-s);
  font-size: var(--font-small);
  color: rgba(70, 24, 29, 0.7);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Fade the hint away once the user has zoomed in. */
.pbmap[data-zoomed="1"] .pbmap__hint {
  opacity: 0;
}

/* Hover tooltip — positioned at the cursor, lifted above it. */
.pbmap__tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  max-width: 240px;
  padding: 6px 10px;
  background: var(--white);
  color: var(--clr-dark);
  font-size: var(--font-small);
  line-height: 1.3;
  border-radius: var(--radius-s);
  box-shadow: 0 2px 8px rgba(70, 24, 29, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 0.12s ease;
  white-space: nowrap;
}

.pbmap__tooltip[data-show="1"] {
  opacity: 1;
}

/* Category filtering ([postbyen_map_filter]): markers whose data-kategori
   doesn't match the active filter get data-hidden="1". */
.pbmap [data-kategori] {
  transition: opacity 0.2s ease;
}

.pbmap [data-kategori][data-hidden="1"] {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 600px) {
  .pbmap__controls {
    width: 174px;
  }
  /*
  .pbmap__reset {
    height: 38px;
    padding: 0 12px;
  }
  .pbmap__btn {
    width: 38px;
    height: 38px;
  }*/
} 
