:root{
  --bgA: #2a0b3d;
  --bgB: #431468;

  --card: #f4f5fb;
  --card2: #ffffff;

  --text: #111827;
  --muted: #6b7280;

  --accent: #e67a17;     /* orange */
  --accentSoft: rgba(230, 122, 23, 0.14);

  --border: rgba(17, 24, 39, 0.10);

  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;

  --shadow-soft: 0 24px 70px rgba(0,0,0,.22);
  --shadow-subtle: 0 10px 30px rgba(0,0,0,.12);
}

body.dark{
  --card: #0b1020;
  --card2: #0b1020;
  --text: #e5e7eb;
  --muted: #a1a1aa;
  --border: rgba(255,255,255,.10);
  --shadow-soft: 0 26px 80px rgba(0,0,0,.55);
  --shadow-subtle: 0 14px 36px rgba(0,0,0,.35);
}

*,
*::before,
*::after{ box-sizing:border-box; }

body{
  margin:0;
  font-family:"Source Sans Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);

  /* fond “galaxie” */
  background:
    radial-gradient(900px 520px at 15% 10%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(800px 460px at 85% 18%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(900px 520px at 55% 0%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(180deg, var(--bgB), var(--bgA));
}

/* Header */
.main-header{
  position: relative;
  top: 0;
  z-index: 100;
  padding: 0.9rem 1rem;
  background: rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}

.header-container{
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* gauche / logo / droite */
  align-items: center;
  gap: 1rem;
}

.header-left{
  justify-self: start;
}

.logo-link{
  justify-self: center;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.site-logo{
  width: 46px;
  height: 46px;       /* hauteur fixe => plus de saut */
  display: block;     /* évite les décalages inline */
  object-fit: contain;
}

.site-title{
  margin:0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.site-tagline{
  margin:0;
  font-size: .92rem;
  color: rgba(255,255,255,.78);
}


/* Hero */
.hero{
  padding: 1.6rem 1rem 2.2rem;
}

.hero-card{
  max-width: 1120px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,.14);
  padding: 1.25rem 1rem 1rem;
}

@media (min-width: 768px){
  .hero-card{ padding: 1.7rem 1.6rem 1.25rem; }
}

.hero-top{
  display:flex;
  align-items:center;
  gap: .55rem;
  margin-bottom: .9rem;
}

.hero-ribbon{
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  letter-spacing: .02em;
  padding: .38rem .82rem;
  border-radius: 10px;
  transform: rotate(-2deg);
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}

.hero-ribbon--light{
  background: rgba(255,255,255,.70);
  color: #111827;
  border: 1px solid rgba(17,24,39,.10);
}

body.dark .hero-ribbon--light{
  background: rgba(255,255,255,.10);
  color: var(--text);
  border-color: rgba(255,255,255,.12);
}

.hero-title{
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.18;
}

.hero-subtitle{
  margin: .4rem 0 1.15rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Layout */
.layout{
  display:flex;
  flex-direction: column;
  gap: 1.2rem;
}

@media (min-width: 900px){
  .layout{
    flex-direction: row;
    align-items:flex-start;
  }
}

/* Editor */
.editor{
  flex: 2;
  background: var(--card2);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 1.15rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
}

@media (min-width: 768px){
  .editor{ padding: 1.25rem 1.35rem 1.35rem; }
}

.editor-label{
  display:block;
  font-weight: 700;
  margin-bottom: .45rem;
}

.editor-textarea{
  width: 100%;
  min-height: 260px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: .85rem .95rem;
  resize: vertical;
  font: inherit;
  line-height: 1.55;
  color: inherit;
  background: transparent;
}

.editor-textarea:focus{
  outline: 3px solid var(--accentSoft);
  border-color: rgba(230, 122, 23, 0.6);
}

.helper-text{
  margin-top: .45rem;
  font-size: .88rem;
  color: var(--muted);
}

/* Actions */
.actions{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  gap: .55rem;
  margin-top: .85rem;
}

.status{
  font-size: .88rem;
  color: var(--muted);
}

/* Buttons (pastilles Framalibre-like) */
.btn{
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.12);
  padding: .58rem .92rem;
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  display:inline-flex;
  align-items:center;
  gap: .45rem;
  box-shadow: var(--shadow-subtle);
  transition: transform .08s ease, box-shadow .10s ease, background-color .15s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(0,0,0,.14);
}

.btn:active{ transform: translateY(0); }

.btn-outline{
  background: rgba(255,255,255,.70);
  color: #111827;
}

body.dark .btn-outline{
  background: rgba(255,255,255,.10);
  color: var(--text);
  border-color: rgba(255,255,255,.12);
}

.btn-outline:hover{
  background: rgba(255,255,255,.88);
}

body.dark .btn-outline:hover{
  background: rgba(255,255,255,.14);
}


/* Stats panel */
.stats-panel{
  flex: 1.4;
  display:flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 900px){
  .stats-panel{
    position: sticky;
    top: 5.2rem;
  }
}

.stats{
  background: var(--card2);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 1.15rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
}

@media (min-width: 768px){
  .stats{ padding: 1.1rem 1.2rem 1.25rem; }
}

.stat-group + .stat-group{
  margin-top: .95rem;
  padding-top: .85rem;
  border-top: 1px dashed rgba(17,24,39,.18);
}

body.dark .stat-group + .stat-group{
  border-top-color: rgba(255,255,255,.14);
}

.stat-group h2{
  font-size: 1rem;
  margin: 0 0 .6rem;
}

.stat-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

@media (max-width: 600px){
  .stat-grid{ grid-template-columns: 1fr; }
  .actions{ flex-direction: column; align-items: flex-start; }
}

.stat-card{
  background: rgba(17,24,39,.04);
  border-radius: var(--radius-md);
  padding: .6rem .65rem;
  border: 1px solid rgba(17,24,39,.10);
}

body.dark .stat-card{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.10);
}

.stat-card.stat-wide{ grid-column: 1 / -1; }

.stat-label{
  display:block;
  font-size: .82rem;
  color: var(--muted);
}

.stat-value{
  display:block;
  margin-top: .2rem;
  font-weight: 800;
}

/* Goal bar */
.goal-info{
  font-size: .95rem;
  margin: 0 0 .35rem;
}

.goal-bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(17,24,39,.10);
  overflow:hidden;
}

body.dark .goal-bar{ background: rgba(255,255,255,.10); }

.goal-bar-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, #f59e0b, #e67a17);
  transition: width .15s ease-out;
}

/* Keywords */
.keywords-section{
  background: var(--card2);
  border-radius: var(--radius-lg);
  padding: .95rem 1rem 1.05rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
}

.keywords-section h2{
  font-size: 1rem;
  margin: 0 0 .25rem;
}

.keywords-helper{
  margin: 0 0 .55rem;
  font-size: .88rem;
  color: var(--muted);
}

.keywords-list{
  list-style:none;
  padding:0;
  margin:0;
  font-size: .95rem;
}

.keywords-list li{
  padding: .3rem 0;
  display:flex;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px dashed rgba(17,24,39,.12);
}

body.dark .keywords-list li{
  border-bottom-color: rgba(255,255,255,.12);
}

.keywords-list li:last-child{ border-bottom:none; }

.keyword-term{ font-weight: 800; }
.keyword-meta{ font-size: .88rem; color: var(--muted); }

/* Quality */
.quality{
  margin-top: 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: .75rem .85rem .85rem;
  background: rgba(17,24,39,.04);
}

body.dark .quality{ background: rgba(255,255,255,.05); }

.quality h2{
  font-size: 1rem;
  margin: 0 0 .45rem;
}

.quality-content{ font-size: .95rem; }

.quality-list{
  padding-left: 1.1rem;
  margin:0;
}

.quality-list li{ margin-bottom: .3rem; }

/* Separateur */
.sep{
  width: 100%;
  height: 1px;
  border: none;
  margin: 2rem 0;
  background: rgba(255,255,255,.18);
}

/* Article (zone longue) */
.article{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  color: rgba(255,255,255,.92);
}

body.dark .article{ color: rgba(255,255,255,.92); }

/* Footer */
.site-footer{
  background: rgba(255,255,255,.06);
  border-top: 1px solid rgba(255,255,255,.14);
  margin-top: 2.2rem;
  padding: 2rem 1rem;
  text-align:center;
}

.footer-content{
  max-width: 900px;
  margin: 0 auto;
  color: rgba(255,255,255,.92);
}

.footer-title{
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 .45rem;
}

.footer-links{
  list-style:none;
  padding:0;
  margin: 1rem 0;
  display:flex;
  justify-content:center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a{
  color: rgba(255,255,255,.92);
  text-decoration:none;
  font-size: .95rem;
}

.footer-links a:hover{ text-decoration: underline; }

.footer-copy{
  font-size: .85rem;
  color: rgba(255,255,255,.70);
  margin-top: 1rem;
}

.back-to-top{
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  padding: .6rem 1rem;
  border-radius: 999px;
  cursor:pointer;
  font-size: .95rem;
  box-shadow: 0 14px 35px rgba(0,0,0,.22);
  display:none;
  z-index: 9999;
  transition: opacity .25s ease, transform .25s ease;
}

.back-to-top:hover{ transform: translateY(-3px); }
.back-to-top:active{ transform: translateY(0); }

/* =========================
   HERO ARTICLE (comme le compteur)
========================= */

.hero-article{
  padding: 2.4rem 1rem 2.8rem;
}

.hero-article .hero-card{
  background: var(--card);
}

/* Contenu texte */
.article-content{
  margin-top: 1.2rem;
  max-width: 900px;
  line-height: 1.7;
}

/* Titres */
.article-content h2{
  font-size: 1.45rem;
  margin: 2rem 0 0.8rem;
}

.article-content h3{
  font-size: 1.2rem;
  margin: 1.6rem 0 0.6rem;
}

/* Paragraphes */
.article-content p{
  margin: 0.6rem 0 1rem;
  color: var(--text);
}

/* Listes */
.article-content ul,
.article-content ol{
  padding-left: 1.2rem;
  margin: 0.8rem 0 1.2rem;
}

.article-content li{
  margin-bottom: 0.4rem;
}

/* Images dans l’article */
.article-content img{
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 1.2rem auto;
  display: block;
  box-shadow: var(--shadow-subtle);
}

/* Mode sombre */
body.dark .article-content p,
body.dark .article-content li{
  color: var(--text);
}

/* =========================
   Bouton mode sombre – style hero
========================= */

.theme-toggle{
  color: #111827;

  border: 1px solid rgba(17,24,39,.12);
  border-radius: 14px;

  padding: .45rem .8rem;
  font-size: .9rem;
  font-weight: 700;

  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;

  box-shadow: 0 8px 20px rgba(0,0,0,.10);
  transition: background .15s ease, transform .12s ease, box-shadow .12s ease;
}

.theme-toggle:hover{
  background: rgba(255,255,255,.85);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
}

.theme-toggle:active{
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0,0,0,.10);
}

/* Mode sombre */
body.dark .theme-toggle{
  background: rgba(255,255,255,.10);
  color: #e5e7eb;
  border-color: rgba(255,255,255,.18);
}

body.dark .theme-toggle:hover{
  background: rgba(255,255,255,.16);
}

/* =========================
   Mode sombre = ruban "VOS STATS"
========================= */

.theme-toggle{
  cursor: pointer;
  transform: rotate(-2deg);
  font-size: 0.85rem;
  padding: .35rem .75rem;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}

.theme-toggle:hover{
  transform: rotate(-2deg) translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}

/* Mode sombre actif */
body.dark .theme-toggle{
  background: rgba(255,255,255,.12);
  color: var(--text);
  border-color: rgba(255,255,255,.18);
}

.theme-toggle{
  justify-self: end;
  min-width: 140px;      /* ajustez si besoin */
  text-align: center;
  display: inline-flex;
  justify-content: center;
  white-space: nowrap;
}

.footer-langs{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.footer-langs a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 8px;
}

.footer-langs img{
  display: block;
  width: 28px;
  height: 20px;
  border-radius: 4px;
}

