/* =========================================================
   GALLIKA — Forum / commentaires d’article
   Ancrage :
   - #comments            -> commentaires affichés
   - .gallika-forum-form  -> formulaire forum SPIP
   ========================================================= */


/* =========================================================
   1. Titres de section
   ========================================================= */

.gk-comments-title,
.gk-forum-title {
  max-width: 720px;
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 600;
  color: #2f3f55;
}

.gk-comments-title {
  margin: 0 0 1rem 0;
}

.gk-forum-title {
  margin: 1.4rem 0 1rem 0;
}


/* =========================================================
   2. Bloc commentaires
   ========================================================= */

.gallika-comments {
  max-width: 720px;
  margin: 1.4rem 0 1.8rem 0;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.gallika-comments .commentlist {
  list-style: none;
  margin: 0;
  padding: 1.4rem 1.15rem !important;
  background: #f8f9fb;
  border: 1px solid #e6e9ee;
  border-left: 3px solid #dbe3ee;
  border-radius: 8px;
}

.gallika-comments li.comment,
.gallika-comments li.comment-li {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0 !important;
  background: transparent;
}

.gallika-comments li.comment + li.comment,
.gallika-comments li.comment-li + li.comment-li {
  margin-top: 1.05rem;
  padding-top: .95rem;
  border-top: 1px solid #e9edf2;
}


/* =========================================================
   3. En-tête d’un commentaire
   ========================================================= */

.gallika-comments .comment-header {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  margin: 0 0 .7rem 0;
  padding-left: .7rem;
  padding-right: .2rem;
}

.gallika-comments .comment-header > .d-flex.align-items-center {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  min-width: 0;
  flex: 0 1 auto;
}

.gallika-comments .comment-header figure {
  margin: 0;
  flex: 0 0 50px;
}

.gallika-comments .comment-header figure img {
  display: block;
  width: 50px;
  height: 50px;
}

.gallika-comments .comment-author {
  margin: 0 0 .15rem 0;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 600;
}

.gallika-comments .comment-author a,
.gallika-comments .comment-author .link-dark {
  color: #364255;
  text-decoration: none;
}

.gallika-comments .comment-author a:hover,
.gallika-comments .comment-author .link-dark:hover {
  text-decoration: underline;
}

.gallika-comments .post-meta {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: .88rem;
  line-height: 1.35;
  color: #8a94a3;
}

.gallika-comments .post-meta li {
  margin: 0;
  white-space: normal;
}

.gallika-comments .comment-reply-wrap {
  flex: 0 0 auto;
  margin-left: 1.1rem;
}

.gallika-comments .comment-reply-wrap .btn,
.gallika-comments .comment-header .btn {
  white-space: nowrap;
  margin-top: 0;
  font-size: .85rem;
  padding: .3rem .7rem;
  opacity: .82;
  transition: opacity .2s ease, transform .2s ease;
}

.gallika-comments .comment-reply-wrap .btn:hover,
.gallika-comments .comment-header .btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}


/* =========================================================
   4. Texte du commentaire
   ========================================================= */

.gallika-comments li.comment > p,
.gallika-comments li.comment-li > p {
  margin: 0 0 .1rem .7rem;
  line-height: 1.55;
  color: #4c5566;
}

.gallika-comments li.comment:last-child p:last-of-type,
.gallika-comments li.comment-li:last-child p:last-of-type {
  margin-bottom: .35rem;
}


/* =========================================================
   5. Bloc Réagir
   ========================================================= */

.gk-forum-anchor {
  margin-top: 0;
}

.gallika-forum-form {
  max-width: 720px;
  margin: 0 0 2.4rem 0;
}

.gallika-forum-form > div {
  background: #fafbfc;
  border: 1px solid #e6e9ee;
  border-left: 3px solid #dbe3ee;
  border-radius: 8px;
  padding: 1.4rem 1.15rem;
}


/* =========================================================
   6. Formulaire SPIP
   ========================================================= */

.gallika-forum-form .formulaire_spip {
  margin: 0;
}

.gallika-forum-form .formulaire_spip:not(.formulaire_recherche) {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.gallika-forum-form .formulaire_spip fieldset {
  border: 0;
  width: auto;
  padding: 0;
  margin: 1.2rem 0;
}

.gallika-forum-form .formulaire_spip fieldset.qui {
  margin-top: 0;
}

.gallika-forum-form .formulaire_spip fieldset.commentaire {
  margin-top: 0;
  margin-bottom: 0;
}

.gallika-forum-form .formulaire_spip fieldset + fieldset.commentaire {
  margin-top: 1.2rem;
}

.gallika-forum-form .formulaire_spip legend,
.gallika-forum-form .formulaire_spip h2.legend,
.gallika-forum-form .formulaire_spip h3.legend {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 .65rem 0;
  color: #364255;
  font-weight: 600;
  font-style: normal;
  text-transform: none;
}

.gallika-forum-form .formulaire_spip > p,
.gallika-forum-form .formulaire_spip fieldset > p {
  margin: 0 !important;
  padding: .2em 0;
}

.gallika-forum-form .formulaire_spip ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.gallika-forum-form .formulaire_spip .editer {
  list-style: none;
  margin: 0 0 .95rem 0;
  clear: both;
  overflow: hidden;
}

.gallika-forum-form .formulaire_spip .editer.afficher {
  overflow: hidden;
  margin-bottom: .8rem;
}

.gallika-forum-form .formulaire_spip .fieldset,
.gallika-forum-form .formulaire_spip .saisie_explication {
  padding: 0;
  border: none;
  background: none;
}

.gallika-forum-form .formulaire_spip .explication {
  display: none !important;
}

.gallika-forum-form .formulaire_spip label,
.gallika-forum-form .formulaire_spip .label {
  font-size: .95rem;
  color: #5b6678;
  font-weight: 600;
}

.gallika-forum-form .formulaire_spip input.text,
.gallika-forum-form .formulaire_spip input.password,
.gallika-forum-form .formulaire_spip input.date,
.gallika-forum-form .formulaire_spip input[type="text"],
.gallika-forum-form .formulaire_spip input[type="password"],
.gallika-forum-form .formulaire_spip input[type="search"],
.gallika-forum-form .formulaire_spip textarea,
.gallika-forum-form .formulaire_spip select {
  font-size: 1em;
  font-family: inherit;
  width: 100%;
  padding: 0 .4em;
  background: #fff;
  border: 1px solid #dfe4ea;
  box-shadow: none;
  min-height: 1.95em;
  line-height: 1.95em;
}

.gallika-forum-form .formulaire_spip textarea {
  min-height: 15rem;
  height: auto;
  line-height: 1.5;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

.gallika-forum-form .formulaire_spip select {
  appearance: none;
  background: #fff;
  padding-right: 28px;
  border-radius: 0;
}

.gallika-forum-form .formulaire_spip .choix {
  overflow: hidden;
  margin: .3em 0;
}

.gallika-forum-form .formulaire_spip .choix label {
  font-weight: 400;
  text-transform: none;
  display: inline-block;
  float: right;
  width: 96%;
  padding-left: .5em;
}

.gallika-forum-form .formulaire_spip .choix label.on {
  font-weight: 700 !important;
}

.gallika-forum-form .formulaire_spip .choix .radio,
.gallika-forum-form .formulaire_spip .choix .checkbox {
  float: left;
  margin-top: .25em;
  margin-left: .2em;
}

.gallika-forum-form .formulaire_spip .obligatoire .label {
  font-weight: 700;
}

.gallika-forum-form .formulaire_spip .boutons {
  margin: .9rem 0 0 0;
  clear: both;
  padding: .8rem 0 0 0;
  text-align: right;
}

.gallika-forum-form .formulaire_spip input[type="submit"],
.gallika-forum-form .formulaire_spip button,
.gallika-forum-form a.button {
  display: inline-block;
  height: 1.95em;
  line-height: 1.95em;
  padding: 0 1em;
  background-color: #397BC1;
  border: none;
  box-shadow: none;
  text-align: center;
  text-decoration: none;
  color: #FFF !important;
  cursor: pointer;
  border-radius: 50rem !important;
  font-size: .92rem;
}

.gallika-forum-form .formulaire_spip button:hover,
.gallika-forum-form .formulaire_spip button:focus,
.gallika-forum-form .formulaire_spip input[type="submit"]:hover,
.gallika-forum-form .formulaire_spip input[type="submit"]:focus,
.gallika-forum-form a.button:hover,
.gallika-forum-form a.button:focus {
  background-color: #204667;
}

.gallika-forum-form .formulaire_spip input[type="text"]:focus,
.gallika-forum-form .formulaire_spip input[type="password"]:focus,
.gallika-forum-form .formulaire_spip input[type="search"]:focus,
.gallika-forum-form .formulaire_spip textarea:focus,
.gallika-forum-form .formulaire_spip select:focus {
  border-color: #838383;
}


/* =========================================================
   7. Prévisualisation
   ========================================================= */

.gallika-forum-form .formulaire_spip .previsu {
  margin-top: 2rem;
}

.gallika-forum-form .formulaire_spip fieldset.previsu {
  background: #fffdf5;
  border: 1px solid #efe2a8;
  padding: 1rem 1rem .25rem;
}

.gallika-forum-form .formulaire_spip fieldset.previsu .comment-meta {
  overflow: auto;
  border-bottom: 1px solid #ece4bf;
  padding-bottom: .5rem;
  margin-bottom: .7rem;
}

.gallika-forum-form .formulaire_spip fieldset.previsu .comment-meta .spip_logo {
  float: right;
  height: auto !important;
  max-width: 20px !important;
}


/* =========================================================
   8. Réponses système
   ========================================================= */

.gallika-forum-form p.reponse_formulaire,
.gallika-forum-form .reponse_formulaire {
  font-size: .92rem;
}

.gallika-forum-form p.reponse_formulaire.reponse_formulaire_ok {
  margin-bottom: 1.4rem !important;
}


/* =========================================================
   9. Responsive
   ========================================================= */

@media (max-width: 768px) {
  .gallika-comments,
  .gallika-forum-form,
  .gk-comments-title,
  .gk-forum-title {
    max-width: 100%;
  }

  .gallika-comments .commentlist,
  .gallika-forum-form > div {
    padding: 1rem .9rem;
  }
}

@media (max-width: 767.98px) {
  .gallika-comments .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }

  .gallika-comments .comment-reply-wrap {
    margin-left: 0;
  }
}

/* Aligner le bouton Réagir à droite */
.gallika-comments .comment-header {
  justify-content: space-between;
}

/* Empêcher le bloc gauche de prendre toute la largeur */
.gallika-comments .comment-header > .d-flex.align-items-center {
  flex: 1;
}

/* Le bouton reste à droite */
.gallika-comments .comment-reply-wrap {
  margin-left: 1rem;
}