/* Shared marker-side media for Earth, Mars, and Venus. */
.exploration-marker-media {
  position: absolute;
  z-index: 3;
  width: 246px;
  display: grid;
  gap: 5px;
  opacity: 0;
  transform: translateY(7px) scale(.985);
  transition: opacity .42s ease .12s, transform .52s cubic-bezier(.2,.75,.2,1) .12s;
  filter: drop-shadow(0 12px 24px #0008);
  pointer-events: auto;
}
.exploration-marker-media[hidden],
.exploration-marker-media [hidden] { display: none; }

.exploration-marker-gallery {
  display: grid;
  pointer-events: auto;
  grid-template-columns: minmax(0, 124px);
  justify-content: end;
  gap: 6px;
}
.exploration-marker-gallery.is-dual {
  grid-template-columns: repeat(2, minmax(0, 120px));
}
.exploration-marker-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d4bc8e50;
  border-radius: 2px;
  background: #030912e8;
  box-shadow: inset 0 0 0 1px #ffffff08;
  appearance: none;
  cursor: zoom-in;
  pointer-events: auto;
  touch-action: manipulation;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.exploration-marker-frame:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #ddc28b94;
  box-shadow: 0 9px 22px #0009, inset 0 0 0 1px #ffffff12;
}
.exploration-marker-frame:focus-visible {
  outline: 1px solid #dec48f;
  outline-offset: 2px;
}
.exploration-marker-frame:disabled { cursor: default; }
.exploration-marker-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #05101c0d 45%, #02070e9e 100%);
}
.exploration-marker-frame img {
  display: block;
  pointer-events: auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.exploration-marker-chip {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid #d6bf9345;
  background: #02070ed6;
  color: #e0ca9e;
  font-size: 5.5px;
  line-height: 1.2;
  letter-spacing: 1px;
  text-align: center;
}
.exploration-marker-status {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #9fa9b6;
  background: #030912;
  font-size: 6px;
  line-height: 1.4;
  letter-spacing: .9px;
  text-align: center;
  text-transform: uppercase;
}
.exploration-marker-meta {
  justify-self: end;
  max-width: 100%;
  overflow: hidden;
  color: #7f8996;
  font-size: 5.5px;
  line-height: 1.3;
  letter-spacing: 1px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 4px #030812;
}

.earth-location-dot:not(.is-relocating) .exploration-marker-media,
.mars-focus-reticle.is-marker-visible .exploration-marker-media,
.venus-focus-reticle.is-marker-visible .exploration-marker-media,
.mercury-focus-reticle.is-marker-visible .exploration-marker-media {
  opacity: 1;
  transform: none;
}

.exploration-photo-source { display: none !important; }

/* One lightbox implementation shared by all planet scenes. */
.exploration-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
  pointer-events: auto;
  touch-action: none;
}
.exploration-lightbox[hidden] { display: none; }
.exploration-lightbox-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: #01040be8;
  backdrop-filter: blur(7px);
  cursor: zoom-out;
}
.exploration-lightbox-dialog {
  position: relative;
  z-index: 1;
  margin: 0;
  width: min(94vw, 1180px);
  max-height: 94vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: clamp(10px, 1.5vw, 16px);
  overflow: hidden;
  border: 1px solid #d6bf934d;
  background: linear-gradient(180deg, #08111cf2, #03070dfa);
  box-shadow: 0 26px 90px #000d, inset 0 0 0 1px #ffffff08;
}
.exploration-lightbox-dialog:focus { outline: none; }
.exploration-lightbox-image-wrap {
  position: relative;
  min-height: min(260px, 48vh);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #01040a;
}
.exploration-lightbox-image {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.exploration-lightbox-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8d98a5;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.exploration-lightbox-loading[hidden] { display: none; }
.exploration-lightbox-loading.is-error { color: #b8a27b; }
.exploration-lightbox-caption {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #d7dbe1;
}
.exploration-lightbox-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.exploration-lightbox-title {
  color: #efe6cf;
  font-size: clamp(.92rem, 1vw + .68rem, 1.12rem);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.exploration-lightbox-counter {
  flex: 0 0 auto;
  color: #9e8a65;
  font-size: .68rem;
  letter-spacing: .14em;
}
.exploration-lightbox-description {
  color: #a7b0ba;
  font-size: .88rem;
  line-height: 1.45;
}
.exploration-lightbox-metadata {
  color: #768290;
  font-size: .7rem;
  line-height: 1.45;
}
.exploration-lightbox-link {
  justify-self: start;
  color: #ccb07c;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}
.exploration-lightbox-link:hover { color: #ecd4a1; }
.exploration-lightbox-close,
.exploration-lightbox-nav {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d8c08b56;
  border-radius: 999px;
  background: #03070edf;
  color: #efe6cf;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}
.exploration-lightbox-close {
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  font-size: 1.35rem;
}

.exploration-lightbox-close svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.exploration-lightbox-nav {
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  font-size: 1.75rem;
}
.exploration-lightbox-prev { left: 18px; }
.exploration-lightbox-next { right: 18px; }
.exploration-lightbox-close:hover,
.exploration-lightbox-nav:hover:not(:disabled) {
  border-color: #ead09b96;
  background: #0a1320f2;
}
.exploration-lightbox-close:focus-visible,
.exploration-lightbox-nav:focus-visible {
  outline: 1px solid #dec48f;
  outline-offset: 2px;
}
.exploration-lightbox-nav:disabled {
  opacity: .24;
  cursor: default;
}
.exploration-lightbox-nav[hidden] { display: none; }
html.is-exploration-lightbox-open,
html.is-exploration-lightbox-open body { overflow: hidden; }

@media (max-width: 700px), (max-height: 700px) {
  .exploration-marker-media { width: 194px; gap: 4px; }
  .exploration-marker-gallery { grid-template-columns: minmax(0, 96px); gap: 4px; }
  .exploration-marker-gallery.is-dual { grid-template-columns: repeat(2, minmax(0, 95px)); }
  .exploration-marker-meta { font-size: 5px; }
  .exploration-marker-chip { top: 4px; left: 4px; font-size: 5px; }
  .exploration-lightbox { padding: 8px; }
  .exploration-lightbox-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); padding: 8px; }
  .exploration-lightbox-image { max-width: calc(100vw - 32px); max-height: 75vh; }
  .exploration-lightbox-nav { width: 36px; height: 36px; font-size: 1.5rem; }
  .exploration-lightbox-prev { left: 12px; }
  .exploration-lightbox-next { right: 12px; }
  .exploration-lightbox-close { top: 10px; right: 10px; width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .exploration-marker-media,
  .exploration-marker-frame,
  .exploration-lightbox-close,
  .exploration-lightbox-nav { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* Scientific-image integrity + exploration gating. */
.exploration-marker-type {
  position:absolute; left:6px; bottom:6px; z-index:2;
  max-width:calc(100% - 12px); padding:2px 5px;
  border:1px solid #d6e2e72e; background:#02070edb; color:#b9c8d0;
  font-size:5px; line-height:1.2; letter-spacing:.75px; text-transform:uppercase;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none;
}
[id$="-scene"]:not(.is-exploring) .exploration-marker-frame {
  pointer-events:none !important; cursor:default !important;
}
[id$="-scene"]:not(.is-exploring) .exploration-marker-frame img { pointer-events:none !important; }
[id$="-scene"]:not(.is-exploring) .exploration-marker-frame:hover {
  transform:none !important; border-color:#d4bc8e50 !important;
  box-shadow:inset 0 0 0 1px #ffffff08 !important;
}
[id$="-scene"]:not(.is-exploring) .exploration-marker-meta { opacity:.52; }

/* Feature-based topics pull their supporting media inward toward the focused object.
   Abstract/system topics keep the established detached side placement. */
@media (min-width: 901px) {
  .jupiter-context-media[data-media-layout="feature"],
  .saturn-context-media[data-media-layout="feature"],
  .uranus-context-media[data-media-layout="feature"],
  .asteroid-context-media[data-media-layout="feature"],
  .neptune-context-media[data-media-layout="feature"] {
    right: clamp(110px, 13vw, 235px);
  }
}

.exploration-marker-credit {
  position:absolute; top:6px; right:6px; z-index:2;
  max-width:calc(100% - 42px); padding:2px 4px;
  background:#02070ec4; color:#aeb9c1; border:1px solid #d5e0e522;
  font-size:4.5px; line-height:1.2; letter-spacing:.45px; text-transform:uppercase;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none;
}
