/* Forum scientifique INRAPE */

.forum-section {
  padding: 2rem 0 3.5rem;
  background:
    radial-gradient(900px 400px at 0% 0%, rgba(27, 107, 58, 0.06), transparent 55%),
    #f4f7f5;
}

.forum-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: start;
}

.forum-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.forum-filter {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.forum-filter.is-active,
.forum-filter:hover {
  background: #1b6b3a;
  border-color: #1b6b3a;
  color: #fff;
}

.forum-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.forum-item {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.forum-item:hover {
  transform: translateY(-2px);
  border-color: #a7f3d0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.forum-item-top {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.forum-item h2 {
  margin: 0 0 0.45rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: #14532d;
  line-height: 1.35;
}

.forum-excerpt {
  margin: 0 0 0.75rem;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.55;
}

.forum-item-meta,
.forum-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.forum-cat {
  display: inline-flex;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.forum-closed {
  display: inline-flex;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 700;
}

.forum-empty,
.forum-empty-inline {
  background: #fff;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  padding: 2rem 1.25rem;
  text-align: center;
  color: #6b7280;
}

.forum-form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.forum-form-card h2,
.forum-form-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #14532d;
}

.forum-form-lead {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.5;
}

.forum-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.forum-form-grid--stack {
  grid-template-columns: 1fr;
}

.forum-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.forum-field--full { grid-column: 1 / -1; }

.forum-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.forum-field input,
.forum-field select,
.forum-field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  color: #111827;
  background: #fff;
}

.forum-field input:focus,
.forum-field select:focus,
.forum-field textarea:focus {
  outline: none;
  border-color: #1b6b3a;
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.12);
}

.forum-field textarea { resize: vertical; line-height: 1.55; }

.forum-hint {
  font-size: 0.74rem;
  color: #6b7280;
  line-height: 1.4;
}

.forum-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.15rem;
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.forum-attachment:hover {
  background: #d1fae5;
}

.forum-has-file {
  color: #047857;
  font-weight: 600;
}

.forum-btn {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 9px;
  background: #1b6b3a;
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.forum-btn:hover { background: #155729; }
.forum-btn:disabled { opacity: 0.7; cursor: wait; }

.forum-alert {
  display: none;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

.forum-alert.show { display: block; }
.forum-alert--success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.forum-alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.forum-back { margin: 0 0 1rem; }
.forum-back a {
  color: #1b6b3a;
  font-weight: 600;
  text-decoration: none;
}
.forum-back a:hover { text-decoration: underline; }

.forum-thread {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
}

.forum-thread-head h2 {
  margin: 0.55rem 0 0.4rem;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  color: #14532d;
  line-height: 1.3;
}

.forum-thread-body {
  margin-top: 1rem;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #374151;
  white-space: pre-wrap;
}

.forum-replies {
  margin-bottom: 1.25rem;
}

.forum-replies h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: #14532d;
}

.forum-reply {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #1b6b3a;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
}

.forum-reply-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: #6b7280;
}

.forum-reply-meta strong { color: #14532d; }

.forum-reply-body {
  font-size: 0.94rem;
  line-height: 1.65;
  color: #374151;
  white-space: pre-wrap;
}

.forum-closed-note {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
  color: #6b7280;
}

@media (max-width: 960px) {
  .forum-layout { grid-template-columns: 1fr; }
  .forum-aside { order: -1; }
  .forum-form-grid { grid-template-columns: 1fr; }
  .forum-field--full { grid-column: 1; }
}
