/* Global */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}
#map {
  width: 100vw;
  height: 100vh;
}

/* Make interactive layers obviously clickable */
.leaflet-interactive {
  cursor: pointer;
}

/* Hamburger Menu Button */
.menu__btn {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 1500;
  display: flex;
  justify-content: center;
  align-items: center;
}
.menu__btn span,
.menu__btn span::before,
.menu__btn span::after {
  display: block;
  position: absolute;
  width: 100%;
  height: 4px;
  background-color: #000;
  transition: 0.25s ease;
  border-radius: 3px;
}
.menu__btn span::before {
  content: "";
  top: -9px;
}
.menu__btn span::after {
  content: "";
  top: 9px;
}
#menu__toggle {
  display: none;
}
#menu__toggle:checked + .menu__btn > span {
  transform: rotate(45deg);
}
#menu__toggle:checked + .menu__btn > span::before {
  top: 0;
  transform: rotate(0);
}
#menu__toggle:checked + .menu__btn > span::after {
  top: 0;
  transform: rotate(90deg);
}

/* Sidebar Panel */
.menu__box {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
  padding: 70px 20px 20px 36px;
  padding-bottom: 30px;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  z-index: 1400;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#menu__toggle:checked ~ .menu__box {
  transform: translateX(0);
}
.menu__box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu__box li {
  margin-bottom: 22px;
}
.menu__item {
  color: #000;
  text-decoration: none;
  font-size: 1.14em;
  font-weight: 600;
}
.menu__item:hover {
  background: none !important;
}
.about-text,
.map-text,
.contact-text {
  font-size: 0.85em;
  opacity: 0.85;
  line-height: 1.4em;
  margin-left: 4px;
  margin-top: 6px;
  display: none;
  font-family: Arial, sans-serif;
}
.about-text.visible,
.map-text.visible,
.contact-text.visible {
  display: block;
}
.legend_point-image,
.legend_area-image {
  display: block;
  margin: 10px auto;
  opacity: 0.6;
}
.legend_point-image {
  max-width: 18%;
}
.legend_area-image {
  max-width: 48%;
}

/* Basemap Toggle */
.basemap-toggle {
  position: absolute;
  top: 60px;
  right: 15px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 1000;
  overflow: hidden;
}
.basemap-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Zoom controls */
.zoom-controls {
  position: absolute;
  top: 115px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
}
.zoom-controls button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  opacity: 0.7;

  position: relative;
  padding: 0;

  -webkit-appearance: none;
  appearance: none;

  font-size: 0;
  line-height: 0;
  color: transparent;
}

/* + icon: perfectly centred horizontal and vertical bars */
#zoom-in::before,
#zoom-in::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: #333;
  transform: translate(-50%, -50%);
}
#zoom-in::before {
  width: 10px;
  height: 2px;
}
#zoom-in::after {
  width: 2px;
  height: 10px;
}

/* − icon */
#zoom-out::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background: #333;
  transform: translate(-50%, -50%);
}

.zoom-controls button:active {
  transform: translateY(1px);
}

/* Bottom-right info box */
.info-box {
  position: absolute;
  right: 15px;
  bottom: 15px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(2px);
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  width: 200px;
  transform: scale(0);
  transform-origin: bottom right;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 1200;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.info-box.open {
  transform: scale(1);
  border-color: #facd52;
  box-shadow:
    0 0 0 2px #facd52,
    0 0 18px rgba(250, 205, 82, 0.85);
}
@media (max-width: 600px) {
  .info-box {
    width: 40vw;
  }
}
.info-box-header {
  display: flex;
  position: relative; /* allows absolute positioning inside */
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-family: Arial, sans-serif;
  font-size: 0.95em;
  font-weight: 600;
  color: #222;
}
.info-box-title {
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  font-weight: 700;
  font-size: 1.05em;
  line-height: 1.2em;
}
.info-box-close {
  position: absolute;
  top: -6px;       /* move upward */
  right: -6px;     /* move further right */
  cursor: pointer;
  font-size: 1.1em;
  opacity: 0.7;
}
.info-box-body {
  font-family: Arial, sans-serif;
  font-size: 0.85em;
  color: #222;
}

/* Info-box photos */
.info-text {
  margin-bottom: 8px;
}
.info-photos {
  margin-top: 6px;
}
.info-photos-title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* container for the stacked thumbnails */
.info-photos-grid {
  position: relative;
  width: 88px;
  height: 88px;
  margin-top: 4px;
}

/* base style for each thumbnail */
.info-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

/* 1.jpg – top of stack */
.info-photo:nth-child(1) {
  z-index: 3;
  transform: translate(0px, 0px) rotate(-3deg);
}

/* 2.jpg – slightly underneath */
.info-photo:nth-child(2) {
  z-index: 2;
  transform: translate(4px, 4px) rotate(2deg);
}

/* 3.jpg – bottom of visible stack */
.info-photo:nth-child(3) {
  z-index: 1;
  transform: translate(-4px, 8px) rotate(-1deg);
}

/* hide any extras beyond the first three */
.info-photo:nth-child(n + 4) {
  display: none;
}

.info-photos-empty {
  font-size: 0.8em;
  opacity: 0.7;
}

/* Only the top (first) thumbnail should be clickable */
.info-photo:not(:first-child) {
  pointer-events: none;
}

/* Related points list: MultiAlph section */
.info-multi {
  margin-top: 8px;
}
.info-multi-title {
  font-weight: 600;
  margin-bottom: 3px;
}

/* tighter 2-column grid for MultiAlph points */
.info-multi-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 8px 0 0 0 !important;

  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: flex-start;    /* keep columns close together */
  column-gap: 10px;                /* horizontal space between columns */
  row-gap: 2px;                   /* vertical space between rows */
}
.info-multi-list li {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.82em;
  text-align: left;
}
.multi-label {
  font-weight: 700;
  margin-right: 3px;
}

/* Text labels next to points */
.srk-point-label {
  pointer-events: none;
}
.srk-point-label span {
  display: inline-block;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  border: 1px solid #ccc;
  padding: 1px 4px;
  font-size: 0.7em;
  color: #111;
  font-weight: 700;
  white-space: nowrap;
}

/* Photo lightbox */
#photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
#photo-lightbox.open {
  display: flex;
}
.photo-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: rgba(70, 70, 70, 0.8);
  border-radius: 10px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox-image {
  max-width: 82vw;
  max-height: 82vh;
  object-fit: contain;
  display: block;
}

/* Close button */
.photo-lightbox-close {
  position: absolute;
  top: 6px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;

  /* hide actual text but keep it in the DOM */
  font-size: 0;
  line-height: 0;
  color: transparent;

  position: absolute;
}

/* draw the ×, perfectly centred */
.photo-lightbox-close::before {
  content: "×";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: #fff;
}

/* Prev / Next */
.photo-lightbox-prev,
.photo-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  user-select: none;

  /* hide actual text inside the divs */
  font-size: 0;
  line-height: 0;
  color: transparent;
}

.photo-lightbox-prev {
  left: -40px;
}
.photo-lightbox-next {
  right: -40px;
}

/* centred arrow icons */
.photo-lightbox-prev::before,
.photo-lightbox-next::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: #fff;
}

.photo-lightbox-prev::before {
  content: "\276E";  /* ❮ */
}
.photo-lightbox-next::before {
  content: "\276F";  /* ❯ */
}

.photo-lightbox-prev.disabled,
.photo-lightbox-next.disabled {
  opacity: 0.3;
  cursor: default;
}

/* Geolocation */
.leaflet-control-locate a {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #fff url("images/locate.svg") center/20px no-repeat;
  border: 1px solid #ccc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  filter: grayscale(100%) saturate(0) opacity(0.7);
}
.leaflet-control-locate a.active {
  background: rgba(255, 255, 255, 0.5)
              url("images/locate_selected.svg")
              center/20px no-repeat;
  filter: opacity(0.9);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* Responsive */
@media (max-width: 768px) {
  .menu__box {
    width: 210px;
  }
  .legend_point-image {
    max-width: 22%;
  }
  .legend_area-image {
    max-width: 55%;
  }
  .photo-lightbox-prev {
    left: 4px;
  }
  .photo-lightbox-next {
    right: 4px;
  }
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(2px);
  border: 1px solid #facd52 !important;
  box-shadow:
    0 0 0 2px #facd52,
    0 0 18px rgba(250, 205, 82, 0.85) !important;

  padding: 0;
  border-radius: 999px;
  position: relative;
}
.leaflet-popup-tip {
  display: none !important;
}
.leaflet-popup-content {
  font-size: 0.8em;
  line-height: 1.2;
  margin: 6px 10px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.leaflet-popup-content-wrapper::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 2px;
  height: 0px;
  transform: translateX(-50%);
  background: #000;
  pointer-events: none;
  opacity: 0.4;
}
.leaflet-popup-close-button {
  display: none !important;
}

/* Position the geolocation control */
.leaflet-top.leaflet-right .leaflet-control-locate {
  margin-top: 16px;
  margin-right: 15px;
}