/* ================================================
   FEATURES — Firmin Joubert
   1. Barre de progression de lecture
   2. Mode clair / sombre
   3. Badge "Écrit par un humain"
   4. Exit-intent pop-up
   ================================================ */

/* ══ 1. BARRE DE PROGRESSION ══ */
#reading-progress-bar {
  position: fixed;
  top: var(--nav-h, 70px);
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--foret), var(--or-nature));
  z-index: 999;
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(45,90,61,0.4);
}

/* ══ 2. TOGGLE DARK/LIGHT ══ */
.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; cursor: pointer;
  font-size: 1rem; transition: background 0.2s, transform 0.2s;
  margin-left: 8px; flex-shrink: 0;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
.theme-icon { pointer-events: none; user-select: none; }

html.theme-light body { background-color: #f7f3ed; color: #2c2c2c; }
html.theme-light section,
html.theme-light .section { background-color: #f7f3ed; }

html, body, section, p, h1, h2, h3, h4 {
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ══ 3. BADGE HUMAIN ══ */
.human-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 6px 14px;
  font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.55);
  margin-top: 12px; transition: border-color 0.2s, color 0.2s;
}
.human-badge:hover { border-color: rgba(201,168,76,0.4); color: rgba(255,255,255,0.8); }
.human-badge-icon { font-size: 0.9rem; line-height: 1; }
.footer-badges {
  display: flex; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-top: 4px; margin-bottom: 6px;
}

/* ══ 4. EXIT-INTENT ══ */
#exit-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99990;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(4px);
}
#exit-overlay.exit-visible { opacity: 1; }

#exit-modal {
  position: relative;
  background: var(--foret-dark);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 20px; padding: 48px 40px 36px;
  max-width: 460px; width: 100%; text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.23,1,0.32,1);
}
#exit-overlay.exit-visible #exit-modal { transform: translateY(0) scale(1); }

#exit-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(255,255,255,0.08); border: none;
  color: rgba(255,255,255,0.5); font-size: 1rem;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
#exit-close:hover { background: rgba(255,255,255,0.18); color: #fff; }
#exit-deco { font-size: 2.8rem; margin-bottom: 12px; line-height: 1; }
#exit-pretitle {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--or-nature); margin-bottom: 10px;
}
#exit-title {
  font-family: var(--font-titre); font-size: clamp(1.5rem,4vw,2rem);
  font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 14px;
}
#exit-title em { font-style: italic; color: var(--menthe); }
#exit-body { color: rgba(255,255,255,0.65); font-size: 0.92rem; line-height: 1.65; margin-bottom: 24px; }
#exit-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
#exit-email {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1.5px solid rgba(201,168,76,0.3);
  background: rgba(255,255,255,0.07); color: #fff;
  font-size: 0.95rem; font-family: var(--font-corps); outline: none;
  transition: border-color 0.2s;
}
#exit-email:focus { border-color: var(--or-nature); }
#exit-email::placeholder { color: rgba(255,255,255,0.35); }
#exit-submit {
  width: 100%; padding: 12px; background: var(--or-nature);
  color: var(--foret-dark); font-weight: 700; font-size: 0.95rem;
  font-family: var(--font-corps); border: none; border-radius: 10px;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
#exit-submit:hover { background: #e0b85a; transform: translateY(-1px); }
#exit-amazon {
  display: block; font-size: 0.82rem;
  color: rgba(255,255,255,0.45); text-decoration: underline;
  text-underline-offset: 3px; margin-bottom: 14px; transition: color 0.2s;
}
#exit-amazon:hover { color: rgba(255,255,255,0.75); }
#exit-note { font-size: 0.73rem; color: rgba(255,255,255,0.3); }
#exit-success { color: var(--menthe); font-size: 1rem; line-height: 1.6; padding: 16px 0; }

/* ══ MERCI POP-UP ══ */
#exit-modal[style*="text-align:center"] #exit-title em { color: var(--menthe); }

@media (max-width: 600px) {
  #exit-modal { padding: 40px 20px 28px; }
}
