.forum-wrap .button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:10px 16px;
  border-radius:10px;
  text-decoration:none;
  font-weight:600;
  border:1px solid transparent;
  background:linear-gradient(180deg, #1b2e4b, #13233b);
  color:var(--surface-text-strong);
  transition:transform .15s ease, opacity .15s ease, background .2s ease, border-color .2s ease;
  cursor:pointer;
}
.forum-wrap .button:hover{
  background:linear-gradient(180deg, #2a3f5f, #1b2e4b);
  transform:translateY(-1px);
  opacity:.95;
  color:#000;
}
.forum-wrap .button.is-active{
  background:var(--brand);
  border-color:var(--brand);
  color:var(--surface-text-strong);
}

.forum-card{
  background:var(--card-light);border-radius:14px;padding:16px;box-shadow:var(--shadow-soft);
}
.forum-thread{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.forum-thread .thread-card{
  border:1px solid var(--border-light-2);
}
.forum-title{font-size:1.1rem}
.muted{color:var(--muted);font-size:.9rem}

.forum-vote{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid var(--border-light-3);
  border-radius:999px;
  background:linear-gradient(180deg, #ffffff, #f1f4f9);
  box-shadow:0 6px 14px rgba(7, 87, 198, 0.08);
}
.forum-vote button{
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid var(--border-light-3);
  background:var(--surface-light-2);
  color:var(--text-dark);
  font-weight:700;
  cursor:pointer;
  transition:transform .15s ease, background .2s ease, border-color .2s ease;
}
.forum-vote button:hover{
  background:var(--surface-light-3);
  border-color:var(--border-light-4);
  transform:translateY(-1px);
}
.forum-vote .score{
  min-width:34px;
  padding:2px 10px;
  border-radius:999px;
  text-align:center;
  font-weight:700;
  background:rgba(var(--brand-accent-rgb), .12);
  color:var(--text-dark);
}
.thread-vote{
  padding:8px 12px;
  background:linear-gradient(180deg, #f8fafc, #eef2f7);
  border-color:var(--border-light-4);
}

.reply-tools button, .flag, .mod-delete, .mod-flag, .reply-toggle{
  background:transparent;
  border:1px solid var(--border-light-3);
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
  color:var(--text-dark);
  transition:transform .15s ease, background .2s ease, border-color .2s ease;
}
.reply-tools button:hover, .flag:hover, .mod-delete:hover, .mod-flag:hover, .reply-toggle:hover{
  border-color:var(--border-light-4);
  background:var(--surface-light-3);
  transform:translateY(-1px);
}

input[type="text"], select, textarea{
  border:1px solid var(--border-light-3);border-radius:10px;padding:8px 10px;outline:none;width:auto
}
textarea:focus, input:focus, select:focus{box-shadow:0 0 0 4px var(--ring);border-color:var(--brand)}

/* ✅ Séparation entre ministères et boutons de tri */
.forum-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--border-light-5);
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.forum-cats { flex: 1; }
.forum-sorts { flex-shrink: 0; }

/* ✅ Formulaire de réponse inline */
.forum-reply {
  margin-top: 12px;
}
.forum-reply input[type="text"] {
  margin-bottom: 6px;
  display: block;
  width: 100%;
  max-width: 250px;
}
.forum-reply textarea {
  width: 100%;
  margin-bottom: 6px;
}
.forum-reply button {
  margin-top: 4px;
}

@media (max-width: 900px){
  .forum-head{flex-direction:column;align-items:flex-start}
}

.replies-wrap{margin-left:10px;border-left:2px dashed var(--border-light-5);padding-left:10px}

.reply-card{
  position:relative;
  background:var(--surface-light);
  border:1px solid var(--border-light-2);
}
.reply-card::before{
  content:"";
  position:absolute;
  left:-12px;
  top:16px;
  width:8px;
  height:8px;
  border-left:2px solid var(--border-light-5);
  border-bottom:2px solid var(--border-light-5);
}
.reply-to{
  display:inline-block;
  font-weight:600;
  color:var(--text-dark);
  background:var(--surface-light-3);
  border:1px solid var(--border-light-3);
  border-radius:999px;
  padding:2px 8px;
}


.thread-card{position:relative}
.thread-card .thread-overlay{
  position:absolute; inset:0; z-index:1;
}
.thread-card .thread-overlay{
  left:64px;
}
.thread-card .forum-vote, .thread-card .forum-vote *{
  position:relative; z-index:2;
}
.thread-card .forum-title, .thread-card .forum-title *{
  position:relative; z-index:2;
}
.thread-card p, .thread-card .muted{
  position:relative; z-index:2;
}


.forum-reply textarea{max-width:720px}
.forum-reply input[type="text"]{max-width:300px}


.forum-confirm-overlay{
  position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.45);z-index:9999;padding:20px;
}
.forum-confirm-modal{
  background:var(--surface-light);border:1px solid var(--border-light-2);
  border-radius:14px;box-shadow:var(--shadow-strong);max-width:420px;width:100%;
  padding:16px 18px;display:flex;flex-direction:column;gap:12px;
}
.forum-confirm-title{font-weight:700;color:var(--text-dark);font-size:1.05rem;}
.forum-confirm-message{color:var(--text-base);line-height:1.5;}
.forum-confirm-actions{display:flex;justify-content:flex-end;gap:8px;}


.forum-replies-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  margin:8px 0 12px;padding-top:8px;border-top:1px solid var(--border-light-4);
}
.forum-replies-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.forum-replies-list .reply-card{margin-top:0}
.forum-replies-sort{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.forum-replies-sort select{min-width:180px}
.forum-replies-sort .button{padding:8px 14px}

.thread-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.thread-title-block{min-width:0;flex:1}
.thread-vote{flex-shrink:0}
.thread-title{margin:0}
.thread-meta{color:var(--muted);font-size:.9rem}

.reply-card{background:var(--surface-light);border:1px solid var(--border-light-2)}
.replies-wrap{margin-left:12px;border-left:2px dashed var(--border-light-5);padding-left:12px}

@media (max-width: 700px){
  .forum-replies-sort select{min-width:140px}
}

@media (max-width: 720px){
  .thread-header{flex-direction:column;align-items:flex-start}
  .thread-vote{align-self:flex-start}
  .forum-vote{
    gap:6px;
    padding:4px 6px;
  }
  .forum-vote button{
    width:24px;
    height:24px;
    font-size:.9rem;
  }
  .forum-vote .score{
    min-width:28px;
    padding:2px 8px;
  }
  .reply-card .muted{
    flex-direction:column;
    align-items:flex-start;
  }
  .reply-card .forum-vote{
    margin-top:6px;
  }
  .thread-card > div{
    flex-direction:column !important;
  }
}

@media (max-width: 560px){
  .thread-header{
    gap:10px;
  }
  .thread-vote{
    order:2;
    align-self:flex-start;
  }
  .thread-card .forum-vote{
    margin-top:8px;
  }
  .forum-vote{
    gap:4px;
    padding:4px 6px;
  }
  .forum-vote button{
    width:22px;
    height:22px;
    font-size:.85rem;
  }
  .forum-vote .score{
    min-width:26px;
    padding:1px 6px;
    font-size:.9rem;
  }
}
