/* ==========================================================================
   bureau.css — Plume sur PC et sur tablette (lot 20).

   Le rapport stratégique n° 2 l'a constaté à l'écran : sur un portable de
   lycée (1366 × 768), Plume était un téléphone étiré — feuilles de dialogue
   sur toute la largeur, barre d'outils collée en bas, listes à 1300 px.

   Ici, UNE feuille de style et rien d'autre : le même code, le même document,
   trois gabarits. Elle ne contient que des requêtes de média, donc :
     - elle ne change RIEN sur un téléphone (< 600 px) ;
     - aucune classe JavaScript n'est nécessaire pour qu'elle agisse (pas de
       flash de mise en page au chargement) ; js/bureau/index.js pose tout de
       même `gabarit-*` sur <html> pour le code qui en a besoin.

     600 px et plus   feuilles = boîtes de dialogue centrées, vues en fondu,
                      listes centrées
     1024 px et plus  barre d'outils de l'éditeur EN HAUT
     pointeur fin     cibles plus petites, états de survol

   index.html la charge avec media="(min-width: 600px)" : sur un téléphone le
   navigateur la télécharge en priorité basse et ne l'applique jamais.
   ========================================================================== */

/* ------------------------------ 600 px et plus ------------------------------ */
@media (min-width: 600px){

  /* Les feuilles remontent du bas sur un téléphone ; ici, ce sont des boîtes
     de dialogue : au centre, arrondies de partout, sans poignée à tirer. */
  .sheet-root{justify-content:center;align-items:center;padding:24px}
  .sheet{
    width:min(680px,100%);
    max-height:min(86vh,880px);
    border-radius:var(--r-xl);
    padding-bottom:0;
    transform:translateY(12px) scale(.985);opacity:0;
    transition:transform .2s var(--ease),opacity .2s var(--ease);
  }
  .sheet-root.is-open .sheet{transform:none;opacity:1}
  .sheet__grab{display:none}
  .sheet__head{padding-top:18px}

  /* Des écrans qui glissent d'un bord n'ont plus de sens sur un grand écran :
     un fondu rapide. */
  .view{transform:none;opacity:0;transition:opacity .18s var(--ease),visibility .18s}
  .view.is-active{opacity:1}
  #view-library{transform:none;opacity:0}
  #view-library.is-active{opacity:1;transform:none}

  /* Les listes se centrent : le contenu garde une largeur lisible, la barre de
     défilement reste au bord de la fenêtre (c'est du remplissage, pas une
     largeur maximale). */
  .library{
    padding-left:max(14px,calc((100% - 1180px) / 2));
    padding-right:max(14px,calc((100% - 1180px) / 2));
  }
  .view > .topbar:not(.topbar--editor){
    padding-left:max(10px,calc((100% - 1180px) / 2));
    padding-right:max(10px,calc((100% - 1180px) / 2));
  }
  .mode-bar{
    padding-left:max(14px,calc((100% - 820px) / 2));
    padding-right:max(14px,calc((100% - 820px) / 2));
  }
  .chip-row{
    padding-left:max(14px,calc((100% - 1000px) / 2));
    padding-right:max(14px,calc((100% - 1000px) / 2));
  }
  .pdf-scroll{
    padding-left:max(0px,calc((100% - 1000px) / 2));
    padding-right:max(0px,calc((100% - 1000px) / 2));
  }
  .tl-field{margin-left:auto;margin-right:auto;width:min(976px,calc(100% - 24px))}

  /* Les cartes de documents en colonnes, la boîte à outils en grille large. */
  .doc-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px}
  .tool-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}
  .tool-grid>.tool-famille>.tool-famille__in{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}   /* lot 173 */
  .mx-cartes{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
}

/* ------------------------------ 1024 px et plus ------------------------------ */
@media (min-width: 1024px){

  /* La barre d'outils de l'éditeur passe EN HAUT, sous le titre : au clavier,
     la souris est en haut, et rien ne vient la couvrir (pas de clavier virtuel
     à éviter). Elle est fixée en bas dans style.css ; la vue est une colonne,
     `order` suffit. */
  #view-editor > .topbar{order:-3}
  #view-editor > .toolbar{
    order:-2;position:static;
    border-top:0;border-bottom:1px solid var(--line);
    padding-bottom:0;will-change:auto;transform:none !important;
  }
  .toolbar__row--extra{border-top:0;border-bottom:1px solid var(--line)}
  /* La réserve sous la page n'a plus de barre à éviter : le JavaScript la
     règle à la hauteur de la barre, d'où !important. */
  .scroll__spacer{height:48px !important}

  /* Une feuille posée sur un fond, pas collée aux bords. */
  .scroll{padding:24px 24px 0}
  .page{margin-bottom:24px;box-shadow:var(--shadow-lg)}
}

/* ------------------------------ pointeur fin (souris, pavé tactile) ------------------------------ */
@media (pointer: fine){
  :root{--tap:38px}
  .icon-btn:hover{background:var(--surface-3);color:var(--ink)}
  .tb-btn:hover,.chip:hover,.mode-chip:hover{background:var(--surface-3)}
  .mode-chip.is-on:hover,.chip.is-on:hover{filter:brightness(1.06)}
  .menu-item:hover{background:var(--surface-2)}
  .doc-card:hover,.tool-tile:hover{box-shadow:var(--shadow-lg)}
  .file-row:hover{background:var(--surface-2)}
  .btn:hover{filter:brightness(.97)}
  .fab:hover{filter:brightness(1.05)}
  *{scrollbar-width:thin;scrollbar-color:var(--line-2) transparent}
}

/* ------------------------------ côte à côte (sujet | copie) ------------------------------ */
/* Lot 28 : aussi une tablette en paysage dès 900 px (js/bureau/confort.js : largeEcran). */
@media (min-width: 1024px), (min-width: 900px) and (orientation: landscape){
  /* Posé par js/bureau/cote-a-cote.js quand le sujet s'ouvre à côté d'une
     copie : l'éditeur reste visible à gauche, le lecteur prend la moitié droite. */
  html.cote-a-cote #view-editor.is-dessous{visibility:visible;opacity:1;right:50%;transition:none}
  html.cote-a-cote #view-reader.is-active{left:50%;border-left:1px solid var(--line);box-shadow:var(--shadow-lg)}
  html.cote-a-cote #view-editor.is-dessous .toolbar{display:block}
}

/* ------------------------------ le plan, en volet (lot 28) ------------------------------ */
.plan{display:none}
@media (min-width: 1024px){
  html.avec-plan #view-editor .plan{
    display:block;position:absolute;left:0;bottom:0;width:220px;z-index:1;
    overflow-y:auto;padding:14px 10px 24px 14px;
    border-right:1px solid var(--line);background:var(--surface);
  }
  html.avec-plan #view-editor .scroll{margin-left:220px}
  html.cote-a-cote.avec-plan #view-editor .plan{display:none}
  html.cote-a-cote.avec-plan #view-editor .scroll{margin-left:0}
}
.plan__titre{margin:0 0 8px;font-size:var(--t-legende);font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
.plan__t{display:block;width:100%;text-align:left;padding:5px 8px;border-radius:6px;font-size:var(--t-note);line-height:1.35;color:var(--ink-2)}
.plan__t:hover,.plan__t:focus-visible{background:var(--surface-2);color:var(--ink)}
.plan__t--1{font-weight:700;color:var(--ink)}
.plan__t--2{padding-left:18px}
.plan__t--3{padding-left:30px;font-size:var(--t-legende)}
.plan__vide{margin:0;font-size:var(--t-legende);line-height:1.5;color:var(--ink-3)}

/* ------------------------------ feuille des raccourcis et palette ------------------------------ */
.rc-liste{display:grid;grid-template-columns:auto 1fr;gap:8px 16px;margin:0;padding:6px 8px 4px;align-items:center}
.rc-liste dt{justify-self:end;white-space:nowrap}
.rc-liste dd{margin:0;color:var(--ink-2);font-size:var(--t-second)}
.rc-touche{
  display:inline-block;min-width:24px;padding:2px 7px;margin-left:3px;text-align:center;
  border:1px solid var(--line-2);border-bottom-width:2px;border-radius:7px;
  background:var(--surface-2);font:600 var(--t-legende)/1.5 inherit;color:var(--ink);
}
.rc-titre{grid-column:1/-1;margin:10px 0 0;font-size:var(--t-legende);font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
.pal-champ{
  width:100%;box-sizing:border-box;margin:0 0 8px;padding:12px 14px;
  border:1px solid var(--line-2);border-radius:var(--r-md);background:var(--surface);
  font-size:var(--t-corps);outline:none;
}
.pal-champ:focus{border-color:var(--accent)}
.pal-liste{display:flex;flex-direction:column;gap:2px;max-height:52vh;overflow-y:auto}
.pal-item{
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  padding:9px 12px;border-radius:10px;border:0;background:transparent;color:var(--ink);font:inherit;
}
.pal-item.is-on,.pal-item:hover{background:var(--accent-soft,var(--surface-3))}
.pal-item__t{flex:1;min-width:0;font-weight:600;font-size:var(--t-second)}
.pal-item__d{display:block;font-weight:400;font-size:var(--t-legende);color:var(--ink-3)}
.pal-item__g{flex:0 0 auto;font-size:var(--t-legende);color:var(--ink-3);text-transform:uppercase;letter-spacing:.05em}
.pal-vide{padding:18px 8px;color:var(--ink-3);font-size:var(--t-second);text-align:center}
