/* =============================================================================
   Choisir des photos : la rangée de vignettes qui remplace le champ de fichiers
   du navigateur. La mécanique est dans javascript/photos-choix.js.

   Les vignettes ont la forme de ce qui sera gardé : ce qu'on voit ici est déjà
   le recadrage. Carrées pour une annonce du Bazar, en 16:9 pour une offre
   d'Avenir — le script pose le rapport du conteneur (data-rapport) dans
   --photo-rapport.
   ============================================================================= */

.photos-choix__liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .55rem;
  margin: .4rem 0 0;
  padding: 0;
  list-style: none;
}

/* Une rangée de bandeaux de quatre-vingt-seize pixels de large ferait des
   timbres : les vignettes larges prennent plus de place. */
.photos-choix[data-rapport] .photos-choix__liste {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.photos-choix__photo,
.photos-choix__case {
  position: relative;
  min-width: 0;
  aspect-ratio: var(--photo-rapport, 1);
}

.photos-choix__photo {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface-2);
}

.photos-choix__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Une photo qu'on prépare : le balayage des silhouettes de liste, le temps
   d'un instant (tools/assets/css/style.css). */
.photos-choix__photo--attente {
  background-image: linear-gradient(90deg,
    transparent 0%, var(--surface-3) 45%, var(--surface-3) 55%, transparent 100%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: silhouette-balayage 1.25s linear infinite;
}

.photos-choix__couverture {
  position: absolute;
  left: .3rem;
  bottom: .3rem;
  padding: .1rem .42rem;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .02em;
  pointer-events: none;
}

.photos-choix__geste {
  position: absolute;
  top: .3rem;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.photos-choix__geste:hover {
  border-color: var(--line-strong);
  color: var(--accent);
}

.photos-choix__geste--retirer:hover {
  color: var(--danger);
}

.photos-choix__geste:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photos-choix__geste--premiere {
  left: .3rem;
}

.photos-choix__geste--retirer {
  right: .3rem;
}

.photos-choix__ajout {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .2rem;
  width: 100%;
  height: 100%;
  padding: .4rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-control);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: .78rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

.photos-choix__ajout small {
  font-size: .7rem;
  color: var(--text-3);
}

.photos-choix__ajout:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.photos-choix__ajout:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photos-choix__message {
  margin: .35rem 0 0;
  font-size: .8rem;
  color: var(--danger);
}

.photos-choix__message:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .photos-choix__photo--attente {
    animation: none;
  }
}
