html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: Garamond, serif;
    padding-top: 120px; 
}

/* entête du site */
header {
    position: fixed;
    top: -25px;
    left: 0;
    width: 100%;
    background-color: white;
    z-index: 1000;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: -75px;
    padding-bottom: -115px;
    margin: 0;
    border-bottom: 1px solid #ccc;
    justify-content: flex-start;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 15px;
    margin-bottom: -20px;
}

.logo img {
    width: 110px;
    height: auto;
    margin: 0 auto;
    display: block;
    position: relative;
    top: -50px;
}

.logo {
    margin-top: -25px;
}

.language-switcher {
    position: fixed;
    margin-right: 1220px;
    padding-top: 100px;
}

.language-switcher .lang-btn,
a.lang-btn {
    display: inline-block;
    text-decoration: none;
    border: 2px solid #007bff;
    border-radius: 20px;
    padding: 6px 12px;
    margin: 5px 6px;
    font-weight: 700;
    color: #007bff;
    line-height: 1;
}

.language-switcher .lang-btn:hover,
a.lang-btn:hover {
    background: #eaf3ff;
}

.language-switcher .lang-btn.active,
a.lang-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.language-switcher .lang-btn:visited,
a.lang-btn:visited {
    color: #007bff;
}

.language-switcher .lang-btn.active,
.language-switcher .lang-btn.active:link,
.language-switcher .lang-btn.active:visited,
a.lang-btn.active,
a.lang-btn.active:link,
a.lang-btn.active:visited {
  color: #fff !important;   
  background-color: #007bff; 
  border-color: #007bff;
}

.language-switcher .lang-btn.active:hover,
a.lang-btn.active:hover {
  filter: brightness(0.95);
}

.donations {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid #3984a0;
    background-color: #3984a0;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
    text-decoration: none !important;
    color: white;
    cursor: pointer;
}

/* Pour la navigation */
nav {
    margin-top: -7px;
}

nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    overflow-x: auto;
}

nav ul li {
    list-style: none;
    white-space: nowrap;
}

nav ul li a {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid var(--rubrique-color);
    background-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav ul li a.active {
    background-color: var(--rubrique-color) !important;
    color: white !important;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    border-bottom: 1px solid #ccc;
}
/* style général du menu sidebar avec les liseret et la forme */
.sidebar ul li a {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 50px;
    border: 2px solid var(--rubrique-color);
    color: var(--rubrique-color);          
    text-align: center;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s, border 0.3s, color 0.3s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background-color: var(--rubrique-color);
    color: #fff;
}

/* Pour rendre invisible le menu burger sur les PC */
@media (min-width: 768px) {
    .burger-container {
        display: none;
    }
    .sidebar {
        display: none;
    }
    nav.main-nav {
        display: block;
    }
    .burger { display: none; }     
    .burger-container { display: none; } 
    .sidebar { display: none; }
    nav.main-nav { display: block; }
}

/* Cacher la navbar horizontale sur les smartphones */
@media (max-width: 768px) {
    nav ul {
        display: none;
    }
    nav.main-nav {
        display: none;
    }
    .main-nav { 
        display: none; 
    }
    .sidebar {
        display: block;
    }

    html, body {
    padding-top: 180px;
    }

   header {
    position: fixed;
    left: 0;
    width: 100%;
    background-color: white;
    z-index: 1000;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: -75px;
    padding-bottom: -115px;
    margin: 0;
    border-bottom: 1px solid #ccc;
    justify-content: flex-start;
    padding: 8px 12px;
}

    .top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 15px;
    margin-bottom: -25px;
}

  .date-heure p {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    margin-right: 30px;
    position: relative;
    top: 5px;
  }

  /*Recentrer le logo */
  .logo, .site-logo, header .logo img {
    max-width: 120px;
    height: auto;
    margin: 6px auto 2px;
    display: block;
    position: relative;
    top: -10px;
    align-items: center;
  }

  /* Sélecteur de langues */
  .language-switcher {
    display: flex;
    justify-content: flex-start; 
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 4px 0;
    margin-bottom: -75px;
    padding-left: 115px;
    top: -85px;
    position: relative;
    right: 165px;
  }
  .language-switcher .lang-btn,
  .language-switcher button a.lang-btn {
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.2;
    margin: -1px -3px;
  }

  /* Gros titres sous le header */
  h1 {
    font-size: 24px;
    line-height: 1.2;
    margin: 12px 16px 8px 16px;
    text-align: center;
    word-break: break-word;
  }

  .burger {
    position: fixed;   
    top: 100px;
    left: 10px;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    z-index: 1200;             /* au-dessus du header et du contenu */
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
  }
  .burger > span, .burger .line {
    width: 22px; height: 2px; background: #222; display: block;
    border-radius: 1px; margin: 3px 0;
  }

  /* Sidebar */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100dvh;
    width: min(85vw, 360px);
    transform: translateX(-100%);
    transition: transform .28s ease;
    background: #fff;
    z-index: 1090;
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 20px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }

  /* Contenu de la sidebar : listes claires, espacées */
  .sidebar nav, .sidebar .menu {
    display: grid; gap: 10px;
    margin-top: 12px;
  }
  .sidebar a, .sidebar button {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.25;
  }
  .sidebar a:active { transform: scale(.985); }

  /* Overlay (clique pour fermer) */
  .backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.28);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1085;
  }
  .backdrop.show { opacity: 1; pointer-events: auto; }

  footer {
    padding: 16px 12px 24px 12px;
    background: #fafafa;
    border-top: 1px solid rgba(0,0,0,.06);
  }

  .footer-links, .footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;  
    gap: 10px 14px;
    align-items: start;
  }

  .search-container {
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
    position: relative;
    right: 70px;
  }
  .search-bar { width: min(300px, 80vw); }
  .search-date { width: min(260px, 70vw); }

  .date-une {
  position: static;
  top: auto; left: auto;
  margin: 8px 12px;
  }

  :root { --header-h-mobile: 180px; }
   html, body { padding-top: var(--header-h-mobile) !important; }
   body.nav-open.burger {display: none !important;}
} 

@media (max-width: 480px) {
  html, body { padding-top: 220px; }   
  .donations { font-size: 13px; padding: 6px 10px; position: relative; left: -15px; top: 5px;}
  .language-switcher .lang-btn, .language-switcher button { font-size: 13px; }
  .logo, .site-logo, header .logo img { max-width: 72px; }
}

@media (max-width: 420px) {
    .footer-links, .footer-grid { grid-template-columns: 1fr; }
  }

  .footer-links a, .footer-grid a {
    display: inline-block;
    padding: 6px 2px;
    font-size: 15px;
    line-height: 1.3;
  }

  .footer-meta { /* ligne ©, mentions, etc. */
    margin-top: 12px;
    font-size: 13px;
    text-align: center;
    color: #666;
}

/* La couleur des rubriques */
.jaune { --rubrique-color: #FFD700; }
.orange { --rubrique-color: #FFA500; }
.bleu_fonce { --rubrique-color: #00008B; }
.bleu_clair { --rubrique-color: #ADD8E6; }
.vert_fonce { --rubrique-color: #006400; }
.jaune_fonce { --rubrique-color: #DAA520; }
.violet_fonce { --rubrique-color: #800080; }
.vert_clair { --rubrique-color: #90EE90; }
.violet_clair { --rubrique-color: #DDA0DD; }
.rouge_clair { --rubrique-color: #FF6347; }
.argent { --rubrique-color: #C0C0C0; }

/* Gestion de l'affichage et couleurs des articles */
.article {
    border-width: 2px;
    border-style: solid;
    border-radius: 25px;
    padding: 15px;
    margin: 10px 0;
    width: 95%;
    max-width: 1100px;
    text-align: left;
    transition: border-color 0.7s ease, width 0.7s ease;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

/*Couleur des articles publiés*/
.article.vie-etudiante { border-color: #00008B; }
.article.vie-associative { border-color: #1E90FF; }
.article.vie-culturelle { border-color: #006400; }
.article.vie-sportive { border-color: #FFD700; }
.article.festivites { border-color: #800080; }
.article.evenements { border-color: #32CD32; }
.article.politique { border-color: #8A2BE2; }
.article.articles-universitaires { border-color: #FF4500; }
.article.bon-plan { border-color: #C0C0C0; }
.article.a_la_une { border-color: #FFD700; }
.article.info_hebdo { border-color: #FFA500; }

.article h3 {
    cursor: pointer;
    color: #00008B;
    font-size: 20px;
    margin-bottom: 5px;
}

.article p {
    margin: 10px 0;
    font-size: 16px;
}

.article-detail {
    display: block;
    padding: 10px;
    background-color: white;
    border-top: 1px solid #ccc;
    margin-top: 10px;
}

@media screen and (max-width: 768px) {
    .article {
        width: 90%;
        max-width: 100%;
    }
}

/* Pour le containers des articles */
.articles-container {
    margin-top: 0;
    padding-top: 0;
}

.date-une {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    position: absolute;
    top: 280px;
    left: 5px;
    background-color: white;
    padding: 5px 10px;
    border-radius: 5px;
    margin-top: -30px;
}

.bienvenue-message {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-top: 0;
    padding-top: 0;
}

.date-heure {
    font-weight: bold;
    margin-left: 8px;
    font-size: 18px;
}

.info-hebdo-container {
    width: 100%;
    max-width: 90vw;
    margin: auto;
}

.info-hebdo-container details,
.articles-by-month-container details {
    border: none;
    box-shadow: none;
    background: none;
    padding: 0;
    margin: 0;
}

.info-hebdo-container summary,
.articles-by-month-container summary {
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 5px;
    text-align: center;
    width: 100%;
    border: 2px solid #ccc;
}

.info-hebdo-container summary:hover,
.articles-by-month-container summary:hover {
    background-color: #e0e0e0;
}

.articles-by-month-container {
    width: 100%;
    max-width: 1100px;
    margin: auto;
}

/* Pour les formulaires génériques */
.form-container {
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    margin: auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
}

.form-container label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    text-align: left;
    width: 100%;
    font-size: 16px;
}

.form-container input,
.form-container select,
.form-container textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ccc;
    border-radius: 25px;
    font-size: 16px;
    background-color: white;
    margin: auto;
}

/* Pour l'éditeur de texte */
.ck-editor__editable {
    min-height: 300px;
    border-radius: 10px;
    border: 2px solid #ccc;
}

/* Bouton du formulaire */
.form-container button {
    width: 100%;
    padding: 12px;
    border-radius: 25px;
    background-color: #007bff;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: -2px;
}

.form-container button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.form-buttons {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.form-buttons button {
    width: 250px;
    padding: 10px;
    font-size: 16px;
}

/* Pour la page de connexion */
.login-container {
    width: 400px;
    margin: 50px auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login:hover {
    background-color: #0056b3;
}

.login-links {
    margin-top: 15px;
}

.login-links a {
    display: block;
    margin: 5px 0;
    color: #007BFF;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.back-to-dashboard {
    text-align: left;
    margin-bottom: 20px;
}

.btn-back {
    display: inline-block;
    padding: 10px 5px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

/* Pour le tableau de bord */
.dashboard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-table,
.table-articles {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.dashboard-table th, .dashboard-table td,
.table-articles th, .table-articles td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}

.dashboard-table th,
.table-articles th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.btn-publish {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-publish:hover {
    background-color: #0056b3;
}

.btn-edit {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-edit:hover {
    background-color: #218838;
}

.btn-login-small {
    display: inline-block;
    padding: 5px 10px;
    background-color: #0056b3;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    position: absolute;
    left: 250px;
    top: 320px;
    z-index: 1000;
}

.btn-login-small:hover {
    background-color: #003a80;
}

/* Pour la cellule recherche */
.search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 8px 0 0 0;
    flex-wrap: wrap;
    padding-left: 450px;
    margin-top: -40px;
}

.search-bar, .search-date {
    padding: 8px;
    border: 1px solid #82a55e;
    border-radius: 30px;
    font-size: 16px;
}

.search-bar { width: 240px; max-width: 80vw; }
.search-date { width: 160px; max-width: 60vw; }

.search-button {
    padding: 8px 12px;
    background-color: #003366;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.search-button:hover { background-color: #002244; }

/* Pour la page résultat des recherches */
.search-results-container {
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.search-results-container h2 {
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-result {
    padding: 15px;
    border-radius: 12px;
    border: 2px solid transparent;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.article-result h3 {
    font-size: 20px;
    color: #005d9f;
}

.article-result p {
    font-size: 16px;
    color: #0b0c0e;
    margin-bottom: 10px;
}

.article-result a {
    font-weight: bold;
    color: #007BFF;
    text-decoration: none;
}

.article-result a:hover {
    text-decoration: underline;
}

/* Bordure dynamique selon la rubrique */
.article-result.vie-etudiante { border-color: #00008B; }
.article-result.vie-associative { border-color: #1E90FF; }
.article-result.vie-culturelle { border-color: #006400; }
.article-result.vie-sportive { border-color: #FFD700; }
.article-result.festivites { border-color: #800080; }
.article-result.evenements { border-color: #32CD32; }
.article-result.politique { border-color: #8A2BE2; }
.article-result.articles-universitaires { border-color: #FF4500; }
.article-result.bon-plan { border-color: #C0C0C0; }

.article-result:hover {
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 96, 241, 0.1);
}

/* Bouton pour les sources */
.delete-source-btn {
    background-color: red;
    color: white;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.edit-source-btn {
    background-color: blue;
    color: white;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
}

/* La partie commentaire */
.commentaire {
    font-size: 12px;
    color: grey;
}

/* Pour le pied de page */
.footer {
    background-color: #f8f8f8;
    padding: 20px 0;
    text-align: center;
    font-size: 16px;
    margin-top: 80px;
    border-top: 2px solid #ccc;
    position: static;
    width: 100%;
}

.footer-container {
    max-width: 1100px;
    margin: auto;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 10px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-links .first-row,
.footer-links .second-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    max-width: 600px;
}

.footer-links li {
    display: inline;
}

.footer-links a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #a03970;
}

.footer-text {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Make the card and its content use the full available width */
.articles-container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.article { width: 100%; max-width: 1100px; box-sizing: border-box; }

/* The rich text wrapper: take the full width and wrap long stuff */
.article-body, .article-detail { width: 100%; overflow-wrap: anywhere; }

/* Kill fixed widths pasted by the editor (divs, tables, etc.) */
.article-body [style*="width"],
.article-detail [style*="width"] {
  width: auto !important;
  max-width: 100% !important;
}

/* Typical block elements inside the body should expand to the card width */
.article-body p,
.article-body div,
.article-body section,
.article-body figure,
.article-body table,
.article-detail p,
.article-detail div,
.article-detail section,
.article-detail figure,
.article-detail table {
  width: 100%;
  box-sizing: border-box;
}

/* Images inside the body should never overflow */
.article-body img,
.article-detail img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 10px auto;
}

/* Iframes (YouTube, etc.) – make them responsive enough */
.article-body iframe,
.article-detail iframe {
  max-width: 100% !important;
  width: 100% !important;
}

/* Tables: avoid horizontal scroll when editor sets a fixed width */
.article-body table,
.article-detail table {
  width: 100% !important;
  table-layout: auto;
}

/* Details containers must not clip the blue border of the article card */
.info-hebdo-container details,
.articles-by-month-container details {
  overflow: visible;
}

.article-body * { outline: 1px dashed rgba(0,0,255,.15); }