/* =========================================================
   POST PAGE — Sujet + réponses
   ========================================================= */

/* Même fond #F7F7F5 que le forum (retour Marion du 6 août) */
.post-page { padding: 40px 0 80px; background: var(--bg); }

/* Ligne « ← Retour » à gauche, fil d'ariane aligné à droite (maquette) */
.post-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.post-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-title);
  font-size: 15px; font-weight: 500;
  color: var(--dark);
}
.post-back:hover { color: var(--primary); }
.post-breadcrumb {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
  text-align: right;
  color: rgba(45, 52, 64, 0.4);
}
.post-breadcrumb a { color: inherit; }
.post-breadcrumb a:hover { color: var(--primary); }
.post-breadcrumb .sep { margin: 0 4px; }

.post-title-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.post-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  color: var(--dark);
  flex: 1;
  min-width: 0;
}
/* Ligne « Catégorie [pastille] | Tags [pastille] [pastille] » */
.post-tags-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 28px;
  font-family: var(--font-title);
  font-size: 12px;
  color: var(--muted-fg);
}
.post-tags-row__label { font-weight: 500; }
.post-tags-row__sep { color: rgba(45, 52, 64, 0.25); margin: 0 4px; }
.post-tags-row .tag { padding: 4px 12px; font-size: 10px; line-height: 16px; }

.post-layout {
  display: grid;
  grid-template-columns: 927fr 341fr;
  gap: 32px;
  align-items: start;
}

/* Bandeau auteur */
.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-author__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.post-author__info { flex: 1; min-width: 0; }
.post-author__name {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-family: var(--font-title);
  font-size: 14px; font-weight: 600; line-height: 20px;
  color: #425062;
}
.post-author__meta {
  font-family: var(--font-title);
  font-size: 10px; font-weight: 400; line-height: 20px;
  color: rgba(45, 52, 64, 0.4);
}
/* Rôle : pastille ronde crème + libellé rose */
.post-author__badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0;
  background: none;
  font-family: var(--font-title);
  font-size: 10px; font-weight: 400; line-height: 20px;
  color: var(--pink);
}
.post-author__badge::before {
  content: "";
  width: 17px; height: 16px;
  border-radius: 128px;
  background: var(--icon-bg);
  flex-shrink: 0;
}
.post-author__date {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600;
  color: rgba(45, 52, 64, 0.4);
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;          /* « Publié 6 mai 2026 » ne doit pas se casser */
}
/* Sans contrainte, le SVG (viewBox seul, sans width) s'affichait à la
   taille par défaut du navigateur — d'où l'énorme horloge signalée. */
.post-author__date svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Carte message */
.post-card {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.post-card--original { border: none; }
.post-card__content {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 400;
  line-height: 19px;
  color: var(--dark);
  /* Marges négatives = les filets vont d'un bord à l'autre de la carte
     (« 100% de width »), sans déplacer le texte. */
  margin-left: -20px;
  margin-right: -20px;
  padding: 12px 56px 23px;
  border-top: 2px solid #F6F6F6;
  border-bottom: 2px solid #F6F6F6;
}
.post-card__content p { margin-bottom: 12px; }
.post-card__content p:last-child { margin-bottom: 0; }
.post-card__actions {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-top: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
/* Bouton « Répondre » : contour sombre, 198×40 */
.post-card__actions .action-btn--reply {
  min-width: 198px;
  min-height: 40px;
  justify-content: center;
  border: 1px solid var(--btn-dark);
  border-radius: 8px;
  color: var(--btn-dark);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
}
.post-card__actions .action-btn--reply:hover {
  background: rgba(50, 58, 69, 0.06);
  border-color: var(--btn-dark);
  color: var(--btn-dark);
}
.post-card__counters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
/* Compteurs à droite, sans contour */
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-full);
  background: none;
  font-family: var(--font-title);
  font-size: 13px; font-weight: 500;
  color: rgba(45, 52, 64, 0.5);
  transition: all var(--transition);
}
.action-btn:hover { color: var(--primary); }
.action-btn svg { width: 15px; height: 15px; }
.action-btn__count { font-weight: 500; color: rgba(45, 52, 64, 0.5); }
.post-card__meta {
  font-family: var(--font-title);
  font-size: 12px;
  color: rgba(45, 52, 64, 0.4);
}

/* Section titre "Les réponses" */
.replies-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  color: var(--dark);
  margin: 40px 0 20px;
}
/* Les réponses sont décalées, avec un rail vertical à gauche */
#repliesList {
  padding-left: 42px;
  border-left: 2px solid #F6F6F6;
}

/* Formulaire de réponse */
.reply-form {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
}
.reply-form__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}
.editor {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
}
.editor__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #FAFAFA;
  flex-wrap: wrap;
}
.editor__group { display: flex; align-items: center; gap: 4px; padding: 0 6px; border-right: 1px solid var(--border); }
.editor__group:last-child { border-right: none; }
.editor__btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-fg);
  border-radius: 4px;
  font-size: 13px;
  transition: background var(--transition);
}
.editor__btn:hover { background: var(--muted); color: var(--dark); }
.editor__size {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 13px;
  background: white;
}
.editor__size button { width: 20px; height: 22px; font-size: 14px; color: var(--muted-fg); }
.editor__size input {
  width: 32px; border: none; outline: none;
  text-align: center; font-family: inherit; font-size: 13px;
}
.editor__font {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted-fg);
}
.editor__area {
  min-height: 140px;
  padding: 14px 16px;
  outline: none;
  font-size: 14px;
  color: var(--dark);
  resize: vertical;
  border: none;
  width: 100%;
  font-family: inherit;
}
.editor__area:focus { outline: none; }
.editor__area::placeholder { color: var(--muted-fg); }

/* ── Éditeur WYSIWYG ───────────────────────────────────────
   La zone est un contenteditable : la mise en forme s'affiche
   telle qu'elle sera publiée, au lieu des balises brutes. */
.editor__area--rich {
  line-height: 1.7;
  overflow-y: auto;
  max-height: 460px;
  cursor: text;
}
.editor__area--rich:empty::before {
  content: attr(data-placeholder);
  color: var(--muted-fg);
  pointer-events: none;
}
/* Le rendu doit être celui d'un message publié, pas celui d'un champ */
.editor__area--rich p { margin: 0 0 10px; }
.editor__area--rich p:last-child { margin-bottom: 0; }
.editor__area--rich ul,
.editor__area--rich ol { margin: 0 0 10px; padding-left: 22px; }
.editor__area--rich li { margin-bottom: 4px; }
.editor__area--rich a { color: var(--primary-dark); text-decoration: underline; }
.editor__area--rich code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--orange-dark);
}
.editor__area--rich blockquote {
  margin: 0 0 10px;
  padding: 6px 0 6px 14px;
  border-left: 3px solid var(--primary-light);
  color: var(--heading-3);
}
/* ── Modification d'un message ─────────────────────────── */
.post-card__edited {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--meta-fg);
  font-style: italic;
}
.post-card__edited svg { width: 12px; height: 12px; }

.edit-box { margin: 4px 0; }
.edit-box__title {
  font-family: var(--font-title);
  font-size: 13px; font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}
.edit-box__actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ── Barre d'administration d'un sujet ─────────────────── */
.admin-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}
.admin-bar__label {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--meta-fg);
  margin-right: 4px;
}
.admin-bar__btn {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: white;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600;
  color: var(--heading-3);
  transition: all var(--transition);
}
.admin-bar__btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.admin-bar__btn--on {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.editor__btn svg { width: 17px; height: 17px; }
.editor__btn--active { background: var(--primary-soft); color: var(--primary-dark); }
.editor__btn--active:hover { background: var(--primary-soft); color: var(--primary-dark); }

.reply-form__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

/* Sidebar auteur */
.author-card {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 20px;
  position: sticky;
  top: calc(var(--navbar-h) + 20px);
}
/* La carte entière mène au profil : elle en a l'air et le comportement. */
.author-card--link { display: block; transition: box-shadow var(--transition), transform var(--transition); }
.author-card--link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.author-card--link:hover .author-card__cta { color: var(--primary-dark); }
.author-card--link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.author-card__cta {
  display: block;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--meta-fg);
  transition: color var(--transition);
}

.author-card__top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.author-card__name {
  font-family: var(--font-title);
  font-size: 14px; font-weight: 600; line-height: 20px;
  color: #425062;
}
.author-card__role {
  font-family: var(--font-title);
  font-size: 10px; font-weight: 400; line-height: 20px;
  color: var(--pink);
}
.author-card__badges { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.mini-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--yellow-soft);
  color: var(--yellow-dark);
  font-size: 11px;
  font-weight: 700;
}
/* Lignes de stats : encadrés crème, chiffres en jaune (maquette) */
.author-card__stats {
  display: flex; flex-direction: column; gap: 10px;
  list-style: none; padding: 0; margin: 0;
}
.author-card__stats li {
  display: flex; align-items: center; gap: 6px;
  min-height: 34.66px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 14px; font-weight: 700; line-height: 17px;
  color: #FFAA00;
}
.author-card__stats .check { color: #FFAA00; font-weight: 700; }
.author-card__date {
  display: flex; align-items: center;
  min-height: 34.66px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 12px; font-weight: 500; line-height: 15px;
  color: var(--btn-dark);
}

/* Encart webinaire (lavande) */
.webinar-card {
  background: var(--tile-lavender);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.webinar-card__title {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 400;
  line-height: 40px;
  color: var(--dark);
}
.webinar-card__title strong { font-weight: 700; display: block; }
.webinar-card__subject {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 21px;
  color: var(--dark);
}
.webinar-card__btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 40px;
  background: var(--btn-dark);
  color: white;
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  margin-top: auto;
}

/* Charger plus */
.load-more {
  display: block; margin: 24px auto 0;
  padding: 12px 26px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  color: var(--dark);
  transition: all var(--transition);
}
.load-more:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .author-card { position: static; }
  .reply-form__actions { grid-template-columns: 1fr; }
}

/* Ajouts du branchement API */
.post-card--accepted { border-color: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,0.08); }
.accepted-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; margin-bottom: 14px;
  border-radius: var(--radius-full);
  background: #DCFCE7; color: #15803D;
  font-size: 12px; font-weight: 700;
}
.accepted-badge svg { width: 13px; height: 13px; }
.action-btn--active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.post-card__meta { margin-left: auto; font-size: 12px; color: var(--muted-fg); }
.editor__hint { margin-left: auto; font-size: 11px; color: var(--muted-fg); }
.post-card__content code {
  background: var(--muted); padding: 2px 6px; border-radius: 4px;
  font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.post-card__content ul, .post-card__content ol { margin: 0 0 12px 20px; }
.post-card__content li { margin-bottom: 4px; }
.post-card__content a { color: var(--primary-dark); font-weight: 600; }
.post-card__content blockquote {
  border-left: 3px solid var(--primary-light);
  padding-left: 14px; margin: 0 0 12px; color: var(--muted-fg);
}
