/* Map/list toggle buttons (components/list-view.js). */

.toggle-btns {
  position: fixed;
  z-index: 3000;
  bottom: 1.5rem;
  left: 5rem;
  display: flex;
  gap: 0.5rem;
  /* Coming back (closing a place): slide up and fade in like in the intro,
     after a short wait so they appear as the panel slides away. */
  transition:
    opacity calc(var(--duration-panel) * 0.4) var(--ease-enter) calc(var(--duration-panel) * 0.25),
    transform calc(var(--duration-panel) * 0.4) var(--ease-enter) calc(var(--duration-panel) * 0.25),
    visibility 0s;
}

/* Coming back to the list: wait until the list has fully slid in, so the
   buttons don't land on cards that are still moving. (Only takes effect
   when they were hidden; switching map/list doesn't touch them.) */
.app.is-list-open .toggle-btns {
  transition-delay: var(--duration-panel), var(--duration-panel), 0s;
}

/* Hidden while a place or the news is open: a quick fade down;
   visibility flips (and takes them out of the tab order) once the fade is
   done. */
.app.is-place-open .toggle-btns,
.app.is-news-open .toggle-btns {
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition:
    opacity calc(var(--duration-panel) * 0.15) ease,
    transform calc(var(--duration-panel) * 0.15) ease,
    visibility 0s linear calc(var(--duration-panel) * 0.15);
}

.toggle-btns button {
  padding: 0.25rem 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid var(--color-text-primary);
  background: #fff;
  color: var(--color-text-primary);
  transition: background 0.2s ease, color 0.2s ease;
}

.toggle-btns button.is-active {
  background: var(--color-text-primary);
  color: #fff;
}
