/* Site title + description over the map, and the first-visit intro
   animation (components/intro.js). */

.intro {
  position: absolute;
  z-index: 1000;
  top: 1rem;
  left: 1rem;
  max-width: min(90vw, 80rem);
  text-align: left;
  /* Fading back in waits a beat, so the title reappears as the list
     slides away rather than on top of it. */
  transition:
    opacity calc(var(--duration-panel) * 0.8) var(--ease-panel) calc(var(--duration-panel) * 0.3),
    visibility 0s;
  pointer-events: none;
}

.intro__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 8rem);
  line-height: 1.05;
  color: var(--color-text-primary);
}

.intro__description {
  margin-top: 0.5rem;
  max-width: 80%;
  font-weight: 700;
  font-size: clamp(0.9rem, 2vw, 1.75rem);
  color: var(--color-text-primary);
}

/* Phones: closer to the edge, and just the title; with the description
   the map gets too crowded. */
@media (max-width: 639px) {
  .intro {
    top: 0.75rem;
    left: 0.75rem;
  }
  .intro__description {
    display: none;
  }
}

@media (min-width: 640px) {
  .intro {
    left: auto;
    right: 1rem;
    text-align: right;
  }
  .intro__description {
    margin-left: auto;
    max-width: 65%;
  }
}


/* Fade out (instead of display:none, which can't animate) alongside the
   panel slide; visibility flips only once the fade has finished. */
.app.is-place-open .intro,
.app.is-list-open .intro {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity calc(var(--duration-panel) * 0.6) var(--ease-panel),
    visibility 0s linear calc(var(--duration-panel) * 0.6);
}

/* ---------- Intro animation ---------- */

/* Hidden until assets/js/components/intro.js animates them in (GSAP's inline styles
   override this); `is-intro` is removed from <html> when it's done. */
.is-intro .leaflet-dot,
.is-intro .leaflet-label,
.is-intro .intro__title,
.is-intro .intro__description,
.is-intro .toggle-btns,
.is-intro .nav-toggle {
  opacity: 0;
}

/* Their own transitions would fight GSAP's tweens. */
.is-intro .toggle-btns,
.is-intro .nav-toggle {
  transition: none;
}

/* The intro starts on a plain cover over the finished map, in the map's
   own land colour (--color-map-land), and fades it out so only the
   contours come through. It sits above the whole map, markers included --
   they only appear after it has faded. */
.intro-cover {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-map-land);
  pointer-events: none;
}

.is-intro .intro-cover {
  display: block;
}
