/* ============================================================================
   NOTIFICATIONS_STYLE.CSS
   Suit exactement l'ordre des sections du fichier notifications.html.

   Sommaire :
     0. Variables globales (couleurs, couleurs des CATÉGORIES, thèmes) & réinitialisation
     1. Barre supérieure (topbar)
     2. Zone principale
     3. Section 1 — En-tête : titre, actions groupées
     4. Section 2 — Filtres (état, catégories)
     5. Section 3 — Liste : cartes de notifications, état vide, erreur
     6. Boutons et éléments communs
     7. Version mobile (responsive)

   COULEURS DES CATÉGORIES (chacune a aussi une icône et un libellé écrit, pour
   rester reconnaissable sans la couleur ; une notification non lue porte en plus
   le mot « Nouveau ») :
     Discussions terre cuite   Sondages bleu-vert   Modération violet
     Aide et législation bleu  Initiatives ocre
   ============================================================================ */


/* ============================================================================
   0. VARIABLES GLOBALES & RÉINITIALISATION
   → Désormais défini une seule fois dans /assets/commun/commun_style.css (palette claire/sombre,
     base de la page, barre du haut) : ne pas le redéfinir ici.
   ============================================================================ */


/* -- Couleurs des catégories (jeton = barre/texte, teinte = fond léger) -- */
:root {
  --cat-discussion: #B5452D;  --cat-discussion-teinte: #F6E3DC;
  --cat-sondage: #1F6F78;     --cat-sondage-teinte: #D9ECEE;
  --cat-moderation: #6B4E8F;  --cat-moderation-teinte: #E8E0F1;
  --cat-contenu: #2A5C8F;     --cat-contenu-teinte: #DDE8F3;
  --cat-initiative: #8F6200;  --cat-initiative-teinte: #F5EBD0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme-effectif="clair"]) {
    --cat-discussion: #E27258;  --cat-discussion-teinte: #3A2620;
    --cat-sondage: #5DB5BF;     --cat-sondage-teinte: #1B3336;
    --cat-moderation: #B79AE0;  --cat-moderation-teinte: #2D2540;
    --cat-contenu: #6FA8DC;     --cat-contenu-teinte: #1E2F3F;
    --cat-initiative: #E0B84A;  --cat-initiative-teinte: #3A3320;
  }
}
html[data-theme-effectif="sombre"]:root {
  --cat-discussion: #E27258;  --cat-discussion-teinte: #3A2620;
  --cat-sondage: #5DB5BF;     --cat-sondage-teinte: #1B3336;
  --cat-moderation: #B79AE0;  --cat-moderation-teinte: #2D2540;
  --cat-contenu: #6FA8DC;     --cat-contenu-teinte: #1E2F3F;
  --cat-initiative: #E0B84A;  --cat-initiative-teinte: #3A3320;
}
.categorie-discussion { --couleur-cat: var(--cat-discussion); --teinte-cat: var(--cat-discussion-teinte); }
.categorie-sondage    { --couleur-cat: var(--cat-sondage);    --teinte-cat: var(--cat-sondage-teinte); }
.categorie-moderation { --couleur-cat: var(--cat-moderation); --teinte-cat: var(--cat-moderation-teinte); }
.categorie-contenu    { --couleur-cat: var(--cat-contenu);    --teinte-cat: var(--cat-contenu-teinte); }
.categorie-initiative { --couleur-cat: var(--cat-initiative); --teinte-cat: var(--cat-initiative-teinte); }


h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--ink);
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

mark {
  background: var(--clay-tint);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}


/* ============================================================================
   1. BARRE SUPÉRIEURE (TOPBAR)
   → Désormais défini une seule fois dans /assets/commun/commun_style.css (palette claire/sombre,
     base de la page, barre du haut) : ne pas le redéfinir ici.
   ============================================================================ */


/* ============================================================================
   2. ZONE PRINCIPALE
   ============================================================================ */
.notifications-main {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}


/* ============================================================================
   3. SECTION 1 — EN-TÊTE : TITRE, ACTIONS GROUPÉES
   ============================================================================ */
.notifications-entete h2 {
  font-size: calc(34px * var(--echelle-texte, 1));
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.notifications-intro {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: calc(16px * var(--echelle-texte, 1));
}
.actions-groupe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.actions-groupe .secondary-btn {
  padding: 8px 16px;
}
.actions-groupe button:disabled {
  opacity: .5;
  cursor: default;
}
.lien-preferences {
  margin-left: auto;
  color: var(--leaf);
  font-size: calc(14px * var(--echelle-texte, 1));
  font-weight: 500;
}
.lien-preferences:hover {
  text-decoration: underline;
}


/* ============================================================================
   4. SECTION 2 — FILTRES
   ============================================================================ */
.filtres {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filtres-ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filtre {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: calc(14px * var(--echelle-texte, 1));
}
.filtre[class*="categorie-"] {
  color: var(--couleur-cat);
  border-color: var(--couleur-cat);
}
.filtre:hover {
  border-color: var(--ink-soft);
}
.filtre-nombre {
  font-size: calc(12.5px * var(--echelle-texte, 1));
  font-weight: 600;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink);
}
/* Filtre choisi : rempli (neutre : encre ; catégorie : sa couleur) */
.filtre-actif {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.filtre-actif[class*="categorie-"] {
  background: var(--couleur-cat);
  border-color: var(--couleur-cat);
  color: var(--paper);
}
.filtre-actif .filtre-nombre {
  background: rgba(255, 255, 255, .25);
  color: inherit;
}


/* ============================================================================
   5. SECTION 3 — LISTE DES NOTIFICATIONS
   ============================================================================ */
.liste-section {
  margin-top: 24px;
}
.liste-notifications {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Carte : barre de couleur de la catégorie à gauche */
.notification {
  padding: 14px 16px 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--couleur-cat);
  border-radius: 4px;
  background: var(--paper);
}
/* Non lue : fond légèrement teinté et texte en gras */
.notification.non-lue {
  background: var(--paper-raised);
  border-color: var(--couleur-cat);
  border-left-width: 4px;
}
.notification.non-lue .notification-texte {
  font-weight: 600;
}
.notification-haut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
}
.etiquette-categorie {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  background: var(--teinte-cat);
  color: var(--couleur-cat);
  font-size: calc(12.5px * var(--echelle-texte, 1));
  font-weight: 600;
}
.notification-type {
  color: var(--muted);
  font-size: calc(13px * var(--echelle-texte, 1));
}
.mention-nouveau {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--couleur-cat);
  color: var(--paper);
  font-size: calc(11.5px * var(--echelle-texte, 1));
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.notification-texte {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.notification-date {
  display: block;
  color: var(--muted);
  font-size: calc(13px * var(--echelle-texte, 1));
}
.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.petit-btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: calc(13px * var(--echelle-texte, 1));
}
.danger-btn:hover {
  border-color: var(--clay);
  color: var(--clay);
}

/* Aucune notification / visiteur */
.etat-vide {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  text-align: center;
  color: var(--ink-soft);
}
.etat-vide-titre {
  margin: 0 0 6px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: calc(18px * var(--echelle-texte, 1));
  color: var(--ink);
}
.etat-vide p {
  margin: 0 0 8px;
}
.lien-bouton {
  display: inline-block;
  margin-top: 6px;
}

/* Erreur */
.notifications-erreur {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--clay);
  border-radius: 4px;
  background: var(--clay-tint);
  color: var(--ink);
}

.liste-pied {
  margin-top: 18px;
  text-align: center;
}


/* ============================================================================
   6. BOUTONS ET ÉLÉMENTS COMMUNS
   ============================================================================ */
.primary-btn {
  background: var(--clay);
  color: #fff;
  border: 1px solid var(--clay);
  padding: 10px 20px;
  border-radius: 3px;
  font-size: calc(14px * var(--echelle-texte, 1));
  font-weight: 500;
}
.primary-btn:hover {
  opacity: .9;
}
.secondary-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink-soft);
  padding: 10px 22px;
  border-radius: 3px;
  font-size: calc(14px * var(--echelle-texte, 1));
  font-weight: 500;
}
.secondary-btn:hover {
  background: var(--paper-raised);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.filtre:focus-visible,
.lien-preferences:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
}


/* ============================================================================
   7. VERSION MOBILE (RESPONSIVE)
   ============================================================================ */
@media (max-width: 640px) {
  
  .notifications-main {
    padding: 22px 16px 48px;
  }
  .notifications-entete h2 {
    font-size: calc(28px * var(--echelle-texte, 1));
  }
  .lien-preferences {
    margin-left: 0;
    flex-basis: 100%;
  }
  .mention-nouveau {
    margin-left: 0;
  }
}
