html, body {
  height: 100%;                /* occupe toute la hauteur */
  margin: 0;
  display: flex;
  flex-direction: column;
}

body {
  background-color: var(--white);   /* fond clair neutre */
  color: var(--black);              /* texte anthracite */
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  margin: 0;
  padding: 0;
}



header {
  color: var(--black);
  background-color: var(--white);
}


header{
    padding: 1em
}

body,
nav ul {
    margin: 0;
    padding: 0
}

h1{
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-weight: var(--font-weight-semibold);
}

.article_ul li a:hover,
.header_logo:hover,
.header_nav ul li a:hover,
.trail-items li a:hover,
nav a:hover {
    text-decoration: underline
}

:root {
    --black: #222222;
    --gray: #7E7E7E;
    --gray-light: #E4E4E4;
    --red: #b30000;
    --blue: #007bff;
    --white: #f9f9f9;
    --pure-white: #ffffff;
    --light-red: #ff6666;
    --dark-gray: #333333;
    --light-gray-bg: #eeeeee;
    --border-gray: #cccccc;
    --hover-gray: #f0f0f0;
    --gray-medium: #999999;
    --dark-red: #990000;
    --green: #28a745;      /* domotique */
    --light-green: #e0ffe0;
    --orange: #ff6600;     /* impression 3D */
    --search-bg: #f6f6f6;
    --border-radius: 10px;
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-md-minus1: 767px;
    --breakpoint-lg: 1024px;
    --font-base: 'Inter', 'Segoe UI', Arial, sans-serif;
    --font-heading: 'Lexend', sans-serif;
    --font-size-base: 1rem;
    --font-size-md: clamp(1.25rem, 0.61vw + 1.1rem, 1.58rem);
    --font-size-lg: clamp(1.56rem, 1vw + 1.31rem, 2.11rem);
    --font-size-xl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
    --font-size-sm: 0.875rem;
    --font-size-xxl: 3rem;
    --focus-outline: 2px solid var(--red);
    --focus-offset: 2px
    /* Font weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;
}


footer {
  background-color: var(--dark-gray);
  color: var(--white);
  text-align: center;
  padding: 1em;
  font-size: var(--font-size-sm);
  
}

footer a {
  color: var(--gray);          /* couleur par défaut */
  text-decoration: none;       /* enlève le soulignement */
  transition: color 0.2s ease; /* effet fluide */
}

footer a:hover {
  color: var(--blue);          /* couleur au survol */
  font-weight: var(--font-weight-bold);
}


.titre-centre {
    text-align: center
}

.container {
    display: grid;
    grid-template-columns: 250px 1fr; /* 250px pour le sommaire, reste pour l’article */
    gap: 2rem;                        /* espace entre les colonnes */
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    width: 100%;
    flex: 1; /* pousse le footer en bas quand le contenu est court */
    box-sizing: border-box;
}

.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* 100% de la hauteur de la fenêtre */
}

main {
    padding: 2em;
}

.btn:hover,
nav {
    background-color: var(--dark-gray)
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1em
}

nav a {
    color: var(--pure-white);
    text-decoration: none;
    font-weight: var(--font-weight-bold)
}

.article_ul li a,
.btn,
.btn-pagination,
.header_logo,
.header_nav ul li a,
.pagination,
.pagination a,
.trail-items li a {
    text-decoration: none
}

.custom-logo {
    width: 100%;
    max-width: 350px;
    height: auto
}

input[type=email],
input[type=password],
input[type=search],
/* input[type=text], Masqué parce que interfére avec la barre de recherche*/
/* select, */
textarea {
    font-size: var(--font-size-base);
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: .7rem .75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-light);
    background-color: var(--white);
    transition: border-color .3s, box-shadow .3s
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--red);
    /* box-shadow: 0 0 0 2px rgba(179, 0, 0, .2) Mets un cercle rouge quand on tape une recherche*/
}

.btn {
    background-color: var(--black);
    border: none;
    color: var(--pure-white);
    padding: 16px 32px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color .3s, transform .2s
}

.btn:hover {
    transform: scale(1.02)
}

.btn:focus {
    outline: 2px solid var(--red);
    outline-offset: 2px
}

.btn-delete {
    padding: 10px 16px;
    background-color: var(--red)
}

.btn-delete:hover {
    background-color: var(--dark-red)
}

.trail-items {
    list-style: none;
    display: flex;
    gap: .5em;
    font-family: var(--font-base);
    font-size: var(--font-size-sm);
    color: var(--dark-gray)
}

.trail-items li a {
    color: var(--blue)
}

.trail-items li::after {
    content: "/";
    margin-left: .5em;
    color: var(--gray-medium)
}

.trail-items li:last-child {
    font-weight: var(--font-weight-bold);
    color: var(--black)
}

.trail-items li:last-child::after {
    content: ""
}

.breadcrumb {
    display: flex;
    justify-content: space-between;
}

.breadcrumb ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0
}

.breadcrumb ul li a {
    color: var(--pure-white);
    /* font-weight: var(--font-weight-bold); */
    font-size: var(--font-size-sm);
}

.breadcrumb li:not(:last-child)::after {
    display: inline-block;
    margin: 0 .25rem;
    content: "/"
}

.breadcrumb li .active {
    color: var(--blue);
    font-weight: var(--font-weight-bold);
}

.nav-left ul {
  list-style: none;
  display: flex;
  gap: 15px;
  padding: 0;
  margin: 0;
}

.nav-right {
  margin-left: auto;
  margin-right: 1rem;
}

.article_ul li a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 18px 0
}

@media only screen and (min-width:768px) {
    .article_ul li a {
        flex-direction: row;
        align-items: center;
        text-decoration: none;
        transition: text-decoration .2s, color .2s
    }

    .article_list_date {
        text-align: right
    }
}

.articles_heading {
    margin-top: 4rem;
    font-weight: var(--font-weight-normal);
}

.article_ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: clamp(1.13rem, calc(1.08rem + .22vw), 1.25rem);
    display: flex;
    flex-direction: column
}

.article_ul li {
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: filter .1s
}

.article_ul li:not(:last-child) {
    border-bottom: 1px solid var(--gray-light)
}

.article_ul li a:hover {
    color: var(--red)
}

.article_list_date {
    font-size: var(--font-size-sm);
    color: var(--gray);
    width: 260px
}

.article {
    word-break: break-word
}

.content {
  display: flex;
  flex-direction: column; /* article puis suggestions en colonne */
  gap: 2rem;
  flex: 1; /* prend tout l’espace disponible */
}

.toc {
  position: sticky;
  top: 1rem;
  align-self: start;
  background: var(--light-gray-bg);
  padding: 1rem;
  border-radius: 8px;
  font-size: var(--font-size-sm);
  height: fit-content; /* évite que le sommaire prenne toute la hauteur */
}

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

.toc a {
  text-decoration: none;
  color: var(--blue);
}

.toc a:hover {
  text-decoration: underline;
}

.article-title {
    margin-bottom: .5rem
}

.author {
    padding: 10px 0;
    text-align: center
}

.author_heading {
    margin-top: 10px;
    margin-bottom: 5px
}

.author_body {
    font-size: var(--font-size-md);
    margin: 5px 0 40px
}



.site-description,
.site-title {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    display: none;
}

.carrousel { 
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: auto;
    overflow: hidden; 
}

.carrousel a {
  display: flex;          /* permet à l’item de rester flex */
  text-decoration: none;  /* enlève le soulignement du lien */
  color: inherit;         /* garde les couleurs originales */
}

.carrousel-item {
  display: none;                 /* aligne image + texte côte à côte */
  flex-direction: row-reverse; /* inverse l’ordre : image à droite, texte à gauche */
  background: var(--light-gray-bg);
  height: 400px;                 /* même hauteur pour image + texte */
  overflow: hidden; /* empêche l’image de dépasser */
}


.carrousel-item.active {
    display: flex;
}


.carrousel-controls {
  position: absolute;
  bottom: 10px;       /* ajuste selon ton design */
  left: 10px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.carrousel-controls button {
  padding: 5px 10px;
  background: var(--dark-gray);
  color: var(--pure-white);
  border: none;
  cursor: pointer;
  border-radius: 4px;      /* arrondir un peu les boutons */
}

.carrousel-excerpt {
  position: relative;   /* pour que le bas de l’excerpt soit le repère */
  display: flex;
  flex-direction: column;
  gap: 20px; 
  padding: 10px;
  padding-bottom: 40px; /* espace pour les boutons */
  font-size: var(--font-size-base);
  
}

.carrousel-title {
  font-size: var(--font-size-base);
  font-weight: bold;
  margin: 0;
}

.carrousel-summary {
  font-size: 1rem;
  margin: 0;
}


.carrousel-image {
    flex: 3;    /* prend 3/4 de la largeur */
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 400px;   /* limite la hauteur */
  background-color: var(--gray-medium);
}





.credits {
  font-size: var(--font-size-sm);
  color: var(--gray);
  text-align: center;
  margin-top: 20px;
}

/* button.next,
button.pause,
button.prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark-gray);
    color: var(--pure-white);
    border: none;
    padding: 10px;
    cursor: pointer
}

button.prev {
    left: 10px;
}

button.next {
    right: 10px;
}

button.pause {
    left: 50%;
} */

.header {
    display: grid;
    align-items: center;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    padding: 1em 2rem;
    grid-template-areas: "logo bouton" "menu menu"
}

.header_logo {
    grid-area: logo;
    font-weight: var(--font-weight-extrabold);
    font-size: clamp(20px, 2vw, 28px);
}

.header_logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}


.header_nav {
    grid-area: menu;
    display: flex;
    justify-content: center
}

.header_nav ul {
    display: flex;
    gap: 1rem;
    list-style: none;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
    padding: 0;
}



.header_bouton {
    grid-area: bouton;
    display: flex;
    justify-content: end;
    align-items: center;
    position: relative;
}


.header_nav ul li a {
    padding: 10px
}

.header_nav ul li a.active {
    color: var(--blue)
}

/* .header_bouton {
    grid-area: bouton;
    display: flex;
    justify-content: end;
    align-items: center;
    position: relative
} */

.header_bouton button {
    display: flex;
    gap: .3rem;
    align-items: center;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-semibold);
    color: var(--black)
}

.header_bouton button:hover {
    border-color: var(--light-red)
}


.search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-gray);
    padding: 6px 12px;
    border-radius: 8px;
    transition: width 0.3s ease;
    background: var(--search-bg);
    cursor: text;
    width: max-content;
}

.search:focus-within {
    background: var(--hover-gray);
}

.search-input {
    width: 0;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    border: none;
    outline: none;
    font-size: var(--font-size-base);
    background: transparent;
    color: var(--black);
    margin-left: 14px;
    font-family:  var(--font-base);
    flex: 1;
}

.search.active .search-input {
    width: auto;
    opacity: 1;
}

.material-symbols-outlined {
    font-size: clamp(20px, 2vw, 28px);
    color: var(--gray);
}



.pagination {
    font-size: var(--font-size-lg);
    color: var(--gray);
    margin-top: 40px;
    display: inline-block
}

.btn-pagination,
.pagination:hover {
    color: var(--black)
}

.admin-title,
.pagination-container {
    display: flex;
    justify-content: space-between
}

.pagination-container {
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
    flex-wrap: wrap
}

.btn-pagination {
    background-color: var(--gray-light);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-bold);
    transition: background-color .3s
}

.btn-pagination:hover {
    background-color: var(--gray);
    color: var(--pure-white);
}

.pagination-info {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
}

.pagination ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    gap: .5rem;
}

.pagination li {
    display: inline
}

.admin-posts-controls form,
.pagination a {
    display: inline-block
}

.pagination a {
    padding: .5em .8em;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    color: var(--dark-gray);
    transition: background-color .2s
}

.pagination a:hover {
    background-color: var(--hover-gray)
}

.pagination a.active {
    background-color: var(--dark-gray);
    color: var(--white);
    font-weight: var(--font-weight-bold);
    border-color: var(--dark-gray)
}

.admin-title {
    align-items: center
}

.admin-posts {
    grid-column: 2;
    padding: 0;
    margin: 0;
}

.admin-container {
  display: grid;
  grid-template-columns: 90px 1fr; /* contenu à gauche, liste à droite */
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.container-about {
  display: grid;
  grid-template-rows: 40px 1fr; /* contenu à gauche, liste à droite */
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.admin-posts-controls .btn {
    display: inline-block;
    background-color: var(--black);
    border: 0;
    color: var(--gray-light);
    text-decoration: none;
    font-size: var(--font-size-sm);
    padding: 4px 8px;
    line-height: 2;
    margin-right: 0.5rem;

}

.admin-posts a {
    display: grid;
    grid-template-columns: 1fr 1fr; /* contenu à gauche, liste à droite */
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    
}

.admin-posts li {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--gray-light);
}

img.emoji,
img.wp-smiley {
    display: inline !important;
    border: none !important;
    box-shadow: none !important;
    height: 1em !important;
    width: 1em !important;
    margin: 0 .07em !important;
    vertical-align: -.1em !important;
    background: 0 0 !important;
    padding: 0 !important
}

.suggestions {
    margin-top: 3rem
}

.suggested-articles {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes égales */
    gap: 1.5rem;
}

.suggested-article {
    flex: 1 1 calc(33% - 1.5rem);
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-sizing: border-box;
    transition: box-shadow .3s
}

.suggested-article:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1)
}

.suggested-article h3 {
    font-size: var(--font-size-md);
    margin-bottom: .5rem
}

.suggested-article p {
    font-size: var(--font-size-base);
    color: var(--gray)
}

@media (max-width:480px) {
    .suggested-article {
        flex: 1 1 100%
    }
}

@media only screen and (max-width:767px) { /* Moins de 767px */
    .header_nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .header_nav li {
        margin: 5px 10px
    }

    .header_nav a {
        text-decoration: none;
        color: var(--pure-white);
        padding: 8px 12px;
        font-size: var(--font-size-base);
        white-space: nowrap;
    }

    .container {
        grid-template-columns: 1fr; /* une seule colonne sur mobile */
    }
    .toc {
        position: static;
        margin-bottom: 1rem;
    }

    .suggested-articles {
        grid-template-columns: 1fr; /* suggestions en une colonne sur mobile */
    }
    body {
        background-color: var(--white) !important;
    }
}

.e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload),
.e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload) * {
    background-image: none !important;
}

@media screen and (max-height:1024px) {

    .e-con.e-parent:nth-of-type(n+3):not(.e-lazyloaded):not(.e-no-lazyload),
    .e-con.e-parent:nth-of-type(n+3):not(.e-lazyloaded):not(.e-no-lazyload) * {
        background-image: none !important;
    }
}

@media screen and (max-height:640px) {

    .e-con.e-parent:nth-of-type(n+2):not(.e-lazyloaded):not(.e-no-lazyload),
    .e-con.e-parent:nth-of-type(n+2):not(.e-lazyloaded):not(.e-no-lazyload) * {
        background-image: none !important;
    }
}

@media (max-width:768px) {
    .nav-left ul {
        flex-wrap: wrap;         /* permet aux liens de passer à la ligne */
        gap: 10px;               /* réduit l’espace entre les liens */
    }
    .nav-right {
        margin-left: 0;          /* plus besoin de pousser à droite */
        margin-top: 0.5em;       /* petit espacement vertical */
    }
  .carrousel-item {
    flex-direction: column; /* image au dessus, texte en dessous */
    height: auto;           /* hauteur adaptative */
  }

  .carrousel-image {
    width: 100%;
    height: auto;
    max-height: 250px;      /* limiter la hauteur sur mobile */
  }

  .carrousel-excerpt {
    padding-bottom: 60px;   /* espace pour boutons si nécessaire */
  }

  .carrousel-controls {
    position: static;       /* boutons dans le flux normal */
    margin-top: 10px;
    justify-content: flex-start; /* boutons à gauche */
  }
  .container {
        grid-template-columns: 1fr; /* une seule colonne */
        gap: 1rem;                 /* réduire l’espace entre les éléments */
        padding: 0 15px; /* padding plus léger pour petits écrans */    
    }
.sidebar { /* ou la classe du sommaire */
        order: -1; /* passe en premier dans le flux */
        margin-bottom: 1rem;
}
.toc {
    position: static; /* désactive sticky sur petit écran */
    width: 100%;
    padding: 0.5rem 1rem;
    box-sizing: border-box; /* inclut le padding dans la largeur */
    overflow-x: auto;   /* si les liens sont très longs */
    margin-top: 1rem;   /* espace avec le contenu principal */
  }
  .toc ul {
    padding: 0;
    margin: 0;
  }

  .toc li {
    word-break: break-word; /* évite que le texte force la largeur */
  }

  .toc a {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
  }
}

@media (min-width: 1024px) { /* laptop et plus */
    .container {
        padding: 0 40px; /* plus d’espace à gauche/droite */
    }
}

.language-switcher a {
  text-decoration: none;
  margin: 0 5px;
  color: var(--gray);
}
.language-switcher a.active {
  font-weight: bold;
  color: var(--blue);
}

#language-select {
    margin-right: 0.5rem;
  font-size: var(--font-size-sm);
}

.adminLoginForm {
  max-width: 400px;
  margin: 60px auto;
  padding: 30px;
  background-color: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  font-family: var(--font-base);
}

.adminLoginForm label {
  display: block;
  margin-bottom: 8px;
  font-weight: var(--font-weight-semibold);
  color: var(--black);
}

.adminLoginForm input[type="text"],
.adminLoginForm input[type="password"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--light-gray-bg);
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.adminLoginForm input:focus {
  border-color: var(--blue);
  outline: none;
}

.adminLoginForm button[type="submit"] {
  width: 100%;
  padding: 12px;
  background-color: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.adminLoginForm button:hover {
  background-color: var(--blue);
}

.contact-form-section {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact-form label {
  font-weight: 600;
  color: var(--black);
  display: block;
  margin-bottom: 0.5rem;
}

.contact-form input[type="nom"],
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.contact-form button {
  background-color: var(--blue);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}


.container-accueil {
    display: grid;
    grid-template-columns: 450px 1fr; /* 250px pour le sommaire, reste pour l’article */
    gap: 2rem;                        /* espace entre les colonnes */
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    width: 100%;
    flex: 1; /* pousse le footer en bas quand le contenu est court */
}

.error-message, .error {
  color: var(--red);
  font-size: 0.9em;
  margin-top: 4px;
}

.success-message {
  color: var(--green);
  font-size: 1em;
  margin-bottom: 10px;
  background: var(--light-green);
  padding: 10px;
  border-radius: 5px;
}

.chart-container {
  width: 600px;
  height: 400px;   /* fixe la taille */
  margin: 20px auto;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}




