/* ── LAYOUT ───────────────────────────────────────── */

.accueil {
  display: flex;
  min-height: calc(100vh - 72px);
}

/* ── LEFT SIDEBAR ────────────────────────────────── */

.categorie-sidebar {
  width: 250px;
  flex-shrink: 0;

  background: var(--bg2);

  border-right: 1.5px solid var(--border);

  padding: 24px 0;

  position: sticky;
  top: 72px;

  height: calc(100vh - 72px);

  overflow-y: auto;
}

.sidebar-section-title {
  padding: 0 20px;
  margin-bottom: 14px;

  color: var(--text-muted);

  font-size: 0.72rem;
  font-weight: 700;

  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.categories {
  display: flex;
  flex-direction: column;
}

/* ── DROPDOWN ────────────────────────────────────── */

.dropdown {
  display: flex;
  flex-direction: column;
}

.categorie {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 11px 20px;

  border-left: 3px solid transparent;

  transition: var(--transition);

  font-size: 0.92rem;
  font-weight: 500;

  cursor: pointer;
}

.categorie::after {
  content: "";
  width: 14px;
  height: 14px;

  background-image: url("../img/chevron-right.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  transition: transform 0.2s ease;
}

.dropdown.open .categorie::after {
  transform: rotate(90deg);
}

.categorie:hover {
  background: var(--accent);
  color: var(--accent-dark);

  border-left-color: var(--accent-strong);
}

.categorie.active {
  background: var(--bg);

  color: var(--accent-strong);

  border-left-color: var(--accent-strong);

  font-weight: 700;
}

/* ── SUBMENU ─────────────────────────────────────── */

.submenu {
  display: none;
  flex-direction: column;

  margin-left: 16px;
  margin-right: 10px;
  margin-bottom: 6px;

  border-left: 2px solid var(--accent);

  overflow: hidden;
}

.dropdown.open .submenu {
  display: flex;
}

.submenu a {
  padding: 9px 14px;

  font-size: 0.84rem;

  color: var(--text-muted);

  transition: var(--transition);
}

.submenu a:hover {
  background: var(--bg);
  color: var(--accent-strong);
}

/* ── MAIN CONTENT ───────────────────────────────── */

.main-content {
  flex: 1;

  padding: 28px 32px;
}

/* ── CONTENT HEADER ─────────────────────────────── */

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 16px;

  flex-wrap: wrap;

  margin-bottom: 20px;
}

.content-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;

  flex-wrap: wrap;
}

/* ── SELECTS ────────────────────────────────────── */

.sort-select,
.per-page-select {
  border: 1.5px solid var(--accent);
  border-radius: 7px;

  background: white;

  padding: 8px 14px;

  outline: none;

  cursor: pointer;

  transition: var(--transition);
}

.sort-select:focus,
.per-page-select:focus {
  border-color: var(--accent-strong);
}

/* ── FILTERS ────────────────────────────────────── */

.tag-filter-bar,
.active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;

  margin-bottom: 16px;
}

.active-filters {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ── TOPIC CARD ─────────────────────────────────── */

.topic-card {
  background: white;

  border: 1.5px solid var(--border);

  border-radius: 2px;

  padding: 18px 20px;

  margin-bottom: 14px;

  cursor: pointer;

  transition: var(--transition);
}



.topic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 12px;

  margin-bottom: 8px;
}

.topic-card-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.topic-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;

  margin-bottom: 12px;

  color: var(--text-muted);

  font-size: 0.8rem;
}

.topic-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  margin-bottom: 14px;
}

.topic-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topic-stats {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topic-stat {
  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 0.82rem;
  color: var(--text-muted);
}

.topic-stat img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

/* ── PAGINATION ─────────────────────────────────── */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  margin-top: 26px;
}

/* ── RIGHT SIDEBAR ──────────────────────────────── */

.right-sidebar {
  width: 240px;
  flex-shrink: 0;

  background: var(--bg2);

  border-left: 1.5px solid var(--border);

  padding: 28px 18px;
}

.right-sidebar h3 {
  font-size: 1rem;
  font-weight: 700;

  color: var(--accent-dark);

  margin-bottom: 14px;
}

.popular-topic {
  display: flex;
  flex-direction: column;
  gap: 4px;

  padding: 12px 0;

  border-bottom: 1px solid var(--border);

  cursor: pointer;

  transition: var(--transition);
}

.popular-topic:last-child {
  border-bottom: none;
}

.popular-topic:hover .popular-topic-title {
  color: var(--accent-strong);
}

.popular-topic-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.popular-topic-score {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ── TAG INPUT ──────────────────────────────────── */

.tags-input-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;

  min-height: 46px;

  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);

  padding: 8px 10px;

  cursor: text;
}

.tags-input-area input {
  border: none;
  outline: none;

  flex: 1;
  min-width: 120px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: var(--accent);

  color: var(--accent-dark);

  border-radius: 999px;

  padding: 5px 10px;

  font-size: 0.78rem;
  font-weight: 600;
}

.tag-pill-remove {
  width: 16px;
  height: 16px;

  border: none;

  background: transparent;

  background-image: url("../img/close.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  cursor: pointer;
}

.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  margin-top: 8px;
}

/* ── TOAST ───────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;

  z-index: 999;
}

/* ── RESPONSIVE ─────────────────────────────────── */

@media (max-width: 1200px) {
  .right-sidebar {
    display: none;
  }
}

@media (max-width: 920px) {
  .accueil {
    flex-direction: column;
  }

  .categorie-sidebar {
    width: 100%;
    height: auto;

    position: relative;
    top: 0;

    border-right: none;
    border-bottom: 1.5px solid var(--border);
  }

  .main-content {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .content-header {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar > * {
    flex: 1;
  }

  .topic-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}