/* ==========================================================================
   ARTIST INDEX — the Artists page, Level 2, on Page: A to Z.
   Markup: templates/views/views-view--otb-artists.html.twig. The search
   box is the filter bar's (film-filter.css); js/artist-index.js filters.

     head      the title, its numbers (mono) at the far end
     search    the filter bar, at most 720px
     letters   one row of letters: a link for each with artists, the rest
               faint and not links
     groups    the letter in the accent beside its names: one column on
               phones, two from 600px, three from 995px (the letter then
               sits in its own column)
     portrait  beside a name on hover or keyboard focus, for pointers that
               hover and screens wide enough; loaded only when shown
   ========================================================================== */

.otb-index.otb-section {
  padding: 0;
}

.otb-index__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.otb-index__title {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: var(--font-size-display-m);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-display);
  letter-spacing: var(--letter-spacing-display);
}

.otb-index__numbers {
  margin: 0;
  color: var(--color-text-muted);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
}

.otb-index__notice {
  margin: var(--space-6) 0 0;
}

.otb-index__search {
  max-width: 720px;
  margin-top: var(--space-8);
}

/* ---------- LETTERS ---------- */

.otb-index__letters ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.otb-index__jump {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  border-radius: var(--border-radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  text-decoration: none;
}

a.otb-index__jump:hover,
a.otb-index__jump:focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* No artist under this letter: shown for the alphabet's shape, not a link. */
.otb-index__jump--none {
  color: var(--color-text-muted);
  opacity: 0.45;
}

/* ---------- GROUPS ---------- */

.otb-index__group {
  display: grid;
  gap: var(--space-3) var(--space-10);
  padding: var(--space-7) 0 var(--space-8);
  border-top: var(--border-width-thin) solid var(--color-border-light);
  scroll-margin-top: var(--space-6);
}

.otb-index__letters + .otb-index__group {
  margin-top: var(--space-10);
}

.otb-index__group[hidden],
.otb-index__item[hidden] {
  display: none;
}

.otb-index__letter {
  margin: 0;
  color: var(--color-primary);
  font-family: var(--font-family-display);
  font-size: var(--font-size-display-m);
  font-weight: var(--font-weight-light);
  line-height: 0.9;
}

.otb-index__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5) var(--space-10);
  margin: 0;
  padding: 0;
  list-style: none;
}

.otb-index__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.otb-index__name {
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  text-decoration: none;
}

.otb-index__name:hover,
.otb-index__name:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.otb-index__films {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
}

/* Drawn only on hover or focus, so it loads only then. */
.otb-index__portrait {
  display: none;
}

.otb-index__empty {
  margin: var(--space-8) 0 0;
  color: var(--color-text-muted);
}

@media (min-width: 600px) {
  .otb-index__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 995px) {
  .otb-index__title {
    font-size: var(--font-size-display-l);
  }

  .otb-index__group {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .otb-index__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (hover: hover) and (min-width: 995px) {
  .otb-index__item:hover .otb-index__portrait,
  .otb-index__item:focus-within .otb-index__portrait {
    position: absolute;
    z-index: 2;
    top: calc(-1 * var(--space-6));
    left: 55%;
    display: block;
    width: 180px;
    height: 180px;
    border-radius: var(--border-radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
  }
}
