/* modern-v2.css - Design SaaS Premium "WOW Effect", UX/SEO Optimisé */
:root {
  --primary: #3b82f6; /* Bleu vibrant */
  --primary-hover: #2563eb;
  --bg-color: #f1f5f9; /* Gris très clair pour le fond */
  --card-bg: #ffffff;
  --sidebar-bg: #0f172a; /* Navy très profond pour contraster */
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #ffffff;
  --text-main: #334155;
  --text-muted: #64748b;
  --sidebar-width: 320px;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Global Layout Grid : Sidebar à gauche ! */
#wrapper {
  display: flex;
  flex-direction: row-reverse; /* Met le sidebar (qui est 2ème dans le HTML) à GAUCHE */
  min-height: 100vh;
}

/* Sidebar Fixed Left (Visuellement très différente, thème sombre premium) */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: none;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: 5px 0 25px rgba(0,0,0,0.1);
  z-index: 10;
}

/* Scrollbar discrète pour la sidebar */
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }

#sidebar .inner {
  padding-bottom: 2rem;
}

.site-branding {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 1.5rem;
}
.site-branding img { max-width: 90%; height: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }
.site-branding p { font-size: 0.85rem; color: var(--sidebar-text); margin-top: 1rem; }

/* Main Content Right */
#main {
  flex-grow: 1;
  padding: 3rem 4rem;
  width: 100%;
  max-width: none;
  background: var(--bg-color);
}

/* Typography & Reset */
h1, h2, h3, h4 {
  color: #0f172a;
  font-weight: 800;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.8rem; margin-top: 0; background: linear-gradient(135deg, #0f172a, #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 1.8rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.5em; }
p, ul, ol { margin-bottom: 1.5rem; max-width: 850px; }

a { color: var(--primary); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--primary-hover); }

/* Buttons avec Micro-animations */
.button {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  padding: 0.8em 1.8em;
  border-radius: 50px; /* Pill shape ultra moderne */
  font-weight: 700;
  text-align: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}
.button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.6);
  color: white;
}

/* Cards (Articles/Posts) avec effet Glass/Hover */
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

article {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.5);
  position: relative;
  overflow: hidden;
}
article::after { /* Effet brillance au hover */
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg); transition: all 0.7s;
}
article:hover { transform: translateY(-8px); box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1); }
article:hover::after { left: 200%; }

article .image { display: block; margin-bottom: 1.5rem; border-radius: 8px; overflow: hidden; }
article .image img { width: 100%; height: 200px; object-fit: cover; transition: transform 0.5s ease; }
article:hover .image img { transform: scale(1.08); }

article h3 { margin-top: 0; font-size: 1.4rem; line-height: 1.4; }
article h3 a { color: #0f172a; }
article h3 a:hover { color: var(--primary); }
article p { flex-grow: 1; color: var(--text-muted); font-size: 0.95rem; }

/* Sidebar Menu Redesign (Thème Sombre) */
#menu header { padding: 0 1.5rem; margin-bottom: 1rem; }
#menu header h2 { font-size: 0.85rem; text-transform: uppercase; color: #64748b; border: none; padding: 0; letter-spacing: 1px; }

#menu ul { list-style: none; padding: 0; margin: 0; }
#menu > ul > li { margin-bottom: 0.25rem; }

#menu > ul > li > .opener,
#menu > ul > li > a {
  display: block;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  color: #cbd5e1; /* Gris clair */
  border-radius: 8px;
  margin: 0 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: none !important;
}
#menu > ul > li > .opener:hover,
#menu > ul > li > a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--sidebar-text-hover);
  transform: translateX(4px); /* Micro interaction */
}

/* Les sous-menus */
#menu ul ul {
  padding-left: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
  border-left: 2px solid rgba(255,255,255,0.05);
  margin-left: 1.5rem;
}
#menu ul ul a {
  display: block;
  padding: 0.4rem 1rem;
  color: var(--sidebar-text);
  font-size: 0.95rem;
  border-radius: 6px;
  margin-bottom: 2px;
  transition: all 0.2s;
}
#menu ul ul a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Monetization / Ads (Anti-CLS, discret mais cliquable) */
.ad-container {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  min-height: 280px; 
  display: block;
  text-align: center;
  padding: 10px;
  margin: 3rem 0;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.ad-container::before {
  content: 'Sponsorisé';
  position: absolute;
  top: -12px;
  background: #f8fafc;
  padding: 2px 15px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

/* Sticky Boutique Sidebar (Glow effect) */
.sidebar-sticky-boutique {
  margin: 2rem 1rem;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.sidebar-sticky-boutique::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 60%);
}
.sidebar-sticky-boutique h3 { color: #fff; margin: 0 0 0.5rem 0; font-size: 1.2rem; position: relative; }
.sidebar-sticky-boutique p { font-size: 0.9rem; color: #cbd5e1; margin-bottom: 1.2rem; position: relative; }
.sidebar-sticky-boutique a {
  display: inline-block; background: var(--primary); color: white; padding: 0.75rem 1.5rem;
  border-radius: 50px; font-weight: bold; transition: all 0.3s; position: relative;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.sidebar-sticky-boutique a:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6); }

/* Responsive */
@media (max-width: 1024px) {
  #main { padding: 2rem; }
}
@media (max-width: 800px) {
  #wrapper { flex-direction: column; } /* Sur mobile, main au dessus, sidebar en dessous */
  #sidebar { width: 100%; height: auto; position: static; border-bottom: 2px solid #1e293b; }
  #main { padding: 1.5rem; }
  .posts { grid-template-columns: 1fr; }
}
