:root{
  /* ===================== BASE ===================== */
  --c-text: #222;
  --c-bg-body: #CFC7BC;

  --c-primary: #1e4ed8;

  /* neutres */
  --c-white: #fff;
  --c-gray-1: #f7f9fc;
  --c-gray-2: #eee;
  --c-gray-3: #ddd;
  --c-gray-4: #ccc;
  --c-gray-5: #999;
  --c-gray-6: #666;

  /* ===================== TITRES ===================== */
  --c-title: var(--c-primary);
  --c-title-shadow-1: navy;
  --c-title-shadow-2: var(--c-white);
  --c-title-shadow-3: black;

  /* ===================== MENUS ===================== */
  --c-menu-1: #fccf47;
  --c-menu-2: #ffab91;
  --c-menu-3: #90caf9;
  --c-menu-4: #a5d6a7;

  --c-menu-hover: #ffd54f;
  --c-menu-text: #333;
  --c-menu-shadow: #c9a94f;
  --c-menu-danger: #FF2805;
  --c-menu-border: var(--c-gray-4);

  /* ===================== SUBMENU ===================== */
  --c-submenu-bg: var(--c-white);
  --c-submenu-border: var(--c-gray-3);
  --c-submenu-hover: var(--c-gray-2);
  --c-submenu-separator: grey;

  /* ===================== ETATS (menu / contenu) ===================== */
  --c-state-draft: #f5a627;
  --c-state-deleted: red;
  --c-state-pending: blue;
  --c-state-archived: #4CAF50;

  --c-draft-bg: #ffe;
  --c-deleted-bg: #ffe;
  --c-pending-bg: #fef;
  --c-archived-bg: #efe;

  /* ===================== FLASH ===================== */
  --c-flash-bg: #cfffcf;
  --c-flash-border: #3c3;

  /* ===================== TITRES PAGE ===================== */
  --c-main-title-bg: var(--c-gray-1);
  --c-main-title-border: var(--c-primary);

  /* ===================== BREADCRUMB ===================== */
  --c-breadcrumb-bg: rgba(255,255,255,0.5);
  --c-breadcrumb-shadow: var(--c-gray-3);
  --c-breadcrumb-link: #0077cc;

  /* ===================== BADGES ===================== */
  --c-badge-border: black;
  --c-badge-draft-bg: #f0ad4e;
  --c-badge-text: black;
  --c-badge-bg: var(--c-white);
  --c-badge-deleted-text: red;

  /* ===================== ARTICLES ===================== */
  --c-article-bg: rgba(255,255,255,0.5);
  --c-article-border: black;
  --c-article-left-border: var(--c-gray-4);
  --c-article-shadow: rgba(0,0,0,0.05);
  --c-article-watermark: rgba(255,0,0,0.2);

  --c-article-info-bg:#dceefc;
  --c-article-devoir-bg:#f2e3c6;

  --c-article-draft-bg: rgba(255,250,204,0.5);
  --c-article-draft-border: #F5A627;

  --c-article-deleted-bg: rgba(242, 216, 187,0.5);
  --c-article-deleted-border: red;

  --c-article-published-border: var(--c-primary);
  
  --c-article-archived-bg: rgba(200, 200, 200,0.5);
  --c-article-archived-border: var(--c-state-archived);
  
  --c-article-pending-bg: rgba(242, 228, 234,0.5);
  --c-article-pending-border: navy;

  --c-article-status: var(--c-gray-5);
 
  --c-article-pre:black;
  
  --c-article-lien:blue;
  --c-article-lien-devoir:blue;
  /* ===================== PDF ===================== */
  --c-pdf-link: blue;

  /* ===================== COLONNES ===================== */
  --c-column-rule: black;

  /* ===================== PHOTOS ===================== */
  --c-photo-shadow: black;

  /* ===================== LATEST ===================== */
  --c-latest-bg: var(--c-white);
  --c-latest-border: var(--c-gray-2);
  --c-latest-separator: var(--c-gray-3);
  --c-latest-shadow: rgba(0,0,0,0.2);
  --c-latest-a:blue;

  /* ===================== FOOTER ===================== */
  --c-footer-text: var(--c-gray-6);
  --c-footer-a: blue;
  --c-footer-bg: var(--c-gray-1);

  /* ===================== SCROLL ===================== */
  --c-scroll-bg: var(--c-primary);
  --c-scroll-bg-hover: #1454b8;
  --c-scroll-text: var(--c-white);
  --c-scroll-shadow: rgba(30,78,216,0.8);

  /* ===================== OMBRES ===================== */
  --shadow-dark: rgba(0,0,0,0.7);
  --shadow-light: rgba(255,255,255,0.7);
  --shadow-soft: rgba(0,0,0,0.2);
  --shadow-menu-hover: rgba(255,213,79,0.8);
  --shadow-icon: rgba(0,0,0,0.2);
  --shadow-submenu: rgba(0,0,0,0.15);

  --bg-image-general: url("avecSpirale.png");
  --bg-image-general-minus: url("sansSpirale.png");
}

/* =============================================================================================================================================================== */
[data-theme="dark"]{
  
  /* ===================== BASE ===================== */
  --c-text: #e5e5e5;
  --c-bg-body: #121212;

  --c-white: orange; /*#1e1e1e;*/
  --c-gray-1: #1a1a1a;
  --c-gray-2: #2a2a2a;
  --c-gray-3: #3a3a3a;
  --c-gray-4: #555;
  --c-gray-5: #999;
  --c-gray-6: #bbb;

  --c-primary: #4f8cff;

  /* ===================== TITRES ===================== */
  --c-title-shadow-2: #000;
  /* corrigé : même oubli que --c-text ci-dessus, remis en gris clair */
  --color-text: #e5e5e5;

  /* ===================== SURFACES ADMIN.CSS (dashboard, formulaires,
     tableaux) — jusqu'ici jamais adaptées au mode sombre : sans ces
     lignes, le back-office restait à fond clair même thème sombre activé */
  --color-bg: #1a1a1a;
  --color-surface: #1e1e1e;
  --color-surface-alt: #242424;
  --color-border: #3a3a3a;
  --color-border-strong: #555555;
  --color-text-muted: #999999;
  --color-accent-bg: rgba(188, 99, 46, 0.2);
  --color-danger-bg: rgba(255, 0, 0, 0.15);
  --color-warning-bg: rgba(255, 165, 0, 0.15);
  --color-success-bg: rgba(0, 0, 255, 0.15);
  --color-info-bg: rgba(107, 106, 92, 0.2);

  /* ===================== MENUS ===================== */
  
  --c-menu-1: #c5dced;   /* bleu */
	--c-menu-2: #d2c9e5;   /* mauve */
	--c-menu-3: #e2d7b8;   /* beige */
	--c-menu-4: #c6e1d5;   /* vert */
  --c-menu-hover: #2b2b2b;
  --c-menu-text: #eee;
  --c-menu-text:navy;

  /* ===================== SUBMENU ===================== */
  --c-submenu-bg: #1e1e1e;
  --c-submenu-border: #333;
  --c-submenu-hover: #2a2a2a;
  --c-submenu-separator: #444;

  /* ===================== ETATS ===================== */
  --c-draft-bg: #2a2415;
  --c-deleted-bg: #2a1a1a;
  --c-pending-bg: #1a1f2a;
  --c-archived-bg: #1f2a1f;

  /* ===================== FLASH ===================== */
  --c-flash-bg: #1f3a1f;
  --c-flash-border: #3c6;

  /* ===================== TITRES PAGE ===================== */
  --c-main-title-bg: #222;

  /* ===================== BREADCRUMB ===================== */
  --c-breadcrumb-bg: rgba(0,0,0,0.4);
  --c-breadcrumb-link: red;
  --c-breadcrumb-shadow: #000;

  /* ===================== BADGES ===================== */
  --c-badge-bg: yellow;
  --c-badge-border: #444;
  --c-badge-text: #eee;

  /* ===================== ARTICLES ===================== */
  --c-article-bg: #444;
  --c-article-border: #444;
  --c-article-left-border: #666;
  --c-article-lien:yellow;
  --c-article-watermark: rgba(0,255,255,0.25);

  --c-article-draft-bg: rgba(116, 134, 247,0.4);
  --c-article-deleted-bg: rgba(103, 65, 191,0.8);
  --c-article-archived-bg: #2a2a2a;

  --c-article-status: #aaa;

   /* ===================== LATEST ===================== */
  --c-latest-bg: #1a1a1a;
  --c-latest-border: #333;
  --c-latest-separator: #333;
  --c-latest-a:yellow;
  --c-article-pre:yellow;

  /* ===================== FOOTER ===================== */
  --c-footer-bg: #1a1a1a;
  --c-footer-text: #aaa;

  /* ===================== OMBRES ===================== */
  --shadow-dark: rgba(0,0,0,0.9);
  --shadow-light: rgba(255,255,255,0.05);
  --shadow-soft: white;
  
  --color-black:white;
  
  --bg-image-general: url("avecSpiraleSombre.png");
  --bg-image-general-minus: url("sansSpiraleSombre.png");
}
/* =============================================================================================================================================================== */


/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--c-text);
  background: var(--c-bg-body);
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  margin-top:10px;
}

/* ========================================= LE CAHIER ================================== */
.general {
  width: 100%;
  max-width: 1200px;
  background: var(--bg-image-general) repeat-y;
  border-radius: 0 30px 30px 10px;
  box-shadow:
    3px 3px 3px var(--shadow-dark),
    5px 5px 3px var(--shadow-light),
    7px 7px 3px var(--shadow-dark);
  padding-left: 10px;
  padding-bottom:30px;
  box-sizing: border-box;
  margin-bottom:10px;
}

/*.general.carnet{background: url("carnet2.png") repeat-y;}*/

/* ============================= LA FEUILLE = APRES LA SPIRALE ================================== */
#feuille{
  padding-left:100px;
  position:relative;
}

#themeToggle {
  position: absolute;
  top: 20px;
  right: 80px;
  z-index: 9999;
  width: clamp(60px, 7vw, 80px);
  height: auto;
  padding: 6px;
  border: none;
  border-radius: 8px;
  font-size: clamp(9px, 1.4vw, 18px);
  cursor: pointer;

  background: var(--c-bg-body);
    
  color: white;

  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

/* ========================================= BOUTON DECONNEXION ================================== */
#connexion {
  position: absolute;
  top: 15px;
  right: 20px;
  z-index: 30;
}

.iconesConnexion {
  width: clamp(32px, 4vw, 48px);
  height: auto;
  cursor: pointer;
  filter: drop-shadow(0 1px 1px var(--shadow-soft));
  transition: transform 0.3s ease;
  border-radius:10px;
  z-index: 200;
}

.iconesConnexion:hover {
  transform: scale(1.1);
}

/* ========================================== HEADER ============================================= */
header {
  position: relative;
  z-index:100;
}

/* =========================================== TITRE PRINCIPAL =================================== */
#titreG {
  font-size: clamp(1.7em, 4vw, 2.7em);
  color: var(--c-title);
  text-transform: uppercase;
  letter-spacing: -0.05em;
  text-shadow:
    1px 1px 1px var(--c-title-shadow-1),
    1px 1px 2px var(--c-title-shadow-2),
    3px 3px 3px var(--c-title-shadow-3);
  margin: 0.5em 0 0 15px;
  display: inline-block;
  line-height: 1.1em;
  z-index: 10;
  position: relative;
  font-weight:normal;
}

#titreImg{
    position:absolute;
    top:100px;
    right:0;
    width:200px;
    height:200px;
    z-index:20;
    pointer-events:none;
}

/* ============================================== MENU =========================================== */
/*
nav > ul.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 10px 0;
  margin: 0 20px 0 15px;
}

.menu-item,
.system {
  position: relative;
}

.menu-item > a,
.system > a {
  display: block;
  padding: 0.5vw 0.5vw;
  font-size: 16px;
  background: var(--c-menu-1);
  border:1px solid grey;
  border-radius: 0.5vw;
  text-decoration: none;
  color: var(--c-menu-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s ease;
}

.menu-item:nth-child(2n) > a,
.system:nth-child(2n) > a {
  background: var(--c-menu-2);
}

.menu-item:nth-child(3n) > a,
.system:nth-child(3n) > a {
  background: var(--c-menu-3);
}

.menu-item:nth-child(4n) > a,
.system:nth-child(4n) > a {
  background: var(--c-menu-4);
}

.menu-item:hover > a,
.system:hover > a {
  background: var(--c-menu-hover);
  box-shadow: 0 0 8px var(--shadow-menu-hover);
  color: var(--c-badge-text);
}

.menu-item.cachee > a {
  color: var(--c-badge-bg);border:none;
  background: var(--c-menu-cachee);
}

.menu-item.level-user,.system.level-user {
    box-shadow: 0px 3px 0 0 green;border-radius: 0 0 10px 10px;
}

.menu-item.level-staff {
    box-shadow: 0 3px 0 0 #FFA500;border-radius: 0 0 10px 10px;
}

.menu-item.level-admin, .system.level-admin{
    box-shadow: 0 3px 0 0 red;border-radius: 0 0 10px 10px;
}
*/

nav > ul.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 8px 0;
  margin: 0 20px 0 15px;
}

.menu-item,
.system {
  position: relative;
}

/* Boutons principaux */
.menu-item > a,
.system > a {
  display: block;
  padding: 0.45rem 0.7rem;
  font-size: 15px;
  background: var(--c-menu-1);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  text-decoration: none;
  color: var(--c-menu-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* Variations de couleurs très discrètes */
.menu-item:nth-child(2n) > a,
.system:nth-child(2n) > a {
  background: var(--c-menu-2);
}

.menu-item:nth-child(3n) > a,
.system:nth-child(3n) > a {
  background: var(--c-menu-3);
}

.menu-item:nth-child(4n) > a,
.system:nth-child(4n) > a {
  background: var(--c-menu-4);
}

/* Survol */
.menu-item:hover > a,
.system:hover > a {
  background: var(--c-menu-hover);
  border-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 5px var(--shadow-menu-hover);
  color: var(--c-badge-text);
}

/* Élément masqué */
.menu-item.cachee > a {
  color: var(--c-badge-bg);
  border: none;
  background: var(--c-menu-cachee);
}

/* Niveau d'accès : simple filet inférieur */
.menu-item.level-user,
.system.level-user {
  border-bottom: 3px solid #4caf50;
}

.menu-item.level-staff {
  border-bottom: 3px solid #f0a000;
}

.menu-item.level-admin,
.system.level-admin {
  border-bottom: 3px solid #d32f2f;
}

/* ========================================= SOUS-MENU ============================================ */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: -50px;
  background: var(--c-submenu-bg);
  border: 1px solid var(--c-submenu-border);
  padding: 0.5vw 0;
  list-style: none;
  min-width: 15vw;
  box-shadow: 0 3px 10px var(--shadow-submenu);
  border-radius: 0.5vw;
  z-index: 1000;
}

.menu-item:hover > .submenu {
  display: block;
}

.submenu li {
  border-bottom: 1px dotted var(--c-submenu-separator);
}

.submenu li a {
  padding: 0.5vw 1vw;
  display: block;
  font-weight: 400;
  text-transform: none;
  color: var(--c-text);
  transition: background 0.2s ease;
  text-decoration:none;
}

.submenu li:last-child {
  border-bottom: none;
}

.submenu li a:hover {
  background: var(--c-submenu-hover);
}

.draft-item {
  background: var(--c-draft-bg);
}

.draft-item a::before {
  content: "-B- ";
  font-weight: bold;
  color: var(--c-draft-text);
  display: inline;
}

.deleted-item {
  background: var(--c-deleted-bg);
  font-weight: bold;
}

.deleted-item a::before {
  content: "-D- ";
  color: var(--c-deleted-text);
  display: inline;
}

.pending-item {
  background: var(--c-pending-bg);
}

.pending-item a::before {
  content: "-P- ";
  color: var(--c-pending-text);
  display: inline;
}

.archived-item {
  background: var(--c-archived-bg);
}

.archived-item a::before {
  content: "-A- ";
  color: var(--c-archived-text);
  display: inline;
}

/* ========================================= MESSAGE FLASH ====================================== */

.message-flash{
  background: var(--c-flash-bg);
  padding:10px;
  border:1px solid var(--c-flash-border);
  width:50%;
  margin: 0 auto 15px auto;
  text-align:center;
  border-radius:7px;
}

/* ========================================ERREURS ============================================== */
.error-page {
    max-width: 480px;
    margin: 60px auto;
    padding: 40px 30px;
    text-align: center;
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #CFC7BC);
    border-radius: var(--radius-lg, 10px);
    box-shadow: var(--shadow-lg, 3px 3px 4px rgba(59, 58, 50, 0.25));
}

.error-page h2 {
    margin: 0 0 15px;
    font-size: 3.5em;
    font-weight: 700;
    color: var(--color-danger, #A3232B);
    line-height: 1;
}

.error-page p {
    margin: 0 0 25px;
    font-size: 1.1em;
    color: var(--color-text, #3B3A32);
}

.error-page .btn {
    margin-right: 0;
}

.error-page.error-403 h2 {
    color: var(--color-warning, #BC632E);
}

/* ========================================== MAIN ============================================== */

main {
  position:relative;
  z-index:10;
  margin-left:15px;
  padding: 10px 20px 0px 0px;
  box-sizing: border-box;
}

/* ======================================== TITRES ============================================== */

main > h2 {
  margin: 0;
  margin-bottom:15px;
  padding: 10px;
  background: var(--c-main-title-bg);
  border:1px dotted var(--c-main-title-border);
  border-left: 5px solid var(--c-main-title-border);
  border-bottom: 1px solid var(--c-main-title-border);
  font-weight: 700;
  color: var(--c-text);
  border-radius: 0.5vw;
  font-size: clamp(1.2em, 3vw, 1.8em);
  box-shadow:0px 0px 5px var(--c-main-title-border);
}

main > h2>#nomCat {
  text-transform: uppercase;
  text-shadow: 1px 1px 3px gray;
}

main > article.article> h3>.nomArticle{text-transform: uppercase;
  text-shadow: 1px 1px 3px gray;
text-decoration: underline;}

/* ========================================== BREAD CRUMB ====================================== */

nav.breadcrumb {
  font-size: 16px;
  margin: -10px 0 5px 20px;
  background: var(--c-breadcrumb-bg);
  box-shadow:1px 1px 1px var(--c-breadcrumb-shadow);
  padding-bottom:5px;
}

nav.breadcrumb a {
  color: var(--c-breadcrumb-link);
  text-decoration: none;
  margin-right: 5px;
}

nav.breadcrumb a:hover {
  text-decoration: underline;
}

/* ======================================== ARTICLE =========================================== */

.badge {
    padding: 2px 6px;
    font-size: 16px;
    border-radius: 4px;
    margin-left: 6px;
    border:1px solid var(--c-badge-border);
	opacity:0.5;
}

.badge-draft {
    background: var(--c-badge-draft-bg);
    color: var(--c-badge-text);
}

.badge-archived {
    background: var(--c-badge-bg);
    color: var(--c-badge-text);
}

.badge-pending {
    background: var(--c-badge-bg);
    color: var(--c-badge-text);
}

.badge-deleted {
    background: var(--c-badge-bg);
    color: var(--c-badge-deleted-text);
}

.badge-published {
    background: var(--c-badge-bg);
    color: var(--c-badge-deleted-text);
}

/* --- Relocalisées depuis admin.css : badges/éléments liés au
   contenu d'un article ou d'une rubrique, pas des composants d'admin
   génériques — regroupés ici avec le reste de la famille .badge-* --- */

.badge-role {
    display: inline-block;
    font-size: 0.65em;
    padding: 2px 8px;
    border-radius: 5px;
    background: #eee;
    color: #aaa;
    vertical-align: 5px;
    margin-left: 10px;
    cursor: help;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge-visibility-author {
    background: var(--color-info-bg);
    color: var(--color-info);
}
.badge-visibility-editor {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}
.badge-visibility-moderator {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* corrigé au passage : couleurs en dur (white/black) remplacées par
   les variables déjà en place, pour que ces badges suivent aussi le
   mode sombre au lieu de rester figés en clair */
.badge-type-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}
.badge-type-devoir {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.btn-sort {
    margin: 0 10px;
    padding: 0 7px 0 7px;
    border: none;
    color: var(--color-text);
    box-shadow: none;
}
.btn-sort:hover {
    background: var(--color-secondary-hover);
}

.article-status {
    color: var(--c-article-status);
    font-style: italic;
    text-shadow:1px 1px 2px var(--c-title-shadow-3);
}

.article {
  margin-top: 10px;
  padding: 1vw 1.5vw;

  background: var(--c-article-bg);

  border: 1px dotted var(--c-article-border);
  border-left: 0.5vw solid var(--c-article-left-border);

  border-radius: 0.5vw;

  box-shadow: inset 0 0 0.5vw var(--c-article-shadow);

  position: relative;
  overflow: hidden;

  --status-text: "";
  --status-border: var(--c-article-left-border);
}


/* mise en forme d'article ayant un type spécifique */
.article.type-info {
    background: var(--c-article-info-bg);
	color:black;
}

.article.type-devoir {
    background: var(--c-article-devoir-bg);
	color:black;
}

.article-content{margin-top:10px;}

.article::before {
    content: var(--status-text, "");
    position: absolute;
    top: 50%;
    left: -50%;
    width: 200%;
    transform: rotate(-10deg) translateY(-50%);
	z-index:-10;
    font-size: 3rem;
    color: var(--c-article-watermark);
    white-space: nowrap;
    pointer-events: none;
}

.article.is-draft {
    --status-text: "BROUILLON BROUILLON BROUILLON BROUILLON BROUILLON BROUILLON BROUILLON";
    background: var(--c-article-draft-bg);
    border-left: 0.25vw dashed var(--c-article-draft-border);
}

.article.is-deleted {
    --status-text: "SUPPRIMÉ SUPPRIMÉ SUPPRIMÉ SUPPRIMÉ SUPPRIMÉ SUPPRIMÉ SUPPRIMÉ SUPPRIMÉ";
    background: var(--c-article-deleted-bg);
    border-left: 0.25vw dashed var(--c-article-deleted-border);
    /*opacity:0.5;*/
}

.article.is-published {
    --status-text: "";
    border-left: 0.25vw solid var(--c-article-published-border);
}

.article.is-archived {
    --status-text: "ARCHIVÉ ARCHIVÉ ARCHIVÉ ARCHIVÉ ARCHIVÉ ARCHIVÉ ARCHIVÉ ARCHIVÉ ARCHIVÉ";
    background: var(--c-article-archived-bg);
    border-left: 0.25vw solid var(--c-article-archived-border);
	color:black;
}

.article.is-pending {
    --status-text: " EN ATTENTE EN ATTENTE EN ATTENTE EN ATTENTE EN ATTENTE EN ATTENTE EN ATTENTE";
	background: var(--c-article-pending-bg);
    border-left: 0.25vw dashed var(--c-article-pending-border);
}

.article-date,
.pied-article {
    font-size:0.8em;
    text-align:right;
    margin-top:10px;
}

.article li{margin-left:20px;}

.article .partie {color: blue;}
ul.nopuce{list-style-type: none;}

/* pour mettre une marge sur les li mais pas sur les li imbriquées et pas sur le 1er li*/
ol > li { margin-top: 10px;}
ol > li:first-child {margin-top: 0;}
ol ol li { margin-top: 0;}

.liste li{line-height:2em;}

/* decoration dans les articles */

a[href$=".pdf"] {
    text-decoration: none;
    color: var(--c-pdf-link);
}

.article a{color:var(--c-article-lien);}

.article a[href$=".pdf"]::before,.mespdf::before {
    content:"";
    display:inline-block;
    width:40px;
    height:50px;
    vertical-align:middle;
    background-image:url("../icones/iconePDF2.png");
    background-size:contain;
    background-repeat:no-repeat;
    margin:0 0.3em;
}

.article a[href$=".php"]::before, .article a[href$=".htm"]::before{
    content:"";
    display:inline-block;
    width:40px;
    height:50px;
    vertical-align:middle;
    background-image:url("../icones/html.png");
    background-size:contain;
    background-repeat:no-repeat;
    margin:0 0.3em;
}

.article a[href$=".php"],
.article a[href$=".htm"],
.article a[href$=".tex"] {
	text-decoration: none;
}

.article.is-published.type-devoir > div.article-content > a{color:var(--c-article-lien-devoir);}
.article.is-published.type-devoir > div.article-content > a[href$=".tex"]{color:red;}


.article a[href$=".tex"] {
    color: var(--color-danger, #A3232B);
    font-size: 0.85em;
}

/* liste de fichiers joints à un article */
#file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin: 0.5rem 0;
}

#file-list > div {
    padding: 0.1rem 0.6rem 0.1rem 0.6rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
	box-shadow:1px 1px 2px black;
    font-size: 0.9rem;
    color: black;
    white-space: nowrap;
}

/* ================================ MISE EN FORME PARTICULIERE ================================= */

.deuxcolonnes {
    width:100%;
    column-count: 2;
    column-rule:1px dotted var(--c-column-rule);
	margin-bottom:20px;
}

.troiscolonnes {
    width:100%;
    column-count: 3;
    column-rule:1px dotted var(--c-column-rule);
	margin-bottom:20px;
}

.fin-colonne {
    break-after: column;
}

.article pre {
    width:100%;
    white-space: pre-wrap;
	color:var(--c-article-pre);
	padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--c-gray-3);
    font-family: monospace;
    background: var(--c-gray-1);
	box-sizing: border-box;
}

.photos {
    width:250px;
    float:left;
    margin:20px;
    border-radius:20px;
    box-shadow:4px 4px 4px var(--c-photo-shadow);
}

.article ul,
.article ol {
    margin-left: 1.5em;
    padding-left: 0;
}

.deuxcolonnes.sanspuce > ul{
    list-style: none;
}

.repartir{
	display: flex;
    width: 100%;
    flex-direction: row;
	flex-wrap: wrap;
    column-gap: 3rem;
    row-gap: 0.5rem;
}
	
/* ======================================== DERNIERS ARTICLES ======================================== */

.latest {
    background: var(--c-latest-bg);
    border: 1px solid var(--c-latest-border);
    border-radius: 6px;
    padding: 20px;
    margin-top: 30px;
    font-size:0.9em;
    box-shadow: 0.4vw 0.4vw 0.4vw var(--c-latest-shadow);
}

.latest h3 {
    margin-top: 0;
}

.latest ul {
    list-style: none;
    padding: 0;
}

.latest li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--c-latest-separator);
}

.latest li a {
    text-decoration: none;color:var(--c-latest-a);
}

.latest li:last-child {
    border-bottom: none;
}

/* =========================================== FOOTER ========================================= */

footer {
  width: 60px;
  margin-top:31px;
  position:absolute;
  right: calc(50% - 350px);
  padding: 2px;
  text-align: center;
  color: var(--c-footer-text);
  font-size: clamp(0.8rem, 2vw, 1rem);
  background: var(--c-footer-bg);
  box-shadow:
    3px 3px 3px var(--shadow-dark),
    5px 5px 3px var(--shadow-light),
    7px 7px 3px var(--shadow-dark);
  border-radius: 0 0 5px 5px;
  opacity:55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 1s ease;
}

footer:hover {
  opacity:1;
  padding:10px;
  width:20%;
  right: calc(50% - 400px);
}

/* ======================================= BOUTON SCROLL TOP =================================== */

#scrollTopBtn {
  position: fixed;
  bottom: 20px;
  right: max(40px, calc((100vw - 1200px) / 2 + 40px));
  z-index: 4000;
  padding: 0.5vw 0.5vw;
  background: var(--c-scroll-bg);
  color: var(--c-scroll-text);
  border: none;
  border-radius: 0.5vw;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.5vw 1vw var(--c-scroll-shadow);
  user-select: none;
  transition: background 0.3s ease;
}

#scrollTopBtn:hover {
  background: var(--c-scroll-bg-hover);
  border-radius: 30%;
  transform: scale(1.5);
}

/* ================================================================================================= */
/* =================================== RESPONSIVE ================================================== */
/* ================================================================================================= */

@media (max-width: 1024px) {

  body {
    margin: 0;
	padding: 0;
  }

  #feuille {
    padding: 0;margin:0;
  }
  
  #themeToggle{top:5px;right:5px;}
  #connexion{top:40px;z-index:40;}
  
  
  /* correction : "menu" n'existe pas comme élément HTML */
  nav {
    padding-left: 5px;
  }

  .general {
    margin: 0 0 50px 0;
    padding-left: 0;
    border-radius: 0;
    background: var(--bg-image-general-minus) repeat-y;
  }

  #titreG {
    margin: 0.5em 0 0 0.5vw;
	font-size: clamp(1.4rem, 4vw, 2.1rem);
    text-shadow: 1px 1px 1px var(--c-title-shadow-1);
	margin-bottom:0px;	  
  }

  #titreImg {
    display: none;
  }

  header {
    padding-left: 5px;
    position: relative;
  }

  nav {
    margin: 0;
    margin-top: 0px;
    margin-bottom: 0px;
  }

  .menu {
    width: 97%;
    margin: 10px;
    position: relative;
  }

  nav > ul.menu {
    font-size: 1.1em;
    flex-direction: row; 
    flex-wrap: wrap;
    gap: 2vw;
    margin: 0;
    width: 90%;
  }

  .submenu{left: 5px;}
  
  .submenu li {
    width: 200px;
    font-size: 0.9em;
  }

  nav.breadcrumb {
    margin: -10px 0 5px 0;
  }
  
  main {
	margin:5px;
    padding: 5px;
    position: relative;
  }

  .repartir{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 30px;
  }

   .liste li{line-height: normal;}

  .latest li {
    font-size: 0.8rem;
  }

  footer {
    right: 50%;
    transform: translateX(50%);
  }

  footer:hover {
    opacity: 1;
    padding: 5px;
    width: 50%;
    right: 50%;
    transform: translateX(50%);
  }

  #scrollTopBtn {
    right: 20px;
  }

  .deuxcolonnes {
    column-count: 1;
    column-rule: 0;
  }
  
  .troiscolonnes {
    column-count: 1;
    column-rule: 0;
  }
  
  ul{padding-left:20px;}
  
  .repartir{
	display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;}
  
  .article.type_devoir a{color:black;}

}