/* Interactive island snorkel map — topo image + clickable spot pins.
   Driven by files/js/snorkel-map-v1.js. Data from _data/snorkel_spots.yml
   via _includes/snorkel-spot-map.html. Font sizes in px per site rules. */

.hg-snorkmap {
  position: relative;
  max-width: 980px;
  margin: 28px auto;
}
.hg-snorkmap__title { text-align: center; font-size: 24px; color: #1866B4; margin: 0 0 14px; }

/* Island switcher (statewide hub) ------------------------------------- */
.hg-sm-switch { max-width: 980px; margin: 24px auto; }
.hg-sm-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 4px; }
.hg-sm-tab {
  border: 1px solid #d9c08a;
  background: #fff;
  color: #8a6a16;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.hg-sm-tab:hover { background: #fbf3df; }
.hg-sm-tab.is-active { background: #c8941f; border-color: #c8941f; color: #fff; }
.hg-sm-pane.is-hidden { display: none; }
.hg-sm-pane .hg-snorkmap { margin-top: 10px; }

.hg-snorkmap__frame {
  position: relative;
  width: 100%;
  line-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  /* Breathing room so coastal pins (and their halos) aren't trimmed by
     the overflow clip — the JS positions pins against the image box, so
     this padding doesn't shift them. */
  padding: 28px 24px;
  box-sizing: border-box;
}

.hg-snorkmap__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px; /* defeat global img radius fighting the frame */
}

/* Pins ---------------------------------------------------------------- */
.hg-snorkmap__pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 4;
}
.hg-snorkmap__pin::before { /* soft halo, like the reference */
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: rgba(200, 148, 31, 0.22);
  transition: transform .15s ease, background .15s ease;
}
.hg-snorkmap__dot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #c8941f;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  z-index: 1;
}
.hg-snorkmap__dot::after { content: "+"; transform: translateY(-1px); }
.hg-snorkmap__pin:hover::before,
.hg-snorkmap__pin:focus-visible::before { transform: scale(1.15); background: rgba(200, 148, 31, .34); }
.hg-snorkmap__pin:focus-visible { outline: none; }
.hg-snorkmap__pin:focus-visible .hg-snorkmap__dot { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #c8941f; }
.hg-snorkmap__pin.is-active { z-index: 6; }
.hg-snorkmap__pin.is-active .hg-snorkmap__dot { background: #1866B4; }
.hg-snorkmap__pin.is-active .hg-snorkmap__dot::after { content: "\2212"; } /* minus */

/* Hover label --------------------------------------------------------- */
.hg-snorkmap__tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 7;
}
.hg-snorkmap__pin:hover .hg-snorkmap__tip { opacity: 1; }

/* Spot card ----------------------------------------------------------- */
.hg-snorkmap__card {
  position: absolute;
  z-index: 8;
  width: 300px;
  max-width: 86%;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .28);
  overflow: hidden;
  display: none;
}
.hg-snorkmap__card.is-open { display: block; }
.hg-snorkmap__card-photo {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0;
  background: #e6ebee;
}
.hg-snorkmap__card-body { padding: 14px 16px 16px; }
.hg-snorkmap__card-region {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #1866B4;
  margin: 0 0 3px;
}
.hg-snorkmap__card-name { font-size: 19px; font-weight: 700; color: #1a1a1a; margin: 0 0 7px; line-height: 1.2; }
.hg-snorkmap__card-line { font-size: 15px; line-height: 1.45; color: #38434a; margin: 0 0 12px; }
.hg-snorkmap__card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hg-snorkmap__badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eaf3ee;
  color: #0f6e56;
}
.hg-snorkmap__badge.is-intermediate,
.hg-snorkmap__badge.is-mod { background: #fbf0dd; color: #854f0b; }
.hg-snorkmap__badge.is-advanced,
.hg-snorkmap__badge.is-hard { background: #fae9e7; color: #993c1d; }
.hg-snorkmap__badge.is-neutral { background: #eef1f3; color: #3a464d; }
.hg-snorkmap__cta { font-size: 15px; font-weight: 700; color: #1866B4; text-decoration: none; white-space: nowrap; }
.hg-snorkmap__cta:hover { text-decoration: underline; }
.hg-snorkmap__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 17px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.hg-snorkmap__close:hover { background: rgba(0, 0, 0, .72); }

.hg-snorkmap__hint {
  text-align: center;
  font-size: 14px;
  color: #5f6b72;
  margin: 10px 0 0;
}

/* Mobile: card docks to the bottom of the map instead of floating ----- */
@media (max-width: 640px) {
  .hg-snorkmap__card {
    position: relative; /* keep the × close anchored to the card, not the map */
    width: auto;
    max-width: none;
    margin: 14px 0 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .14);
  }
  .hg-snorkmap__pin { width: 34px; height: 34px; }  /* easier tap target */
  .hg-snorkmap__dot { font-size: 21px; }
}

/* Cluster pins — several spots merged into one numbered pin ------------ */
.hg-snorkmap__pin.is-cluster { width: 36px; height: 36px; }
.hg-snorkmap__pin.is-cluster .hg-snorkmap__dot {
  font-size: 16px;
  font-family: inherit;
}
/* the count is the dot's text — suppress the "+" / minus glyphs */
.hg-snorkmap__pin.is-cluster .hg-snorkmap__dot::after { content: none; }
.hg-snorkmap__pin.is-cluster::before { inset: -6px; }

/* Cluster chooser list -------------------------------------------------- */
.hg-snorkmap__card.is-list .hg-snorkmap__card-body { padding: 14px 10px 10px 16px; }
/* Scoped reset: .article-content ul carries list-style:disc +
   padding-left:45px !important (0,1,1) — outrank it at (0,2,0). */
.hg-snorkmap__list,
.article-content .hg-snorkmap__list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0 !important;
  max-height: 320px;
  overflow-y: auto;
}
.hg-snorkmap__list li,
.article-content .hg-snorkmap__list li { list-style: none; margin: 0; padding: 0; }
.hg-snorkmap__list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px 9px 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #edf1f4;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.hg-snorkmap__list li:last-child .hg-snorkmap__list-item { border-bottom: 0; }
.hg-snorkmap__list-item:hover,
.hg-snorkmap__list-item:focus-visible { background: #f5f9fc; }
.hg-snorkmap__list-name {
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
}
.hg-snorkmap__list-region {
  flex: 0 1 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #5f6b72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}
.hg-snorkmap__list-go { flex: 0 0 auto; font-size: 20px; color: #c8941f; line-height: 1; }

@media (max-width: 640px) {
  .hg-snorkmap__pin.is-cluster { width: 40px; height: 40px; }
  .hg-snorkmap__pin.is-cluster .hg-snorkmap__dot { font-size: 17px; }
  .hg-snorkmap__list { max-height: none; }
}
