/* ===== Explore Map page ===== */
.explore-hero {
  padding: 28px 24px 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.explore-hero h1 { margin-bottom: 6px; }
.explore-hero p { margin: 0; max-width: 640px; }

.explore-view-switch {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 12px;
  display: flex;
  gap: 4px;
}
.explore-view-btn {
  border: 0;
  background: var(--color-mint);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-teal-dark);
  cursor: pointer;
}
.explore-view-btn.is-active {
  background: var(--color-teal-dark);
  color: var(--color-white);
  opacity: 1;
}

/* The layer toggles float directly on the map (rather than stacking above
   it in normal flow) specifically so the map itself is visible right away
   on mobile — previously the hero text + toggles + view switch pushed the
   map a full screen down before any pin was visible. */
.explore-map-wrap {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}
.explore-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 56px; /* clears Mapbox's own zoom control, anchored top-right */
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.explore-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  border: 2px solid #e2e2e0;
  background: var(--color-white);
  box-shadow: 0 2px 10px rgba(20, 32, 31, 0.14);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-ink);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.explore-toggle__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.explore-toggle.is-active {
  opacity: 1;
  border-color: currentColor;
}

#explore-map {
  width: 100%;
  height: 62vh;
  min-height: 380px;
  max-height: 640px;
}

/* Pins & clusters are rendered as native Mapbox GL circle/symbol layers
   (paint properties in explore-map.js), not DOM elements, so no marker
   CSS is needed here. */

.explore-creator-cta {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding: 20px 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid #e2e2e0;
}
.explore-creator-cta p {
  margin: 0;
  max-width: 560px;
}

/* List view — an alternative, non-map way to browse the same data.
   Scroll-friendly by design: plain stacked cards, nothing that hijacks
   the page's scroll the way the map's own zoom gesture can. */
#explore-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 40px;
}
.explore-list__section {
  margin-bottom: 28px;
}
.explore-list__section-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.explore-list__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.explore-list__card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-white);
  border: 1.5px solid #e2e2e0;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  font-family: var(--font-body);
}
.explore-list__card:hover {
  border-color: var(--accent, var(--color-teal));
}
.explore-list__thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--color-cream);
}
.explore-list__fallback {
  width: 100%;
  height: 120px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, var(--color-teal));
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.explore-list__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 4px;
  color: var(--color-ink);
}
.explore-list__meta {
  font-size: 0.82rem;
  color: #566361;
  margin: 0;
}
.explore-list__cta {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--color-ink);
  border-bottom: 2px solid var(--accent, var(--color-teal));
}
.explore-list__empty {
  color: #566361;
  font-size: 0.9rem;
}

/* Branded popup — a soft, pill-like card instead of Mapbox's default.
   Centered over the map (not anchored to the clicked pin) so it's always
   fully visible regardless of where on the map that pin sits — an
   edge/corner pin used to open a popup that ran partly off the map (or the
   screen, on mobile). !important beats Mapbox's own inline anchor-position
   transform, same cascade rule already relied on elsewhere on this page. */
.mapboxgl-popup.explore-popup-wrap {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  max-width: min(320px, calc(100% - 32px)) !important;
  max-height: calc(100% - 32px) !important;
  overflow-y: auto !important;
  z-index: 6; /* above the floating toolbar (z-index: 5) */
}
.mapboxgl-popup.explore-popup-wrap .mapboxgl-popup-content {
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(20, 32, 31, 0.18);
  border: 1.5px solid #e2e2e0;
  padding: 0;
  overflow: hidden;
}
.mapboxgl-popup.explore-popup-wrap .mapboxgl-popup-tip {
  display: none;
}
.mapboxgl-popup.explore-popup-wrap .mapboxgl-popup-close-button {
  font-size: 1.1rem;
  padding: 4px 10px;
  color: var(--color-ink);
}
.explore-popup {
  padding: 18px 20px 20px;
}
.explore-popup__eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, var(--color-teal));
  margin-bottom: 6px;
}
.explore-popup__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0 0 6px;
}
.explore-popup__meta {
  font-size: 0.85rem;
  color: #566361;
  margin: 0 0 10px;
}
.explore-popup__locked {
  font-size: 0.85rem;
  color: #566361;
  margin: 0 0 10px;
  font-style: italic;
}
.explore-popup__tags,
.explore-list__card .explore-popup__tags {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
}
.explore-popup__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
}
.explore-popup__tag--comp {
  background: var(--accent, var(--color-teal));
  color: #ffffff;
}
.explore-popup__thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  margin-bottom: 10px;
  border: 1px solid #e2e2e0;
}
.explore-popup__yt-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin-bottom: 4px;
}
.explore-popup__yt-embed iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border: 0;
}
.explore-popup__embed-slot {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
/* TikTok's oEmbed HTML sets inline min-width:325px/max-width:605px on its
   own blockquote — wider than our popup, which is what forced the embed to
   spill past the card's edge. Inline styles need !important to override. */
.explore-popup__embed-slot .tiktok-embed {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}
/* TikTok also sets a fixed ~739px inline height on the iframe itself
   (unrelated to width — width alone wasn't the whole bug). At our narrow
   width that height covers video + caption + a "watch more" ticker strip,
   and the ticker's own content doesn't fit 277px cleanly, reading as a
   second overflow bug. Capping height keeps just the video+header visible,
   which is what "watch the video" actually needs. */
.explore-popup__embed-slot .tiktok-embed iframe {
  height: 560px !important;
  max-height: 560px !important;
}
.explore-popup__cta {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-ink);
  border-bottom: 2px solid var(--accent, var(--color-teal));
}

/* Feed-grid popup state (Creator Content pins with multiple posts) —
   an Instagram-profile-style grid of square thumbnails, so browsing posts
   at a location never has to load a single video/embed until one is picked. */
.explore-feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid #e2e2e0;
}
.explore-feed-grid__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--color-mint);
}
.explore-feed-grid__media {
  display: block;
  width: 100%;
  height: 100%;
}
.explore-feed-grid__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.explore-feed-grid__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px;
  text-align: center;
  background: var(--accent, var(--color-teal));
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.explore-feed-grid__play {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #ffffff;
  font-size: 0.7rem;
  text-shadow: 0 0 3px rgba(0,0,0,0.65);
  pointer-events: none;
}
.explore-feed-back {
  display: inline-block;
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent, var(--color-teal));
  cursor: pointer;
}

/* Submission form */
.explore-submit {
  max-width: 640px;
  margin: 0 auto;
}
.explore-submit__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.explore-submit__field { margin-bottom: 16px; }
.explore-submit__field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.explore-submit__field input,
.explore-submit__field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d8d8d5;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
#explore-submit-status {
  margin-top: 12px;
  font-weight: 600;
  color: var(--color-teal-dark);
}

@media (max-width: 720px) {
  #explore-map { height: 60vh; }
  .explore-submit__row { grid-template-columns: 1fr; }
  .explore-toggle { padding: 6px 12px; font-size: 0.78rem; }
  .explore-toggle__dot { width: 8px; height: 8px; }
}
