/* ====== Solarpunk v2 : Low-Tech Garden ====== */
:root {
    --couleur1 : #a3be8c;     /* Vert Sauge (Doux et naturel) */
    --couleur2 : #e67e22;     /* Orange Cuivre */
    
    --font-titre: "Fira Code", monospace;
    --font-text : "Fira Code", "Ubuntu Mono", monospace;
    
    --bg-dark : #24292e;      /* Gris charbon organique */
    --sidebar-bg : #1b2024;   /* Ombre de forêt */
    --text-main : #eceff4;    /* Blanc cassé / Brume */
}

/* ====== Structure Globale ====== */
body {
    color: var(--text-main);
    background-color: var(--bg-dark);
    font-family: var(--font-text);
    font-size: 1.05em;
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* ====== Sidebar & Menu (Indicateurs /) ====== */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

header {
    padding: 30px 20px;
    border-bottom: 2px solid var(--couleur1);
    text-align: center;
}

header h1 {
    font-family: var(--font-titre);
    font-size: 1.3em;
    color: var(--couleur1);
    text-transform: uppercase;
    margin: 0;
}

nav.topnav { flex: 1; overflow-y: auto; }
nav.topnav ul { list-style: none; padding: 0; margin: 0; }

/* Premier Niveau */
nav.topnav ul li a {
    display: block;
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
    border-bottom: 1px solid #1a1a1a;
}
nav.topnav ul li a:before { content: "/ "; color: var(--couleur1); font-weight: bold; }

/* Deuxième Niveau (Sous-menus) */
nav.topnav ul li ul li a {
    padding-left: 40px;
    font-size: 0.9em;
    background: #0d0e14;
}
nav.topnav ul li ul li a:before { content: "// "; color: var(--couleur2); }

nav.topnav li a:hover {
    background: #1a1c25;
    color: var(--couleur1);
}

/* ====== Contenu Principal ====== */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 280px);
}

section.main {
    padding: 40px 8%;
    flex: 1;
}

section img {
    max-width: 80%;
    max-height: 500px;
    height: auto;
    margin: 10px;
}

@media (max-width: 800px) {
  section img {
      max-width: 100%;
      height: auto;
      margin: 2px;
  }
}

h1 { 
      color: var(--couleur1); 
      font-family: var(--font-titre); 
      }

h2 {  
      color: var(--couleur1); 
      font-family: var(--font-titre); 
      padding-left: 12px; 
      text-transform: uppercase; 
      }
h3 {  
      color: var(--couleur1); 
      font-family: var(--font-titre); 
      padding-left: 20px; 
    }

section h1 {
  border-bottom: 2px dashed var(--couleur2);
  text-transform: uppercase;
}

section h1:before { content: "> "; color: var(--couleur2); font-weight: bold; }
h2:before { content: "# "; color: var(--couleur2); font-weight: bold; }
h3:before { content: "## "; color: var(--couleur2); font-weight: bold; }

/* Liens textuels */
a { color: var(--couleur2); text-decoration: none; border-bottom: 1px dotted; }
a:hover { color: var(--couleur1); }

table, td, th {
    border: 1px solid var(--couleur2);
    padding: 4px;
}
th {
    background-color: var(--couleur2);
    padding: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* ====== Galerie (Style Monolith / Couleurs Terminal) ====== */
.gallery img {
    width: 180px;
    height: 180px;
    object-fit: cover; /* Comme Monolith */
    padding: 6px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    margin: 5px;
    transition: border 0.3s;
}

.gallery img:hover {
    border: 1px solid var(--couleur2);
    filter: brightness(1.2);
}

/* Photos EXIF */
.ph-box {
    display: flex;
    background: #151515;
    border: 1px solid var(--couleur2);
    padding: 15px;
    gap: 20px;
}
.ph-meta { color: var(--couleur2); font-size: 0.85em; }

blockquote.callout {
    border: 1px solid var(--couleur1);
    background: rgba(0, 255, 65, 0.05);
    padding: 15px;
}

code{
    background-color: #111;
    font-variant: normal ;
    font-family: monospace;
    display: block;
    color: white;
    padding: 10px;
    margin:20px;
    border: 1px solid #444;
}

@media (max-width: 850px) {
  code{
    padding: 5px;
    margin:0px;
  }
}

/*CSS pour framalibre*/
.framalibre-notice {
  display: flex;
  background-color: #222;
  border: 1px solid #555;
  max-width: 60%;
  margin: auto;
}

.framalibre-notice:not(:last-child) {
  margin-bottom: 3rem;
}

.framalibre-notice > div {
  padding: 1.25rem;
}

.framalibre-notice > div:first-of-type {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 25%;
}

.framalibre-notice img {
  max-width: 80%;
}

.framalibre-notice > div:last-of-type > div {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.framalibre-notice a {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-weight: 400;
  color: var(--couleur2);
  text-align: center;
  vertical-align: middle;
  font-size: 1rem;
  line-height: 1.5;
  text-decoration: none;
  border: 1px solid var(--couleur1);
  background-color: transparent;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.framalibre-notice a:hover {
  color: #fff;
  background-color: var(--couleur2);
  border-color: var(--couleur1);
}

/* ====== Footer ====== */
footer {
    padding: 20px 40px;
    background: #0d0e14;
    border-top: 1px solid #222;
    font-size: 0.8em;
}

.droite a {
    color: var(--couleur1);
    border: none;
}

.droite a:hover { color: var(--couleur2); }

/* ====== Responsive ====== */
@media (max-width: 900px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .main-container { max-width: 100%; }
    nav.topnav ul li { float: none; }
}
