/* Ritual Map — preview styles. Everything is scoped to .rm-root / .rm-* */

.rm-root {
  position: relative;
  overflow: hidden;
  background: var(--night);
  color: var(--sand);
  font-family: var(--sans);
}
.rm-root [hidden] { display: none !important; }

/* map canvas sits in its own stacking context so overlays always win */
.rm-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ── Leaflet, dressed for the night ─────────────────────────── */
.rm-root .leaflet-container {
  background: var(--night);
  font-family: var(--sans);
  outline: none;
}
.rm-root.rm-picking .leaflet-container,
.rm-root.rm-picking .leaflet-container .leaflet-interactive {
  cursor: crosshair;
}
.rm-root .leaflet-popup-content-wrapper,
.rm-root .leaflet-popup-tip {
  background: var(--night-800);
  color: var(--sand);
  border: 1px solid rgba(217, 164, 65, 0.25);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.rm-root .leaflet-popup-content-wrapper { border-radius: 14px; }
.rm-root .leaflet-popup-content {
  margin: 14px 16px;
  font-size: 13px;
  line-height: 1.4;
}
.rm-root .leaflet-popup-content p { margin: 0; }
.rm-root .leaflet-container a.leaflet-popup-close-button {
  color: var(--dusk);
}
.rm-root .leaflet-container a.leaflet-popup-close-button:hover { color: var(--sand); }
.rm-root .leaflet-control-attribution {
  background: rgba(14, 11, 9, 0.7);
  color: var(--dusk);
  font-size: 10px;
  padding: 0 6px;
  border-top-left-radius: 6px;
}
.rm-root .leaflet-control-attribution a { color: var(--gold); }
.rm-root .leaflet-bar {
  border: 1px solid rgba(217, 164, 65, 0.25);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  overflow: hidden;
}
.rm-root .leaflet-bar a,
.rm-root .leaflet-bar a:hover {
  background: var(--night-800);
  color: var(--gold);
  border-bottom-color: rgba(217, 164, 65, 0.25);
}
.rm-root .leaflet-bar a:hover { background: var(--night-700); color: var(--gold-soft); }
.rm-root .leaflet-touch .leaflet-bar a,
.rm-root .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 20px; }
.rm-root .leaflet-bar a.leaflet-disabled { background: var(--night-800); color: var(--dusk); opacity: 0.5; }
.rm-root .leaflet-bottom.leaflet-right .leaflet-control-zoom { margin-bottom: 8px; }

/* listener popup copy */
.rm-pop-msg {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.3;
  color: var(--sand);
}
.rm-root .leaflet-popup-content .rm-pop-meta { margin-top: 8px; font-size: 12px; color: var(--dusk); }
.rm-root .leaflet-popup-content .rm-pop-note {
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--gold-soft);
  opacity: 0.75;
}

/* ── Ritual place pins ───────────────────────────────────────── */
.rm-root .rm-pin-icon { background: none; border: 0; }
.rm-pin {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
}
.rm-pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: radial-gradient(circle at 35% 35%, #f4d38c, #d9a441 55%, #a87a24);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.18), 0 0 22px rgba(217, 164, 65, 0.65);
  transition: transform 0.15s ease;
}
.rm-pin:hover .rm-pin-dot { transform: scale(1.15); }
.rm-root .rm-pin-icon:focus { outline: none; }
.rm-root .rm-pin-icon:focus-visible .rm-pin { outline: 2px solid var(--gold); outline-offset: -6px; }
.rm-pin.rm-upcoming .rm-pin-dot {
  background: transparent;
  border: 2px dashed rgba(217, 164, 65, 0.8);
  box-shadow: none;
}
.rm-pin-count {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--night);
  border: 1px solid rgba(217, 164, 65, 0.6);
  color: var(--gold-soft);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-family: var(--sans);
  box-sizing: border-box;
}

/* ── Top bar: filters + drop pin ─────────────────────────────── */
.rm-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  pointer-events: none;
}
.rm-filter-wrap,
.rm-drop-btn { pointer-events: auto; }
.rm-root .rm-filters-toggle {
  background: rgba(14, 11, 9, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding-top: 10px;
  padding-bottom: 10px;
}
.rm-root .rm-drop-btn { box-shadow: 0 0 30px rgba(217, 164, 65, 0.35); }
.rm-filters {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin-top: 8px;
}
.rm-filters.rm-open { display: flex; }
@media (max-width: 767.98px) {
  .rm-filter-wrap { position: relative; }
  .rm-filters {
    position: absolute;
    left: 0;
    top: 100%;
    width: min(340px, calc(100vw - 24px));
    box-sizing: border-box;
  }
}
.rm-root .rm-sel {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 14px;
}
.rm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  white-space: nowrap;
  font-size: 14px;
  color: rgba(243, 233, 218, 0.8);
  cursor: pointer;
}
.rm-check input { accent-color: var(--gold); margin: 0; width: 15px; height: 15px; }

@media (min-width: 768px) {
  .rm-root .rm-filters-toggle { display: none; }
  .rm-filters,
  .rm-filters.rm-open {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 0;
  }
  .rm-root .rm-sel-lang { width: 176px; }
  .rm-root .rm-sel-track { width: 224px; }
}

/* ── Legend ──────────────────────────────────────────────────
   Desktop: a narrow column bottom-left (over the open ocean, clear of Rio and Búzios).
   Phones: folded behind a small "Key" button. */
.rm-legend {
  position: absolute;
  left: 12px;
  bottom: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: rgba(243, 233, 218, 0.8);
}
.rm-root .rm-legend-btn { display: none; }
@media (max-width: 639px) {
  .rm-legend { display: none; bottom: 76px; }
  .rm-legend.rm-open { display: flex; }
  .rm-root .rm-legend-btn {
    display: inline-flex;
    position: absolute;
    left: 12px;
    bottom: 24px;
    z-index: 10;
    min-height: 44px;
    padding: 0.55rem 0.95rem;
    font-size: 12px;
    background: rgba(14, 11, 9, 0.8);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}
.rm-legend-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rm-lg { display: inline-block; border-radius: 9999px; flex-shrink: 0; box-sizing: border-box; }
.rm-lg-place { width: 12px; height: 12px; background: var(--gold); box-shadow: 0 0 10px #d9a441; }
.rm-lg-soon { width: 12px; height: 12px; border: 1px dashed var(--gold); }
.rm-lg-origin { width: 12px; height: 11px; border-radius: 0; background: linear-gradient(90deg, #D9A441 50%, #A87A24 50%); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.rm-lg-listener { width: 10px; height: 10px; border: 1px solid var(--sand); background: rgba(232, 196, 122, 0.6); }

/* ── Panels (place card + pin form) ──────────────────────────── */
.rm-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 20;
  max-height: 70%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 164, 65, 0.3) transparent;
}
.rm-form { z-index: 30; max-height: 75%; }
@media (min-width: 768px) {
  .rm-panel {
    left: auto;
    right: 12px;
    bottom: auto;
    top: 80px;
    width: 400px;
    max-height: calc(100% - 96px);
  }
  .rm-form { width: 380px; }
}
.rm-panel p,
.rm-panel h2,
.rm-panel h3,
.rm-panel ul { margin: 0; }
.rm-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.rm-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid rgba(217, 164, 65, 0.2);
  background: transparent;
  color: var(--dusk);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.rm-close:hover { color: var(--sand); border-color: rgba(217, 164, 65, 0.45); }
.rm-close:focus-visible { outline: 2px solid rgba(217, 164, 65, 0.7); outline-offset: 2px; }

.rm-place-name {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--sand);
}
.rm-place-count { font-size: 14px; color: var(--dusk); margin-top: 2px; }
.rm-panel .rm-mine { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gold-soft); }
.rm-panel .rm-venue { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.rm-tracks { list-style: none; padding: 0; margin-top: 20px; }
.rm-track { border-top: 1px solid rgba(217, 164, 65, 0.1); padding-top: 20px; }
.rm-track + .rm-track { margin-top: 24px; }
.rm-track-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rm-track-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--sand);
}
.rm-track-series { flex-shrink: 0; font-size: 12px; color: var(--dusk); }
.rm-panel .rm-track-meta { margin-top: 4px; font-size: 12px; color: rgba(217, 164, 65, 0.8); }
.rm-panel .rm-blurb { margin-top: 8px; font-size: 14px; line-height: 1.5; color: rgba(243, 233, 218, 0.75); }
.rm-panel .rm-arrives {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(217, 164, 65, 0.4);
  font-size: 14px;
  color: var(--gold-soft);
}
.rm-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.rm-root .rm-btn-sm {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 12px;
  text-decoration: none;
}

/* pin form */
.rm-form-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--sand);
}
.rm-pick {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(217, 164, 65, 0.2);
  background: var(--night-700);
  font-size: 14px;
}
.rm-pick-text { flex: 1; color: rgba(243, 233, 218, 0.8); }
.rm-field { display: block; margin-top: 16px; min-width: 0; }
.rm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; align-items: end; }
.rm-grid2 .rm-field { margin-top: 0; }
.rm-root .rm-textarea { min-height: 88px; resize: none; font-family: inherit; }
.rm-root .rm-form .input { box-sizing: border-box; width: 100%; }
.rm-panel .rm-error { margin-top: 12px; font-size: 14px; color: var(--ember); }
.rm-root .rm-submit { width: 100%; margin-top: 20px; }
.rm-panel .rm-fineprint { margin-top: 12px; text-align: center; font-size: 11px; color: var(--dusk); }

.rm-done { text-align: center; padding: 24px; }
.rm-panel .rm-done-moon { font-size: 36px; line-height: 1.2; }
.rm-panel .rm-done-title { margin-top: 12px; font-family: var(--serif); font-size: 24px; color: var(--sand); }
.rm-panel .rm-done-msg { margin-top: 8px; font-size: 14px; color: var(--sand-70); }
.rm-root .rm-done-back { margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .rm-pin-dot, .rm-close { transition: none; }
}

.rm-track-art { width: 100%; aspect-ratio: 1 / 1; max-width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 14px; background: var(--night-700); }
.rm-track-art.rm-wide { aspect-ratio: 16 / 9; }
.rm-track-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767px) { .rm-track-art { aspect-ratio: 16 / 9; } }

/* ── Phone pin flow, step 1: compact bar keeps the map near full height ── */
.rm-root .rm-compact { max-height: none; padding: 12px; }
.rm-compact-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rm-panel .rm-compact-title { font-family: var(--serif); font-size: 20px; line-height: 1.2; color: var(--sand); }
.rm-compact-row { display: flex; gap: 8px; margin-top: 10px; }
.rm-compact-city { flex: 1; min-width: 0; }
.rm-root .rm-compact .input { width: 100%; }
.rm-root .rm-next { flex: none; min-height: 44px; }
.rm-compact .rm-pick { margin-top: 10px; padding: 8px 12px; font-size: 13px; }
.rm-pick .link { min-height: 44px; font-size: 14px; }
.rm-root.rm-compact-on .rm-top { display: none; }

/* the origin marker: YALI YALI at Giza */
.rm-root .leaflet-marker-icon.rm-origin-icon.leaflet-interactive,
.rm-root .rm-origin, .rm-root .rm-origin-ring, .rm-root .rm-origin-label, .rm-root .rm-origin .rm-pin-count { pointer-events: none; }
.rm-root .rm-origin-pyr { pointer-events: auto; cursor: pointer; }
.rm-root .rm-origin-pyr .rm-origin-beam { pointer-events: none; }
.rm-root .rm-origin { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.rm-root .rm-origin-pyr { width: 34px; height: 30px; overflow: visible; filter: drop-shadow(0 0 10px rgba(217,164,65,.8)); position: relative; z-index: 1; }
.rm-root .rm-origin-ring { position: absolute; left: 50%; top: 58%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 999px; border: 1.5px solid rgba(217,164,65,.7); animation: rm-pulse 2.4s ease-out infinite; }
@keyframes rm-pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.rm-root .rm-origin-label { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); white-space: nowrap; text-align: center;
  font-family: var(--serif); font-size: 15px; line-height: 1; color: var(--gold-soft); text-shadow: 0 1px 6px #000, 0 0 2px #000; letter-spacing: .06em; pointer-events: none; }
.rm-root .rm-origin-label small { display: block; margin-top: 3px; font-family: var(--sans); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--sand); opacity: .8; }
.rm-root .rm-origin .rm-pin-count { top: 2px; right: 0; z-index: 2; }
.rm-root .rm-top-right { display: flex; gap: 8px; align-items: flex-start; pointer-events: auto; }
.rm-root .rm-origin-btn { background: rgba(14,11,9,.8); backdrop-filter: blur(6px); }
@media (max-width: 639px) {
  .rm-top { flex-wrap: nowrap; padding: 10px; gap: 6px; }
  .rm-root .rm-top-right { gap: 6px; flex-wrap: nowrap; }
  .rm-root .rm-top .btn { min-height: 44px; padding: .55rem .8rem; font-size: 12px; letter-spacing: 0; }
  .rm-root .rm-drop-btn { box-shadow: 0 0 18px rgba(217, 164, 65, 0.3); }
}
@media (max-width: 359px) { .rm-root .rm-top .btn { padding-inline: .6rem; font-size: 11.5px; } }
@media (prefers-reduced-motion: reduce) { .rm-root .rm-origin-ring { animation: none; opacity: .5; } }

/* phones: shorter place panel so the map strip above it stays useful */
@media (max-width: 767px) { .rm-place { max-height: 60%; padding: 16px; } .rm-place .rm-place-name { font-size: 30px; } }

/* compact song rows (phones, long panels) and the Giza "After the pyramid" block */
.rm-tracks-c { margin-top: 12px; }
.rm-track.rm-track-c { padding-top: 10px; }
.rm-tracks-c .rm-track + .rm-track { margin-top: 10px; }
.rm-track-c { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rm-c-art { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--night-700); display: block; }
.rm-panel .rm-c-title { font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.12; color: var(--sand); overflow-wrap: anywhere; }
.rm-panel .rm-track-c .rm-venue { margin-bottom: 0; font-size: 10px; letter-spacing: .14em; }
.rm-panel .rm-track-c .rm-track-meta { margin-top: 2px; }
.rm-panel .rm-c-soon { margin-top: 2px; font-size: 12px; color: var(--gold-soft); }
.rm-c-act { display: flex; gap: 6px; align-items: center; }
.rm-root .rm-c-yt { padding-inline: 12px; }
.rm-root .rm-c-play { width: 44px; height: 44px; box-shadow: none; }
.rm-root .rm-c-play svg { width: 18px; height: 18px; }
.rm-root .rm-remind { display: inline-flex; align-items: center; min-height: 44px; margin-block: -8px; font-size: 12px; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.rm-after { margin-top: 22px; padding-top: 16px; border-top: 1px dashed rgba(217, 164, 65, 0.35); }
.rm-panel .rm-after-t { margin-top: 4px; font-family: var(--serif); font-size: 22px; color: var(--sand); }
.rm-after-list { list-style: none; padding: 0; margin: 12px 0 0 !important; display: grid; gap: 10px; }

/* go-live: no fan pins (nothing is collected) */
.rm-root .rm-drop-btn, .rm-root .rm-check, .rm-root .rm-mine { display: none !important; }
