/* ---------------------------------------------------------------
   /learn/redewendungen/ — the phrase collection (js/phrases.js), and
   the same list as a fold-out under the player (js/listen.js).

   Follows the design language in style.css: each episode's list is one
   soft card; the term is set in the display face, the explanation in
   the quieter ink beside it. Gold marks the note next to a term.
   --------------------------------------------------------------- */

.phrases {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: calc(var(--space) * 3) var(--space) calc(var(--space) * 5);
}

.phrases .page-intro p {
  max-width: 56ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* --- Search, view switch, count ------------------------------------ */

.phrase-tools {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.phrase-tools[hidden] {
  display: none;
}

.phrase-search-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 12px;
  color: var(--ink-soft);
}

.phrase-search-wrap svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.phrase-search {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.phrase-search::placeholder {
  color: var(--ink-soft);
}

.phrase-search-wrap:focus-within {
  color: var(--accent);
}

.phrase-views {
  flex: none;
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
}

.phrase-views button {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.phrase-views button.is-on {
  background: var(--ink);
  color: var(--bg);
}

.phrase-count {
  flex: none;
  margin: 0 12px 0 2px;
}

.phrase-empty {
  margin: 40px 0;
  color: var(--ink-soft);
  font-style: italic;
}

/* --- One episode (or one letter) ----------------------------------- */

.phrase-group {
  margin-top: 48px;
}

.phrase-group[hidden],
.phrase-groups[hidden],
.phrase[hidden] {
  display: none;
}

.phrase-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 20px;
  margin-bottom: 14px;
}

.phrase-head .meta-row {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.phrase-head h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.phrase-head .link-arrow {
  white-space: nowrap;
  padding-bottom: 3px;
}

.phrase-letter {
  margin: 0 0 14px;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
}

/* --- The list itself -------------------------------------------------- */

/* Rows are ruled underneath and pulled up by a pixel, and the card clips
   its edge: the last row shown never has a rule under it, whichever rows a
   search has hidden. */
.phrase-list {
  margin: 0;
  padding: 0 28px;
  overflow: hidden;
}

.phrase {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: 6px 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: -1px;
}

.phrase dt {
  margin: 0;
}

.phrase-term {
  font-family: var(--font-display-latin);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.phrase-note {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: 2px;
  white-space: nowrap;
}

.phrase-note--text {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
  font-style: italic;
  vertical-align: baseline;
  white-space: normal;
}

.phrase-ep {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}

.phrase-ep:hover {
  color: var(--accent);
}

.phrase dd {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* --- Small screens ---------------------------------------------------- */

@media (max-width: 700px) {
  .phrase-tools {
    position: static;
    flex-wrap: wrap;
    border-radius: 22px;
    gap: 8px;
  }

  .phrase-search-wrap {
    flex-basis: 100%;
  }

  .phrase-count {
    margin-left: auto;
  }

  .phrase-group {
    margin-top: 36px;
  }

  .phrase-head h2 {
    font-size: 1.3rem;
  }

  .phrase-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .phrase-list {
    padding: 0 20px;
  }

  .phrase {
    grid-template-columns: minmax(0, 1fr);
    padding: 15px 0;
  }
}
