/* Reset et base moderne */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  background: #ffffff;
  min-height: 100vh;
  color: #2d3748;
}

/* Variables CSS modernes */
:root {
  --primary-color: #6b7280;
  --primary-dark: #4b5563;
  --primary-light: #9ca3af;
  --secondary-color: #06b6d4;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #e2e8f0;
  
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* Mode sombre */
html[data-theme='dark'] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3a3a3a;
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
  --border-color: #4a5568;
  --border-light: #2d3748;
}

html[data-theme='dark'] body {
  background: #1a1a1a;
}

/* Navbar moderne - Override Bulma */
.navbar,
.navbar.is-primary {
  background: #f8f9fa !important;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 20;
}

html[data-theme='dark'] .navbar,
html[data-theme='dark'] .navbar.is-primary {
  background: #2d3748 !important;
  border-bottom: 1px solid #4a5568;
}

/* Bannière logo modernisée */
.logo-banner {
  background: linear-gradient(135deg, #0f172a, #1e293b, #111827) !important;
  padding: 1.5rem 0 !important;
  position: relative;
  overflow: hidden;
  text-align: center !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer plus fin */
.footer {
  padding-top: 1.25rem !important;
  padding-bottom: 1.25rem !important;
}

.footer .content {
  margin-bottom: 0;
}

/* Quill toolbar plus compacte */
.ql-toolbar.ql-snow {
  padding: 4px 6px;
}

.ql-toolbar.ql-snow .ql-formats {
  margin-right: 6px;
}

.ql-toolbar.ql-snow button svg {
  width: 14px;
  height: 14px;
}

.ql-toolbar.ql-snow button {
  padding: 2px 3px;
}

.logo-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.logo-banner-img {
  width: 96px !important;
  height: 96px !important;
  object-fit: cover;
  border-radius: 50% !important;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  position: relative;
  top: -8px; /* remonte légèrement le logo */
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-banner-img:hover {
  transform: scale(1.15);
  box-shadow: 0 14px 28px rgba(0,0,0,0.5);
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
}

.navbar-brand .navbar-item,
.navbar.is-primary .navbar-brand .navbar-item {
  color: var(--primary-color) !important;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  max-width: 70vw; /* évite de prendre toute la largeur sur mobile */
}

.navbar-burger {
  margin-left: 0.5rem;
  position: relative;
  z-index: 3; /* passe au-dessus de la zone cliquable du brand */
}

.navbar-item,
.navbar.is-primary .navbar-item,
.navbar.is-primary .navbar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-secondary) !important;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: var(--radius-md);
  margin: 0 0.25rem;
}

.navbar-brand .navbar-item,
.navbar.is-primary .navbar-brand .navbar-item {
  color: var(--primary-color) !important;
  font-weight: 700;
  font-size: 1.25rem;
  padding: 0;
  margin: 0;
}

.navbar-item:hover,
.navbar.is-primary .navbar-item:hover,
.navbar.is-primary .navbar-link:hover {
  background: var(--bg-secondary) !important;
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

.navbar-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1400px; /* un peu plus large pour éviter le retour à la ligne, sans trop étirer */
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .navbar {
    position: relative;
  }
  .navbar-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0.5rem 1rem 1rem 1.5rem;
  }
  .navbar-menu.is-active {
    display: flex;
  }
  .navbar-start,
  .navbar-end {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
  }
  .navbar-item,
  .navbar.is-primary .navbar-item,
  .navbar.is-primary .navbar-link {
    width: auto;
    justify-content: center;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  /* Sur mobile on cache le texte de la marque pour libérer le burger */
  .navbar.is-primary .navbar-brand .navbar-item {
    display: none !important;
  }
  /* Sur mobile, simplifier la zone de droite (notif / messages / profil) */
  .navbar-end {
    margin-top: 0.5rem;
  }
  .navbar-end .navbar-item.has-dropdown {
    width: 100%;
  }
  .navbar-end .navbar-item.has-dropdown .navbar-link {
    width: 100%;
    justify-content: space-between;
  }
  .navbar-end .navbar-item.has-dropdown .navbar-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    margin-top: 0.25rem;
    width: 100%;
  }

  /* Sur mobile, les liens Notifications / Messages / Profil (bloc is-hidden-desktop)
     sont affichés en ligne comme les autres items */
  .navbar-end .is-hidden-desktop {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-top: 0.35rem;
  }

  .navbar-end .is-hidden-desktop .navbar-item {
    flex: 0 0 auto;
    width: auto !important;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    justify-content: center;
  }
}

.navbar-start {
  display: flex;
  align-items: center;
}

.navbar-end {
  display: flex;
  align-items: center;
}

/* resserrer légèrement l'espacement entre notifications / messages / profil */
.navbar-end .navbar-item {
  margin: 0 0.15rem;
}

/* Dropdown moderne */

/* Style spécial pour notifications et messages */
.navbar-item.has-dropdown .navbar-link {
  background: #4b5563 !important;
  color: white !important;
  border-radius: var(--radius-md);
  margin: 0 0.25rem;
  padding: 0.35rem 0.75rem; /* plus compact */
  font-size: 0.85rem;       /* texte un peu plus petit */
  transition: all 0.3s ease;
}

.navbar-item.has-dropdown .navbar-link:hover {
  background: #374151 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Masquer la flèche par défaut de Bulma (on utilise nos icônes Font Awesome) */
.navbar-item.has-dropdown .navbar-link::after {
  border-color: transparent !important;
}

/* Espacement correct pour les icônes et badges */
.navbar-item.has-dropdown .navbar-link .icon {
  margin-right: 0.35rem;
}

.navbar-item.has-dropdown .navbar-link .tag {
  margin-left: 0.35rem;
  margin-right: 0.5rem; /* Espace pour la flèche */
}

/* Style des badges de notification */
.navbar-item.has-dropdown .tag.is-danger,
.navbar-item.has-dropdown .tag.is-info {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Exception pour le dropdown profil - garder plus clair */
.navbar-item.has-dropdown:last-child .navbar-link {
  background: #9ca3af !important;
  color: var(--text-primary) !important;
}

.navbar-item.has-dropdown:last-child .navbar-link:hover {
  background: #6b7280 !important;
  color: white !important;
}

.navbar-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  z-index: 1001;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  transition: all 0.3s ease 0.1s;
}

.navbar-item.has-dropdown:hover .navbar-dropdown,
.navbar-item.has-dropdown.is-active .navbar-dropdown,
.navbar-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Zone de transition pour éviter que le dropdown disparaisse */
.navbar-item.has-dropdown {
  position: relative;
}

.navbar-item.has-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 15px;
  background: transparent;
  z-index: 999;
}


/* Transition rapide à l'ouverture */
.navbar-item.has-dropdown:hover .navbar-dropdown {
  transition: all 0.2s ease;
}

.navbar-dropdown .navbar-item {
  display: block;
  padding: 0.75rem 1rem;
  margin: 0;
  border-radius: 0;
  white-space: nowrap;
}

.navbar-dropdown .navbar-item:first-child {
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.navbar-dropdown .navbar-item:last-child {
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Amélioration du contenu des dropdowns */
.navbar-dropdown .navbar-item {
  font-size: 0.875rem;
  line-height: 1.4;
}

.navbar-dropdown .navbar-item small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.navbar-dropdown .navbar-item:hover {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

.navbar-dropdown .has-text-link:hover {
  color: var(--primary-color) !important;
}

/* Divider style */
.navbar-dropdown hr.navbar-divider {
  margin: 0.5rem 0;
  border: none;
  height: 1px;
  background: var(--border-color);
}

.navbar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
  border: none;
}

/* Tags/badges modernes */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Ligne d'actions d'un post (réactions + menu ...) */
.topic-post .media-content {
  position: relative;
  padding-bottom: 2.25rem; /* réserve de la place pour la barre d'actions en bas */
}

.topic-actions-row {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* actions collées à droite */
  gap: 0.5rem;
}

/* Barre de réactions sous les posts */
.post-reactions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  background: var(--bg-secondary);
}

.post-reactions .button {
  border-radius: 9999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  border: 1px solid transparent;
}

.post-reactions .button:hover {
  border-color: var(--border-color);
  background: #e5e7eb;
}

.post-reactions .button .js-react-count {
  min-width: 1.3rem;
  display: inline-block;
  text-align: center;
}

.topic-actions-more {
  display: flex;
  align-items: center;
}

.tag.is-info {
  background: var(--info-color);
  color: white;
}

.tag.is-danger {
  background: var(--danger-color);
  color: white;
}

.tag.is-success {
  background: var(--success-color);
  color: white;
}

.tag.is-warning {
  background: var(--warning-color);
  color: white;
}

/* Container et section */
.section {
  padding: 2rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Cards modernes */
.box, .card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.box:hover, .card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Boutons modernes */
.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.button.is-primary, .btn-primary {
  background: var(--primary-color);
  color: white;
}

.button.is-primary:hover, .btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button.is-secondary, .btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.button.is-secondary:hover, .btn-secondary:hover {
  background: var(--bg-tertiary);
}

.button.is-danger, .btn-danger {
  background: var(--danger-color);
  color: white;
}

.button.is-danger:hover, .btn-danger:hover {
  background: #dc2626;
}

/* Formulaires modernes */
.field {
  margin-bottom: 1.5rem;
}

.label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.input, .textarea, .select select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.input:focus, .textarea:focus, .select select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Tables modernes */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table th, .table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.table tr:hover {
  background: var(--bg-secondary);
}

/* Icônes */
.icon {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
}

.icon-only {
  margin-right: 0;
}

/* Utilitaires */
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mr-4 { margin-right: 1rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

.has-text-grey { color: var(--text-muted); }
.has-text-link { color: var(--primary-color); }
.has-text-danger { color: var(--danger-color); }
.has-text-success { color: var(--success-color); }

/* Responsive */
@media (max-width: 768px) {
  .navbar-menu {
    flex-direction: row;
    flex-wrap: wrap;
    /* espace bas augmenté, adapté à la barre Safari (safe-area) */
    padding: 0.75rem 1rem calc(env(safe-area-inset-bottom, 0) + 3.5rem) 1rem;
  }
  
  .navbar-start,
  .navbar-end {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
  }
  
  .navbar-item {
    width: auto;
    justify-content: center;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  .box, .card {
    padding: 1.25rem;
  }

  /* Forum: liste des sujets, meilleure lisibilité mobile */
  .forum-topic-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .forum-topic-box .has-text-right {
    text-align: left;
    margin-right: 0;
  }

  /* Sujet: posts en colonne sur mobile */
  .topic-post .media {
    flex-direction: column;
  }
  .topic-post .media-left {
    width: 100% !important;
    margin-bottom: 0.75rem;
  }
  .topic-post .media-content {
    width: 100%;
  }

  /* Barre d'actions des posts : ne pas la coller en absolu sur mobile */
  .topic-post .media-content {
    position: static;
    padding-bottom: 0.75rem;
  }
  .topic-actions-row {
    position: static;
    margin-top: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .navbar-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--bg-secondary);
    margin-top: 0.5rem;
    border-radius: var(--radius-md);
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  .box, .card {
    padding: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Layout type Docy pour la page d'accueil */
.kb-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, #eef2ff, #eff6ff);
}

html[data-theme='dark'] .kb-hero {
  background: linear-gradient(135deg, #111827, #1f2937);
}

.kb-hero-main {
  flex: 1 1 auto;
}

.kb-hero-title {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.kb-hero-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.kb-hero-search {
  margin-bottom: 1.5rem;
}

.kb-hero-search-input {
  border-radius: 9999px;
}

.kb-hero-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kb-hero-shortcuts .button {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

html[data-theme='dark'] .kb-hero-shortcuts .button {
  background: rgba(15, 23, 42, 0.9);
}

.kb-hero-meta {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding-left: 1.5rem;
  border-left: 1px solid rgba(148, 163, 184, 0.5);
}

.kb-hero-stat {
  display: flex;
  flex-direction: column;
}

.kb-hero-stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kb-hero-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.kb-layout {
  align-items: flex-start;
}

.kb-sidebar-box,
.kb-aside-box {
  padding: 1.5rem;
}

.kb-sidebar-title {
  margin-bottom: 1rem;
}

.kb-category-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 420px;
  overflow-y: auto;
}

.kb-category-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.kb-category-nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.kb-category-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--primary-color);
}

.kb-category-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kb-aside-ad {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  background: var(--bg-secondary);
}

.kb-aside-ad + .kb-aside-ad {
  margin-top: 0.75rem;
}

.kb-category-block {
  scroll-margin-top: 120px;
}

.kb-category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.kb-category-icon-wrapper {
  flex: 0 0 auto;
}

.kb-category-icon img {
  border-radius: 1rem;
}

.kb-category-placeholder-icon {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  background: var(--bg-secondary);
}

.kb-category-title {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.kb-category-description {
  font-size: 0.9rem;
}

.kb-forum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

.kb-forum-card {
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.kb-forum-card:hover {
  border-color: var(--border-color);
  background: var(--bg-secondary);
}

.kb-forum-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.kb-forum-description {
  font-size: 0.85rem;
}

.kb-inbox {
  margin-bottom: 2rem;
}

.kb-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.kb-inbox-messages {
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  background: var(--bg-secondary);
}

.kb-latest-topics .kb-latest-topic-item + .kb-latest-topic-item {
  margin-top: 0.5rem;
}

.kb-aside-box p {
  margin-bottom: 0.25rem;
}

@media (max-width: 1023px) {
  .kb-hero {
    flex-direction: column;
  }

  .kb-hero-meta {
    flex-direction: row;
    justify-content: space-between;
    padding-left: 0;
    padding-top: 1rem;
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.5);
  }
}

@media (max-width: 768px) {
  .kb-hero-title {
    font-size: 1.75rem;
  }

  .kb-hero {
    padding: 1.5rem;
  }
}

/* Hamburger menu pour mobile */
.navbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.navbar-burger span,
.navbar.is-primary .navbar-burger span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--text-primary) !important;
  margin: 2px 0;
  transition: 0.3s;
  border-radius: 1px;
}

@media (max-width: 1023px) {
  .navbar-burger {
    display: flex;
  }
  
  /* Sur mobile, le menu pousse le contenu et scrolle avec la page
     pour éviter tout recouvrement avec la barre Safari */
  .navbar-menu {
    display: none;
    position: static;
    width: 100%;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    /* même logique : marge bas supplémentaire pour rester au-dessus de la barre Safari */
    padding: 0.5rem 1rem calc(env(safe-area-inset-bottom, 0) + 3.5rem) 1rem;
  }
  
  .navbar-menu.is-active {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Amélioration de la lisibilité */
p {
  margin-bottom: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

a {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Messages d'alerte */
.notification, .alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

/* Meilleure réponse dans un sujet */
.topic-post.best-answer {
  border-color: var(--success-color);
  box-shadow: 0 0 0 1px rgba(16,185,129,0.3), var(--shadow-md);
}

/* Assurer le wrapping correct du contenu des posts */
.topic-post .content {
  display: block;
  width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden; /* empêche tout débordement horizontal visuel */
}

/* Messages masqués (utilisateur ignoré) */
.blocked-post-warning {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

.blocked-post-content.is-hidden {
  display: none;
}

/* Lien de signalement dans les MP (discret) */
.pm-report-link {
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.5rem;
  color: #c53030; /* rouge discret */
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.pm-report-link .icon {
  margin-right: 0;
}

.pm-report-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Modals au-dessus de tout (navbar comprise) */
.modal.is-active {
  z-index: 999 !important;
}

/* Page de recherche */
.kb-search-header {
  margin-bottom: 2rem;
}

.kb-search-results {
  margin-top: 1rem;
}

.kb-search-item {
  padding: 0.75rem 0;
}

.kb-search-item-icon {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.35rem;
}

.kb-topic-logo {
  width: 32px;
  height: 32px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.kb-category-icon-search img {
  border-radius: 1rem;
}

.kb-topic-logo-letter {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
}

.kb-search-item-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kb-search-item-title {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.kb-search-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.kb-search-item-snippet {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.notification.is-info, .alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--info-color);
  color: #1e40af;
}

.notification.is-success, .alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success-color);
  color: #059669;
}

.notification.is-warning, .alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning-color);
  color: #d97706;
}

.notification.is-danger, .alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger-color);
  color: #dc2626;
}
