/* ============================================================
   PAGE D'ACCUEIL
   ============================================================ */

.section--alt { background: var(--bg-2); }
.home-empty { text-align: center; color: var(--text-3); padding: 40px; }

/* ─── BOUTONS ───────────────────────────────────────────────── */
.btn-light { background: #fff; color: var(--primary); border-color: #fff; }
.btn-light:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); border-color: #fff; color: #fff; }

/* ─── HERO ──────────────────────────────────────────────────── */
.home-hero {
  position: relative; min-height: 560px; display: flex; align-items: center;
  background: var(--primary) url('/img/hero.jpg') center/cover no-repeat;
}
.home-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14,14,70,0.88) 0%, rgba(26,26,110,0.6) 55%, rgba(26,26,110,0.2) 100%);
}
.home-hero-inner { position: relative; z-index: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 80px 24px; }
.home-hero-eyebrow {
  display: inline-block; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 16px;
}
.home-hero-title { font-size: 52px; font-weight: 800; color: #fff; line-height: 1.1; max-width: 640px; margin-bottom: 20px; }
.home-hero-desc { font-size: 17px; color: rgba(255,255,255,0.85); max-width: 520px; line-height: 1.7; margin-bottom: 32px; }
.home-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.home-hero-pic { display: none; }

/* ─── EN-TÊTES DE SECTION ───────────────────────────────────── */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.home-head h2 { font-size: 30px; margin-top: 4px; }
.home-head-link { display: inline-flex; align-items: center; gap: 4px; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; color: var(--primary); }
.home-head-link:hover { color: var(--accent); }
.home-head-link .material-icons { font-size: 18px; }

/* ─── SLIDERS ───────────────────────────────────────────────── */
.slider-wrap { position: relative; }
.slider-track {
  display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; scroll-padding-left: 4px; padding: 8px 4px 20px; scrollbar-width: none;
}
.slider-track::-webkit-scrollbar { display: none; }
.slider-item { flex: 0 0 calc((100% - 96px) / 5); min-width: 190px; scroll-snap-align: start; }

.slider-btn {
  position: absolute; top: 40%; width: 42px; height: 42px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: var(--shadow); z-index: 2; transition: var(--transition); color: var(--primary);
}
.slider-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.slider-btn-prev { left: -18px; }
.slider-btn-next { right: -18px; }

/* Petits traits de position (un seul élément visible) */
.slider-dots { display: none; justify-content: center; gap: 6px; margin-top: 6px; }
.slider-wrap.is-single .slider-dots { display: flex; }
.slider-dot {
  position: relative; width: 18px; height: 4px; padding: 0; border: none; border-radius: 2px;
  background: var(--border); cursor: pointer; transition: var(--transition);
}
.slider-dot::after { content: ''; position: absolute; inset: -12px -3px; }
.slider-dot.active { width: 34px; background: var(--primary); }

/* ─── CATÉGORIES ────────────────────────────────────────────── */
.cat-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
.cat-marquee { display: none; }

.cat-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 700; color: #fff; transition: var(--transition);
}
.cat-badge:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.cat-badge small { background: rgba(255,255,255,0.25); padding: 2px 8px; border-radius: var(--radius); font-size: 11px; }
.cat-c0 { background: #1a1a6e; } .cat-c1 { background: #e8a020; } .cat-c2 { background: #0f8b8d; } .cat-c3 { background: #c0392b; }
.cat-c4 { background: #6c3fb5; } .cat-c5 { background: #2e7d32; } .cat-c6 { background: #d35400; } .cat-c7 { background: #2471a3; }

@keyframes cat-left  { from { transform: translateX(0); }    to { transform: translateX(-50%); } }
@keyframes cat-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ─── LA MAISON ET PRIX : titre / média / texte ─────────────── */
.home-split {
  display: grid; grid-template-columns: 1fr 1fr;
  grid-template-areas: "head media" "body media";
  column-gap: 64px; align-content: center;
}
.home-split-head { grid-area: head; align-self: end; }
.home-split-body { grid-area: body; align-self: start; }
.home-split-media { grid-area: media; align-self: center; }

.home-split-head h2 { font-size: 30px; line-height: 1.25; margin: 8px 0 20px; }
.home-split--prize .home-split-head h2 { font-size: 28px; line-height: 1.3; }
.home-split-body p { color: var(--text-2); line-height: 1.85; margin-bottom: 16px; }
.home-split-body strong { color: var(--primary); }
.home-split-body .btn { margin-top: 8px; }
.home-split-media img,
.home-split-media video {
  width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.home-split-media video { background: #000; }

/* ─── BANDES BLEUES CENTRÉES ────────────────────────────────── */
.home-band-wrap { padding: 24px 0; }
.home-band { background: var(--primary); border-radius: var(--radius); padding: 56px 48px; }
.home-band--center { text-align: center; }
.home-band--center h2 { color: #fff; font-size: 22px; margin-bottom: 14px; }
.home-band--center p { color: rgba(255,255,255,0.8); max-width: 540px; margin: 0 auto 28px; }

/* ─── CAFÉ LITTÉRAIRE ───────────────────────────────────────── */
.home-cafe-inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.home-cafe-icon {
  width: 88px; height: 88px; border: 2px solid var(--accent); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.home-cafe-icon .material-icons { font-size: 44px; color: var(--accent); }
.home-cafe-text { flex: 1; min-width: 260px; }
.home-cafe-text h2 { color: #fff; font-size: 30px; margin: 6px 0 12px; }
.home-cafe-text p { color: rgba(255,255,255,0.82); line-height: 1.8; max-width: 620px; }

/* ─── RÉSEAUX SOCIAUX : cases de même largeur ───────────────── */
.social-links--section {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; max-width: 760px; margin: 0 auto;
}
.social-links--section .social-link { justify-content: center; padding: 14px 12px; }

/* ─── ACTUALITÉS : les deux dernières ───────────────────────── */
.actualites-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ─── NEWSLETTER ────────────────────────────────────────────── */
.home-news-card {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 32px 36px;
}
.home-news-text { display: flex; align-items: center; gap: 16px; }
.home-news-text .material-icons { font-size: 40px; color: var(--primary); }
.home-news-text h2 { font-size: 22px; margin-bottom: 4px; }
.home-news-text p { color: var(--text-2); font-size: 14px; }
.home-news-form { display: flex; gap: 10px; flex: 1; min-width: 320px; max-width: 620px; }
.home-news-form input {
  flex: 1; min-width: 0; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; outline: none; background: #fff; font-family: 'Lato', sans-serif;
}
.home-news-form input:focus { border-color: var(--primary); }
.home-news-form button {
  padding: 13px 24px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.home-news-form button:hover { background: var(--primary-2); }

/* ─── BARRE DE RECHERCHE ────────────────────────────────────── */
.home-search { max-width: 760px; text-align: center; }
.home-search h2 { font-size: 30px; margin-bottom: 24px; }

.home-search-form {
  display: flex; align-items: center; gap: 12px; max-width: 680px; margin: 0 auto;
  padding: 8px 8px 8px 18px; background: #fff; border: 2px solid var(--border);
  border-radius: var(--radius); transition: var(--transition);
}
.home-search-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,26,110,0.08); }
.home-search-form > .material-icons { color: var(--text-3); }
.home-search-form input {
  flex: 1; min-width: 0; border: none; outline: none; font-size: 17px; padding: 12px 0;
  color: var(--text); background: transparent; font-family: 'Lato', sans-serif; text-overflow: ellipsis;
}
.home-search-form input::placeholder { color: var(--text-3); opacity: 1; }
.home-search-form button {
  padding: 13px 26px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer;
}
.home-search-form button:hover { background: var(--primary-2); }
.home-search-form .btn-icon { display: none; color: #fff; }

/* ─── TABLETTE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .slider-item { flex: 0 0 calc((100% - 48px) / 3); }
  .home-split {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "media" "body";
  }
  .home-split-head { align-self: start; }
  .home-split-head h2 { margin-bottom: 18px; }
  .home-split-media { margin-bottom: 24px; }
}

/* ─── MOBILE LARGE ET TABLETTE PORTRAIT (≤ 768px) ───────────── */
@media (max-width: 768px) {
  .home-hero { min-height: 480px; }
  .home-hero-title { font-size: 34px; }
  .slider-item { flex: 0 0 46%; }
  .slider-btn { display: none; }
  .home-head h2 { font-size: 24px; }
  .home-band { padding: 36px 22px; }
  .home-band--center h2, .home-cafe-text h2 { font-size: 24px; }
  .home-search h2 { font-size: 24px; }
  .home-news-card { padding: 24px 20px; }
  .home-news-form { flex-direction: column; min-width: 0; max-width: none; width: 100%; }
  .home-split-head h2, .home-split--prize .home-split-head h2 { font-size: 24px; }

  /* Catégories : deux lignes qui défilent en sens contraire */
  .cat-cloud--desktop { display: none; }
  .cat-marquee { display: grid; gap: 12px; margin-inline: calc(50% - 50vw); overflow: hidden; }
  .cat-row { overflow: hidden; }
  .cat-track { display: flex; width: max-content; animation: cat-left var(--dur, 32s) linear infinite; }
  .cat-row--rtl .cat-track { animation-name: cat-right; }
  .cat-track .cat-badge { flex: 0 0 auto; margin-right: 12px; white-space: nowrap; }
  .cat-row:active .cat-track { animation-play-state: paused; }
}

@media (prefers-reduced-motion: reduce) {
  .cat-track { animation: none; width: auto; flex-wrap: wrap; row-gap: 12px; padding: 0 16px; }
  .cat-track [aria-hidden="true"] { display: none; }
}

/* ─── MOBILE (≤ 600px) ──────────────────────────────────────── */
@media (max-width: 600px) {

  /* Hero : l'image mobile s'affiche en entier, le texte est dessous.
     --hero-m-ratio = hauteur ÷ largeur de hero-mobile.png (1000×1200 → 1.2) */

     /* Hero mobile : l'image se fond dans le bleu, le texte remonte dessus */
  .home-hero { --hero-m-overlap: 110px; display: block; min-height: 0; background: var(--primary); }
  .home-hero::before { display: none; }

  .home-hero-pic { display: block; position: relative; line-height: 0; }
  .home-hero-pic img { display: block; width: 100%; height: auto; aspect-ratio: auto 5 / 6; }
  .home-hero-pic::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 55%;
    background: linear-gradient(to bottom,
      rgba(26,26,110,0) 0%, rgba(26,26,110,0.35) 40%, rgba(26,26,110,0.8) 75%, #1a1a6e 100%);
  }

  .home-hero-inner {
    position: relative; z-index: 2; width: 100%;
    margin-top: calc(var(--hero-m-overlap) * -1);
    padding: 0 16px 36px;
  }
    
  .home-hero-title { font-size: 32px; }
  .home-hero-desc { font-size: 15px; margin-bottom: 24px; }

  /* Les deux boutons : même largeur, même hauteur */
  .home-hero-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .home-hero-actions .btn {
    width: 100%; min-height: 52px; padding: 0 16px; font-size: 15px;
    justify-content: center; white-space: nowrap;
  }

  /* Parutions : un livre à la fois */
  .slider-item { flex: 0 0 100%; min-width: 0; }
  .slider-item .book-card { max-width: 340px; margin: 0 auto; }

  /* Auteurs : un auteur à la fois */
  .auteurs-slider .auteurs-grid {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; scrollbar-width: none; padding: 4px 0;
  }
  .auteurs-slider .auteurs-grid::-webkit-scrollbar { display: none; }
  .auteurs-slider .auteur-card { flex: 0 0 100%; scroll-snap-align: start; }

  /* Actualités : l'une sous l'autre */
  .actualites-grid--two { grid-template-columns: 1fr; }

  /* Réseaux : 2 × 2, mêmes largeurs */
  .social-links--section { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 420px; }

  /* Bande manuscrit : le bouton reste sur une ligne */
  .home-band--center .btn { white-space: nowrap; padding: 0 18px; font-size: 14px; }
  .home-cafe-inner .btn { width: 100%; }

  /* Café littéraire */
  .home-cafe-inner { gap: 20px; }
  .home-cafe-icon { width: 64px; height: 64px; }
  .home-cafe-icon .material-icons { font-size: 32px; }

  /* Recherche : bouton réduit à une flèche, le texte animé s'affiche en entier */
  .home-search-form--compact { padding: 6px 6px 6px 14px; gap: 8px; }
  .home-search-form--compact input { font-size: 16px; }
  .home-search-form--compact button {
    width: 46px; height: 46px; padding: 0; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .home-search-form--compact .btn-label { display: none; }
  .home-search-form--compact .btn-icon { display: inline-block; }
}

/* ─── ÉCRANS TACTILES : plus de survol ──────────────────────── */
@media (hover: none) {
  .book-fav-btn { opacity: 1; }
  .book-card-overlay { transform: translateY(0); }
  .book-card:hover, .auteur-card:hover, .actualite-card:hover { transform: none; }
}