/* Défilement des fenêtres Windows (chargé en dernier).
   Cause du défaut : education.css, experience.css, skills.css, contact.css redéfinissent chacun .window / .window-body
   avec leurs propres hauteurs écrites à la main (100vh - 87px, - 92px, - 133px, - 138px…) ; la dernière feuille chargée
   gagnait, la fenêtre dépassait alors sous la barre des tâches et son bas restait caché.
   Ici : la fenêtre est une colonne flex, le corps prend la place restante (min-height: 0) et défile lui-même.
   La hauteur maximale exacte (bureau − position de la fenêtre) est posée par fxFitWindows() dans window-drag.js. */
body.windows .desktop .window:not([hidden]):not(.min) {
  display: flex;
  flex-direction: column;
}
body.windows .desktop .window:not([hidden]):not(.min) > .window-head { flex: none; }
body.windows .desktop .window:not([hidden]):not(.min) > .window-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
}
body.windows .desktop .window.min > .window-body { display: none; }

/* Barre de défilement fine et arrondie (style Windows 11), thèmes clair et sombre */
body.windows {
  --sb-thumb: #7a8fa6aa;
  --sb-thumb-hover: #4f6a86;
}
/* thème sombre (ex-@media prefers-color-scheme) */

  :where(:root[data-theme="dark"]) body.windows { --sb-thumb: #9fb4cbaa; --sb-thumb-hover: #c3d4e6; }

body.windows :is(.window-body, .wp-detail, .wp-list, .wp-tree, .pg-thumbs) {
  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb) transparent;
}
@supports selector(::-webkit-scrollbar) {
  body.windows :is(.window-body, .wp-detail, .wp-list)::-webkit-scrollbar { width: 10px; height: 10px; }
  body.windows :is(.window-body, .wp-detail, .wp-list)::-webkit-scrollbar-track { background: transparent; }
  body.windows :is(.window-body, .wp-detail, .wp-list)::-webkit-scrollbar-thumb {
    background: var(--sb-thumb); border-radius: 99px; border: 2px solid transparent; background-clip: content-box;
  }
  body.windows :is(.window-body, .wp-detail, .wp-list)::-webkit-scrollbar-thumb:hover {
    background: var(--sb-thumb-hover); background-clip: content-box;
  }
}

/* Fenêtre « Centres d'intérêt » : le contenu (interests-view.js) gère ses propres marges */
body.windows .interests-window > .window-body { padding: 0; }

/* Focus clavier du corps de fenêtre : visible seulement au clavier */
body.windows .window-body:focus { outline: none; }
body.windows .window-body:focus-visible { outline: 2px solid #2871b6; outline-offset: -3px; }

/* ===== Agrandir / Restaurer et redimensionnement (fxWinChrome, window-drag.js) ===== */
.fx-rz { position: absolute; z-index: 20; touch-action: none; }
.fx-rz-n { top: 0; left: 18px; right: 18px; height: 5px; cursor: ns-resize; }
.fx-rz-s { bottom: 0; left: 18px; right: 18px; height: 5px; cursor: ns-resize; }
.fx-rz-e { right: 0; top: 18px; bottom: 18px; width: 5px; cursor: ew-resize; }
.fx-rz-w { left: 0; top: 18px; bottom: 18px; width: 5px; cursor: ew-resize; }
.fx-rz-ne { top: 0; right: 0; width: 18px; height: 18px; cursor: nesw-resize; }
.fx-rz-sw { bottom: 0; left: 0; width: 18px; height: 18px; cursor: nesw-resize; }
.fx-rz-nw { top: 0; left: 0; width: 18px; height: 18px; cursor: nwse-resize; }
.fx-rz-se { bottom: 0; right: 0; width: 18px; height: 18px; cursor: nwse-resize; }
.fx-resizing, .fx-resizing * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; transition: none !important; user-select: none; }
.fx-maxed { border-radius: 0 !important; animation: none !important; }
.fx-maxed .fx-rz { display: none; }
.fx-maxed > :is(.window-head, .ctw-head, .education-head) { cursor: default; border-radius: 0; }
body.windows .controls [data-max], .ctw-ctl [data-max] { font-size: 13px; }
@media (max-width: 899px) { .fx-rz, [data-max] { display: none !important; } }

/* Barre de titre : titre à gauche et boutons Réduire / Agrandir / Fermer à l'extrême droite ; en persan (RTL) tout est inversé :
   titre à droite et boutons dans le coin supérieur gauche. Même comportement pour toutes les fenêtres. */
.window-head, .about-titlebar, .ctw-head { justify-content: space-between; }
html.lang-rtl :is(.window-head, .about-titlebar, .ctw-head) { direction: rtl; }
.window-head .controls, .about-controls, .ctw-ctl { flex: none; margin-inline-start: auto; }
