/*
 * 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;
    object-position: var(--nl-avatar-focus, var(--nl-avatar-focus-default));
  }
  .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-avatar-bg, var(--nl-color-accent));
    color: var(--nl-avatar-fg, var(--nl-color-black));
    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; }
    /* Damian 18.11: większe zdjęcia i podpisy w teaserze. 8 pozycji w rzędzie: szerokość listy / 8 minus odstępy, najwyżej 8,5 rem (ok. 110 px przy 1024, 136 px od ok. 1280); bez przewijania w bok. Bez jednostek cqi zostaje 6 rem. */
    .nl-authors--teaser { container-type: inline-size; }
    .nl-authors--teaser .nl-author-list { --nl-avatar: min(8.5rem, calc((100cqi - 7 * var(--nl-space-4)) / 8)); }
    .nl-authors--teaser .nl-author-list__item .nl-author-list__name { font-size: 1rem; }
  }
  .nl-authors:not(.nl-authors--teaser) .nl-author-list { flex-wrap: wrap; overflow: visible; justify-content: center; align-items: start; } /* S27: pełna lista (Redakcja) wyśrodkowana, podpisy od jednej linii */
  /* Pełna lista z indeksem (blok nlad/authors, atrybut index): rząd liter A–Ż (kotwice, bez JS), nagłówek litery nad grupą. Cel dotyku 44 px (--nl-touch). */
  .nl-authors__letters { display: flex; flex-wrap: wrap; gap: var(--nl-space-1); margin: 0 0 var(--nl-space-5); padding: 0; list-style: none; font-family: var(--nl-font-heading); font-weight: var(--nl-heading-weight); }
  .nl-authors__letters a { display: grid; place-items: center; min-inline-size: var(--nl-touch); min-block-size: var(--nl-touch); padding-inline: var(--nl-space-2); border: 1px solid var(--nl-color-line); color: var(--nl-color-primary-fg); text-decoration: none; }
  .nl-authors__letters a:hover, .nl-authors__letters a:focus-visible { background: var(--nl-color-primary); color: var(--nl-color-paper); }
  .nl-authors__letter { margin: var(--nl-space-6) 0 var(--nl-space-4); padding-block-end: var(--nl-space-1); border-block-end: var(--nl-series-line) solid var(--nl-color-accent); font-size: var(--nl-text-xl); scroll-margin-block-start: var(--nl-space-7); }
}
