/* /explore/ Signal World — isolated styles for the 3D exploration layer.
   Derives from the shared Audio Atlas tokens (see /styles.css :root). */

body.explore-page { overflow-x: hidden; }

.explore-fallback[hidden],
.explore-loading[hidden],
.explore-card[hidden],
.explore-categories-panel[hidden] {
  display: none !important;
}

/* Compact floating header over the dark scene */
body.explore-page .site-header {
  position: sticky;
  top: 0;
  z-index: 21;
  padding: 0.6rem 0 0.75rem;
  background: rgba(13, 16, 19, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(57, 66, 75, 0.55);
}
body.explore-page .site-header h1 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

/* 3D stage: fixed full-viewport canvas behind the page content */
.explore-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #0d1013;
  overflow: hidden;
}
.explore-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.explore-stage[data-explore-status="ready"] .explore-loading { display: none; }
.explore-stage[data-explore-status="fallback"] .explore-loading { display: none; }

.explore-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.explore-loading-label { animation: explore-pulse 1.6s ease-in-out infinite; }
@keyframes explore-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.explore-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--text);
  background: #0d1013;
}
.explore-fallback h2 { margin-bottom: 0.5rem; }

/* Explore control bar (sticky below the site header) */
.explore-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  margin: 0.75rem 0 0;
  color: var(--text);
  background: rgba(24, 29, 34, 0.88);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  backdrop-filter: blur(8px);
}
.explore-btn {
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  font-weight: 750;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.explore-btn:hover { border-color: var(--accent); }
.explore-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.explore-btn-link { font-weight: 750; }
.explore-search { display: flex; align-items: center; gap: 0.35rem; min-width: min(18rem, 100%); }
.explore-search input {
  min-width: 8rem;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
}
.explore-search input::placeholder { color: var(--muted); }
.explore-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.explore-categories { position: relative; }
.explore-categories-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 25;
  min-width: min(21rem, 80vw);
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  padding: 0.4rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  list-style: none;
  margin: 0;
}
.explore-category-item { display: flex; width: 100%; }
.explore-category-link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  width: 100%;
  padding: 0.45rem 0.7rem;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.explore-category-link:hover,
.explore-category-link.is-active {
  border-color: var(--accent);
  background: var(--page);
}
.explore-category-dot {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}
.explore-category-count {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

.explore-current {
  margin-left: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Floating hint (top-left, fades out after first interaction) */
.explore-hint {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 19;
  max-width: 17rem;
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  background: rgba(24, 29, 34, 0.85);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
}
.explore-hint.is-hidden { display: none; }
.explore-hint strong { color: var(--text); display: block; margin-bottom: 0.15rem; }

/* District information card (HTML overlay, not canvas) */
.explore-card {
  position: fixed;
  top: 5.2rem;
  right: 1rem;
  z-index: 30;
  width: min(21.5rem, calc(100vw - 2rem));
  max-height: calc(100vh - 6.4rem);
  overflow-y: auto;
  padding: 1.1rem 1.15rem;
  color: var(--text);
  background: rgba(24, 29, 34, 0.94);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0.45rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}
.explore-card-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  font-size: 1rem;
  cursor: pointer;
}
.explore-card-close:hover { color: var(--text); border-color: var(--line); }
.explore-card-icon { font-size: 1.5rem; line-height: 1; }
.explore-card-title { margin: 0.35rem 0 0.25rem; font-size: 1.35rem; padding-right: 2.2rem; }
.explore-card-desc { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.95rem; }
.explore-card-count {
  margin: 0 0 0.6rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.explore-card-featured {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}
.explore-card-featured li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  font-size: 0.9rem;
}
.explore-card-featured a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  text-decoration: none;
}
.explore-card-featured a:hover { text-decoration: underline; }
.explore-card-featured .explore-card-featured-type {
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: capitalize;
}
.explore-card-actions { display: flex; }
.explore-card-viewall {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  color: #061018;
  background: var(--accent);
  border-radius: 0.3rem;
  font-weight: 800;
  text-decoration: none;
}
.explore-card-viewall:hover { text-decoration: underline; }

/* Scrollable content zone that overlays the fixed canvas */
.explore-spacer { height: calc(100vh - 12rem); min-height: 22rem; pointer-events: none; }
.explore-summary,
.explore-district-list-section {
  position: relative;
  z-index: 10;
  padding: 2.2rem 1rem;
  color: var(--text);
  background: var(--page);
}
.explore-summary { border-top: 1px solid var(--line); }
.explore-summary h2 { margin-bottom: 0.6rem; }
.explore-summary-text { max-width: 48rem; margin: 0; color: var(--muted); font-size: 1.05rem; }

.explore-district-list-section h2 { margin-bottom: 0.4rem; }
.explore-district-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.8rem;
}
.explore-district-link {
  display: block;
  min-height: 44px;
  padding: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font-weight: 700;
  text-decoration: none;
}
.explore-district-link:hover { border-color: var(--accent); }
.explore-district-icon { margin-right: 0.45rem; font-size: 1.1rem; }
.explore-district-name { font-size: 1.05rem; }
.explore-district-count {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.explore-district-desc {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

body.explore-page .site-footer { position: relative; z-index: 10; background: var(--page); }

/* Mobile */
@media (max-width: 640px) {
  .explore-topbar { gap: 0.35rem; padding: 0.45rem; z-index: 40; }
  .explore-btn { min-height: 40px; padding: 0.4rem 0.65rem; font-size: 0.82rem; }
  .explore-current { display: none; }
  .explore-categories-panel {
    position: fixed;
    top: 8rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    min-width: 0;
    max-height: calc(100vh - 10rem);
    z-index: 50;
  }
  .explore-category-menu-list { margin: 0; padding: 0; list-style: none; }
  .explore-card {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 52vh;
    border-radius: 0.8rem 0.8rem 0 0;
  }
  .explore-spacer { height: calc(100vh - 10rem); }
}

@media (prefers-reduced-motion: reduce) {
  .explore-loading-label { animation: none; }
  body.explore-page { scroll-behavior: auto; }
}
