/* ark.suite — liste déroulante native (source : arksuite-ui/ui-core).
   La flèche est dessinée par la feuille, à 12 px du bord droit, et le texte
   s'arrête 8 px avant elle. Fonctionne sur un <select> natif, sans JavaScript.

   Deux règles d'application cassent souvent la flèche :
   - « padding: 8px 12px » posé après cette feuille écrase l'espace de droite.
     Utiliser padding-block et padding-inline-start, ou laisser cette feuille
     régler le padding.
   - « background: … » efface l'image de la flèche. Utiliser background-color. */

.ark-select {
  --ark-select-chevron-size: 16px;
  --ark-select-chevron-inset: 12px;
  --ark-select-text-gap: 8px;
  --ark-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23716873' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  max-width: 100%;
  padding-inline-end: calc(var(--ark-select-chevron-inset) + var(--ark-select-chevron-size) + var(--ark-select-text-gap));
  background-image: var(--ark-select-chevron);
  background-repeat: no-repeat;
  background-position: right var(--ark-select-chevron-inset) center;
  background-size: var(--ark-select-chevron-size);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.ark-select:dir(rtl) {
  background-position: left var(--ark-select-chevron-inset) center;
}

.ark-select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Thème sombre : flèche claire. */
:is(.dark, [data-theme="dark"]) .ark-select {
  --ark-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9c0cb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Liste ouverte (multiple ou size > 1) : pas de flèche. */
.ark-select:is([multiple], [size]:not([size="1"])) {
  padding-inline-end: revert;
  background-image: none;
  white-space: normal;
}

/* Couleurs forcées (Windows) : on rend la main au contrôle du système. */
@media (forced-colors: active) {
  .ark-select {
    appearance: auto;
    padding-inline-end: revert;
    background-image: none;
  }
}
