/* Collections-Übersicht (collections.html): eine Zeile pro Collection im Zickzack –
   Bild und ruhige Fläche je zur Hälfte, direkt aneinander, Seiten im Wechsel.
   Vorbild: Nicis bisherige Portfolio-Seite (docs/Konzept-Feinschliff.md, Teil A). */

/* Kopf und Liste mittig, mit begrenzter Breite */
.page-head:has(+ .collection-list) {
  align-items: center;
  max-width: none;
  margin-bottom: var(--space-xl);
  text-align: center;
}

.collection-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 72rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

/* Feste Zeilenhöhe: Bild und Fläche sind immer gleich hoch und stoßen ohne Lücke aneinander */
.collection-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: 'image panel';
  height: clamp(17rem, 30vw, 26rem);
}
/* jede zweite Zeile gespiegelt: Bild rechts */
.collection-list li:nth-child(even) .collection-row { grid-template-areas: 'panel image'; }

.collection-row__image {
  grid-area: image;
  min-width: 0;
  overflow: hidden;
  background: var(--color-land-2);
}
.collection-row__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.collection-row__image.is-empty { background: var(--color-land); }

/* ruhige Fläche daneben, Inhalt mittig */
.collection-row__panel {
  grid-area: panel;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  min-width: 0;
  padding: var(--space-l);
  background: var(--color-land-2);
  text-align: center;
}

.collection-row__name {
  font-size: clamp(2rem, 1.4rem + 2vw, 3.25rem);
  font-weight: 200;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color var(--duration-fast) ease;
}

.collection-row__text {
  max-width: 22rem;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--color-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Überfahren / Tastaturfokus: Bild zoomt leicht, Name in Gletscherfarbe – keine Linien */
.collection-row:hover .collection-row__image img { transform: scale(1.03); }
.collection-row:hover .collection-row__name,
.collection-row:focus-visible .collection-row__name { color: var(--color-accent); }
.collection-row:focus-visible { outline-offset: 4px; }

/* Handy: Bild oben (3:2), darunter eine schmale Leiste (Ziffer + Name links, Zähler rechts) */
@media (max-width: 47.99rem) {
  .collection-list { gap: var(--space-l); }
  .collection-row,
  .collection-list li:nth-child(even) .collection-row {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'image' 'panel';
  }
  .collection-row__image { aspect-ratio: 3 / 2; }
  /* Zähler rechts; ist er zu lang (z. B. „2 Bilder · aus 2 Einträgen“), rutscht er in die nächste Zeile,
     statt den Namen zu überdecken */
  .collection-row__panel {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: var(--space-xs) var(--space-s);
    padding: var(--space-s) var(--space-s) var(--space-m);
    text-align: left;
  }
  .collection-row__name { font-size: 1.75rem; }
  .collection-row__count { margin-left: auto; }
  .collection-row__text { display: none; }
}
