/* =========================================================
   =========================================================
      STYLE DES BLOCS (à fusionner)
   =========================================================
   ========================================================= */


body {
  margin: 0;                  /* Retire les marges par défaut du navigateur */
  padding: 0px 0 0px 0px;  /* Espace interne autour du contenu */
  font-family: "amie", Arial, sans-serif; /* Police principale de la page */
  font-size: 15px;
  font-weight: 400;
  background: whitesmoke;   /* Fond global */
  color: black;               /* Couleur du texte */
  height: 100vh;              /* Pleine hauteur d’écran */
  overflow: hidden;           /* Pas de scroll sur le body → chaque colonne scrolle */
}

/* ----- Conteneur principal ----- */

.page-forum {
  display: flex;          /* La page est structurée en flex horizontal */
  flex-direction: row;
  width: 100%;
  height: 100vh;
  min-height: 0vh;      /* Assure un affichage pleine hauteur */
  background-color: whitesmoke;
}

.top-top-bar-marge {
  width: 100%;    /* top bar marge */
  background-color: whitesmoke; !important;
  position: fixed !important;            /* Toujours visible en haut */
  height: 20px !important;
  top: 0px;
  left: 0px;
  right: 0px;
  z-index: 10000;              /* Passe devant le reste */
  opacity: 1;
}

/* ---------------------------------------------------------
   BLOCS VERTICAUX
   --------------------------------------------------------- */

.col-kw {
  display: flex; /* le bloc est structuré en flex vertical */
  flex-direction: column;
  width: 15%;
  background-color: whitesmoke;
  box-sizing: border-box;
  min-height: 0;
}

.col-forum {
  display: flex;
  flex-direction: column;
  width: 51.5%;
  box-sizing: border-box;
  font-family: "enby", serif;
  font-size: 18px;
  height: 100vh;
  background-color: whitesmoke;
  min-height: 0;
  padding-top: 0px;
  overflow-y: auto;
  overflow-x: hidden;
}

.forum {
  padding-top: 150px;
  width: 100%;
  height: auto;
  padding-right: 30px;
  padding-left: 10px;
  text-align: justify;
  box-sizing: border-box;
  background-color: whitesmoke;
  opacity: 1;
}

h4 {
  font-family: "enby", Arial, serif;
  font-weight: 400;
  margin: 0;
  font-size: 18px;
  text-align: center;
  margin-bottom: 15px;
}

.spacer-col-menu1 {
  width: 0%;
  background-color: whitesmoke;
  min-height: 0;
}

.col-explicative {
  width: 33.5%;
  background-color: whitesmoke;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------------------------------------------------------
   TOP BAR FIXE
   --------------------------------------------------------- */

.top-bar-forum {
  display: flex;              /* top bar structurée en flex horizontal */
  align-items: flex-start;
  background-color: transparent;
  position: fixed;            /* Toujours visible en haut */
  height: 120px;
  top: 0px;
  left: 0px;
  right: 0px;
  z-index: 1000;              /* Passe devant le reste */
  opacity: 1;
}

.logo {
  width: 11%;
  height: 120px;
  display: flex;              /* logo zone structurée en flex vertical */
  flex-direction: column;
  align-items: flex-start;
  padding-top: 20px;
  padding-left: 35px;
  box-sizing: border-box;
  background-color: whitesmoke;
}

.logo__img {
  max-width: 89px;                  /* <-- ta largeur en pixels */
  height: auto;                  /* garde les proportions */
  display: block;
}

.logo__text {
  text-align: left;
  font-size: 15px;
  line-height: 1.2;
}

.spacer-col-forum {
  width: 29.5%;
  height: 20px; /* sert de marge superieure */
  background-color: whitesmoke;
  opacity: 1;
}

.col-menu1 {
  width: 26%;
  height: auto;
  text-align: right;
  box-sizing: border-box;
  padding-top: 20px;
  padding-right: 30px;
  background-color: whitesmoke;
}

.spacer-top-col-explicative {
  width: 33.5%;
  height: 20px; /* marge supérieure */
  background-color: whitesmoke ;
}

/* ---------------------------------------------------------
   SOUS BLOCS col-kw
   --------------------------------------------------------- */

.spacer-kw {
  width: 100%;
  background-color: whitesmoke;
  height: 120px;
  box-sizing: border-box;
}

.kw {
  width: 100%;
  background-color: whitesmoke;
  text-align: left;
  height: auto;
  padding-top: 30px;
  padding-right: 20px;
  padding-left: 35px;   /* ← espace intérieur à droite */
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   SOUS BLOCS col-explicative
   --------------------------------------------------------- */

.spacer-col-explicative {
  background-color: whitesmoke;
  height: 120px;
}

.texte-explicatif {
  background-color: whitesmoke; /* alignement avec grid */
  height: auto;
  padding-top: 30px;
  padding-bottom: 20px;
  padding-right: 35px;
  padding-left: 5px;
  text-align: left;
}

.formulaire-forum {
  background-color: whitesmoke; /* alignement avec grid */
  height: auto;
  padding-top: 10px;
  padding-right: 35px;
  padding-left: 5px;
  text-align: justify;
}

.texte-explicatif2 {
  background-color: whitesmoke; /* alignement avec grid */
  height: auto;
  padding-top: 10px;
  padding-right: 35px;
  padding-left: 5px;
  text-align: justify;
}

/* ---------------------------------------------------------
   Champs du formulaire
   --------------------------------------------------------- */

/* --- Champs label + input sur une ligne --- */
.editer {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

/* largeur fixe des labels */
.editer label {
  width: 160px;          /* ajuste si besoin */
  margin-bottom: 0;
  font-weight: 400;
}

/* inputs texte */
.editer input {
  width: 60%;
}

/* --- Exception : textarea (message) --- */

/* Textarea avec lignes d’écriture */
.editer textarea {
  width: 99%;
  min-height: 110px;

  margin: 0;
  padding: 0.6em 0 0 0;   /* ↓ FAIT DESCENDRE LE TEXTE SUR LA LIGNE */

  border: none;
  background-color: transparent;

  font-family: "amie", Arial, sans-serif;
  font-size: 15px;

  /* rythme vertical */
  line-height: 1.4;

  resize: vertical;

  /* lignes d’écriture */
  background-image: none;
}

/* on repasse en colonne UNIQUEMENT
   pour le champ message */
.editer:has(textarea) {
  flex-direction: column;
  align-items: flex-start;
}

.editer:has(textarea) label {
  width: auto;
  margin-bottom: -10px;
}

.editer:has(textarea) {
  margin-top: 26px;
}

/* Bouton envoyer = style lien menu */
.boutons input[type="submit"] {
  background: none;
  border: none;
  padding: 0;
  margin: 0;

  font-family: inherit;    /* même typo */
  font-size: inherit;
  color: black;

  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;

  cursor: pointer;
}

/* hover identique aux liens */
.boutons input[type="submit"]:hover {
  text-decoration-color: transparent;
}

/* Inputs : ligne dessinée comme le textarea (même rendu) */
.editer input[type="text"],
.editer input[type="email"] {
  margin: 0;
  padding: 0;
  border: none;
  background-color: transparent;

  font-family: "amie", Arial, sans-serif;;
  font-size: 15px;
  line-height: 1.2;

  /* ligne 1px (même technique que le textarea) */
  background-image: linear-gradient(black, black);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
}

/* ---------------------------------------------------------
   Pas de scrollbar (colonnes principales)
   --------------------------------------------------------- */
.col-forum::-webkit-scrollbar{ display: none; }                /* Chrome/Safari/Edge */
.col-forum { scrollbar-width: none; -ms-overflow-style: none; }/* Firefox + ancien Edge/IE */

.col-explicative::-webkit-scrollbar{ display: none; }
.col-explicative { scrollbar-width: none; -ms-overflow-style: none; }

/* =========================================================
   LIEN QUI OUVRE LA FENÊTRE (même style que le menu)
   ========================================================= */

/* Style du lien "Écrire un message" */
.ouvrir-formulaire {
  text-decoration: underline;          /* soulignement comme les liens du menu */
  text-decoration-thickness: 2px;      /* épaisseur du trait */
  text-underline-offset: 2px;          /* distance entre texte et soulignement */
  color: black;                        /* couleur du texte */
}

/* Effet au survol : le soulignement disparaît */
.ouvrir-formulaire:hover { text-decoration-color: transparent; }

/* =========================================================
   OVERLAY (couche plein écran derrière la fenêtre)
   ========================================================= */

.modal-overlay[hidden] { display: none; } /* invisible et inactif */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: transparent; /* PAS de voile */
  z-index: 3000;
}

/* =========================================================
   FENÊTRE (la modale elle-même)
   ========================================================= */

.modal {
  position: fixed;
  right: 20px;
  top: 20px;
  transform: none;

  width: min(400px, 62vw);
  color: black;

  border: 1px solid black;
  background-image: url("images/estampeplast.png");
  background-repeat: repeat;
  background-position: top left;
  background-size: 89px 89px;
}

/* =========================================================
   BARRE DE TITRE (zone draggable)
   ========================================================= */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;

  padding: 0px 10px;
  border-bottom: 1px solid black;

  cursor: move;
  user-select: none;
}

.modal-title { font-size: 15px; }

/* =========================================================
   BOUTON FERMER
   ========================================================= */

/* Croix modale + croix drawer (quand ouvert) : une seule source de vérité */
.modal-close,
.page-forum .col-explicative.is-open .ouvrir-formulaire{
  background: none;
  border: none;
  padding: 0;
  margin: 0;

  font-family: inherit;
  font-size: 25px;
  color: black;

  cursor: pointer;

  /* neutralise le style lien quand c’est la croix */
  text-decoration: none;
  line-height: 1;
}

/* =========================================================
   CONTENU DE LA FENÊTRE
   ========================================================= */

.modal-body { padding: 10px 10px 10px 10px; }

/* =========================================================
   STYLE FORMULAIRE
   ========================================================= */

input:focus,
textarea:focus,
button:focus {
  outline: none;
  box-shadow: none;
}

/* Forum : supprimer le bouton "Prévisualiser" */
p.boutons input[type="submit"][name="previsualiser_message"]{
  display: none !important;
}

/* ===============================
   FORUM — MÉTADONNÉES ALIGNÉES À DROITE
   =============================== */

.forum-meta{
  text-align: right;
  font-family: "Enby", serif;
  font-size: 12px;
  margin-bottom: 4px;
  padding-right: 4px;
}

.forum-texte p:first-child{ margin-top: 0; }
.forum-message{ margin-bottom: 0px; }

/* ===============================
   FORUM — lien "Se déconnecter" (modale)
   =============================== */

.page-forum .modal .logout { margin-top: 4px; }

.page-forum .modal .logout a {
  display: inline-block;
  font-family: inherit;
  font-size: inherit;
  color: black;

  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.page-forum .modal .logout a:hover { text-decoration-color: transparent; }

/* =========================================================
   FORUM — lien "Se déconnecter" (SPIP) — FIX robuste (modale)
   ========================================================= */

.page-forum .modal a[href*="logout"],
.page-forum .modal a[href*="deconnexion"],
.page-forum .modal a[href*="action=logout"]{
  display: block !important;
  margin-top: 4px !important;

  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 2px !important;
  color: black !important;

  font-family: inherit !important;
  font-size: inherit !important;
}

.page-forum .modal a[href*="logout"]:hover,
.page-forum .modal a[href*="deconnexion"]:hover,
.page-forum .modal a[href*="action=logout"]:hover{
  text-decoration-color: transparent !important;
}

/* =========================================================
   LOGIN (SPIP) — règles uniques MODALE + DRAWER
   ========================================================= */

/* 0) Variable largeur label (login) dans les 2 contextes */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content){
  --login-label-w: clamp(110px, 18vw, 180px);
}

/* 1) Login seulement : grille 2 colonnes (modale + drawer) */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer{
  display: grid !important;
  grid-template-columns: var(--login-label-w) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  margin: 14px 0;
}

/* Labels (login uniquement) */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer label{
  margin: 0 !important;
  width: auto !important;
  line-height: 1.2;
  font-weight: 400;
}

/* Champs login : texte / email / password */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login
input[type="text"],
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login
input[type="email"],
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login
input[type="password"]{
  min-width: 0 !important;
  width: 100% !important;

  background-color: transparent !important;
  color: black !important;

  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  padding: 6px 2px !important;

  background-image: linear-gradient(black, black) !important;
  background-size: 100% 1px !important;
  background-repeat: no-repeat !important;
  background-position: left bottom !important;

  font-family: "amie", Arial, sans-serif !important;
  font-size: 15px !important;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login input::placeholder{
  color: rgba(0,0,0,0.45);
}

/* Autofill login — cross-browser */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login input:-webkit-autofill,
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login input:-webkit-autofill:hover,
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login input:-webkit-autofill:focus{
  -webkit-text-fill-color: black !important;
  caret-color: black !important;

  -webkit-box-shadow: 0 0 0 1000px rgba(0,0,0,0.001) inset !important;
  box-shadow: 0 0 0 1000px rgba(0,0,0,0.001) inset !important;

  transition: background-color 9999s ease-in-out 0s;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login input:-moz-autofill,
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login input:autofill{
  caret-color: black !important;
  box-shadow: 0 0 0 1000px rgba(0,0,0,0.001) inset !important;
}

/* Mot de passe oublié : sous le champ, aligné à droite (modale + drawer) */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_password{
  grid-template-columns: var(--login-label-w) minmax(0, 1fr) !important;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_password input{
  grid-column: 2;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_password a{
  grid-column: 2;
  justify-self: end;
  margin-top: 6px;
  white-space: nowrap;

  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  color: black;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_password a:hover{
  text-decoration-color: transparent;
}

/* Checkbox "Se souvenir de moi" : sur une seule ligne (modale + drawer) */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_session{
  grid-template-columns: var(--login-label-w) minmax(0, 1fr);
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_session label{
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_session label br{
  display: none !important;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .editer_session input[type="checkbox"]{
  width: auto !important;
  margin: 0 !important;
  accent-color: black;
}

/* Bouton "Se connecter" à droite (modale + drawer) */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) .formulaire_login .boutons{
  display: flex;
  justify-content: flex-end;
}

/* Logout : valable modale + drawer */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) a[href*="logout"],
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) a[href*="deconnexion"],
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) a[href*="action=logout"]{
  display: block !important;
  margin-top: 4px !important;

  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 2px !important;
  color: black !important;

  font-family: inherit !important;
  font-size: inherit !important;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) a[href*="logout"]:hover,
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) a[href*="deconnexion"]:hover,
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) a[href*="action=logout"]:hover{
  text-decoration-color: transparent !important;
}

/* Pseudo (strong/b) : valable modale + drawer */
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) strong,
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) b{
  font-weight: 900 !important;
}

.page-forum :is(.modal, .drawer-form-slot .forum-form-content) strong::before,
.page-forum :is(.modal, .drawer-form-slot .forum-form-content) b::before{
  content: " : ";
  font-weight: 400;
}

/* =========================================================
   SCROLLBARS — masquées partout SAUF textarea du message
   ========================================================= */

.page-forum *{
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.page-forum *::-webkit-scrollbar{
  display: none;
}

.page-forum textarea{
  scrollbar-width: auto !important;
  -ms-overflow-style: auto !important;
}

.page-forum textarea::-webkit-scrollbar{
  display: block !important;
}



/* =========================================================
   (hors media) éléments liés à la modale / topbar
   ========================================================= */

/* Overlay au-dessus de la barre du bas (z-index:5000) */
.page-forum .modal-overlay{
  z-index: 9000 !important;
}

/* Le contenu scrolle dans la modale si c’est long */
.page-forum .modal-body{
  max-height: calc(100vh - 90px) !important; /* header + marges */
  overflow-y: auto !important;
}

/* =========================================================
   FORUM — TOP BAR TRANSPARENTE (BLOCS UNIQUEMENT)
   ========================================================= */

.page-forum .top-bar-forum{
  background-color: transparent !important;
}

/* Blocs internes de la top bar */
.page-forum .top-bar-forum .logo,
.page-forum .top-bar-forum .spacer-col-forum,
.page-forum .top-bar-forum .col-menu1,
.page-forum .top-bar-forum .spacer-top-col-explicative{
  background-color: transparent !important;
}

.modal fieldset {
  border: 1px solid black; /* ou none */
  box-shadow: none;
}


/* =========================================================
   MEDIA (max-width: 900px)
   (regroupé — ordre interne conservé)
   ========================================================= */
@media (max-width: 900px){

/* 1) Layout principal : 2 colonnes (kw + forum) */
  .page-forum{
    display: flex;
    flex-direction: row;
    height: 100vh;
    min-height: 0;
  }

  /* KW à gauche = ~25% */
  .page-forum .col-kw{
    width: 25% !important;
    flex: 0 0 25% !important;
    min-width: 100px !important;
    min-height: 0;
    height: calc(100vh - var(--drawer-h, 15vh)) !important; 
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Styles internes KW */
  .page-forum .kw{
    text-align: left;
    height: auto;
    padding-top: 20px !important;
    padding-right: 0px !important;
    padding-left: 35px !important;
    box-sizing: border-box;
  }

  /* Forum = tout le reste */
  .page-forum .col-forum{
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0;
    min-height: 0;
    height: calc(100vh - var(--drawer-h, 15vh)) !important;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px !important;
    text-align: justify !important;
  }

  /* si ton spacer existe encore au milieu */
  .page-forum .spacer-col-menu1{
    display: none !important;
  }

  /* 2) Colonne explicative => barre fixe en bas */
  .page-forum .col-explicative{
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;

    width: 100% !important;
   height: var(--drawer-h, 15vh) !important;

    z-index: 5000;
    box-sizing: border-box;

    overflow: hidden !important;
  }

  /* on enlève le spacer “top-bar” dans la barre du bas */
  .page-forum .col-explicative .spacer-col-explicative{
    display: none !important;
    height: 0 !important;
  }

  /* contenu scrollable dans la barre */
  .page-forum .col-explicative .texte-explicatif{
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-top: 8px;
    padding-bottom: 8px;
  }

.page-forum .col-explicative{
  border-top: 0px solid black !important;
}

/* panneau texte */
.page-forum .col-explicative{
  background-image: url("images/estampe.png");
  background-repeat: repeat;
  background-size: 90px 90px;
}

/* IMPORTANT : ne pas masquer le motif */
.page-forum .col-explicative .texte-explicatif{
  background: transparent !important;
}

/* La barre basse devient une colonne : texte (scroll) + bouton (fix en bas) */
  .page-forum .col-explicative{
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important; /* le scroll doit être sur .texte-explicatif */
  }

  /* Zone texte = scrolleur */
  .page-forum .col-explicative .texte-explicatif{
    flex: 1 1 auto;
    min-height: 0;              /* IMPORTANT pour que le scroll fonctionne */
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 12px;       /* petit confort */
  }

  /* Bloc bouton = en bas, sans chevauchement */
  .page-forum .col-explicative .formulaire-forum{
    position: static !important;   /* <-- enlève l’overlay */
    flex: 0 0 auto;
    align-self: flex-end;
    padding: 8px 12px 10px;
    margin: 0;
    background: transparent;
    z-index: 2;
  }

/* =========================================================
   FORMULAIRE INLINE DANS LA BARRE BASSE (<900px)
   → même style que la modale, sans overlay
   ========================================================= */

  /* le slot qui reçoit le formulaire */
  .page-forum .drawer-form-slot{
    margin-top: 10px;
    padding: 0;
  }

  /* wrapper du contenu du formulaire (ex-modale) */
  .page-forum .drawer-form-slot .forum-form-content{
    border: 1px solid black;
    background-image: url("images/estampe.png");
    background-repeat: repeat;
    background-size: 80px 80px;

    padding: 10px 10px 12px;
    box-sizing: border-box;
  }

  /* cohérence avec la modale */
  .page-forum .drawer-form-slot fieldset{
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  /* séparation douce avec le texte explicatif */
  .page-forum .drawer-form-slot{
    border-top: 0px solid black !important;
    padding-top: 10px;
  }

  /* éviter que les champs débordent */
  .page-forum .drawer-form-slot input,
  .page-forum .drawer-form-slot textarea{
    max-width: 100%;
    box-sizing: border-box;
  }

  /* bouton envoyer = même style lien */
  .page-forum .drawer-form-slot .boutons{
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
  }

/* =========================================================
   <900px — Drawer compact au départ, ouverture fluide
   ========================================================= */

  /* IMPORTANT : enlever les fonds blancs qui font la bande */
  .page-forum .col-explicative .texte-explicatif,
  .page-forum .col-explicative .formulaire-forum{
    background: transparent !important;
  }

  /* zone texte : scrolle si long */
  .page-forum .col-explicative .texte-explicatif{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 0px 12px 8px !important;
  }

  /* lien en bas, sans “bande” */
  .page-forum .col-explicative .formulaire-forum{
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 8px 12px 10px !important;
    align-self: flex-end;
  }

  /* === Formulaire : replié par défaut, déplié en douceur === */
  .page-forum .drawer-form-slot{
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0px solid black !important;
    min-height: 0 !important;
    overflow: hidden !important;
    max-height: 0;
    opacity: 0;
    transition: max-height 220ms ease, opacity 180ms ease;
  }

  /* ouvert : le slot devient visible, max 25vh et scroll interne */
  .page-forum .col-explicative.is-open .drawer-form-slot{
    max-height: 25vh;
    opacity: 1;
    overflow-y: auto !important;
  }

  /* réduire un peu le champ message dans le drawer */
  .page-forum .drawer-form-slot textarea{
    min-height: 70px !important;
    max-height: 120px !important;
  }

/* Quand le formulaire est ouvert : il prend toute la barre, le texte disparait */
  .page-forum .col-explicative.is-open .texte-explicatif{
    display: none !important;
  }

  /* le slot devient le scrolleur principal */
  .page-forum .col-explicative.is-open .drawer-form-slot{
    max-height: none !important;   /* <-- plus de limite à 25vh */
    flex: 1 1 auto !important;
    overflow-y: auto !important;
  }

  /* et le slot doit pouvoir s'étirer */
  .page-forum .drawer-form-slot{
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

/* Sous 900px : pas de spacer au-dessus du texte explicatif */
  .page-forum .col-explicative .spacer-col-explicative{
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* au cas où : annule un margin-top qui trainerait */
  .page-forum .col-explicative .texte-explicatif{
    margin-top: 0 !important;
  }

  .page-forum .drawer-form-slot{
    transition: max-height 240ms ease, opacity 200ms ease;
  }

  .page-forum .drawer-form-slot{
    will-change: max-height, opacity;
  }

/* <900 : formulaire inline SANS CADRE (plat) */
  .page-forum .drawer-form-slot .forum-form-content,
  .page-forum .drawer-form-slot form{
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

/* <900 : quand le formulaire est ouvert, on évite que son haut passe sous la barre KW */
  .page-forum .col-explicative.is-open .drawer-form-slot{
    overflow: auto !important;  /* important : pas juste overflow-y */
  }

/* <900px : masquer "Qui êtes-vous ?" (legend du login ET du forum) */
  .page-forum :is(.formulaire_login, .formulaire_forum) legend{
    display: none !important;
  }

/* <900px : ajouter ":" après certains labels du formulaire forum */
  /* Titre */
  .page-forum .formulaire_forum .editer_titre label::after{
    content: " :";
    font-weight: 400;
  }

  /* Texte du message */
  .page-forum .formulaire_forum .editer_texte label::after{
    content: " :";
    font-weight: 400;
  }

/* DRAWER <900 : ajouter ":" après "Titre" et "Texte de votre message" */
  /* Champ titre (input texte) */
  .page-forum .drawer-form-slot .formulaire_forum .editer:has(input[type="text"]) label::after{
    content: " :";
    font-weight: 400;
  }

  /* Champ message (textarea) */
  .page-forum .drawer-form-slot .formulaire_forum .editer:has(textarea) label::after{
    content: " :";
    font-weight: 400;
  }

}


/* =========================================================
   MEDIA (max-width: 900px) and (min-width: 651px)
   (regroupé — ordre interne conservé)
   ========================================================= */
@media (max-width: 900px) and (min-width: 651px){

/* Poignée + zone d'accroche seulement entre 650 et 900 */

  /* on crée une petite zone en haut du drawer pour attraper */
  .page-forum .col-explicative{
    position: fixed; /* tu l'as déjà en <900, on le laisse */
  }

  /* le texte ne doit pas passer sous la poignée */
  .page-forum .col-explicative .texte-explicatif{
    padding-top: 8px !important;
  }

  .page-forum .drawer-handle{
    height: 22px;
    cursor: ns-resize;
    touch-action: none;      /* IMPORTANT: drag ici seulement */
    position: relative;
  }

  .page-forum .drawer-handle::after{
    content:"";
    position:absolute;
    top: 8px;
    left:50%;
    transform:translateX(-50%);
    width:44px;
    height:5px;
    border-radius:999px;
    background: rgba(0,0,0,.35);
    opacity:.65;
    pointer-events:none;
  }

  .page-forum .drawer-handle{
    flex: 0 0 22px;
    pointer-events: auto;
    z-index: 10;
  }

}


/* =========================================================
   MEDIA (min-width: 651px) and (max-width: 900px)
   (regroupé — ordre interne conservé)
   ========================================================= */
@media (min-width: 651px) and (max-width: 900px){

/* 651–900 : un petit padding suffit */
  .page-forum .col-explicative.is-open .drawer-form-slot{
    padding-top: 0px !important;
  }

}


/* =========================================================
   MEDIA (max-width: 700px)
   (regroupé — ordre interne conservé)
   ========================================================= */
@media (max-width: 700px){

  .page-forum .kw{
    text-align: left;
    height: auto;
    padding-top: 20px !important;
    padding-right: 0px !important;
    padding-left: 20px !important;
    box-sizing: border-box;
  }
   .page-forum .forum{
    padding-right: 10px !important;
    box-sizing: border-box;
  }

}


/* =========================================================
   MEDIA (max-width: 650px)
   (regroupé — ordre interne conservé)
   ========================================================= */
@media (max-width: 650px){

/* =========================================================
   FORUM — <650px
   - forum = 100% largeur
   - barre basse (drawer) = 15% hauteur, extensible (via JS)
   - KW intégrés visuellement dans la barre basse en ligne
   ========================================================= */

  /* Variables de mise en page (JS mettra --drawer-h en px quand on drag) */
  .page-forum{
    --kwbar-h: 48px;
  }
/* laisse un micro espace en haut du drawer pour pouvoir attraper (drag JS) */
.page-forum .col-explicative{
  padding-top: 0 !important;
}
  /* Forum prend 100% largeur */
  .page-forum{
    flex-direction: column;
    height: 100vh;
    min-height: 0;
  }

  .page-forum .spacer-col-menu1{
    display: none !important;
  }

  .page-forum .col-forum{
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;

    /* laisse la place à la barre basse */
    height: calc(100vh - var(--drawer-h)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* =========================
     BARRE BASSE (col-explicative)
     ========================= */
  .page-forum .col-explicative{
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;

    width: 100% !important;
    height: var(--drawer-h) !important;

    z-index: 6000;
    box-sizing: border-box;
    overflow: hidden !important;

    /* séparation + “poignée” */
    border-top: 0px solid black !important;
    background: lightgrey;
  }

  /* on enlève le spacer interne */
  .page-forum .col-explicative .spacer-col-explicative{
    display: none !important;
    height: 0 !important;
  }
/* “poignée” (visuelle) */
  /* réserve en haut de la barre basse pour la rangée KW */
  .page-forum .col-explicative .texte-explicatif{
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;

    padding-top: calc(var(--kwbar-h) + 10px);
    padding-right: 12px;
    padding-left: 12px;
    padding-bottom: 10px;
  }

 /* poignée (visuelle) : on la met sur la barre KW, car elle est AU-DESSUS */
.page-forum .col-kw::before{
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  opacity: 0.6;
  z-index: 2;
  pointer-events: none;
}

  /* =========================
     KW DANS LA BARRE BASSE (visuellement)
     ========================= */
  
.page-forum .col-kw{
    position: fixed !important;
    left: 0;
    right: 0;

    /* place la “rangée KW” en haut du drawer */
    bottom: calc(var(--drawer-h) - var(--kwbar-h)) !important;

    width: 100% !important;
    height: var(--kwbar-h) !important;
    min-width: 0 !important;

    z-index: 6500;
    background: whitesmoke;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    /* pas de colonne */
    display: block !important;
  }

  /* plus de gros spacer KW */
  .page-forum .col-kw .spacer-kw{
    display: none !important;
    height: 0 !important;
  }

  /* rangée KW : inline */
  .page-forum .col-kw .kw{
    padding: 10px 12px !important;
    height: 100%;
    box-sizing: border-box;
  }

  .page-forum .col-kw nav ul{
    display: flex !important;
    flex-direction: row !important;
    gap: 14px;
    align-items: center;
    white-space: nowrap;
  }

  .page-forum .col-kw nav li{
    margin: 0 !important;
  }

  .page-forum .col-kw nav a{
    white-space: nowrap;
  }

  /* optionnel : scrollbar invisible sur la rangée KW */
  .page-forum .col-kw::-webkit-scrollbar{ display:none; }
  .page-forum .col-kw{ scrollbar-width:none; -ms-overflow-style:none; }

/* Le contenu interne ne doit pas recouvrir le fond du drawer */
.page-forum .col-explicative .texte-explicatif{ background: transparent !important; }

/* =========================================================
   Drawer bas — motif identique à la modale
   ========================================================= */
/* panneau texte */
.page-forum .col-explicative{
  background-image: url("images/estampe.png");
  background-repeat: repeat;
  background-size: 90px 90px;
}

/* barre KW */
.page-forum .col-kw{
  background-image: url("images/estampe.png");
  background-repeat: repeat;
  background-size: 90px 90px;
}

/* bloc interne KW */
.page-forum .col-kw .kw{
  background-image: url("images/estampe.png");
  background-repeat: repeat;
  background-size: 90px 90px;
}

/* IMPORTANT : le contenu ne doit pas recouvrir le fond */
.page-forum .col-explicative .texte-explicatif{
  background: transparent !important;
}

  .page-forum .col-forum .forum{
    padding-left: 10px !important;   /* enlève le décalage à gauche */
    padding-right: 0px !important; /* garde un peu d’air */
  }

  .page-forum .col-explicative{
    touch-action: auto !important;     /* ou pan-y */
  }

  /* confort iOS */
  .page-forum .col-explicative .texte-explicatif{
    -webkit-overflow-scrolling: touch;
  }

/* FIX <650 (donc <500 aussi) : le texte ne doit PAS faire height:100% en flex */
  .page-forum .col-explicative{
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .page-forum .col-explicative .texte-explicatif{
    height: auto !important;     /* <-- important : annule le height:100% */
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 12px !important;
  }

  .page-forum .col-explicative .formulaire-forum{
    position: static !important;
    flex: 0 0 auto !important;
    align-self: flex-end !important;
    z-index: 2;
  }

  .page-forum .col-kw{ cursor: ns-resize; }

/* FIX <650 : le texte ne doit jamais passer sous la rangée KW */
  .page-forum .col-explicative .texte-explicatif{
    padding-top: calc(var(--kwbar-h) + 0px) !important;
  }

/* <650 : le formulaire doit commencer sous la barre KW */
  .page-forum .col-explicative.is-open .drawer-form-slot{
    padding-top: calc(var(--kwbar-h) - 5px) !important;
  }

  .page-forum .top-bar-forum{
    background-color: whitesmoke !important;
  }

  .page-forum .top-bar-forum .logo,
  .page-forum .top-bar-forum .spacer-col-forum,
  .page-forum .top-bar-forum .col-menu1,
  .page-forum .top-bar-forum .spacer-top-col-explicative{
    background-color: whitesmoke !important;
  }


/* FIX <650 : le menu reste transparent */
  .page-forum .top-bar-forum .col-menu1{
background-color: transparent !important;
  }
}


/* =========================================================
   MEDIA (max-width: 650px) and (min-width: 501px)
   (regroupé — ordre interne conservé)
   ========================================================= */
@media (max-width: 650px) and (min-width: 501px){

  .page-forum .col-explicative.is-open .drawer-form-slot{
    padding-top: 20px !important;
  }

    .page-forum .col-forum .forum{
    padding-left: 20px !important;
    padding-right: 10px !important;
  }

}


/* =========================================================
   MEDIA (max-width: 500px)
   (regroupé — ordre interne conservé)
   ========================================================= */
@media (max-width: 500px){

/* =========================================================
   FORUM — TYPO <500px (uniquement la colonne forum)
   ========================================================= */

  .page-forum .col-forum .forum{
    font-size: 16px;
    padding-right: 0px !important;
  }
  .forum-meta{
  text-align: right;
  font-family: "Enby", serif;
  font-size: 8px;
  margin-bottom: 4px;
  padding-right: 4px;
}

.forum-texte p:first-child{
  margin-top: 0;
}

.forum-message{
  margin-bottom: 0px;
}

h4 {
  font-family: "enby", Arial, serif;
  font-weight: 400;
  margin: 0;
  font-size: 18px;
  text-align: center;
  margin-bottom: 15px;
}

/* Fullscreen <500px (SOUS la top bar)
   top-bar: 120px + marge: 10px = 130px */

  .page-forum .modal{
    left: 0 !important;
    top: 130px !important;          /* <-- évite le recouvrement par la top bar */
    transform: none !important;

    width: 100vw !important;
    height: calc(100vh - 130px) !important;

    max-width: none !important;
    max-height: none !important;

    border-radius: 0 !important;
    animation: none; /* optionnel */
  }

  .page-forum .modal-body{
    height: calc(100% - 40px) !important;
  }

  .page-forum .col-explicative.is-open .drawer-form-slot{
    padding-top: 40px !important;
  }

  .top-top-bar-marge{
    height: 10px !important;
  }
}


@media (max-width: 900px){

  .page-forum .col-explicative .texte-explicatif p{
    display: inline;
 /*   background: rgba(150, 195, 255, 0.6);*/
 background: rgba(255, 255, 255, 1);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

}

@media (max-width: 650px){

  .page-forum .col-kw nav a{
    display: inline;
    background: rgba(255, 255, 255, 1);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;

padding: 0px 3px 2px 3px; /* micro respiration, optionnel */
  }

}

@media (max-width: 900px){

  .page-forum .ouvrir-formulaire{
    display: inline;
    background: rgba(255, 255, 255, 1);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;

padding: 0px 3px 2px 3px;
  }


}

  @media (max-width: 900px){

  /* === FORMULAIRE DRAWER : TEXTE BLANC === */
  .page-forum .drawer-form-slot{
    color: white;
  }

  /* labels, paragraphes, légendes */
  .page-forum .drawer-form-slot label,
  .page-forum .drawer-form-slot p,
  .page-forum .drawer-form-slot legend{
    color: white;
  }

  /* liens (ex : mot de passe oublié, logout) */
  .page-forum .drawer-form-slot a{
    color: white;
  }

  /* bouton submit (style lien chez toi) */
  .page-forum .drawer-form-slot input[type="submit"]{
    color: white;
  }

}


@media (max-width: 900px){

  .page-forum .drawer-form-slot input[type="text"],
  .page-forum .drawer-form-slot input[type="email"],
  .page-forum .drawer-form-slot input[type="password"],
  .page-forum .drawer-form-slot textarea{
    color: white;

  }

  .page-forum .drawer-form-slot textarea::placeholder,
  .page-forum .drawer-form-slot input::placeholder{
    color: rgba(255,255,255,0.5);
  }

}


@media (max-width: 900px){

  /* <900px : nom / pseudo en graisse normale */
  .page-forum .drawer-form-slot .forum-form-content strong,
  .page-forum .drawer-form-slot .forum-form-content b{
    font-weight: 400 !important;
  }

}

@media (max-width: 900px){

  /* <900px : "Se déconnecter" en BLANC dans le drawer (override des noirs en !important) */
  .page-forum .drawer-form-slot .forum-form-content
  a[href*="logout"],
  .page-forum .drawer-form-slot .forum-form-content
  a[href*="deconnexion"],
  .page-forum .drawer-form-slot .forum-form-content
  a[href*="action=logout"]{
    color: #fff !important;
    background: none !important;
    -webkit-text-fill-color: #fff !important; /* au cas où (WebKit) */
  }

}

@media (max-width: 900px){

  /* <900px : croix du drawer en BLANC, sans surlignage */
  .page-forum .col-explicative.is-open .ouvrir-formulaire{
    color: white !important;
    background: none !important;
    box-decoration-break: initial !important;
    -webkit-box-decoration-break: initial !important;
    padding: 0 !important;
  }

}

@media (max-width: 900px){

  /* ===== LOGIN (déconnecté) — TEXTE BLANC ===== */

  /* labels login */
  .page-forum .drawer-form-slot .formulaire_login label{
    color: white !important;
  }

  /* champs login */
  .page-forum .drawer-form-slot .formulaire_login
  input[type="text"],
  .page-forum .drawer-form-slot .formulaire_login
  input[type="email"],
  .page-forum .drawer-form-slot .formulaire_login
  input[type="password"]{
    color: white !important;
    background-image: linear-gradient(white, white) !important;
  }

  /* placeholder */
  .page-forum .drawer-form-slot .formulaire_login input::placeholder{
    color: rgba(255,255,255,0.5) !important;
  }

  /* lien "mot de passe oublié ?" */
  .page-forum .drawer-form-slot .formulaire_login a{
    color: white !important;
    background: none !important;
  }

  /* bouton "Se connecter" */
  .page-forum .drawer-form-slot .formulaire_login
  .boutons input[type="submit"]{
    color: white !important;
    background: none !important;
    text-decoration-color: white !important;
  }

  /* checkbox */
  .page-forum .drawer-form-slot .formulaire_login
  input[type="checkbox"]{
    accent-color: white;
  }

}
@media (max-width: 900px){

  /* ===== TEXTE SAISI — LOGIN (email / pseudo / mot de passe) ===== */

  .page-forum .drawer-form-slot .formulaire_login
  input[type="text"],
  .page-forum .drawer-form-slot .formulaire_login
  input[type="email"],
  .page-forum .drawer-form-slot .formulaire_login
  input[type="password"]{
    color: white !important;
    caret-color: white !important;
    -webkit-text-fill-color: white !important; /* Chrome / Safari */
  }

}

@media (max-width: 900px){

  /* LOGIN <900 : "Se souvenir de moi" sur la MÊME ligne que la checkbox */
  .page-forum .drawer-form-slot .formulaire_login .editer_session{
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;

    /* annule un éventuel grid 2 colonnes sur cette ligne */
    grid-template-columns: none !important;
  }

  /* Si SPIP met le <br> dans le label : on le supprime */
  .page-forum .drawer-form-slot .formulaire_login .editer_session label br{
    display: none !important;
  }

  /* Label : texte à côté, pas en dessous */
  .page-forum .drawer-form-slot .formulaire_login .editer_session label{
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  /* Checkbox : pas de marge qui casse l'alignement */
  .page-forum .drawer-form-slot .formulaire_login .editer_session input[type="checkbox"]{
    margin: 0 !important;
    flex: 0 0 auto !important;
  }

}

@media (max-width: 900px){

  /* iOS: couvrir la zone sous le drawer (safe area en bas) */
  .page-forum .col-explicative{
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--drawer-h, 15vh) + env(safe-area-inset-bottom)) !important;
  }

}