/* =============================================================================
   threads.css — Fil "façon Threads" (voir templates/page-threads.php)
   ============================================================================= */

.th-wrap {
  max-width: 600px;
  margin: 0 auto;
}

.th-feed {
  display: flex;
  flex-direction: column;
}

.th-post {
  display: flex;
  gap: 12px;
  padding: 18px 4px;
  border-bottom: 1px solid #e2e5ea;
}
.th-post:first-child { padding-top: 4px; }

.th-post-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0078d4 0%, #003a6b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
}

.th-post-body {
  flex: 1;
  min-width: 0;
}

.th-post-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.th-post-name {
  font-weight: 700;
  font-size: 14.5px;
  color: #111;
}
.th-post-date {
  font-size: 13px;
  color: #8a8f98;
}

.th-post-text {
  font-size: 14.5px;
  line-height: 1.45;
  color: #222;
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.th-post-img {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e5ea;
  margin-bottom: 10px;
}
.th-post-img img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

/* --- Grille de plusieurs images (1 à 4+) --- */
.th-post-images {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e5ea;
  margin-bottom: 10px;
}
.th-post-img-btn {
  position: relative;
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  background: #000;
  cursor: zoom-in;
  overflow: hidden;
}
.th-post-img-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.th-post-img-btn:hover img { transform: scale(1.03); }

.th-grid-1 { grid-template-columns: 1fr; }
.th-grid-1 .th-post-img-btn {
  /* Pas de recadrage forcé : l'image garde ses propres proportions,
     juste limitée en hauteur pour rester entièrement visible (comme avant). */
  aspect-ratio: unset;
  max-height: 420px;
}
.th-grid-1 .th-post-img-btn img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  background: #f2f3f5;
}

.th-grid-2 { grid-template-columns: 1fr 1fr; }
.th-grid-2 .th-post-img-btn { aspect-ratio: 1/1; }

.th-grid-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.th-grid-3 .th-post-img-btn:nth-child(1) { grid-row: 1 / 3; aspect-ratio: unset; }
.th-grid-3 .th-post-img-btn:nth-child(2),
.th-grid-3 .th-post-img-btn:nth-child(3) { aspect-ratio: unset; }

.th-grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.th-grid-4 .th-post-img-btn { aspect-ratio: 1/1; }

.th-post-img-more {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.th-post-actions {
  display: flex;
  gap: 18px;
  margin-top: 2px;
}
.th-act {
  font-size: 19px;
  color: #444;
  line-height: 1;
  user-select: none;
}

.th-footer-note {
  text-align: center;
  font-size: 11.5px;
  color: #9aa0a8;
  padding: 18px 10px 4px;
  font-style: italic;
}

@media (max-width: 500px) {
  .th-post { padding: 14px 2px; gap: 10px; }
  .th-post-avatar { width: 34px; height: 34px; font-size: 12px; }
}
