/* Back button (top-left) */
.back-container {
  margin-bottom: 15px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.back-btn i {
  font-size: 16px;
}

.back-btn .back-btn-text {
  font-size: 14px;
  line-height: 1;
}

.back-btn:hover {
  background: rgba(255,255,255,0.04);
}

/* Alerte aperçu (affichée aux membres de l'équipe pour les articles non publiés) */
.preview-banner {
  background: #14181f;
  color: #e6007e;
  padding: 12px;
  border-left: 4px solid #e6007e;
  border-radius: 8px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .back-btn { 
    padding: 8px 10px; 
    gap: 8px; 
  }
  .back-btn .back-btn-text { 
    font-size: 13px; 
  }
}

/* Conteneur principal */
.article-container {
  max-width: 1320px;
  margin: 0 auto;
}


/* En-tête de l'article */
.article-header {
  margin-bottom: 18px;
}

.article-header .meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.article-title {
  font-size: 34px;
  line-height: 1.08;
  margin: 0 0 8px;
  color: var(--text);
}

.article-description {
  color: var(--text-muted);
  margin-bottom: 18px;
}


/* Layout : contenu principal + sidebar */
.article-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}


/* -------------------------------
   Média principal / galerie
   ------------------------------- */
   ------------------------------- */
.media-main {
  background: var(--bg-card);
  padding: 14px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Media gallery */
.media-area {
  width: 100%;
}

.media-main {
  background: var(--bg-card, #111216);
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  margin-bottom: 14px;
}

.media-display {
  width: 100%;
  height: 482px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.1));
}

.media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.media-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.media-thumb {
  width: 72px;
  height: 48px;
  flex: 0 0 72px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 4px 10px rgba(0,0,0,0.45);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb.active {
  border-color: var(--primary, #ff4b8b);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 0 6px rgba(0,0,0,0.15) inset;
}

@media (max-width: 768px) {
  .media-display { height: 240px; }
  .media-thumb { width: 56px; height: 40px; }
}

/* On mobile, allow thumbnails to wrap to next line to respect design */
@media (max-width: 600px) {
  .media-thumbnails {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
  }
  .media-thumb {
    flex: 0 0 auto;
    width: 30%;
    max-width: 120px;
    height: auto;
  }
  .media-thumb img {
    height: 48px;
    object-fit: cover;
  }
}

/* Article card wrapper to make gallery+text appear as one card */

/* make the logged-out prompt take the full width of the comments area */
.comment-form .comment-form-logged-out {
  box-sizing: border-box;
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  padding: 18px;
  background: var(--bg-card);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.comment-form-logged-out h2 {
  margin: 0 0 8px;
  font-size: 22px;
  text-transform: uppercase;
  font-weight: 700;
}
.comment-form-logged-out .auth-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.article-card {
  background: var(--bg-card, #151619);
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  display: block;
  margin-bottom: 18px;
}

.article-card .media-main {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.article-card .media-caption {
  color: var(--muted, #9aa0a6);
  margin-top: 10px;
}

.article-card .post-excerpt,
.article-card .full-article {
  margin-top: 14px;
  color: var(--text, #e6e6e6);
}

.article-card .post-actions {
  margin-top: 12px;
}

.media-main img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.media-caption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.media-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.media-thumbs img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}

.media-thumbs img:hover {
  border-color: var(--primary);
}


/* -------------------------------
   Extrait / contenu de l'article
   ------------------------------- */
.post-excerpt {
  background: var(--bg-card);
  padding: 14px;
  border-radius: 12px;
  margin-top: 16px;
  color: var(--text);
}

.post-excerpt p {
  margin: 0 0 10px;
}

.post-excerpt ul {
  margin: 8px 0 0 18px;
}

.full-article {
  margin-top: 18px;
  color: var(--text);
  line-height: 1.7;
}

.full-article p {
  margin-bottom: 14px;
}

.full-article p img{
  border-radius: 10px;
  width: 100%;
  height: 100%;
}


/* Actions (likes / commentaires / partage) */
.post-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  border: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Vue (affichage non-cliquable mais stylé comme les boutons) */
.views-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: default;
}
.views-display i {
  font-size: 16px;
}


.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.large {
  padding: 12px 18px;
  font-weight: 800;
}


/* -------------------------------
   Sidebar : téléchargement + similaires
   ------------------------------- */
.article-sidebar .download-card {
  background: var(--bg-card);
  padding: 18px;
  border-radius: 12px;
  color: var(--text);
  position: static;
}

.download-card .badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 12px;
}

.download-card h3 {
  margin: 6px 0 10px;
  font-size: 18px;
}

.download-card .platforms {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.download-card .small {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 12px;
}


.similar {
  margin-top: 18px;
  background: var(--bg-card);
  padding: 12px;
  border-radius: 12px;
}

.similar h4 {
  margin: 0 0 10px;
}

.similar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.similar li {
  display: flex;
  gap: 12px;
  align-items: center;
  /* prevent text from stretching the image */
  min-height: 56px;
}

.similar a {
  color: var(--primary);
  text-decoration: none;
}

/* No comments placeholder */
.no-comments {
  background: #0b0e14;
  border-radius: 10px;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 12px;
}
.no-comments p.muted {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.similar img {
  width: 56px;
  height: 56px;
  flex: 0 0 56px; /* prevent flex from resizing image */
  min-width: 56px;
  min-height: 56px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Ensure the text block can shrink and wrap without enlarging the image */
.similar li > div {
  flex: 1 1 auto;
  min-width: 0;
}

.similar strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar strong {
  display: block;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}


/* -------------------------------
   Commentaires (full width)
   ------------------------------- */
.comments {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.comments h2 {
  margin: 0 0 12px;
}

.comment-form {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

/* Mobile: stack comment form and ensure buttons don't overflow */
@media (max-width: 680px) {
  .comment-form {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .comment-form .comment-form-logged-out {
    padding: 14px;
  }
  .comment-form-logged-out .auth-actions {
    justify-content: flex-start;
    gap: 10px;
  }
  .comment-form-logged-out .auth-actions .btn {
    flex: 0 1 auto;
    min-width: 120px;
  }
}

.comment-form textarea {
  flex: 1;
  height: 64px;
  border-radius: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.comment-form .btn {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  height: auto;
  border-radius: 25px;
}

.comment-form .btn i {
  font-size: 16px;
  margin-right: 5px; 
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}

.pagination-controls .pg-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.pagination-controls .pg-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pagination-controls .pg-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Like button state */
.btn-like.liked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-like.liked i,
.btn-like.liked .count {
  color: #fff;
}

/* Badge pour les membres du staff à côté du pseudo */
.staff-badge {
  color: #e6007e;
  font-size: 16px;
}

/* Logged-out comment form */
.comment-form-logged-out {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  padding: 12px;
  border-radius: 10px;
}

.comment-form-logged-out .auth-actions {
  display: flex;
  gap: 8px;
}

.comments-empty-box {
  margin-top: 18px;
  background: rgba(255,255,255,0.01);
  padding: 14px;
  border-radius: 10px;
}

.comments-empty-box h3 {
  margin: 0 0 8px 0;
}

.comments-empty-box .auth-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
}

.comment {
  display: flex;
  align-items: flex-start;
  background: var(--bg-card);
  padding: 12px;
  border-radius: 10px;
}

.comment-items {
  gap: 15px;
  display: flex;
  flex-direction: column !important;
}

/* Ensure each comment takes full width and avatar/body align correctly */
.comment {
  width: 100% !important;
  align-items: flex-start;
}
.comment .avatar {
  flex: 0 0 44px;
}
.comment .comment-body {
  flex: 1 1 auto;
}



/* delete button on comment */
.comment .comment-actions {
  position: absolute;
  right: 12px;
  top: 10px;
}
.comment .comment-actions .comment-delete {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.comment .comment-actions .comment-delete:hover {
  color: var(--primary);
}

.comment { position: relative; }
.comment .comment-body-inner { margin-left: 56px; }
.comment .avatar { position: absolute; left: 12px; top: 12px; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: transparent;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comment-body .comment-meta {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.comment-body p {
  margin: 0;
  color: var(--text);
}


/* -------------------------------
   Responsive
   ------------------------------- */
@media (max-width: 1000px) {
  .article-body {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    order: 2;
  }

  .media-area {
    order: 1;
  }

  .download-card {
    position: relative;
    top: 0;
  }
}

@media (max-width: 480px) {
  .article-title {
    font-size: 24px;
  }

  .media-thumbs img {
    width: 56px;
    height: 40px;
  }
}

