/* ── HG Interactive Map Widget ──────────────────────────────────────────── */

.hg-map { position: relative; }
.hg-map * { margin: 0; padding: 0; box-sizing: border-box; }

/* Header / legend toggle */
.hg-map__header {
  position: absolute;
  top: 0; right: 0;
  padding: 12px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.hg-map__header .legend-toggle {
  background: #fff;
  color: #000;
  padding: 8px 16px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all .2s;
  white-space: nowrap;
  border: 2px solid #97c93d;
  box-shadow: 0 0 8px rgba(0,0,0,.5);
}
.hg-map__header .legend-toggle:hover { background: #97c93d; }
@media (min-width: 768px) {
  .hg-map__header .legend-toggle { padding: 10px 20px; font-size: 13px; }
}

/* Map container — maintains aspect ratio */
.hg-map__container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 75.6%;
  overflow: hidden;
  min-height: calc(75.6vw - 48px);
}
@media (min-width: 768px) {
  .hg-map__container { min-height: 0; }
}

/* Zoomable / pannable wrapper */
.hg-map__wrapper {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transition: transform .5s ease-in-out;
  cursor: grab;
  transform-origin: 0 0;
}
.hg-map__wrapper:active { cursor: grabbing; }
.hg-map__wrapper.zoomed { cursor: default; }
.hg-map__wrapper .map-image {
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Markers */
.hg-map .marker {
  position: absolute;
  width: 2.7vw; height: 2.7vw;
  cursor: pointer;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: transform .2s;
  border-radius: 50%;
}
.hg-map .marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 4px #fff, 0 0 10px #fff, 0 0 20px #97c93d;
}
@media (min-width: 1150px) {
  .hg-map .marker { width: 31px; height: 31px; }
}
.hg-map .marker img {
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

/* Extended hit area pseudo-element per label direction */
.hg-map .marker::after {
  content: "";
  display: block;
  position: absolute;
  z-index: 1;
  left: 0; right: 0; bottom: 0; top: 0;
}
.hg-map .marker.top::after    { right: -2vw; left: -2vw; top: -2vw; }
.hg-map .marker.right::after  { right: -6vw; }
.hg-map .marker.bottom::after { right: -4vw; bottom: -2vw; }
@media (min-width: 1150px) {
  .hg-map .marker.top::after    { right: -24px; left: -24px; top: -24px; }
  .hg-map .marker.right::after  { right: -72px; }
  .hg-map .marker.bottom::after { right: -48px; bottom: -24px; }
}

/* Overlay */
.hg-map__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.1);
  z-index: 2;
}
.hg-map__overlay.active { display: block; }

/* Info window */
.hg-map .info-window {
  position: fixed;
  background: #083a12;
  color: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  padding: 20px;
  max-height: 50vh;
  overflow-y: auto;
  z-index: 3;
  opacity: 0;
  bottom: 0; left: 0; right: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
@media (min-width: 480px) {
  .hg-map .info-window {
    padding: 24px;
    left: 50%; right: auto; bottom: 24px;
    border-radius: 12px;
    transform: translateX(-50%) translateY(20px);
    max-width: 500px; min-width: 400px;
  }
}
@media (min-width: 768px) {
  .hg-map .info-window { position: absolute; min-width: 720px; width: 720px; }
}
@media (min-width: 1150px) {
  .hg-map .info-window { position: absolute; min-width: 820px; width: 820px; }
}
.hg-map .info-window.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
@media (min-width: 480px) {
  .hg-map .info-window.active { transform: translateX(-50%) translateY(0); }
}
@media (min-width: 768px) {
  .hg-map .info-window #infoContent { display: flex; }
}

/* Info image */
.hg-map .info-window .image {
  width: 200px; min-width: 200px;
  margin-right: 20px;
  position: relative;
  display: none;
}
@media (min-width: 768px) {
  .hg-map .info-window .image { display: block; }
}
.hg-map .info-window .image a {
  display: block;
  position: absolute;
  transition: all .2s;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #97c93d;
}
.hg-map .info-window .image a img {
  height: 100%; width: 100%;
  transition: all .2s;
  object-fit: cover;
}
.hg-map .info-window .image a:hover img { transform: scale(1.1); }

/* Info close button */
.hg-map .info-window .close-btn {
  position: absolute;
  top: 16px; right: 16px;
  background: hsla(0,0%,100%,.1);
  color: #fff;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.hg-map .info-window .close-btn:hover { background: hsla(0,0%,100%,.25); }

/* Info text */
.hg-map .info-window h2 { color: #fff; margin-bottom: 4px; padding-right: 40px; }
.hg-map .info-window p  { font-size: 15px; line-height: 1.5; margin-bottom: 0; color: hsla(0,0%,100%,.8); }
.hg-map .info-window p.category {
  font-size: 12px; font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #fff;
}
.hg-map .info-window .learn-more {
  text-align: right;
  font-size: 15px; font-weight: 800;
  padding-top: 4px;
  color: #97c93d;
}
.hg-map .info-window .learn-more a        { color: #97c93d; }
.hg-map .info-window .learn-more a:hover  { text-decoration: underline; }

/* Zoom controls */
.hg-map__controls {
  position: absolute;
  bottom: 12px; right: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 8px;
  background: #97c93d;
  box-shadow: 0 0 8px rgba(0,0,0,.5);
  z-index: 1;
}
.hg-map__controls .control-btn {
  background: #fff;
  color: #000;
  width: 44px; height: 44px;
  border-radius: 0;
  border: 0;
  border-left: 2px solid #97c93d;
  border-right: 2px solid #97c93d;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.hg-map__controls .control-btn:first-child {
  border-radius: 8px 8px 0 0;
  border-top: 2px solid #97c93d;
}
.hg-map__controls .control-btn:last-child {
  border-radius: 0 0 8px 8px;
  border-bottom: 2px solid #97c93d;
}

/* Legend panel (slide-in from right) */
.hg-map .legend-panel {
  position: fixed;
  top: 0; right: -100%;
  width: 100%; max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.3);
  z-index: 99;
  transition: right .3s ease-in-out;
  overflow-y: auto;
}
@media (min-width: 768px) {
  .hg-map .legend-panel { right: -400px; width: 400px; max-width: 90vw; }
}
.hg-map .legend-panel.active { right: 0; }

/* Legend header */
.hg-map .legend-header {
  position: sticky; top: 0;
  background: #083a12; color: #fff;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  z-index: 3;
}
.hg-map .legend-header h2 { font-size: 18px; font-weight: 700; color: #fff; }
.hg-map .legend-close {
  background: hsla(0,0%,100%,.2);
  border: none; color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.hg-map .legend-close:hover { background: hsla(0,0%,100%,.3); }

/* Legend list */
.hg-map .legend-content { padding: 16px; }
.hg-map .legend-item {
  display: flex;
  align-items: center;
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #f8f8f8;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid rgba(0,0,0,0);
}
@media (min-width: 768px) {
  .hg-map .legend-item { padding: 16px; margin-bottom: 8px; }
}
.hg-map .legend-item:hover {
  background: #f0f0f0;
  border-color: #97c93d;
  transform: translateX(4px);
}
.hg-map .legend-item.active {
  background: color-mix(in srgb, #fff 90%, #97c93d);
  border-color: #97c93d;
}
.hg-map .legend-marker {
  flex-shrink: 0;
  width: 40px; height: 40px;
  margin-right: 16px;
}
@media (min-width: 768px) {
  .hg-map .legend-marker { width: 36px; height: 36px; margin-right: 12px; }
}
.hg-map .legend-marker img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hg-map .legend-info { flex: 1; }
.hg-map .legend-info .title    { font-weight: 600; color: #333; }
.hg-map .legend-info .category { font-size: 12px; font-weight: bold; text-transform: uppercase; color: #666; }

/* Legend search */
.hg-map .legend-search { padding: 16px; border-bottom: 1px solid #e0e0e0; }
.hg-map .legend-search input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color .2s;
}
.hg-map .legend-search input:focus { outline: none; border-color: #97c93d; }
