/* Everything you can do (js/everything.js), the list in js/catalogue.js. It opens through js/drill.js: a sheet that
   slides up on phones, a wide panel over the screen on laptops, both on the room sheet's glass. Its rows are the
   room sheet's rows (v2.css, "A room"): a name, a line, and an "i" when there's one more sentence. On a laptop the
   groups are cards, three across, so the whole map shows at a glance. The chrome stays starlight on glass: colour
   is for the music. Uses the v2.css tokens only. */

.ev {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* On a phone the sheet keeps its height while Find narrows the list, so it doesn't jump as you type. */
@media (max-width: 639px) {
  .drill:has(.ev) {
    height: 88vh;
    height: 88dvh;
  }
}

.ev-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ev-line {
  margin: 0;
  color: var(--dust);
  font-size: 14px;
}

/* Find: a pill, like Riff's box. */
.ev-find {
  position: relative;
}

.ev-find-ic {
  position: absolute;
  top: 50%;
  left: 15px;
  translate: 0 -50%;
  color: var(--dust);
  pointer-events: none;
}

.ev-q {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--space) 45%, transparent);
  color: var(--starlight);
  font-size: 16px;
  transition: border-color var(--t) ease;
}

.ev-q::placeholder {
  color: var(--dust);
  font-size: 15px;
}

.ev-q:hover {
  border-color: var(--hair-hi);
}

.ev-q:focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: 3px;
}

/* "For you now", or "Start here" before Jam knows anything about you. */
.ev-k {
  margin: 0 0 6px;
  padding-left: 12px;
  color: var(--dust);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.ev-for[hidden],
.ev-jump[hidden],
.ev-none[hidden] {
  display: none;
}

.ev-for-list {
  gap: 6px;
}

.ev-for-list .room-go {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  border: 1px solid var(--line);
  background-color: var(--lift);
}

.ev-for-list .room-sub {
  grid-column: 1 / -1;
}

/* The group it's in, at the top right of a pick. */
.ev-tag {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  color: var(--dust);
  font-size: 12.5px;
  font-weight: 500;
}

/* The chips that jump to a group, in a row that scrolls sideways, as the starters do. */
.ev-jump {
  flex-wrap: nowrap;
  margin: -6px -16px 0;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 16px, black calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, black 16px, black calc(100% - 16px), transparent);
}

.ev-jump::-webkit-scrollbar {
  display: none;
}

.ev-jump .chip {
  flex: none;
  min-height: 36px;
  color: var(--starlight);
}

.ev-jump .chip[hidden] {
  display: none;
}

.ev-groups {
  display: grid;
  gap: 26px;
}

.ev-gh {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  padding: 0 12px;
}

.ev-gname {
  flex: none;
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  scroll-margin-top: 8px;
}

.ev-gname:focus {
  outline: none;
}

.ev-gname:focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: 4px;
  border-radius: 4px;
}

.ev-gline {
  min-width: 0;
  margin: 0;
  color: var(--dust);
  font-size: 13px;
  text-align: right;
}

/* A row that's a link (the Earth page) looks like the rest. */
a.room-go {
  color: inherit;
  text-decoration: none;
}

/* Soon: plain text, dimmed, with its tag. */
.ev-row.is-soon .room-name,
.ev-row.is-soon .room-sub {
  color: var(--dust);
}

.ev-row.is-soon .room-go {
  cursor: default;
}

.ev-row .soon-tag {
  margin-left: 8px;
  font-weight: 400;
}

.ev-where {
  display: block;
  margin-top: 4px;
  color: var(--dust);
  font-size: 13px;
}

.ev-more {
  margin: 2px 0 0;
}

.ev-none {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 0 12px;
}

.ev-none-p {
  margin: 0;
  color: var(--dust);
}

.ev-ask {
  min-height: 40px;
  padding-left: 14px;
}

/* ---------- On a laptop: a wide panel, the groups as cards, three across ---------- */
@media (min-width: 640px) {
  /* Wider than a lesson's panel, and ending above the play bar (transport.css: 48px tall, the gutter from the
     bottom), so the last cards aren't under it. */
  .drill[data-size="wide"]:has(.ev) {
    width: min(1080px, calc(100vw - 48px));
    max-height: calc(100dvh - max(72px, 9vh) - var(--gutter) - 64px);
  }

  /* On a card, the group's line sits under its name. */
  .ev-group .ev-gh {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 6px;
  }

  .ev-group .ev-gline {
    text-align: left;
  }

  .ev-top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
  }

  .ev-find {
    flex: 0 1 360px;
  }

  .ev-jump {
    display: none;
  }

  .ev-for-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
  }

  .ev-groups {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    align-items: start;
    gap: 12px;
  }

  .ev-group {
    padding: 12px 4px 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: color-mix(in srgb, var(--starlight) 3%, transparent);
  }

  .ev-group .room-name {
    font-size: 15px;
  }

  .ev-group .room-sub {
    font-size: 13px;
  }
}

/* ---------- The Menu's row for it, under the three rooms: it opens the page, so its chevron points on ---------- */
.ev-menu .ic-chev {
  margin-left: auto;
}
