/* ============================================================================
   SETTING_STYLE.CSS
   Suit le même ordre que setting.html.

   Sommaire :
     0. Variables globales & réinitialisation
     1. Barre supérieure
     2. Structure générale (shell)
     3. Menu latéral
     4. Contenu principal — en-tête de page
     5. Sections de paramètres (bloc commun à Affichage / Accessibilité /
        Notifications / Confidentialité)
     6. Composants de formulaire (champs, interrupteurs, boutons)
     7. États techniques communs
     8. VARIANTES D'ACCESSIBILITÉ — appliquées via des attributs sur <html>
        par setting_java.js (thème, taille de police, contraste, daltonisme,
        police lisible, interligne, mouvement réduit)
     9. Responsive
   ============================================================================ */


/* ============================================================================
   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.
   ============================================================================ */
:root {
  --duree-transition: .15s;
}


/* Thème choisi explicitement dans les paramètres (voir section 8) */


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, select { font-family: inherit; }


/* ============================================================================
   1. BARRE SUPÉRIEURE
   → 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.
   ============================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}


.btn { border: 1px solid var(--line); background: transparent; color: var(--ink-soft); padding: 8px 16px; border-radius: 3px; font-size: calc(13.5px * var(--echelle-texte, 1)); font-weight: 500; }
.btn:hover { border-color: var(--ink-soft); color: var(--ink); }

.icon-btn[aria-current="page"] { border-color: var(--leaf); background: var(--leaf-tint); }


/* ============================================================================
   2. STRUCTURE GÉNÉRALE (SHELL)
   ============================================================================ */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  max-width: 1180px;
  margin: 0 auto;
}


/* ============================================================================
   3. MENU LATÉRAL
   ============================================================================ */
.sidebar { padding: 26px 20px 40px; border-right: 1px solid var(--line); min-height: calc(100vh - 68px); }
.nav-group { margin-bottom: 26px; }
.nav-label { font-size: calc(12px * var(--echelle-texte, 1)); color: var(--muted); margin: 0 0 10px 10px; font-weight: 500; }
.followed-causes { list-style: none; margin: 4px 0 0; padding: 0; }
.followed-causes li { padding: 7px 10px 7px 20px; font-size: calc(13.5px * var(--echelle-texte, 1)); color: var(--ink-soft); display: flex; justify-content: space-between; border-radius: 3px; }
.followed-causes li:hover { background: var(--paper-raised); color: var(--ink); }
.followed-causes .count { color: var(--muted); font-size: calc(12px * var(--echelle-texte, 1)); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 3px; color: var(--ink-soft); font-size: calc(14px * var(--echelle-texte, 1)); font-weight: 500; border-left: 2px solid transparent; }
.nav-link:hover { background: var(--paper-raised); color: var(--ink); }
.nav-link .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex-shrink: 0; }


/* ============================================================================
   4. CONTENU PRINCIPAL — EN-TÊTE DE PAGE
   ============================================================================ */
.main { padding: 34px 30px 70px; min-width: 0; }
.page-wrap { max-width: 640px; margin: 0 auto; }
.page-eyebrow { font-size: calc(12.5px * var(--echelle-texte, 1)); color: var(--muted); margin-bottom: 8px; }
.page-title { font-size: calc(30px * var(--echelle-texte)); font-weight: 600; margin-bottom: 10px; }
.page-lede { font-size: calc(14.5px * var(--echelle-texte, 1)); color: var(--ink-soft); margin-bottom: 34px; }


/* ============================================================================
   5. SECTIONS DE PARAMÈTRES
   Bloc commun réutilisé par Affichage / Accessibilité / Notifications /
   Confidentialité (chacune un <form class="param-section">).
   ============================================================================ */
.param-section {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 4px;
  padding: 22px 24px;
  margin-bottom: 22px;
}
.param-titre {
  font-size: calc(17px * var(--echelle-texte));
  font-weight: 600;
  margin-bottom: 4px;
}
.param-desc {
  font-size: calc(13px * var(--echelle-texte, 1));
  color: var(--muted);
  margin: 0 0 18px;
}
.badge-proposition {
  display: inline-block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: calc(10.5px * var(--echelle-texte, 1));
  font-weight: 500;
  color: var(--clay);
  background: var(--clay-tint);
  padding: 2px 8px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 6px;
}


/* ============================================================================
   6. COMPOSANTS DE FORMULAIRE
   ============================================================================ */
.champ {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.champ:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.champ > label,
.champ-titre-simple {
  display: block;
  font-size: calc(13.5px * var(--echelle-texte, 1));
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.champ-aide {
  font-size: calc(12px * var(--echelle-texte, 1));
  color: var(--muted);
  margin: 2px 0 8px;
  line-height: 1.5;
}

.champ select,
.champ input[type="range"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 3px;
  padding: 9px 12px;
  font-size: calc(14px * var(--echelle-texte, 1));
  color: var(--ink);
}
.champ select:focus,
.champ input:focus {
  outline: 2px solid var(--leaf);
  outline-offset: 1px;
}

.echelle {
  display: flex;
  justify-content: space-between;
  font-size: calc(11px * var(--echelle-texte, 1));
  color: var(--muted);
  margin-top: 6px;
}

/* -- Ligne "bascule" : intitulé + description à gauche, interrupteur à droite -- */
.champ-bascule {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.champ-bascule > div { flex: 1; }
.champ-bascule label { margin-bottom: 2px; }
.champ-bascule .champ-aide { margin-bottom: 0; }

/* Interrupteur (checkbox stylée) — reste un vrai <input type="checkbox">
   pour être nativement compatible avec les lecteurs d'écran et le clavier */
.interrupteur {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 20px;
  background: var(--line);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--duree-transition) ease;
}
.interrupteur::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper-raised);
  transition: transform var(--duree-transition) ease;
}
.interrupteur:checked {
  background: var(--leaf);
}
.interrupteur:checked::after {
  transform: translateX(18px);
}
.interrupteur:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
}

.section-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.feedback {
  font-size: calc(12.5px * var(--echelle-texte, 1));
  color: var(--leaf);
}
.btn-enregistrer {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 9px 18px;
  border-radius: 3px;
  font-size: calc(13.5px * var(--echelle-texte, 1));
  font-weight: 500;
}
.btn-enregistrer:hover { background: var(--leaf); }

.btn-secondaire {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 3px;
  font-size: calc(13px * var(--echelle-texte, 1));
  font-weight: 500;
}
.btn-secondaire:hover { border-color: var(--leaf); color: var(--leaf); }


/* ============================================================================
   7. ÉTATS TECHNIQUES COMMUNS
   ============================================================================ */
.loading-placeholder {
  font-size: calc(13px * var(--echelle-texte, 1));
  color: var(--muted);
  padding: 12px 4px;
}


/* ============================================================================
   8. VARIANTES D'ACCESSIBILITÉ
   Ces règles réagissent à des attributs posés sur <html> par
   appliquerParametresAffichage() / appliquerParametresAccessibilite() dans
   setting_java.js. Elles s'appliquent donc à TOUTE la page (pas seulement à
   ce formulaire), pour que le réglage soit immédiatement visible partout.
   ============================================================================ */

/* Les règles de chaque variante (taille du texte, couleur d'accentuation,
   contraste, daltonisme, police lisible, interligne, animations) sont
   désormais dans /assets/commun/commun_style.css (section 5) pour s'appliquer
   à toutes les pages, pas seulement à celle-ci. */

html[data-interligne="large"] .champ-aide,
html[data-interligne="large"] .param-desc {
  line-height: 1.7;
}

.param-section-derniere { margin-bottom: 0; }


/* ============================================================================
   9. RESPONSIVE
   ============================================================================ */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 560px) {
  .champ-bascule { flex-direction: column; align-items: flex-start; gap: 10px; }
}
