/* teacher/lists.css

   Listes d'évaluations, séries, menu d'actions d'une ligne.

   Chargé par index.html, dans l'ordre de css/README.md. Ne pas changer cet
   ordre sans relire la section « Ordre de chargement ». */

/* ---------- liste des évaluations ---------- */

/*
 * Un tableau à huit colonnes écrasait la colonne des titres : chaque nom
 * d'exercice se cassait sur quatre lignes et les boutons sortaient de l'écran.
 * Une ligne par exercice : le titre lisible d'un bloc, les caractéristiques en
 * légende, les actions à droite.
 */

/* ---------- listes d'évaluations ----------

   Une liste d'exercices n'est pas un tableau de données : on n'y compare pas
   des colonnes, on y cherche un titre. Le titre domine donc, les
   caractéristiques passent en légende sous lui, et les traits disparaissent
   presque entièrement.
   ------------------------------------------------------------------------ */

.list-block { margin-top: 44px; }

.list-block:first-of-type { margin-top: 28px; }

.count-line { font-size: var(--fs-2); color: var(--muted); margin: 4px 0 18px; }

.item-list { display: flex; flex-direction: column; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--r);
  transition: background .12s ease;
}

.item + .item { border-top: 1px solid var(--border); }

.item:hover { background: var(--surface); }

/* Toute la zone gauche ouvre l'exercice : une cible large vaut mieux qu'un
   petit lien à viser. */

.item-main {
  flex: 1;
  min-width: 0;
  display: block;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 22px;
  font: inherit;
  cursor: pointer;
}

.item-title {
  display: block;
  font-size: var(--fs-4);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-main:hover .item-title { color: var(--primary); }

.item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: var(--fs-2);
  color: var(--muted);
}

.item-meta > span + span:not(.chip)::before { content: '·'; margin-right: 8px; }

.item-public { color: var(--green); }
.item-author { color: var(--muted); }

.chip {
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: var(--fs-1);
  letter-spacing: .02em;
  color: var(--text);
}

/* Le menu s'efface tant qu'on ne survole pas la ligne. Sur écran tactile,
   où le survol n'existe pas, il reste visible. */

.item-actions { padding-right: 12px; }

@media (hover: hover) {
  .item-actions { opacity: 0; transition: opacity .12s ease; }
  .item:hover .item-actions,
    .item:focus-within .item-actions { opacity: 1; }
}

/* Une série est un objet, pas une ligne de tableau : elle a sa carte. */

.set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.set-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 14px 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.set-card-body { min-width: 0; }

.set-card-title { font-size: var(--fs-4); font-weight: 500; margin: 0 0 6px; }

.set-card-meta { font-size: var(--fs-2); color: var(--muted); margin: 0; }

@media (max-width: 640px) {
  .item-main { padding: 16px 14px; }
  .item-title { white-space: normal; }
  .item-actions { padding-right: 6px; }
}

/* ---------- menu d'actions secondaires ---------- */

.row-menu { position: relative; }

.row-menu-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--muted);
  font: inherit;
  font-size: var(--fs-5);
  line-height: 1;
  padding: 6px 9px;
  cursor: pointer;
}

.row-menu-btn:hover { color: var(--text); border-color: var(--border); }

.row-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 150px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
}

.row-menu-pop button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-2);
  padding: 7px 10px;
  cursor: pointer;
}

.row-menu-pop button:hover { background: var(--surface); }

.row-menu-pop button.danger { color: var(--red); }
