/* Space Gun Ranch theme for the map explorer.
   Same colors and fonts as the landing page: blue bar, cream, gold buttons.
   Loaded last, so it only restyles; remove this file's link to go back. */
:root {
  --sgr-cream: #f3e2c4;
  --sgr-cream-soft: #fbf1df;
  --sgr-blue: #23476b;
  --sgr-blue-deep: #1a3653;
  --sgr-gold: #e2a650;
  --sgr-gold-dark: #b07a2c;
  --sgr-ink: #3a2318;
  --sgr-ink-dim: rgba(58, 35, 24, 0.74);
  --sgr-red: #8e3329;
  --sgr-sky: #aadbf5;
  --sgr-cream-line: rgba(246, 228, 196, 0.22);
  --sgr-glass: rgba(26, 54, 83, 0.9);
}

html,
body {
  background: var(--sgr-cream);
}

body {
  font-family: "Barlow", "Segoe UI", sans-serif;
}

#map {
  background: #d6c6a4;
}

/* ---------- Left panel ---------- */
#app-shell .sidebar {
  padding: 0 0 1.3rem;
  gap: 0;
  background: var(--sgr-cream);
  color: var(--sgr-ink);
  border: 0;
  border-right: 1px solid rgba(58, 35, 24, 0.14);
  box-shadow: 10px 0 30px rgba(26, 54, 83, 0.18);
  backdrop-filter: none;
  scrollbar-gutter: auto;
}

#app-shell .brand-block {
  display: grid;
  grid-template-columns: 58px 1fr;
  column-gap: 0.85rem;
  row-gap: 0.2rem;
  align-items: center;
  padding: 1.3rem 1.2rem 1.25rem;
  background: var(--sgr-blue);
  color: var(--sgr-cream-soft);
}

#app-shell .brand-mark {
  grid-row: 1 / span 2;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

#app-shell .brand-block .eyebrow {
  grid-column: 2;
  align-self: end;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--sgr-gold);
}

#app-shell .brand-block h1 {
  grid-column: 2;
  align-self: start;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 1.85rem;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--sgr-cream-soft);
}

#app-shell .brand-block .lede {
  grid-column: 1 / -1;
  margin-top: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(251, 241, 223, 0.84);
}

#app-shell .brand-block .detail-link {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.95rem;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(251, 241, 223, 0.55);
  border-radius: 999px;
  background: transparent;
  color: var(--sgr-cream-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#app-shell .brand-block .detail-link:hover,
#app-shell .brand-block .detail-link:focus-visible {
  border-color: var(--sgr-gold);
  background: rgba(226, 166, 80, 0.14);
  color: var(--sgr-cream-soft);
}

#app-shell .control-group {
  padding: 1.25rem 1.2rem 0;
  gap: 0.6rem;
}

#marker-toggle,
#app-shell .sidebar #marker-toggle {
  display: none !important;
}

#app-shell .sidebar .control-button {
  min-height: 46px;
  border: 1px solid var(--sgr-gold-dark);
  border-radius: 999px;
  background: var(--sgr-gold);
  color: #2a160d;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(226, 166, 80, 0.3);
}

#app-shell .sidebar .control-button:hover,
#app-shell .sidebar .control-button:focus-visible {
  border-color: var(--sgr-gold-dark);
  background: #ebb565;
  color: #2a160d;
}

#app-shell .sidebar .control-button-secondary {
  background: transparent;
  border-color: rgba(58, 35, 24, 0.35);
  color: var(--sgr-ink);
  box-shadow: none;
}

#app-shell .sidebar .section-block {
  margin: 1.25rem 1.2rem 0;
}

#app-shell .sidebar .section-header h2 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--sgr-red);
}

/* Legend card */
#app-shell .sidebar .legend-block {
  padding: 1.05rem 1.1rem 1.15rem;
  border-radius: 18px;
  background: var(--sgr-blue);
  color: var(--sgr-cream-soft);
  box-shadow: 0 14px 30px rgba(35, 71, 107, 0.22);
}

#app-shell .sidebar .legend-block .section-header h2 {
  color: var(--sgr-gold);
}

#app-shell .sidebar .legend-block .legend-list {
  gap: 0.6rem;
}

#app-shell .sidebar .legend-block .legend-list li {
  gap: 0.8rem;
  font-size: 0.95rem;
  color: var(--sgr-cream-soft);
}

#app-shell .sidebar .swatch {
  flex-shrink: 0;
  width: 28px;
  height: 0;
  border-radius: 3px;
  background: none;
}

#app-shell .sidebar .swatch-property {
  border-top: 3px solid #74d5df;
}

#app-shell .sidebar .swatch-surrounding {
  border-top: 3px dashed #f4b868;
}

#app-shell .sidebar .swatch-road {
  border-top: 4px solid #f6e2b4;
}

/* Admin tools (hidden from visitors): keep them readable on cream */
#app-shell .sidebar .authoring-block,
#app-shell .sidebar .detail-card {
  background: var(--sgr-cream-soft);
  border: 1px solid rgba(58, 35, 24, 0.12);
  color: var(--sgr-ink);
}

#app-shell .sidebar .mini-button,
#app-shell .sidebar .mini-button-primary,
#app-shell .sidebar .control-button-authoring {
  border-color: rgba(58, 35, 24, 0.22);
  background: #fff8ec;
  color: var(--sgr-ink);
}

#app-shell .sidebar .section-meta,
#app-shell .sidebar .readout-label,
#app-shell .sidebar .authoring-status,
#app-shell .sidebar .detail-field label,
#app-shell .sidebar .detail-placeholder,
#app-shell .sidebar .detail-help,
#app-shell .sidebar .detail-meta-grid span {
  color: var(--sgr-ink-dim);
}

#app-shell .sidebar .authoring-readout code,
#app-shell .sidebar .detail-description,
#app-shell .sidebar .item-title {
  color: var(--sgr-ink);
}

#app-shell .sidebar .detail-field input,
#app-shell .sidebar .detail-field select,
#app-shell .sidebar .detail-field textarea {
  border-color: rgba(58, 35, 24, 0.22);
  background: #fffaf1;
  color: var(--sgr-ink);
}

/* ---------- Panels on the map ---------- */
#app-shell .map-floating.panel {
  border: 1px solid var(--sgr-cream-line);
  background: var(--sgr-glass);
  color: var(--sgr-cream-soft);
  box-shadow: 0 16px 36px rgba(15, 30, 48, 0.32);
  backdrop-filter: blur(10px);
}

#app-shell .compact-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--sgr-sky);
}

#active-view-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sgr-cream-soft);
}

#map-note {
  font-size: 0.94rem;
  line-height: 1.5;
  color: rgba(251, 241, 223, 0.92);
}

#app-shell .compact-close {
  border-color: rgba(251, 241, 223, 0.45);
  background: transparent;
  color: var(--sgr-cream-soft);
}

#app-shell .compact-close:hover,
#app-shell .compact-close:focus-visible {
  border-color: var(--sgr-gold);
  background: rgba(251, 241, 223, 0.12);
  color: var(--sgr-cream-soft);
}

.leaflet-control-zoom a {
  background: var(--sgr-blue);
  color: var(--sgr-cream-soft);
  border-bottom-color: var(--sgr-cream-line);
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus {
  background: var(--sgr-blue-deep);
  color: var(--sgr-gold);
}

/* Popups */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--sgr-cream-soft);
  color: var(--sgr-ink);
}

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(58, 35, 24, 0.14);
  box-shadow: 0 18px 36px rgba(15, 30, 48, 0.3);
}

.popup-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--sgr-ink);
}

.popup-copy {
  color: var(--sgr-ink-dim);
}

.popup-action {
  font-family: "JetBrains Mono", monospace;
  color: var(--sgr-red);
}

.leaflet-container a.leaflet-popup-close-button {
  border-color: rgba(58, 35, 24, 0.22);
  background: transparent;
  color: var(--sgr-ink) !important;
}

/* Photo viewer */
#hotspot-modal .modal-backdrop {
  background: rgba(15, 30, 48, 0.55);
}

#hotspot-modal .modal-card {
  border: 1px solid rgba(58, 35, 24, 0.14);
  background: var(--sgr-cream-soft);
  color: var(--sgr-ink);
  box-shadow: 0 30px 70px rgba(15, 30, 48, 0.4);
  backdrop-filter: none;
}

#hotspot-modal .modal-kicker {
  font-family: "JetBrains Mono", monospace;
  color: var(--sgr-red);
}

#hotspot-modal .modal-title {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--sgr-ink);
}

#hotspot-modal .modal-description,
#hotspot-modal .modal-helper,
#hotspot-modal .modal-credit,
#hotspot-modal .modal-placeholder {
  color: var(--sgr-ink-dim);
}

#hotspot-modal .modal-media {
  border-color: rgba(58, 35, 24, 0.12);
  background: #efe3cc;
}

#hotspot-modal .modal-close {
  border-color: transparent;
  background: var(--sgr-blue);
  color: var(--sgr-cream-soft);
}

#hotspot-modal .modal-close:hover,
#hotspot-modal .modal-close:focus-visible {
  background: var(--sgr-blue-deep);
  color: var(--sgr-gold);
}

/* ---------- Phone ---------- */
@media (max-width: 768px) {
  #app-shell > .sidebar {
    padding: 0 0 1.3rem;
    border-radius: 0 22px 22px 0;
    box-shadow: 24px 0 48px rgba(15, 30, 48, 0.34);
  }

  #app-shell .brand-block {
    padding-top: 4.6rem;
  }

  #app-shell > .mobile-sidebar-toggle {
    border: 1px solid var(--sgr-gold);
    background: var(--sgr-blue);
    color: var(--sgr-cream-soft);
    box-shadow: 0 12px 26px rgba(15, 30, 48, 0.3);
  }

  #app-shell > .mobile-sidebar-toggle:hover,
  #app-shell > .mobile-sidebar-toggle:focus-visible {
    border-color: var(--sgr-gold);
    background: var(--sgr-blue-deep);
  }

  #app-shell.mobile-sidebar-open > .mobile-sidebar-toggle {
    border-color: var(--sgr-gold-dark);
    background: var(--sgr-gold);
    color: #2a160d;
  }
}

/* ---------- Tablet (769 to 960 px): let the map fill the screen,
   with the panel as a card on the left. This fixed a gap where
   the map only filled a narrow column. ---------- */
@media (min-width: 769px) and (max-width: 960px) {
  #app-shell.app-shell:not(.is-admin),
  #app-shell.app-shell.is-admin {
    grid-template-columns: 1fr;
  }

  #app-shell .sidebar {
    right: auto;
    width: 320px;
    border-radius: 22px;
    border-right: 0;
  }
}

/* Phones and tablets: keep the notes box clear of the zoom buttons and the map credits */
@media (max-width: 960px) {
  #app-shell .bottom-left {
    right: 4.2rem;
    bottom: 2.9rem;
  }

  #app-shell .top-right {
    top: 1rem;
    right: 1rem;
    bottom: auto;
  }
}
