/*
 * Komponent: lista autorów w rzędzie (blok nlad/authors, układ row; HTML: modules/model/templates/authors.php).
 * Teaser na głównej (`.nl-authors--teaser`: tytuł + „Zobacz wszystkich”): jeden rząd, na telefonie 2x2 i tylko 4 pierwsze.
 * Strona z pełną listą (/autorzy/, /redakcja/): ten sam wygląd, wszystkie pozycje, zawijane w wiersze. Ładuje się z paczką home albo osobno, gdy strona ma blok.
 */
@layer components {
  .nl-author-list {
    display: flex;
    gap: var(--nl-space-4);
    margin: 0;
    padding: 0 0 var(--nl-space-2);
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .nl-author-list__item { display: flex; flex: 0 0 var(--nl-avatar); flex-direction: column; align-items: center; gap: var(--nl-space-2); text-align: center; scroll-snap-align: start; }
  .nl-author-list__item img {
    inline-size: var(--nl-avatar);
    block-size: var(--nl-avatar);
    border-radius: var(--nl-radius-pill);
    object-fit: cover;
  }
  .nl-author-list__initials {
    display: grid;
    place-items: center;
    inline-size: var(--nl-avatar);
    block-size: var(--nl-avatar);
    border-radius: var(--nl-radius-pill);
    background: var(--nl-color-accent-text);
    color: var(--nl-color-paper);
    font-family: var(--nl-font-heading);
    font-size: var(--nl-text-xl);
    font-weight: var(--nl-heading-weight);
  }
  .nl-author-list__count { font-size: var(--nl-text-s); }
  .nl-author-list__item .nl-author-list__name { padding-block: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-block-size: 2.4em; text-wrap: balance; color: var(--nl-color-ink); font-size: var(--nl-text-s); font-weight: var(--nl-heading-weight); line-height: 1.2; text-decoration: none; }
  .nl-author-list__role,
  .nl-author-list__bio { display: none; }
  @media (max-width: 63.99em) { /* telefon i tablet: siatka 2 kolumny, bez ucinanych elementów; nazwa w max. 2 liniach o stałej wysokości, więc liczby tekstów równo */
    .nl-author-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--nl-space-5) var(--nl-space-4); overflow: visible; }
    .nl-author-list__item { flex: none; }
    .nl-authors--teaser .nl-author-list__item:nth-child(n+5) { display: none; } /* teaser na głównej, telefon: 2x2, reszta pod „Zobacz wszystkich” */
  }
  @media (min-width: 64em) {
    .nl-authors--teaser .nl-author-list { justify-content: space-between; }
  }
  .nl-authors:not(.nl-authors--teaser) .nl-author-list { flex-wrap: wrap; overflow: visible; }
}
