/* 
   theme/static/css/ltm.css
*/

:root {
  /* Palette de couleurs */
  --background-color:#dec193;
  --text-color: #111;
  --link-color: #111;
  --link-hover-color: #777;
  --border-color: #333;
  --light-bg-color: #f5f5f0;
  --secondary-text-color: #555;
  
  /* Typographie */
  --body-font: 'Roboto', serif;
  --heading-font: 'Roboto', serif;
  --code-font: 'Courier New', monospace;
}

.logo {
    flex-shrink: 0;
    margin-right: 1.5rem;
}

.logo img {
    max-height: 80px;
    width: auto;
}

.header-text {
    flex-grow: 1;
}

.site-subtitle {
    margin: 0;
    color: var(--secondary-text-color);
}

/* Reset de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Styles généraux */
html {
  font-size: 100%;
}

body {
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
  background-image: url('../../../pictures/kp.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  max-width: 700px;
  margin: 0 auto;
  padding: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(222, 193, 147, 0.5);
  z-index: -1;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: normal;
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
}

/* Liens */
a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover-color);
}

/* Header du site */
.site-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 1.5rem 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  font-size: 1.6rem;
  margin: 0;
  margin-bottom: 0.3rem;
  border-bottom: none;
  padding-bottom: 0;
}

.site-title a {
  text-decoration: none;
  color: var(--text-color);
}

.site-title a:hover {
  color: var(--link-hover-color);
}


/* Navigation */
.site-nav {
  margin-bottom: 2rem;
  padding: 0 1.5rem;
}

main {
  padding: 0 1.5rem;
}

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

.site-nav li {
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

/* Dropdown menu */
.site-nav .dropdown {
  position: relative;
  display: inline-block;
}

.site-nav .dropdown-toggle {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-nav .dropdown-toggle:hover {
  color: var(--link-hover-color);
}

.site-nav .dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background-image: url('../../../pictures/kp.png');
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0;
  min-width: 150px;
  z-index: 1000;
  list-style: none;
  margin: 0;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.site-nav .dropdown-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(222, 193, 147, 0.5);
  z-index: -1;
}

.site-nav .dropdown:hover .dropdown-menu {
  display: block;
}

.site-nav .dropdown-menu li {
  margin: 0;
  padding: 0;
}

.site-nav .dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.site-nav .dropdown-menu a:hover {
  background-color: rgba(245, 245, 240, 0.8);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  /* Effet dithering simulé */
  /* filter: grayscale(100%) contrast(120%); */
}

figcaption {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
  color: var(--secondary-text-color);
  font-style: italic;
}

/* Listes */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Articles */
.article, .article-summary {
  margin-bottom: 3rem;
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.article-title a {
  text-decoration: none;
  color: var(--text-color);
}

.article-title a:hover {
  color: var(--link-hover-color);
}

.article-meta {
  font-size: 0.9rem;
  color: var(--secondary-text-color);
  margin-bottom: 1rem;
}

.article-meta a {
  color: var(--secondary-text-color);
}

.article-tags {
  margin-top: 0.5rem;
}

.article-tags a {
  color: var(--secondary-text-color);
  text-decoration: none;
}

.article-tags a:hover {
  text-decoration: underline;
}

.article-content {
  margin-bottom: 2rem;
}

.article-excerpt {
  margin-bottom: 1rem;
}

.article-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  font-size: 0.9rem;
}

/* Pagination */
.pagination {
  text-align: center;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.pagination a {
  margin: 0 1rem;
}

/* Archives */
.archives h2 {
  margin-top: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.archive-list {
  list-style: none;
  margin-left: 0;
}

.archive-list li {
  display: flex;
  margin-bottom: 0.5rem;
  align-items: baseline;
}

.archive-list time {
  min-width: 60px;
  margin-right: 1rem;
  font-size: 0.9rem;
  color: var(--secondary-text-color);
}

/* Blocs de code */
pre, code {
  font-family: var(--code-font);
  background-color: var(--light-bg-color);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

code {
  padding: 0.1rem 0.3rem;
}

pre {
  padding: 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  line-height: 1.3;
}

pre code {
  border: none;
  padding: 0;
  background-color: transparent;
}

/* Citations */
blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--border-color);
  font-style: italic;
  background-color: var(--light-bg-color);
}

/* Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

th, td {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

th {
  background-color: var(--light-bg-color);
  font-weight: normal;
}

/* Éléments d'interface */
hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: 2rem 0;
}

/* Pied de page */
.site-footer {
  margin-top: 3rem;
  padding: 1rem 1.5rem 2rem 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--secondary-text-color);
}

/* Styles utilitaires */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.small {
  font-size: 0.9rem;
}

.muted {
  color: var(--secondary-text-color);
}

/* Mise en forme spéciale pour contenu low-tech */
.energy-data {
  background-color: var(--light-bg-color);
  padding: 1rem;
  border: 1px solid var(--border-color);
  margin: 1rem 0;
}

.energy-data h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-item {
  text-align: center;
  padding: 0.5rem;
  background-color: var(--light-bg-color);
  border: 1px solid var(--border-color);
}

.stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--secondary-text-color);
}

/* Mode sombre "hors ligne solaire" */
.solar-offline {
  --background-color: #111;
  --text-color: #ddd;
  --link-color: #ddd;
  --link-hover-color: #fff;
  --border-color: #444;
  --light-bg-color: #222;
  --secondary-text-color: #aaa;
}

.offline-notice {
  background-color: #333;
  color: #ddd;
  padding: 1rem;
  text-align: center;
  margin-bottom: 2rem;
  border: 1px solid #555;
}

/* Version responsive */
@media (max-width: 700px) {
  body {
    padding: 1rem;
    font-size: 0.95rem;
  }
  
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .site-header > div:last-child {
    text-align: left;
    margin-top: 1rem;
  }
  
  .battery-status {
    max-width: 150px;
  }
  
  h1 {
    font-size: 1.6rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  .site-nav ul {
    flex-direction: column;
  }
  
  .site-nav li {
    margin-right: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .archive-list li {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .archive-list time {
    margin-right: 0;
    margin-bottom: 0.2rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }
  
  h1 {
    font-size: 1.4rem;
  }
  
  .article-meta {
    font-size: 0.8rem;
  }
}

/* Optimisations d'impression */
@media print {
  body {
    max-width: none;
    padding: 0;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .site-header,
  .site-nav,
  .site-footer,
  .battery-status {
    display: none;
  }
  
  a {
    text-decoration: none;
    color: var(--text-color);
  }
  
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
}

/* Animations subtiles */

a {
  transition: color 0.2s ease;
}

/* Focus pour l'accessibilité */
a:focus,
button:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}