/* ------------------------------------------------------------
   view-library.css — bibliothèque, liste des créations (lot 05)
   Les cartes/lignes de création viennent de creations.css (lot 01) ;
   ce fichier ne porte que le cadrage propre à cet écran.
   Référence : handoffs/05-bibliotheque/screenshots/
   ------------------------------------------------------------ */

.library-screen {
  min-height: calc(100vh - 108px - env(safe-area-inset-bottom, 0px));
  padding: 52px var(--sp-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* La bibliothèque vide doit occuper le centre de l'écran, pas s'empiler
   juste sous l'en-tête avec tout le reste du viewport vide en dessous. */
.library-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.library-content .state-empty { margin: auto 0; }

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.library-head h1 { font-size: 26px; }

.view-toggle { display: flex; gap: 4px; }
.view-toggle__btn {
  width: 40px;
  height: 40px;
  margin: 2px 0;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.view-toggle__btn[aria-pressed="true"] { background: var(--tint); color: var(--ink); }

.library-filters {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--sp-4) * -1);
  padding: 0 var(--sp-4);
}
.library-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--field);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 14px;
  cursor: pointer;
}
.filter-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

.library-empty-note {
  text-align: center;
  padding-top: 32px;
  font-size: 15px;
  color: var(--ink);
  display: grid;
  gap: var(--sp-2);
  justify-items: center;
}

@media (min-width: 960px) {
  .library-screen { max-width: 1200px; margin: 0 auto; padding: 40px var(--sp-5) 0; }
  .creation-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .creation-list { max-width: 760px; }
}
