/* Responsive design tokens for map */
:root {
  --marker-size: 20px;
  --initial-zoom: 1.5; /* numeric value as string, will be parsed in JS */
  /* Device and orientation flags (strings) */
  --device: desktop; /* phone | tablet | desktop | large */
  --orientation: landscape; /* portrait | landscape */
  /* Help button offsets (you can customize these) */
  --help-offset-right: 20px;
  --help-offset-bottom: 20px;
}


/* Orientation flags */
@media (orientation: portrait) {
  :root { --orientation: portrait; }
}
@media (orientation: landscape) {
  :root { --orientation: landscape; }
}

/* Rotation-safe device tiers using min-dimension approximations */
/* Phone (portrait): width 0–500, height 600–1000 */
@media (orientation: portrait) and (max-width: 500px) and (min-height: 600px) and (max-height: 1000px) {
  :root { --device: phone; }
}
/* Phone (landscape): height 0–500, width 600–1000 */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 600px) and (max-width: 1000px) {
  :root { --device: phone; }
}

/* Tablet (portrait): constrain width (shorter side) and height (longer side) */
/* Increased max-height to 1600px to account for device pixel ratio scaling */
@media (orientation: portrait) and (min-width: 501px) and (max-width: 1200px) and (min-height: 601px) and (max-height: 1600px) {
  :root { --device: tablet; }
}
/* Tablet (landscape): flip constraints so height (shorter side) is limited */
/* Increased max-width to 1600px to account for device pixel ratio scaling */
@media (orientation: landscape) and (min-height: 501px) and (max-height: 1200px) and (min-width: 601px) and (max-width: 1600px) {
  :root { --device: tablet; }
}


/* Large monitor: both dimensions must be >= 1441 (more specific to avoid overriding tablets) */
/* Only match if BOTH width AND height are large (not just one dimension) */
@media (min-width: 1441px) and (min-height: 1441px) {
  :root { --device: large; }
}

/* #map-section {
  height: 100vh;
  position: relative;
  background: url('../images/starsbg1.jpeg') no-repeat center center fixed;
  background-size: cover;
  z-index: 0;
} */



#map-section {
  height: 100vh;
  position: relative;
  background: #000 !important;
  z-index: 5; /* Ensure map section is above hero content */
}

/* Map section top-right nav positioning (desktop) */
.map-nav {
  position: absolute;
  top: 30px;
  right: 40px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 30px; /* keep horizontal spacing between filters and Submit on large screens */
}

/* Desktop/default: Submit lives in the nav; mobile version is hidden */
.map-nav-submit-container {
  display: flex;
}
.map-submit-mobile {
  display: none;
}

/* Submit button style within map section (desktop + mobile) */
.map-nav-link.map-btn-submit {
  position: relative;
  background: white; /* Solid white background */
  color: #000;
  font-weight: 700; /* Bold */
  padding: 8px 22px; /* Include border width in padding */
  border-radius: 25px;
  text-shadow: none;
  text-transform: uppercase; /* Make text all caps */
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  font-size: 1.1rem;
}

/* Animated gradient border layer (behind button) */
.map-nav-link.map-btn-submit::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(90deg, #FFD700, #1E90FF, #e53935, #FF69B4, #FFA500);
  background-size: 300% 100%;
  border-radius: 27px; /* Slightly larger than button */
  z-index: -1;
  animation: mapSubmitGradient 6s linear infinite;
}

.map-nav-link.map-btn-submit:hover {
  transform: scale(1.05);
}

.map-nav-link.map-btn-submit:hover::before {
  animation-duration: 2.5s;
}

@keyframes mapSubmitGradient {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* Map-only top-right nav styles (decoupled from hero) */
.map-nav-list {
  list-style: none;
  display: flex;
  gap: 30px;
  font-family: 'Helvetica', Arial, sans-serif;
  font-weight: 400; /* not bold */
  margin: 0;
  padding: 0;
  align-items: center; /* Vertically center all nav items */
}
.map-nav-item { position: relative; }
.map-nav-link {
  color: #000;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 400; /* not bold */
  line-height: 1.2;
  display: flex;
  align-items: center;
  vertical-align: middle;
  text-shadow: 0 0 2px #ffffff, 0 0 2px #ffffff;
}
.map-nav-link:hover { opacity: 0.85; }

/* Map-only dropdowns */
.map-dropdown { position: relative; }
.map-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  background: rgba(0,0,0,0.85);
  color: #fff;
  border-radius: 8px;
  padding: 6px;
  margin-top: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: none;
  z-index: 2002;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar styling for map dropdown */
.map-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.map-dropdown-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.map-dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.map-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
.map-dropdown.open .map-dropdown-menu { display: block; }
.map-dropdown .dropdown-item {
  width: 100%;
  background: transparent;
  color: #fff;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.map-dropdown .dropdown-item:hover { background: #222; }
.map-dropdown .dropdown-item:active { background: #333; }

@media (max-width: 768px) {
  .map-nav { right: 10px; top: 25px; flex-direction: column; align-items: flex-end; gap: 10px; }
  .map-nav-list { gap: 15px; }
  .map-nav-link { font-size: 0.85rem; }
}

/* Stack Values/Sub-categories vertically on phones and tablets */
/* Stack Values/Sub-categories vertically on PHONES (portrait) */
@media (orientation: portrait) and (max-width: 500px) and (min-height: 600px) and (max-height: 1000px) {
  .map-nav { top: 16px; right: 12px; flex-direction: column; align-items: flex-end; gap: 8px; }
  .map-nav-list { flex-direction: column; align-items: flex-end; gap: 8px; }
  .map-nav-item { width: max-content; }
  .map-dropdown-menu { right: 0; left: auto; }
}
/* Stack on PHONES (landscape) */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 600px) and (max-width: 1000px) {
  .map-nav { top: 12px; right: 12px; flex-direction: column; align-items: flex-end; gap: 6px; }
  .map-nav-list { flex-direction: column; align-items: flex-end; gap: 6px; }
  .map-nav-item { width: max-content; }
  .map-dropdown-menu { right: 0; left: auto; }
}




/* Stack on TABLETS (portrait) */
@media (orientation: portrait) and (min-width: 501px) and (max-width: 1200px) and (min-height: 601px) and (max-height: 1600px) {
  .map-nav { top: 20px; right: 16px; flex-direction: column; align-items: flex-end; gap: 10px; }
  .map-nav-list { flex-direction: column; align-items: flex-end; gap: 10px; }
  .map-nav-item { width: max-content; }
  .map-dropdown-menu { right: 0; left: auto; }
}
/* Stack on TABLETS (landscape) */
@media (orientation: landscape) and (min-height: 501px) and (max-height: 1200px) and (min-width: 601px) and (max-width: 1600px) {
  .map-nav { top: 18px; right: 16px; flex-direction: column; align-items: flex-end; gap: 10px; }
  .map-nav-list { flex-direction: column; align-items: flex-end; gap: 10px; }
  .map-nav-item { width: max-content; }
  .map-dropdown-menu { right: 0; left: auto; }
}

.mapboxgl-ctrl-logo {
  display: none !important;
}



#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

/* Custom right-side controls container (desktop only) */
#custom-map-controls {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0; /* No gap - unified widget */
  background: white;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  overflow: hidden; /* Clip children to border radius */
}

/* Mobile "?" over-map button is hidden by default; only enabled in small-screen media query */
.map-help-mobile {
  display: none;
}

/* Style Mapbox zoom control to be part of unified widget */
#custom-map-controls .mapboxgl-ctrl-group {
  background: white;
  border-radius: 0 !important; /* No individual border radius */
  box-shadow: none !important; /* No individual shadow */
  margin: 0 !important;
  border: none !important;
}

/* Remove borders between Mapbox buttons */
#custom-map-controls .mapboxgl-ctrl-group button {
  width: 29px;
  height: 29px;
  border: none !important;
  border-bottom: 1px solid #ddd !important; /* Only bottom border for divider */
}

/* Last Mapbox button (zoom out) - add bottom border */
#custom-map-controls .mapboxgl-ctrl-group button:last-child {
  border-bottom: 1px solid #ddd !important; /* Divider before help button */
}

/* Help/Instructions button - same style as zoom buttons */
.map-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 0; /* Square, part of unified widget */
  text-decoration: none;
  color: #333;
  background: #fff;
  font-weight: 600;
  font-size: 18px;
  box-shadow: none; /* No individual shadow */
  transition: background 0.2s ease;
  border: none;
}
.map-help-btn:hover { 
  background: #f0f0f0;
}

/* Hide only navigation control containers to prevent flash/jump */
/* But keep attribution visible */
.mapboxgl-ctrl-top-left:not(:has(.mapboxgl-ctrl-attrib)),
.mapboxgl-ctrl-top-right:not(:has(.mapboxgl-ctrl-attrib)),
.mapboxgl-ctrl-bottom-left:not(:has(.mapboxgl-ctrl-attrib)),
.mapboxgl-ctrl-bottom-right:not(:has(.mapboxgl-ctrl-attrib)) {
  display: none !important;
}

/* Ensure attribution is always visible in both positions */
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-bottom-left:has(.mapboxgl-ctrl-attrib),
.mapboxgl-ctrl-bottom-right:has(.mapboxgl-ctrl-attrib) {
  display: block !important;
}

/* Hide custom controls on mobile/tablet (show only on desktop) */
@media
  /* Phone (portrait) */
  (orientation: portrait) and (max-width: 500px) and (min-height: 600px) and (max-height: 1000px),
  /* Phone (landscape) */
  (orientation: landscape) and (max-height: 500px) and (min-width: 600px) and (max-width: 1000px),
  /* Tablet (portrait) */
  (orientation: portrait) and (min-width: 501px) and (max-width: 1200px) and (min-height: 601px) and (max-height: 1600px),
  /* Tablet (landscape) */
  (orientation: landscape) and (min-height: 501px) and (max-height: 1200px) and (min-width: 601px) and (max-width: 1600px)
{
  #custom-map-controls {
    display: none;
  }
}

.mapboxgl-marker {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.mapboxgl-marker:hover {
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
}

#buttons {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

#buttons button {
  padding: 15px 30px;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s ease;
}

#buttons button:hover {
  transform: scale(1.05);
}

#message {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* Popup Styles */
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1999; /* match rectangle overlay so it sits above all map UI */
  display: none;
}

#popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #fcfdfe 0%, #ffd699 60%, #ffffff 100%);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 2000; /* above overlay and all buttons/controls */
  width: 90vw;
  max-width: 600px;
  box-sizing: border-box;
}


#popup-title {
  margin-bottom: 8px;
}
#popup-country {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 8px;
}
#popup-action {
  margin-bottom: 8px;
}
#popup-extra > div {
  margin-bottom: 6px;
}
#popup-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-top: 18px;
  margin-bottom: 15px;
}

#popup button {
  margin-top: 10px;
  margin-right: 10px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

#popup-button {
  background-color: #1e90ff;
  color: white;
}

#popup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* align buttons to left */
  gap: 12px;
}
#popup-actions #popup-social {
  order: 2; /* keep social to the right of buttons */
  margin-left: auto; /* push social to far right if space allows */
}
#popup-actions a#popup-readmore {
  width: 140px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0; /* unify visual height */
  box-sizing: border-box;
  margin: 0; /* remove extra margins to keep alignment */
}
#popup-actions button { margin: 0; }

#popup-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%; /* perfect circle since width == height */
  background-color: #e53935;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Read more button: same sizing as close, blue variant */
#popup-readmore {
  background-color: #1e90ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  text-decoration: none;
  display: inline-block;
}
#popup-readmore:hover {
  filter: brightness(0.95);
}

#popup-button:hover {
  background-color: #005cbf;
}

#popup-close:hover {
  background-color: #e0e0e0;
}

/* Submission Dots in Rectangle Popup */
#rectangle-popup {
  min-height: 80px;
  min-width: 320px;
  padding-top: 48px;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

#rectangle-popup .submission-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #eee;
  box-shadow: 0 0 8px rgba(30,144,255,0.15);
  margin: 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid #fff;
}
#rectangle-popup .submission-dot:hover {
  transform: scale(1.12);
  box-shadow: 0 0 16px 2px #1e90ff;
}

#rectangle-popup > div {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#rectangle-popup > div > div {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}

/* Map Section Buttons */
.map-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0 22px;
  margin-bottom: 8px;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  text-align: center;
  line-height: 1.2;
  min-width: 220px;
  max-width: 220px;
  width: 220px;
  height: 64px; /* fixed height to match other buttons */
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-btn span {
  display: block;
  white-space: normal; /* allow wrap to two lines */
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* clamp to two lines */
  -webkit-box-orient: vertical;
}
.btn-unity {
  background: #e53935;
}
.btn-oneness {
  background: #1976d2;
}
.btn-bridge {
  background: #8e24aa;
}
.btn-voices {
  background: #43a047;
}
.btn-perspectives {
  background: #fc8db2;
}
.btn-showall {
  background: #fbc02d;
}
.btn-submit {
  background: transparent !important;
}
.map-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
  filter: brightness(1.08);
}
/* Dropdown button appearance (Borderless Values / Sub-categories) */
.btn-dropdown {
  background: #e0e0e0;
  color: #222;
}
/* Minimal dropdown menus */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  background: #111;
  color: #fff;
  border-radius: 8px;
  padding: 6px;
  margin-top: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: none; /* hidden by default */
  z-index: 2002;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar styling for mobile dropdown */
.dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
.dropdown.open .dropdown-menu {
  display: block;
}
.dropdown-item {
  width: 100%;
  background: transparent;
  color: #fff;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.dropdown-item:hover {
  background: #222;
}
.dropdown-item:active {
  background: #333;
}
@media (max-width: 600px) {
  .map-btn {
    font-size: 0.98rem;
    min-width: 120px;
    max-width: 98vw;
    width: 44vw;
    height: 54px; /* fixed mobile height */
    padding: 0 10px;
  }
}

@media (max-width: 600px) {
  #rectangle-popup {
    min-width: 0;
    max-width: 98vw;
    padding: 16px 4px 16px 4px;
  }
  #rectangle-popup .submission-dot {
    width: 36px;
    height: 36px;
  }
  #rectangle-popup > div > div {
    gap: 8px;
  }
} 

#popup, #popup * {
  font-family: 'Helvetica', Arial, sans-serif;
} 

/* Instructions Popup */
#instructions-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
}

#instructions-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f5f5f5;
  padding: 36px 36px 32px 36px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 2001;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  display: none;
}
#instructions-popup h2 {
  color: #222;
  margin-bottom: 18px;
  font-size: 1.7rem;
  font-weight: 700;
  text-align: center;
}
.instructions-section {
  margin-bottom: 22px;
}
.instructions-section:last-child {
  margin-bottom: 0;
}
.instructions-heading {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  margin-top: 0;
  font-size: 1.08rem;
}
#instructions-popup ul {
  margin: 0 0 0 18px;
  padding: 0;
  list-style: disc inside;
}
#instructions-popup ul li {
  margin-bottom: 7px;
  color: #444;
  font-size: 1rem;
  line-height: 1.6;
}
#instructions-popup p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 10px;
  font-size: 1rem;
}
#instructions-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: #666;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#instructions-close:hover {
  background: #444;
}












/* 
map and instructions pop up setting */



@media
  /* Phone (portrait) */
  (orientation: portrait) and (max-width: 500px) and (min-height: 600px) and (max-height: 1000px),
  /* Phone (landscape) */
  (orientation: landscape) and (max-height: 500px) and (min-width: 600px) and (max-width: 1000px),
  /* Tablet (portrait) */
  (orientation: portrait) and (min-width: 501px) and (max-width: 1200px) and (min-height: 601px) and (max-height: 1600px),
  /* Tablet (landscape) */
  (orientation: landscape) and (min-height: 501px) and (max-height: 1200px) and (min-width: 601px) and (max-width: 1600px)
{
  #map-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
    height: 100vh;
    background: #fff !important;
    position: relative;
    padding-bottom: 80px; /* space for buttons */
    box-sizing: border-box;
  }
  /* Show top-right nav on mobile/tablet */
  .map-top-right-nav { display: block; }
  .logo-container {
    flex: 0 0 auto;
    align-self: flex-start;
    margin: 10px 0 0 10px;
    z-index: 2;
  }
  .map-container {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    min-width: 0;
    position: relative;
    height: 100%;
    width: 100%;
    padding-bottom: 64px; /* space for buttons and attribution */
    box-sizing: border-box;
  }
  #map {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0 auto;
    border-radius: 0;
    background: #fff !important;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    position: relative;
  }
  /* Ensure Mapbox copyright is always visible and inside the map */
  #map .mapboxgl-ctrl-bottom-left,
  #map .mapboxgl-ctrl-bottom-right {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    z-index: 10;
    background: rgba(255,255,255,0.8);
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 4px 4px 0 0;
  }
  /* Hide the legacy bottom button bar on mobile/tablet to match desktop */
  #map-section #buttons { display: none; }
  /* Buttons hidden, no sizing needed */
  /* No special sizing for instructions on mobile since buttons are hidden */

  /* On phones/tablets: move Submit below the map, centered; hide nav Submit */
  .map-nav-submit-container {
    display: none;
  }
  .map-submit-mobile {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 56px; /* roughly centered in the bottom padding space */
    z-index: 1100;
    align-items: center;
    justify-content: center;
  }
  .map-submit-mobile .map-btn-submit {
    /* Reuse existing button styling but ensure it looks good centered */
    white-space: nowrap;
  }
  /* Small screens: show a simple "?" in the bottom-right of the map container */
  
  
  /* .map-help-mobile {
    display: block;
    position: absolute;
    right: 21px; 
    bottom: 77px;
    z-index: 1100;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000000;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    
  } */

/* Help/Instructions button - same style as zoom buttons */
/* .map-help-mobile  {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 4px; 
  text-decoration: none;
  color: #333;
  background: #fff;
  font-weight: 600;
  font-size: 18px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); 
  transition: background 0.2s ease;
  border: none;
}
.map-help-mobile:hover { 
  background: #f0f0f0;
}
 */




}

@media (min-width: 1025px) {
  /* On desktop, hide the legacy button stack and use top-right nav */
  #map-section #buttons { display: none; }
}
@media (max-width: 480px) {
  #map-section #buttons {
    gap: 3px;
    padding: 4px 0 4px 0;
  }
  #map-section .map-btn {
    font-size: 0.82rem;
    min-width: 80px;
    max-width: 48vw;
    padding: 6px 2px;
    border-radius: 7px;
    margin: 0 1px 2px 1px;
    flex: 1 1 48vw;
  }
}


@media (max-width: 500px) and (max-height: 700px) {
  #popup {
    width: calc(100vw - 20px);
    /* height: calc(100vh - 20px); */
    max-width: 400px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  #popup, #popup * {
    font-size: 0.8rem;
    line-height: 1.2;
  }
  #popup-image {
    height: 180px;
    margin-top: 8px;
    margin-bottom: 0px;
    border-radius: 3px;
  }
  #popup-title {
    margin-top: 4px;
    margin-bottom: 4px;
  }
  #popup-extra > div {
    margin-bottom: 3px;
  }
}

@media (max-width: 500px) and (min-height: 701px) {
  #popup {
    width: calc(100vw - 20px);
    /* height: 600px; */
    max-width: 400px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  /* #popup, #popup * {
    font-size: 0.98rem;
    line-height: 1.25;
  } */
}

@media (min-width: 501px) and (max-width: 850px) {
  #popup {
    width: 85vw;
    max-width: 460px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

@media (min-width: 851px) and (max-width: 1200px) {
  #popup {
    width: 75vw;
    max-width: 540px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    
  }
}

@media (min-width: 1025px) {
  #popup {
    width: 30vw;
    max-width: 800px;
  }
  #popup-image {
    height: 250px;
  }
}


