/**
 * TW Blog - Styles front (article, commentaires, votes)
 * 2024-2025 Target Web
 */

/* ----- Tri des commentaires ----- */
.twblog-comments-list-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 0.75rem;
}

.twblog-comments-sort {
  font-size: 0.9rem;
}

.twblog-comments-sort .twblog-sort-label {
  margin-right: 0.35em;
  color: #666;
}

.twblog-comments-sort .twblog-sort-sep {
  margin: 0 0.35em;
  color: #999;
}

.twblog-comments-sort .twblog-sort-link.active {
  font-weight: bold;
}

/* ----- Bloc commentaire ----- */
.twblog-comment {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.twblog-comment-reply {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  border-left: 2px solid #ddd;
  padding-left: 0.75rem;
}

.twblog-comment-author {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.twblog-comment-author .twblog-comment-date {
  color: #666;
  font-weight: normal;
  margin-left: 0.35em;
}

.twblog-comment-content {
  margin: 0.35rem 0 0.5rem;
  line-height: 1.4;
}

/* ----- Barre d'actions (Reply, Report, Vote) ----- */
.twblog-comment-actions-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #666;
  margin-top: 0.35rem;
}

/* Groupe flèches + score : espacement serré */
.twblog-comment-vote-group {
  display: flex;
  align-items: center;
}

.twblog-comment-vote-group .twblog-vote-score {
  margin: 0;
  min-width: 1.4em;
}

.twblog-comment-actions-bar .twblog-vote-form {
  display: inline;
}

.twblog-comment-actions-bar button {
  display: flex;
  align-items: center;
  font-size: 14px;
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.twblog-comment-actions-bar .twblog-vote-btn:hover {
  color: #1a1a1b;
}

/* Vote déjà effectué : SVG rempli en bleu (fill + stroke) */
.twblog-comment-actions-bar .twblog-vote-btn.active.up,
.twblog-comment-actions-bar .twblog-vote-btn.active.down {
  color: #2563eb;
}

.twblog-comment-actions-bar .twblog-vote-btn.active.up svg,
.twblog-comment-actions-bar .twblog-vote-btn.active.down svg {
  fill: #2563eb;
  stroke: #2563eb;
}

.twblog-comment-actions-bar .twblog-vote-score {
  font-weight: bold;
  min-width: 1.5em;
  text-align: center;
  color: #1a1a1b;
  font-size: 0.95rem;
  margin: 0;
}

.twblog-comment-actions-bar .twblog-action-sep {
  color: #ccc;
  margin: 0 2px;
}

.twblog-comment-actions-bar .twblog-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.twblog-comment-actions-bar .twblog-icon svg {
  width: 100%;
  height: 100%;
}

.twblog-comment-actions-bar .twblog-vote-btn {
  justify-content: center;
  width: 22px;
  height: 26px;
  min-width: 22px;
  color: #878a8c;
}

.twblog-comment-actions-bar .twblog-vote-btn .twblog-icon {
  width: 16px;
  height: 16px;
}

.twblog-comment-actions-bar .twblog-vote-btn:hover {
  color: #1a1a1b;
}

.twblog-comment-actions-bar .twblog-btn-report {
  gap: 0;
  color: #b80000;
}

.twblog-comment-actions-bar .twblog-btn-report:hover {
  color: #8b0000;
}

/* Wrapper pour positionner l’infobulle de signalement */
.twblog-report-wrap {
  position: relative;
  display: inline-block;
}

/* Infobulle (popover) du formulaire de signalement */
.twblog-report-popover {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  min-width: 220px;
  max-width: 280px;
  padding: 0;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.twblog-report-popover::before {
  content: "";
  position: absolute;
  left: 12px;
  top: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
  filter: drop-shadow(0 -1px 0 #e0e0e0);
}

.twblog-report-popover-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.twblog-report-popover-body .form-control.input-sm {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.twblog-report-popover-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.twblog-report-popover-actions .twblog-report-action {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: #333;
  cursor: pointer;
}

.twblog-report-popover-actions .twblog-report-action:hover {
  color: #000;
  text-decoration: underline;
}

.twblog-report-popover-actions .twblog-cancel-report {
  order: 1;
}

.twblog-report-popover-actions .twblog-report-send {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.twblog-report-popover-actions .twblog-report-send .twblog-icon {
  display: inline-flex;
}

.twblog-report-popover-actions .twblog-report-send .twblog-icon svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.twblog-comment-actions-bar .twblog-btn-reply {
  gap: 4px;
}

.twblog-comment-actions-bar .twblog-vote-arrow .twblog-icon {
  color: #ccc;
}

/* custom thème Legac */
#module-twblog-list .twblog-list {
  margin-top: 2rem;
}
#module-twblog-list h2,
#module-twblog-category h2 {
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
}
#module-twblog-list h3,
#module-twblog-category h3 {
  font-size: 20px;
}
#module-twblog-list h3 a:hover,
#module-twblog-category h3 a:hover,
.twblog-article-preview-category a:hover{
  color: #000;
  text-decoration: none;
}
.twblog-article-featured,
.twblog-article-preview {
  border: 1px solid #e9e9e9;
}
.twblog-article-preview-content {
  padding-top: 8px;
  border-top: 1px solid #e9e9e9;
}

.twblog-article-featured-category,
.twblog-article-featured-date,
.twblog-article-preview-category,
.twblog-article-preview-date {
  font-size: 14px;
}

.twblog-article-preview {
  margin-bottom: 1rem;
}
.twblog-category-filter-wrapper {
  height: 100%;
  background: #f6f6f6;
  .twblog-category-filter {
    position: sticky;
    top: 200px;
  }
}
.twblog-category-filter h3 {
  font-size: 20px;
  font-weight: bold;
  text-transform: uppercase;
}
#module-twblog-article h1,
#module-twblog-article h2,
#module-twblog-article h3,
#module-twblog-article h4 {
  font-weight: 600;
}
#module-twblog-article h1 {
  font-size: 2.5rem;
}
#module-twblog-article h2 {
  font-size: 2rem;
}
#module-twblog-article h3 {
  font-size: 1.75rem;
}

#module-twblog-article ul {
  list-style-type: disc;
  padding-left: 1.5rem;
}
#module-twblog-article .twblog-article-content a {
  text-decoration: underline;
}
#module-twblog-article .twblog-article a:hover {
  color: #000;
}

.twblog-pagination .pagination a {
  width: fit-content;
}
.twblog-pagination .pagination .page-item.active .page-link {
  background-color: var(--main-color);
  border: none;
}
.twblog-category-filter-item {
  margin-bottom: 8px;
}
.twblog-category-filter-item a:hover{
  text-decoration: none;
  font-weight: 500;
  color: #000;
}

.twblog-comment-form {
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid #e1e1e1;
}
.add-comment-label {
  font-size: 25px;
  font-weight: 600;
}

#module-twblog-article .twblog-article {
  margin-top: 50px;
}

#module-twblog-article .h-captcha {
  margin-top: 1rem;
}
