/* ============================================ */
/* stylelatex.css — Spécifique à la compilation */
/* LaTeX en ligne (codelatex.html)              */
/* Nécessite style.css en complément            */
/* ============================================ */

div.spacer { margin-top: 16px; }

/* ============================================ */
/* LAYOUT — arborescence + éditeur              */
/* ============================================ */
#layout {
  display: flex;
  height: 100%;
  position: relative;
}

/* colonne gauche : arbre */
#tree {
  position: absolute;
  font-size: 90%;
  top: 0;
  left: 0;
  min-width: 16.66em;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(250, 250, 250, 0.75);
  z-index: 1;            /* derrière #main par défaut */
  transition: z-index 0s, box-shadow 0.15s;
}

#tree:hover {
  z-index: 10;           /* passe devant au survol */
}

/* colonne principale */
#main {
  flex: none;
  width: calc(100% - 15em);   /* largeur fixe, ne bouge jamais */
  margin-left: 15em;          /* = partie visible de #tree */
  display: flex;
  flex-direction: column;
  z-index: 2;                  /* devant #tree par défaut */
}

/* ============================================ */
/* ARBORESCENCE                                 */
/* ============================================ */
ul {
  list-style: none;
  padding-left: 1em;
}

li {
  cursor: pointer;
  user-select: none;
  margin: 0.15em 0;
}

li.dir::before { content: "📁 "; }
li.dir.open::before { content: "📂 "; }
li.file::before { content: "📄 "; }

li.file {
  padding: 2px 6px;
  border-radius: 4px;
}

li.dir > .label,
li.file > .label {
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

li.dir:hover > .label,
li.file:hover > .label {
  background: #e0e0ff;
}

#editorTitle {
  padding: 0.4em 0.6em;
  background: #f0f0f8;
  border-bottom: 1px solid #ccc;
  font-family: monospace;
  font-size: 0.9em;
  color: #333;
}

/* Cacher les boutons de compilation des éditeurs annexes */
#lo-pre0,
#lo-pre1 {
  display: none !important;
}

/* ============================================ */
/* RESPONSIVE — tablette/mobile (≤ 900px)       */
/* ============================================ */
@media (max-width: 900px) {
  #layout {
    flex-direction: column;
    position: static;   /* annule le position: relative du desktop */
  }

  #tree {
    position: static;
    width: 100%;
    height: auto;
    overflow-y: visible;
    overflow-x: visible;
    background: rgba(250, 250, 250, 0.95);
    box-shadow: none;
    backdrop-filter: none;
    font-size: 1em;
    z-index: auto;       /* annule le z-index */
    transition: none;    /* annule les transitions */
  }

  #main {
    width: 100%;
    margin-left: 0;
    z-index: auto;       /* annule le z-index */
    flex: 1;
  }

  #editorTitle { font-size: 1em; }

  li { padding: 0.2em 0; }
}
