/* ═══════════════════════════════════════════════════════════
   MODERN 2026 — Mathieux Joubert
   Liquid Glass · Bento Grid · Mode Calme
   Charger après features.css
═══════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════════════════
   1. LIQUID GLASS NAVIGATION
══════════════════════════════════════════════════════ */

.site-nav {
  background: rgba(10, 10, 20, 0.68) !important;
  backdrop-filter: blur(28px) saturate(180%) brightness(0.95);
  -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 6px 40px rgba(0, 0, 0, 0.25) !important;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

/* Effet plus opaque au scroll */
.site-nav.nav-scrolled {
  background: rgba(10, 10, 20, 0.90) !important;
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

/* Reflet intérieur subtil sur le logo */
.nav-logo {
  text-shadow: 0 0 20px rgba(240, 165, 0, 0.2);
}


/* ══════════════════════════════════════════════════════
   2. BOUTON MODE CALME
══════════════════════════════════════════════════════ */

.calm-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-corps);
  transition: all 0.25s ease;
  flex-shrink: 0;
  margin-left: 4px;
}
.calm-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.80);
  border-color: rgba(255, 255, 255, 0.20);
}
.calm-toggle-btn.calm-on {
  background: rgba(78, 205, 196, 0.12);
  border-color: rgba(78, 205, 196, 0.40);
  color: #4ecdc4;
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.12);
}
.calm-toggle-btn .calm-icon { font-size: 0.85rem; }


/* ══════════════════════════════════════════════════════
   3. MODE CALME — réduit animations, sobriété visuelle
══════════════════════════════════════════════════════ */

html.theme-calm .stars-bg            { display: none !important; }
html.theme-calm .hero-home::before   { opacity: 0.3 !important; }

html.theme-calm *,
html.theme-calm *::before,
html.theme-calm *::after {
  animation-play-state: paused !important;
  transition-duration: 50ms !important;
}

html.theme-calm img:hover,
html.theme-calm .livre-card:hover,
html.theme-calm .bento-cell:hover,
html.theme-calm .livre-mini:hover {
  transform: none !important;
  box-shadow: inherit !important;
}

/* Atténue les dégradés criards */
html.theme-calm .bento-bio {
  background-image: none !important;
  background: #1c1c2e !important;
}
html.theme-calm .bento-citation {
  background: #18182e !important;
}

/* Message d'état discret */
html.theme-calm body::after {
  content: "🌿 Mode Calme actif";
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid rgba(78, 205, 196, 0.35);
  color: #4ecdc4;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 20px;
  font-family: var(--font-corps);
  z-index: 9999;
  pointer-events: none;
}


/* ══════════════════════════════════════════════════════
   4. BENTO GRID — section principale index
══════════════════════════════════════════════════════ */

.bento-section {
  background: var(--creme);
  padding: 48px 40px 56px;
}

.bento-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto;
  gap: 16px;
}

/* ── Cellule générique ── */
.bento-cell {
  border-radius: 22px;
  padding: 30px;
  overflow: hidden;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.35s ease;
}
.bento-cell:hover {
  transform: translateY(-6px);
  box-shadow:
    2px 12px 40px rgba(0, 0, 0, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.10);
}


/* ── CELLULE BIO (col 1–2, row 1) ── */
.bento-bio {
  grid-column: 1 / 3;
  grid-row: 1;
  background: var(--encre);
  color: #fff;
  background-image:
    radial-gradient(ellipse at 0% 110%, rgba(240,165,0,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 100% -10%, rgba(78,205,196,0.12) 0%, transparent 50%);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

.bento-bio-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(240,165,0,0.18);
  border: 1px solid rgba(240,165,0,0.30);
  color: var(--or);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.bento-bio-title {
  font-family: var(--font-titre);
  font-size: clamp(1.8rem, 2.4vw, 2.6rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 16px;
}
.bento-bio-title em {
  font-style: italic;
  color: var(--or);
}

.bento-bio-text {
  font-size: 0.94rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.72);
  margin-bottom: 6px;
}
.bento-bio-text p { margin-bottom: 10px; }

.bento-bio-signature {
  color: var(--or);
  font-family: var(--font-titre);
  font-style: italic;
  font-size: 1rem;
  margin-top: 4px;
  margin-bottom: 24px;
  opacity: 0.85;
}

.bento-bio-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.bento-bio-actions .btn-glass {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-corps);
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}
.bento-bio-actions .btn-glass:hover {
  background: rgba(255,255,255,0.22);
}


/* ── CELLULE CITATION + COMPTEUR (col 3–4, row 1) ── */
.bento-citation {
  grid-column: 3 / 5;
  grid-row: 1;
  background: linear-gradient(145deg, #1a1a30 0%, #14142a 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
}

.bento-quote {
  font-family: var(--font-titre);
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(255,255,255,0.88);
  line-height: 1.65;
  border-left: 3px solid var(--or);
  padding-left: 18px;
  margin-bottom: 10px;
}

.bento-quote-author {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  padding-left: 18px;
  margin-bottom: 24px;
}

.bento-counter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 20px;
}
.bento-counter-num {
  font-family: var(--font-titre);
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--or);
  line-height: 1;
}
.bento-counter-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.60);
  line-height: 1.45;
}

.bento-amazon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--or);
  color: var(--noir);
  font-weight: 800;
  font-size: 0.9rem;
  font-family: var(--font-corps);
  padding: 13px 20px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s cubic-bezier(0.23,1,0.32,1), box-shadow 0.2s ease;
  margin-top: auto;
  box-shadow:
    2px 3px 10px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.20);
}
.bento-amazon-btn:hover {
  background: #ffd93d;
  transform: translateY(-3px);
  box-shadow:
    3px 8px 20px rgba(0,0,0,0.22),
    0 0 16px rgba(240,165,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.25);
}


/* ── CELLULE LIVRES (col 1–4, row 2 — pleine largeur) ── */
.bento-livres {
  grid-column: 1 / 5;
  grid-row: 2;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  padding: 32px 36px;
}

.bento-livres-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.bento-livres-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(240,165,0,0.12);
  border: 1px solid rgba(240,165,0,0.25);
  color: var(--or);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.bento-livres-title {
  font-family: var(--font-titre);
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--noir);
  line-height: 1.1;
}
.bento-livres-title em {
  font-style: italic;
  color: var(--or);
}


/* ── CELLULE ACTUALITÉS (col 1–2, row 3) ── */
.bento-actu {
  grid-column: 1 / 3;
  grid-row: 3;
  background: #fdf8f0;
  border: 1px solid rgba(0,0,0,0.06);
}

.bento-actu-title {
  font-family: var(--font-titre);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--noir);
  margin-bottom: 20px;
}

.bento-blog-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--or);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 14px;
  text-decoration: none;
  transition: gap 0.2s;
}
.bento-blog-link:hover { gap: 8px; }


/* ── CELLULE QCM (col 3–4, row 3) ── */
.bento-qcm {
  grid-column: 3 / 5;
  grid-row: 3;
  background: linear-gradient(145deg, #1a1a3e 0%, #2a1a4e 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.bento-qcm-emoji {
  font-size: 2.4rem;
  line-height: 1;
}
.bento-qcm-title {
  font-family: var(--font-titre);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.bento-qcm-sub {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.58);
  line-height: 1.55;
}
.btn-bento-qcm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(100, 100, 238, 0.22);
  border: 1.5px solid rgba(100, 100, 238, 0.45);
  color: #a5b4fc;
  font-weight: 700;
  font-size: 0.86rem;
  font-family: var(--font-corps);
  padding: 11px 22px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
  align-self: flex-start;
}
.btn-bento-qcm:hover {
  background: rgba(100, 100, 238, 0.42);
  color: #fff;
  transform: translateX(3px);
}


/* ══════════════════════════════════════════════════════
   5. RESPONSIVE BENTO
══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .bento-section { padding: 36px 24px; }
  .bento-container { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .bento-bio      { grid-column: 1 / 3; grid-row: 1; }
  .bento-citation { grid-column: 1 / 3; grid-row: 2; }
  .bento-livres   { grid-column: 1 / 3; grid-row: 3; padding: 24px; }
  .bento-actu     { grid-column: 1 / 2; grid-row: 4; }
  .bento-qcm      { grid-column: 2 / 3; grid-row: 4; }

  /* Bug fix: grille livres → 2 cols sur tablette pour éviter le débordement */
  .bento-livres .livres-apercu-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
  .bento-livres .livre-mini-cover { height: 180px !important; }
}

/* Bug fix: bouton Calme caché aussi entre 641–768px (nav trop étroite) */
@media (max-width: 768px) {
  .calm-toggle-btn { display: none !important; }
}

@media (max-width: 640px) {
  .bento-section { padding: 24px 16px; }
  .bento-container { grid-template-columns: 1fr; gap: 12px; }

  .bento-bio,
  .bento-citation,
  .bento-livres,
  .bento-actu,
  .bento-qcm { grid-column: 1; grid-row: auto; }

  .bento-cell { padding: 22px; }
  .bento-livres { padding: 22px 18px; }
  .bento-bio-title { font-size: 1.9rem; }
  .bento-counter-num { font-size: 2.6rem; }

  /* Grille livres → 2 cols sur mobile (pas 4) */
  .bento-livres .livres-apercu-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .bento-livres .livre-mini-cover { height: 150px !important; }
}


/* ══════════════════════════════════════════════════════
   6. AMÉLIORATION CARTES LIVRES (garde les IDs JS)
══════════════════════════════════════════════════════ */

/* Nouvelle apparence des mini-cartes livres dans le bento */
.bento-livres .livre-mini {
  border-radius: 14px;
  overflow: hidden;
  background: #fdf8f0;
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.3s cubic-bezier(0.23,1,0.32,1), box-shadow 0.3s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.bento-livres .livre-mini:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow:
    2px 10px 32px rgba(0,0,0,0.16),
    0 4px 12px rgba(0,0,0,0.08);
}


/* ══════════════════════════════════════════════════════
   7. AMÉLIORATION HERO — micro-ajustements
══════════════════════════════════════════════════════ */

/* Grain subtil sur le hero pour texture premium */
.hero-home::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
  z-index: 0;
}
