/* Explorateur de fichiers façon VSCode, généré par filetree.lua */

.filetree {
  --filetree-bg: #f8f8f8;
  --filetree-border: #e5e5e5;
  --filetree-hover: rgba(0, 0, 0, 0.05);
  --filetree-guide: rgba(0, 0, 0, 0.12);
  --filetree-text: #3b3b3b;
  --filetree-comment: #8a8a8a;
  --filetree-indent: 16px;
  --filetree-label-width: 16em;

  background: var(--filetree-bg);
  border: 1px solid var(--filetree-border);
  border-radius: 6px;
  padding: 6px 4px;
  margin: 0 0 1rem 0;
  color: var(--filetree-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
}

.filetree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.filetree li {
  margin: 0;
}

.filetree .filetree-children {
  /* Ligne de guide sous le chevron du dossier parent */
  margin-left: calc(var(--filetree-indent) / 2);
  padding-left: calc(var(--filetree-indent) / 2);
  border-left: 1px solid var(--filetree-guide);
}

.filetree .filetree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px 1px 0;
  border-radius: 3px;
  white-space: nowrap;
}

.filetree .filetree-row:hover {
  background: var(--filetree-hover);
}

/* Le thème Bootstrap de Quarto ajoute une marge sous chaque <details> et
   grise les <summary> */
.filetree details {
  margin: 0;
}

.filetree summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: inherit;
}

.filetree summary::-webkit-details-marker {
  display: none;
}

.filetree .filetree-chevron,
.filetree .filetree-spacer {
  flex: 0 0 var(--filetree-indent);
  height: var(--filetree-indent);
}

.filetree .filetree-chevron {
  position: relative;
}

.filetree .filetree-chevron::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-70%, -50%) rotate(-45deg);
  transition: transform 0.15s ease;
}

.filetree details[open] > summary .filetree-chevron::before {
  transform: translate(-50%, -70%) rotate(45deg);
}

.filetree .filetree-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

.filetree .filetree-comment {
  margin-left: 1.5em;
  color: var(--filetree-comment);
  font-style: italic;
}

/* Groupes délimités par des accolades. Le cadre prend la largeur de l'arbre
   pour que la colonne de droite soit alignée sur toutes les lignes, quelle
   que soit leur profondeur */
.filetree.filetree-has-groups {
  width: fit-content;
  max-width: 100%;
}

.filetree .filetree-gutter {
  display: flex;
  align-self: stretch;
  margin-left: auto;
  padding-left: 2em;
}

.filetree .filetree-bracket {
  position: relative;
  flex: 0 0 8px;
}

/* Les morceaux débordent du padding vertical des lignes pour que
   l'accolade soit continue */
.filetree .filetree-bracket-start::before,
.filetree .filetree-bracket-mid::before,
.filetree .filetree-bracket-end::before,
.filetree .filetree-bracket-single::before {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  right: 0;
  border-right: 1.5px solid var(--filetree-comment);
}

.filetree .filetree-bracket-start::before {
  top: 50%;
  border-top: 1.5px solid var(--filetree-comment);
  border-top-right-radius: 4px;
}

.filetree .filetree-bracket-end::before {
  bottom: 50%;
  border-bottom: 1.5px solid var(--filetree-comment);
  border-bottom-right-radius: 4px;
}

.filetree .filetree-bracket-single::before {
  top: 20%;
  bottom: 20%;
  border-top: 1.5px solid var(--filetree-comment);
  border-bottom: 1.5px solid var(--filetree-comment);
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.filetree .filetree-label-cell {
  position: relative;
  flex: 0 0 var(--filetree-label-width);
  margin-left: 0.75em;
}

.filetree .filetree-label {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  white-space: normal;
  line-height: 1.3;
  color: var(--filetree-comment);
}

.filetree .filetree-label-center {
  top: 50%;
}

.filetree .filetree-label-top {
  top: 0;
}
