header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  transition: all 0.3s ease;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;    /* largeur max */
  margin: 0 auto;       /* centre horizontalement */
}


header h1 {
  margin: 0;
  font-size: 1.5rem;
  transition: font-size 0.3s ease;
}

header nav {
  display: flex;
  gap: 1.5rem;
}

header.scrolled {
  padding: 0.4rem 1rem;       /* réduit la hauteur */
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

header.scrolled h1 {
  font-size: 1.1rem;
}



header .logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

header nav {
  display: flex;
  gap: 1.5rem;
}

header nav a {
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  transition: color 0.2s;
}

header nav a:hover {
  color: #111827;
}

header .user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: #374151;
}
/* Bouton déconnexion plus doux */
.logout-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  background-color: #fee2e2; /* rouge pastel */
  color: #b91c1c; /* rouge foncé mais lisible */
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s;
}

.logout-btn:hover {
  background-color: #fecaca; /* un peu plus soutenu au hover */
  color: #991b1b;
}


.navbar {
  display: flex;
  justify-content: center; /* centre horizontalement */
  gap: 1.5rem;             /* espace entre les liens */
  padding: 1rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.navbar a {
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar a:hover {
  color: #111827;
}


/* === Tooltips === */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: max-content;
  background-color: #111827;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  position: absolute;
  z-index: 1;
  bottom: 125%; /* au-dessus */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8rem;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* === Base === */
body {
  font-family: "Inter", system-ui, sans-serif;
  background: #fdfdfd;
  margin: 0;
  padding: 0;
  color: #2d2d2d;
  line-height: 1.6;
}

h2 {
  margin: 1.5rem 0 1rem;
  font-size: 1.6rem;
  color: #111;
}

/* === Layout container === */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* === Cards === */
.post-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  background-color: #e5e7eb; /* gris doux */
  color: #111827; /* gris foncé */
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover {
  background-color: #d1d5db; /* hover doux */
  color: #000;
}

/* === Tags === */
.tag {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: default;
  transition: opacity 0.2s ease;
}

.tag a {
  color: #0c4a6e;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

/* Effacer tout bouton */
.clear-tags {
  font-size: 0.85rem;
  color: #9ca3af;
  cursor: pointer;
  margin-left: 1rem;
}

.clear-tags:hover {
  color: #ef4444;
}

/* === Responsive === */
@media (max-width: 640px) {
  .container {
    max-width: 100%;
    padding: 0.8rem;
  }

  .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.6rem;
  }

  input[type="text"] {
    width: 100%;
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
  }

  .tag {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
  }
}
