/*
 * Custom Theme Styles
 * This file is loaded AFTER plucss.min.css and theme.min.css
 * Override any styles here
 */



/* ========================================
   CSS Variables - Customize these!
   ======================================== */
:root {
  /* Primary colors - Nature magazine green theme */
  --custom-primary: #4CAF50; /* Vert forêt */
  --custom-secondary: #66BB6A; /* Vert menthe */
  --custom-accent: #FFC107; /* Jaune doré pour accents */

  /* Background colors */
  --custom-bg-light: #F8F9FA; /* Gris très clair */
  --custom-bg-dark: #2C3E50; /* Bleu nuit foncé pour dark mode */
  --custom-bg-header: #E8F5E9; /* Vert très clair pour header */
  --custom-bg-footer: #34495E  url(../img/kitten.svg) 95% 90% / 150px no-repeat; /* Gris foncé pour footer */
  --custom-bg-card: #FFFFFF; /* Fond blanc pour les cartes */
  --custom-bg-card-dark: #34495E; /* Fond foncé pour les cartes en dark mode */

  /* Text colors */
  --custom-text-light: #333333; /* Noir doux */
  --custom-text-dark: #ECF0F1; /* Blanc cassé */
  --custom-text-muted: #7F8C8D; /* Gris moyen */
  --custom-text-link: var(--custom-primary);
  --custom-text-link-hover: var(--custom-secondary);

  /* Fonts */

  --custom-font-body:   font-family: "Charter", "Georgia Pro", Georgia, "Cambria",  "Times New Roman", Times, serif; /* Police de lecture confortable */
  --custom-font-heading: font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;; /* Police moderne pour les titres */


  /* Spacing */
  --custom-spacing-sm: 0.5rem;
  --custom-spacing-md: 1rem;
  --custom-spacing-lg: 2rem;
  --custom-spacing-xl: 3rem;

  /* Border radius */
  --custom-radius: 0.5rem;

  /* Shadows */
  --custom-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --custom-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --custom-transition: all 0.3s ease-in-out;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  :root {
    --custom-bg-light: #2C3E50;
    --custom-bg-dark: #1A242F;
    --custom-bg-header: #2C3E50;
    --custom-bg-footer: #1A242F;
    --custom-bg-card: #34495E;
    --custom-text-light: #ECF0F1;
    --custom-text-dark: #F8F9FA;
    --custom-text-muted: #BDC3C7;
  }
}

/* ========================================
   Global Styles
   ======================================== */
html {
  scroll-behavior: smooth;   
   }
body {
  font-family: var(--custom-font-body);
  color: var(--custom-text-light);
  background-color: var(--custom-bg-light);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--custom-font-heading);
  color: var(--custom-text-dark);
  margin-top: var(--custom-spacing-lg);
  margin-bottom: var(--custom-spacing-md);
  line-height: 1.3;
}
.main :is(h1,h2,h3,h4,h5,h6) {
    color:var(--custom-secondary);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

a {
  color: var(--custom-text-link);
  text-decoration: none;
  transition: var(--custom-transition);
}

a:hover {
  color: var(--custom-text-link-hover);
  text-decoration: underline;
}

p {
  margin-bottom: var(--custom-spacing-md);
}

/* ========================================
   Layout Adjustments (Header Left, Article Right, Masonry Below)
   ======================================== */
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--custom-spacing-md);
  padding-right: var(--custom-spacing-md);
}

.header {
position: relative;
  z-index: 101;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--custom-text-dark);
  background-image: url('../img/kitten.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  overflow: hidden;
  box-shadow: var(--custom-shadow), inset 0 25vh #759c4388, inset 0 -25vh #759c4388;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4); /* Overlay semi-transparent */
  z-index: 1;
}

.header .container {
  position: relative;
  z-index: 2;
  padding: var(--custom-spacing-xl);
}
.header .logo {
  padding-bottom: 25%;
}
.header .logo h1 a,
.header .logo h2 {
  color: var(--custom-text-dark);
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.header .logo h1 {
  font-size: 3rem;
  margin-bottom: var(--custom-spacing-sm);
}

.header .logo h2 {
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: yellow;
}
/* Sticky Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 1002;
  background-color: rgba(255, 255, 255, 0.9); /* Translucide */
  box-shadow: var(--custom-shadow);
  padding: var(--custom-spacing-sm) 0;
  backdrop-filter: blur(5px); /* Effet de flou moderne */
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  .nav {
    background-color: rgba(44, 62, 80, 0.9);
  }
}

.nav .menu {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav .menu li {
  margin: 0 var(--custom-spacing-md);
}

.nav .menu li a {
  color: var(--custom-text-light);
  font-weight: 600;
  padding: var(--custom-spacing-sm) var(--custom-spacing-md);
  border-radius: var(--custom-radius);
}

.nav .menu li a:hover,
.nav .menu li.active a {
  color: var(--custom-primary);
  background-color: rgba(var(--custom-primary), 0.1);
  text-decoration: none;
}

/* Main Content Layout */
.main {
  padding-inline:var(--custom-spacing-sm);
}
.main .grid {
  display: grid;
  grid-template-columns: 1fr; /* Default to single column */
  gap: var(--custom-spacing-lg);
  margin-top: var(--custom-spacing-xl);
  grid-auto-flow:dense;
}
.main .breadcrumb,.main .breadcrumb li {
    display:flex;
    align-items:center;
}
.main .breadcrumb li:not(:last-child)::after {
    margin-left:0;
}
@media (min-width: 992px) { /* Large screens */
  .main .grid {
    grid-template-columns: 1fr 3fr; /* Sidebar left, content right */
  }
  .main .grid .aside {
    grid-column: 1 / 2; /* Sidebar is first column */
  }
  .main .grid .content {
    grid-column: 2 / 3; /* Content is second column */
  }
}

/* Article Vedette (Featured Article) */
.article-loop .article:first-child {
  background-color: var(--custom-bg-card);
  padding: var(--custom-spacing-lg);
  border-radius: var(--custom-radius);
  box-shadow: var(--custom-shadow);
  margin-bottom: var(--custom-spacing-lg);
  display: flex;
  flex-direction: column;
  transition: var(--custom-transition);
}

.article-loop .article:first-child:hover {
  transform: translateY(-5px);
  box-shadow: var(--custom-shadow-hover);
}

.article-loop .article:first-child .art-thumbnail {
  order: -1; /* Place thumbnail first */
  margin-bottom: var(--custom-spacing-md);
}

.article-loop .article:first-child .art-thumbnail img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--custom-radius);
}

.article-loop .article:first-child h2 {
  font-size: 2.2rem;
  color: var(--custom-primary);
}

.article-loop .article:first-child .art-chapo {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Masonry Grid for other articles */
.article-loop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--custom-spacing-lg);
  margin-top: var(--custom-spacing-lg);
  padding-inline:var(--custom-spacing-sm);
}

.article:not(:first-child) { /* All articles except the first one */
  background-color: var(--custom-bg-card);
  padding: var(--custom-spacing-md);
  border-radius: var(--custom-radius);
  box-shadow: var(--custom-shadow);
  display: flex;
  flex-direction: column;
  transition: var(--custom-transition);
  height: auto; /* Allow height to adjust */
}

.article:not(:first-child):hover {
  transform: translateY(-5px);
  box-shadow: var(--custom-shadow-hover);
}

.article:not(:first-child) .art-thumbnail {
  margin-bottom: var(--custom-spacing-md);
}

.article:not(:first-child) .art-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--custom-radius);
}

.article:not(:first-child) h2 {
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: var(--custom-spacing-sm);
}

.article:not(:first-child) .art-chapo {
  flex-grow: 1; /* Allow chapo to take available space */
  margin-top: var(--custom-spacing-sm);
  margin-bottom: var(--custom-spacing-md);
}

/* ========================================
   Article Details (Reading Mode)
   ======================================== */
.article {
  background-color: var(--custom-bg-card);
  padding: var(--custom-spacing-xl);
  border-radius: var(--custom-radius);
  box-shadow: var(--custom-shadow);
  margin-bottom: var(--custom-spacing-lg);
  line-height: 1.9;
  font-size: 1.1rem;
}

.article header h2 {
  color: var(--custom-primary);
  font-size: 2.8rem;
  margin-bottom: var(--custom-spacing-md);
}

.article header small {
  color: var(--custom-text-muted);
  font-size: 0.9rem;
  display: block;
  margin-bottom: var(--custom-spacing-md);
}

.article header small span {
  margin-right: var(--custom-spacing-md);
}

.article .art-thumbnail {
  margin-bottom: var(--custom-spacing-lg);
}

.article .art-thumbnail img {
  max-width: 100%;
  height: auto;
  border-radius: var(--custom-radius);
  box-shadow: var(--custom-shadow);
}

.article p {
  margin-bottom: var(--custom-spacing-md);
}

.article strong {
  font-weight: 700;
}

.article em {
  font-style: italic;
}

/* Table of Contents (Auto) */
/* This requires JavaScript to generate, but we can style its container */
.toc-container {
  background-color: var(--custom-bg-light);
  border: 1px solid var(--custom-secondary);
  border-radius: var(--custom-radius);
  padding: var(--custom-spacing-md);
  margin-bottom: var(--custom-spacing-lg);
  box-shadow: var(--custom-shadow);
}

.toc-container h3 {
  color: var(--custom-primary);
  margin-top: 0;
  border-bottom: 1px solid var(--custom-primary);
  padding-bottom: var(--custom-spacing-sm);
}

.toc-container ul {
  list-style: none;
  padding-left: 0;
}

.toc-container ul li a {
  display: block;
  padding: var(--custom-spacing-sm) 0;
  color: var(--custom-text-light);
}

.toc-container ul li a:hover {
  background-color: rgba(var(--custom-primary), 0.05);
  padding-left: var(--custom-spacing-sm);
  text-decoration: none;
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 5px;
  background-color: var(--custom-primary);
  z-index: 9999;
  transition: width 0.1s linear;
}


/* ========================================
   Comment form Styles
   ======================================== */
.comment {
  scroll-margin-top: 10em;
}
#comment-form .grid.full-width {
  grid-template-columns:1fr;
  gap:0;
  margin:0;
}
#comment-form .grid.full-width.col2 {
  display: flex;
  gap: 0 1em;
}

/* ========================================
   Sidebar Styles
   ======================================== */
.aside {
  background-color: var(--custom-bg-card);
  padding: var(--custom-spacing-md);
  border-radius: var(--custom-radius);
  box-shadow: var(--custom-shadow);
  margin-inline:var(--custom-spacing-sm);
}

.aside h3 {
  font-size: 1.25rem;
  color: var(--custom-primary);
  border-bottom: 2px solid var(--custom-secondary);
  padding-bottom: var(--custom-spacing-sm);
  margin-top: var(--custom-spacing-md);
  margin-bottom: var(--custom-spacing-md);
}

.aside ul {
  list-style: none;
  padding: 0;
  margin-bottom: var(--custom-spacing-lg);
}

.aside ul li {
    padding:0;
}

.aside ul li:last-of-type {
  margin-bottom: var(--custom-spacing-sm);
}

.aside ul li a {
  color: var(--custom-text-light);
  /*display: block;
  padding: var(--custom-spacing-sm) 0;*/
}

.aside ul li a:hover {
  color: var(--custom-secondary);
  padding-left: var(--custom-spacing-sm);
  text-decoration: none;
}
.lastcom-list li a *{
    display: contents
}
.aside .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--custom-spacing-sm);
}

.aside .tag-list li {
  display: inline-block;
  background-color: var(--custom-bg-light);
  border: 1px solid var(--custom-secondary);
  border-radius: var(--custom-radius);
  padding: var(--custom-spacing-sm) var(--custom-spacing-md);
  font-size: 1rem;
}

.aside .tag-list li a {
  color: var(--custom-primary);
  padding: 0;
  background:none;
}

.aside .tag-list li a:hover {
  color: var(--custom-bg-footer);
  text-decoration: none;
  padding-left: 0;
  background:none;
}

/* ========================================
   Footer Styles
   ======================================== */
.footer {
  background: var(--custom-bg-footer);
  color: var(--custom-text-dark);
  padding: var(--custom-spacing-xl) 0;
  text-align: center;
  margin-top: var(--custom-spacing-xl);
  box-shadow: inset 0 5px 15px rgba(0,0,0,0.2);
}

.footer a {
  color: var(--custom-secondary);
}

.footer a:hover {
  color: var(--custom-accent);
}

/* ========================================
   Buttons and Links
   ======================================== */
.btn.blue, button.blue,
.pagination a {
  background-color: var(--custom-primary);
  border-color: var(--custom-primary);
  color: var(--custom-text-dark);
  padding: var(--custom-spacing-sm) var(--custom-spacing-md);
  border-radius: var(--custom-radius);
  transition: var(--custom-transition);
}

.btn.blue:hover, button.blue:hover,
.pagination a:hover {
  background-color: var(--custom-secondary);
  border-color: var(--custom-secondary);
  box-shadow: var(--custom-shadow);
  color: var(--custom-text-dark);
  text-decoration: none;
}

/* Pagination */
.pagination a {
  margin: 0 5px;
}

/* ========================================
   Go to Top Button
   ======================================== */
.gotop a {
  background: var(--custom-primary);
  border-radius: 50%;
  padding:5px  10px;
  display: grid;
  place-content: center;
  aspect-ratio: 1;
  box-shadow: var(--custom-shadow);
  transition: var(--custom-transition);
}

.gotop a:hover {
  background: var(--custom-secondary);
  box-shadow: var(--custom-shadow-hover);
}

.gotop img {
  width: 24px;
  height: 24px;
  filter: invert(100%); /* Make arrow white */
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 767px) {
  .header .logo h1 {
    font-size: 2.5rem;
  }
  .header .logo h2 {
    font-size: 1.2rem;
  }
  .nav .menu {
    flex-direction: column;
  }
  .nav .menu li {
    margin: var(--custom-spacing-sm) 0;
  }
  .main .grid {
    grid-template-columns: 1fr;
  }
  .article-loop {
    grid-template-columns: 1fr;
  }
  .article-loop .article:first-child .art-thumbnail img {
    height: 200px;
  }
  .article {
    padding: var(--custom-spacing-md);
  }
  .article header h2 {
    font-size: 2rem;
  }
}

/* ========================================
   Comments Section
   ======================================== */
#comments {
  color: var(--custom-primary);
  border-bottom: 2px solid var(--custom-primary);
  padding-bottom: var(--custom-spacing-sm);
  margin-top: var(--custom-spacing-xl);
  margin-bottom: var(--custom-spacing-lg);
}

.comment {
  background-color: var(--custom-bg-card);
  padding: var(--custom-spacing-md);
  border-radius: var(--custom-radius);
  box-shadow: var(--custom-shadow);
  margin-bottom: var(--custom-spacing-md);
}

.comment small {
  color: var(--custom-text-muted);
}

.comment blockquote {
  border-left: 4px solid var(--custom-secondary);
  margin-left: 0;
  padding-left: var(--custom-spacing-md);
  color: var(--custom-text-light);
}

#comment-form {
  background-color: var(--custom-bg-card);
  padding: var(--custom-spacing-lg);
  border-radius: var(--custom-radius);
  box-shadow: var(--custom-shadow);
  margin-top: var(--custom-spacing-xl);
}

#comment-form h2 {
  color: var(--custom-primary);
  border-bottom: 2px solid var(--custom-primary);
  padding-bottom: var(--custom-spacing-sm);
  margin-top: 0;
  margin-bottom: var(--custom-spacing-lg);
}

#comment-form label {
  display: block;
  margin-bottom: var(--custom-spacing-sm);
  font-weight: 600;
  color: var(--custom-text-light);
}

#comment-form input[type="text"],
#comment-form input[type="email"],
#comment-form input[type="url"],
#comment-form textarea {
  width: 100%;
  padding: var(--custom-spacing-sm);
  border: 1px solid var(--custom-text-muted);
  border-radius: var(--custom-radius);
  background-color: var(--custom-bg-light);
  color: var(--custom-text-light);
}

@media (prefers-color-scheme: dark) {
  #comment-form input[type="text"],
  #comment-form input[type="email"],
  #comment-form input[type="url"],
  #comment-form textarea {
    background-color: var(--custom-bg-dark);
    border-color: var(--custom-text-muted);
    color: var(--custom-text-dark);
  }
}

#comment-form input:focus,
#comment-form textarea:focus {
  border-color: var(--custom-primary);
  box-shadow: 0 0 0 3px rgba(var(--custom-primary), 0.2);
  outline: none;
}

/* Author Infos */
.author-infos {
  background-color: var(--custom-bg-light);
  padding: var(--custom-spacing-md);
  border-left: 5px solid var(--custom-secondary);
  border-radius: var(--custom-radius);
  margin-top: var(--custom-spacing-xl);
  margin-bottom: var(--custom-spacing-xl);
  box-shadow: var(--custom-shadow);
}

@media (prefers-color-scheme: dark) {
  .author-infos {
    background-color: var(--custom-bg-card-dark);
  }
}

/* Specific PluCSS overrides for consistency */
.alert.orange {
  background-color: #FFECB3; /* Light orange */
  color: #E65100; /* Dark orange text */
  border-color: #FFC107; /* Orange border */
}

@media (prefers-color-scheme: dark) {
  .alert.orange {
    background-color: #5E35B1; /* Purple for dark mode errors */
    color: #F3E5F5;
    border-color: #7E57C2;
  }
}

/* Additional styling for masonry ultra fluide */
/* This will typically rely on a JS library like Masonry.js
   For CSS-only, it's about flex/grid and content order.
   The current CSS grid setup is a good start for "masonry-like" */

/* Ensure images within content are responsive */
.article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--custom-spacing-md) auto;
  border-radius: var(--custom-radius);
}

/* Code blocks */
pre {
  background-color: var(--custom-bg-dark);
  color: var(--custom-text-dark);
  padding: var(--custom-spacing-md);
  border-radius: var(--custom-radius);
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin-bottom: var(--custom-spacing-md);
}

code {
  background-color: rgba(var(--custom-primary), 0.1);
  color: var(--custom-primary);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

/* Blockquotes */
blockquote {
  border-left: 5px solid var(--custom-primary);
  margin: var(--custom-spacing-md) 0;
  padding-left: var(--custom-spacing-md);
  font-style: italic;
  color: var(--custom-text-muted);
}

/* Lists */
ul, ol {
  margin-left: var(--custom-spacing-lg);
  margin-bottom: var(--custom-spacing-md);
}

ul li, ol li {
  margin-bottom: var(--custom-spacing-sm);
}

/* Hide responsive menu label on larger screens */
.responsive-menu label,
.responsive-menu input[type="checkbox"] {
    display: none;
  }
.nav .menu {
  justify-content: initial;
}
/* Show responsive menu label on smaller screens */
@media (max-width: 767px) {
  .responsive-menu label {
    display: block;
    cursor: pointer;
    text-align: right;
    padding: var(--custom-spacing-sm);
    color: var(--custom-primary);
    font-weight: bold;
  }
  .responsive-menu .menu {
  position:static;
  }
  .responsive-menu >.menu {
    display:none;
  }
  .container .responsive-menu input[type="checkbox"]:checked + .menu {
    display:grid;
  }
  .nav .menu li a {
    width: 100%;
    text-align: center;
    padding: var(--custom-spacing-md) 0;
  }
}
/* Progress bar for reading */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background-color: var(--custom-primary);
  z-index: 9999;
  transition: width 0.1s linear;
}


/* =====================================================
   Css Updates for your plugins, add them down here
   ===================================================== */
/*example markdownEditor */
#editor.distraction-free {
  z-index: 1005;
}