/* ========== POLICE ========== */
/* Place FreeSerif.ttf dans un dossier fonts/ à côté de style.css */
@font-face {
  font-family: "FreeSerif";
  src: url("fonts/FreeSerif.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "FreeSerif";
  src: url("fonts/FreeSerifBold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "FreeSerif";
  src: url("fonts/FreeSerifItalic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
}

/* ========== VARIABLE COULEUR ========== */
:root {
  --accent: #1515fc;       /* couleur modifiée par le slider */
  --accent-contrast: #fff; /* texte sur fond accent (blanc par défaut) */
  --accent-hue: 240;       /* teinte initiale en degrés */
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "FreeSerif", serif;
  line-height: 1.5;
  color: #333;
  background-color: #ffffff;
}

/* ========== SLIDER CHROMATIQUE ========== */
.color-slider {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  z-index: 9999;
  cursor: crosshair;
  touch-action: none;  /* empêche le scroll tactile */
  user-select: none;
  background: linear-gradient(
    to right,
    hsl(0,98%,54%)   0%,
    hsl(30,98%,54%)  8%,
    hsl(60,98%,54%)  16%,
    hsl(90,98%,54%)  24%,
    hsl(120,98%,54%) 32%,
    hsl(150,98%,54%) 40%,
    hsl(180,98%,54%) 48%,
    hsl(210,98%,54%) 56%,
    hsl(240,98%,54%) 64%,
    hsl(270,98%,54%) 72%,
    hsl(300,98%,54%) 80%,
    hsl(330,98%,54%) 88%,
    hsl(360,98%,54%) 94%,
    hsl(0,80%,35%)   96%,
    hsl(0,50%,15%)   98%,
    #000             100%
  );
}

/* Curseur de position sur le slider */
.color-slider__cursor {
  position: absolute;
  top: 0;
  width: 3px;
  height: 100%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  transform: translateX(-50%);
  left: 66.66%; /* position initiale ≊ hue 240° */
}

/* ========== BOUTON FIXE ========== */
.fixed-btn {
  position: absolute;
  right: 100px;
  top: 600px;
  z-index: 200;
  color: var(--accent);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  cursor: crosshair;
  text-decoration: none;  transition: unset;
}
.fixed-btn:hover img,
.fixed-btn:hover svg {
  filter: invert(1);
  transition: filter 0.15s;
}
.fixed-btn__label {
  font-family: "FreeSerif", serif;
  font-size: 1rem;
  color: var(--accent);
  white-space: nowrap;
}
.fixed-btn svg,
.fixed-btn img {
  width: 300px;
  height: 200px;
  display: block;
}

/* ========== LOGO OVERLAY ========== */
.logo-overlay {
  position: absolute;  /* reste en place, ne suit pas le scroll */
  top: 4rem;
  right: 3rem;
  z-index: 100;
}

.logo-overlay img,
.logo-overlay svg {
  height: 200px;
  width: auto;
  display: block;
}

/* ========== HEADER ========== */
.header {
  padding: 4rem 2rem;
}

/* ========== NAVIGATION FLOTTANTE ========== */

/* Header cliquable → accueil */
.header__name {
  display: inline-block; /* zone de survol = taille du SVG uniquement */
  cursor: crosshair;
}
.header__name img,
.header__name svg {
  height: 180px;
  width: auto;
  display: block;
  transition: filter 0.15s;
}
.header__name:hover img,
.header__name:hover svg {
  filter: invert(1);
}

/* Nav compacte — cachée sur desktop */
.nav-compact {
  display: none;
}

/* Boutons flottants nav */
.float-nav-btn {
  position: absolute;
  background: none;
  border: none;
  padding: 0;
  cursor: crosshair;
  z-index: 200;
  color: var(--accent);
  display: inline-block; /* se rétrécit au SVG — pas de zone invisible */
}
.float-nav-btn img,
.float-nav-btn svg {
  display: block;
  width: auto;
  height: auto;
  transition: filter 0.15s;
}
.float-nav-btn:hover img,
.float-nav-btn:hover svg {
  filter: invert(1);
}

/* Position des boutons — valeurs statiques, modifiables manuellement par breakpoint */
.float-nav-btn[data-tab="manifeste"] {
  right: 1000px;
  top: 100px;
}
.float-nav-btn[data-tab="manifeste"] img,
.float-nav-btn[data-tab="manifeste"] svg {
  width: 150px;
}
.float-nav-btn[data-tab="support"] {
  right: 390px;
  top: 300px;
}
.float-nav-btn[data-tab="support"] img,
.float-nav-btn[data-tab="support"] svg {
  width: 190px;
}
.float-nav-btn[data-tab="informations"] {
  right: 600px;
  top: 500px;
}
.float-nav-btn[data-tab="informations"] img,
.float-nav-btn[data-tab="informations"] svg {
  width: 220px;
}


/* ========== CONTENU PRINCIPAL ========== */
.main {
  padding-bottom: 20px; /* 20px contenu + 20px slider fixe */
}

/* Le tab-container occupe au minimum 380px :
   le bloc GitLab ne peut jamais remonter au-dessus de sa position actuelle.
   Ajuste cette valeur si besoin. */
.tab-container {
  min-height: 510px;
  padding-bottom: 20px; /* gap de 40px entre le contenu et GitLab */
}

.info-block {
  padding: 0rem 2rem;
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
  gap: 1.2rem;
}

.info-block__title {
  font-family: "FreeSerif", serif;
  font-size: 1rem;
  font-weight: normal;
  color: var(--accent);
}

.info-block__title-link {
  color: var(--accent);
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.info-block__text {
  font-size: 1rem;
  max-width: 60ch;     /* limite la largeur du texte pour la lisibilité */
  color: var(--accent);
}

.info-block__text a {
  text-decoration: underline;
}

/* ---- Bouton de don ---- */
.donate-btn-wrap {
  margin-top: 0rem;
}

.donate-btn {
  display: inline-block;
  padding: 0.8em 1.6em;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}

.donate-btn:hover {
  opacity: 0.82;
}

.info-block__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-block__list li::before {
  content: "— ";
  color: #aaa;
}

/* ========== PROJETS GITLAB ========== */

/* Projet : bloc dépliable */
.gitlab__project {
  border-top: 1px solid var(--accent);  /* ← change la couleur/style de séparateur ici */
  padding: 0.4rem 0;
}
.gitlab__project:last-child {
  border-bottom: 1px solid var(--accent);
}

/* Titre du projet */
.gitlab__project-name {
  cursor: pointer;
  list-style: none;              /* retire le triangle natif */
  font-size: 1rem;
  color: var(--accent);
  padding: 0.3rem 0;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.gitlab__project-name::before {
  content: "+";               /* ← change le préfixe ici ("+", "▶", "→", etc.) */
}
.gitlab__project[open] > summary.gitlab__project-name::before {
  content: "--";               /* ← symbole quand ouvert */
}

.gitlab__project-name__label {
  flex: 1;
}

/* Topics */
.gitlab__topics {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gitlab__topic {
  font-size: 1rem;
  color: var(--accent);
  opacity: 1;
  letter-spacing: 0.04em;
}
.gitlab__topic::before {
  content: "";
}

/* Description */
.gitlab__project-desc {
  font-size: 0.85rem;
  color: #555;
  margin: 0.3rem 0 0.5rem 1.2rem;
  font-style: italic;
}

/* Corps du projet — wrapper animé */
.gitlab__project-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  overflow: hidden;
}
.gitlab__project[open] > .gitlab__project-body {
  grid-template-rows: 1fr;
}
.gitlab__project-body-inner {
  overflow: hidden;
  min-height: 0;
  padding-left: 1.2rem;
  padding-bottom: 20px;
}

/* Layout arborescence + viewer côte à côte */
.gitlab__layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.gitlab__tree-panel {
  flex: 0 0 auto;
  min-width: 180px;
  position: sticky;
  top: 1rem;
  max-height: 90vh;
  overflow-y: auto;
  /* pour le positionnement de la flèche */
  padding-bottom: 1.2rem;
}

/* Flèche discrète « scroll possible » */
.gitlab__tree-panel::after {
  content: '⌄';
  position: sticky;
  bottom: 0;
  display: block;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s;
}
.gitlab__tree-panel.tree-end::after {
  opacity: 0;
}

/* ---- Viewer markdown ---- */
.gitlab__viewer-panel {
  flex: 1;
  border-left: 1px solid var(--accent);
  padding-left: 1.5rem;
  min-width: 0;           /* empêche le débordement flex */
}

.gitlab__viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.gitlab__viewer-filename {
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.6;
  font-style: italic;
  word-break: break-all;
}

.gitlab__viewer-link {
  color: var(--accent);
  font-size: 1rem;
  text-decoration: none;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.gitlab__viewer-link:hover {
  text-decoration: underline;
}

/* Contenu markdown rendu — tout en bleu */
.gitlab__viewer-content {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--accent);
  overflow-wrap: break-word;
}
.gitlab__viewer-content h1,
.gitlab__viewer-content h2,
.gitlab__viewer-content h3,
.gitlab__viewer-content h4 {
  font-family: "FreeSerif", serif;
  color: var(--accent);
  margin: 1rem 0 0.4rem;
}
.gitlab__viewer-content p {
  margin: 0.4rem 0;
}
.gitlab__viewer-content a {
  color: var(--accent);
}
.gitlab__viewer-content code {
  font-family: monospace;
  font-size: 0.85em;
  background: rgba(21, 21, 252, 0.06);
  padding: 0.1em 0.3em;
}
.gitlab__viewer-content pre {
  background: rgba(21, 21, 252, 0.06);
  padding: 0.8rem;
  overflow-x: auto;
  margin: 0.6rem 0;
}
.gitlab__viewer-content ul,
.gitlab__viewer-content ol {
  padding-left: 1.5rem;
  margin: 0.4rem 0;
}
.gitlab__viewer-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 0.8rem;
  opacity: 0.7;
  margin: 0.4rem 0;
}

/* Viewer image */
.gitlab__viewer-content--image {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
  height: 90vh;
}

.gitlab__viewer-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.gitlab__viewer-content--pdf {
  padding: 0;
}

.gitlab__viewer-pdf {
  width: 100%;
  height: 90vh;
  border: none;
  display: block;
}

.gitlab__viewer-content--step {
  padding: 0;
}

.gitlab__viewer-step {
  width: 100%;
  height: 90vh;
  background: #ffffff;
}

.gitlab__viewer-step canvas {
  display: block;
  cursor: grab;
}

.gitlab__viewer-step canvas:active {
  cursor: grabbing;
}

/* Liste de fichiers */
.gitlab__file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.3rem 0;
}

/* Fichier */
.gitlab__file-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

/* Bouton .md (même look qu'un lien) */
.gitlab__file-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}
.gitlab__file-btn::before {
  content: "· ";
  color: #aaa;
}
.gitlab__file-btn:hover {
  text-decoration: underline;
}

/* Lien fichier non-.md */
.gitlab__file-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.gitlab__file-link::before {
  content: "· ";
  color: #aaa;
}
.gitlab__file-link:hover {
  text-decoration: underline;
}

/* Icône ↗ GitLab */
.gitlab__file-ext {
  color: var(--accent);
  font-size: 0.7rem;
  text-decoration: none;
  opacity: 0.4;
}
.gitlab__file-ext:hover {
  opacity: 1;
}

/* Répertoire (sous-dossier dépliable) */
.gitlab__subdir > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  color: var(--accent);
  user-select: none;
}
.gitlab__subdir > summary::before {
  content: "+ ";
}
.gitlab__subdir[open] > summary::before {
  content: "- ";
}
.gitlab__subdir-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
  overflow: hidden;
}
.gitlab__subdir[open] > .gitlab__subdir-body {
  grid-template-rows: 1fr;
}
.gitlab__subdir-body > .gitlab__files {
  overflow: hidden;
  min-height: 0;
  padding-left: 1rem;
}

/* Messages d'état */
.gitlab__status {
  font-size: 0.85rem;
  color: var(--accent);
  opacity: 0.5;
  padding: 0.2rem 0;
}
.gitlab__error {
  font-size: 0.85rem;
  color: #c00;
  padding: 0.2rem 0;
}

/* ========== RESPONSIVE ========== */


@media (max-width: 1600px) {
  /* Logo overlay plus petit */
  .logo-overlay img,
  .logo-overlay svg {
    height: 120px;
  }

  /* Nom plus petit */
  .header__name img,
  .header__name svg {
    height: 160px;
  }

  /* Bouton wiki : réduire l'icône + repositionner */
  .fixed-btn {
    right: 60px;
    top: 420px;
  }
  .fixed-btn svg,
  .fixed-btn img {
    width: 180px;
    height: 120px;
  }

  /* Boutons nav : repositionnement tablette */
  .float-nav-btn[data-tab="manifeste"] {
    right: 860px;
    top: 70px;
    width: 140px;
  }
  .float-nav-btn[data-tab="liens"] {
    right: 200px;
    top: 260px;
    width: 120px;
  }
  .float-nav-btn[data-tab="informations"] {
    right: 400px;
    top: 130px;
    width: 190px;
  }

  /* Viewer GitLab : garder côte à côte */
  /* (flex-direction: row par défaut, rien à faire) */
}

@media (max-width: 1280px) {
 /* Boutons nav : repositionnement tablette */
  .float-nav-btn[data-tab="manifeste"] {
    right: 460px;
    top: 70px;
    width: 140px;
  }
  .float-nav-btn[data-tab="liens"] {
    right: 150px;
    top: 260px;
    width: 120px;
  }
  .float-nav-btn[data-tab="informations"] {
    right: 250px;
    top: 180px;
    width: 190px;
  }
}

@media (max-width: 900px) {
  /* Logo overlay caché */
  .logo-overlay img,
  .logo-overlay svg {
    height: 60px;
    display: none;
  }

  /* Nom plus petit */
  .header__name img,
  .header__name svg {
    height: 160px;
  }

  /* Masquer les boutons SVG flottants et le bouton wiki */
  .float-nav-btn,
  .fixed-btn {
    display: none;
  }

  /* Afficher la nav compacte sous le header */
  .nav-compact {
    display: flex;
    gap: 1.5rem;
    padding: 0.8rem 2rem 0;
  }

  .info-block {
    
    max-width: 100%;
    padding-top: 60px;
  }
  
  .nav-compact__btn {
    background: none;
    border: none;
    font-family: "FreeSerif", serif;
    font-size: 1rem;
    color: var(--accent);
    cursor: crosshair;
    padding: 0;
    transition: filter 0.15s;
  }
  .nav-compact__btn:hover {
    filter: invert(1);
  }
  .nav-compact__btn.tab-active {
    text-decoration: underline;
  }
  .nav-compact__wiki {
    text-decoration: none;
  }
  .nav-compact__wiki:hover {
    filter: invert(1);
  }
}

/* Mobile — ≤ 600px */
@media (max-width: 600px) {
  .header__name img,
  .header__name svg {
    height: 160px;
  }

  /* Texte : pas de max-width contraignant */
  .info-block__text {
    
    max-width: 100%;
  }

  .gitlab__viewer-pdf {
  width: 100%;
  height: 30vh;
  border: none;
  display: block;
}

  .info-block {
    
    max-width: 100%;
    padding-top: 60px;
  }

  /* Viewer pleine largeur */
  .gitlab__layout {
    flex-direction: column;
  }

  .gitlab__tree-panel {
    position: static;
    max-height: 40vh;
  }

  .gitlab__viewer-panel {
    border-left: none;
    border-top: 1px solid var(--accent);
    padding-left: 0;
    padding-top: 1rem;
    width: 100%;
  }
}

