/* ==========================================================================
   Epsylon Tools — HOME (refonte juillet 2026)
   Layout accueil : sidebar de navigation (desktop), topbar recherche,
   hero compact, grille de catégories, vues par catégorie.
   Chargé uniquement par la page d'accueil. Utilise les tokens de core.css.
   ========================================================================== */

/* === LAYOUT GLOBAL === */
.home-layout { display: flex; min-height: 100vh; }
.home-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-content main { flex: 1; }

/* === SIDEBAR === */
.side-nav {
  width: 256px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; background: var(--bg2); border-right: 1px solid var(--border);
  padding: 20px 12px 16px; display: flex; flex-direction: column; z-index: 50;
}
.side-logo {
  display: flex; align-items: center; gap: 10px; padding: 2px 10px 16px;
  text-decoration: none; color: var(--text);
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.08rem; letter-spacing: -0.4px;
}
.side-logo img { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }
.side-logo small { display: block; font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 0.7rem; color: var(--text2); letter-spacing: 0; }

.side-nav .nav-group { display: flex; flex-direction: column; gap: 1px; }
.side-nav .nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px;
  border: none; border-radius: var(--radius-sm); background: none; cursor: pointer;
  text-decoration: none; color: var(--text); text-align: left;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.side-nav .nav-item:hover { background: var(--bg3); }
.side-nav .nav-item.active { background: var(--glow); color: var(--accent); font-weight: 700; }
.side-nav .nav-item .n {
  margin-left: auto; font-size: 0.7rem; font-weight: 600; color: var(--text2);
  background: var(--bg3); border-radius: 20px; padding: 1px 8px; line-height: 1.5;
}
.side-nav .nav-item.active .n { background: var(--accent); color: #fff; }
.side-titre {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text2); font-weight: 700; padding: 16px 10px 6px;
}
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.side-foot .nav-item { color: var(--text2); font-size: 0.84rem; }

/* === TOPBAR RECHERCHE === */
.home-topbar {
  position: sticky; top: 0; z-index: 60; background: var(--bg);
  padding: 16px 28px 10px; border-bottom: 1px solid transparent;
}
.home-topbar .search-wrap { max-width: 640px; margin: 0; animation: none; }
.home-topbar .search-hint { margin: 8px 2px 0; font-size: 0.76rem; }

/* === HERO COMPACT === */
.home-hero.hero { text-align: left; padding: 26px 28px 6px; overflow: visible; }
.home-hero.hero::before { display: none; }
.home-hero h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.8px; margin-bottom: 8px; }
.home-hero p { margin: 0; max-width: 660px; font-size: 1rem; }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero-chips .chip {
  font-size: 0.76rem; font-weight: 600; color: var(--text2);
  background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px;
}
.hero-chips .chip b { color: var(--text); }

/* === CONTENU PRINCIPAL : gouttières === */
.home-content .shortcuts,
.home-content .cat-cards-block,
.home-content .cat-section,
.home-content .games-banner,
.home-content .trust { max-width: 1100px; margin-left: 0; padding-left: 28px; padding-right: 28px; }
.home-content .cat-section { padding-top: 24px; padding-bottom: 8px; }
.home-content .shortcuts { padding-top: 18px; }

/* === GRILLE DE CATÉGORIES === */
.cat-cards-block { padding-top: 10px; }
.cat-cards-block h2 {
  font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 700; margin-bottom: 14px;
}
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cat-card {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card .cc-ico {
  width: 42px; height: 42px; border-radius: 11px; background: var(--glow);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0;
}
.cat-card h3 { font-family: 'Outfit', sans-serif; font-size: 0.92rem; font-weight: 700; line-height: 1.25; }
.cat-card small { color: var(--text2); font-size: 0.76rem; }
.cat-card .cc-fleche { margin-left: auto; color: var(--text2); font-size: 0.9rem; transition: transform 0.2s; }
.cat-card:hover .cc-fleche { transform: translateX(3px); color: var(--accent); }

/* === VUE CATÉGORIE === */
.back-home {
  display: inline-flex; align-items: center; gap: 8px; margin: 18px 28px 0;
  padding: 9px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg2); color: var(--text); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.86rem; font-weight: 600; transition: border-color 0.15s;
}
.back-home:hover { border-color: var(--accent); color: var(--accent); }

/* Les sections catégories sont pilotées par js/home.js (vues).
   Fallback sans JS : tout reste visible. */

/* === DESKTOP : le header horizontal cède la place à la sidebar === */
@media (min-width: 901px) {
  body.has-sidenav .site-header { display: none; }
}

/* === MOBILE / TABLETTE : header + bottom-nav classiques, pas de sidebar === */
@media (max-width: 900px) {
  .side-nav { display: none; }
  .home-topbar { top: 64px; padding: 12px 20px 8px; }
  .home-hero.hero { padding: 18px 20px 4px; }
  .home-content .shortcuts,
  .home-content .cat-cards-block,
  .home-content .cat-section,
  .home-content .games-banner,
  .home-content .trust { padding-left: 20px; padding-right: 20px; }
  .back-home { margin: 14px 20px 0; }
  .cat-cards { grid-template-columns: 1fr 1fr; }
  .cat-card { padding: 12px; gap: 9px; }
  .cat-card .cc-ico { width: 36px; height: 36px; font-size: 1.05rem; }
  .cat-card .cc-fleche { display: none; }
}
@media (max-width: 480px) {
  .cat-cards { grid-template-columns: 1fr; }
}
