/* =============================================================
   GATE — Responsive Layout  (responsive.css)  · Redesigned 2026-06 v2
   Deux expériences distinctes pilotées par device.js :
     is-mobile  → layout iPhone du handoff
     is-desktop → layout desktop / admin rail

   OPTION B — Header sticky + navbar horizontale (implémenté)
   ============================================================= */


/* =============================================================
   0. UTILITAIRES CONDITIONNELS
   ============================================================= */

.is-mobile-only  { /* visible par défaut, caché sur desktop */ }
.is-desktop-only { /* visible par défaut, caché sur mobile  */ }


/* =============================================================
   1. MOBILE / TABLETTE TACTILE
   Cible : max-width 1023px OU pointer: coarse
   ============================================================= */
@media (max-width: 1023px), (pointer: coarse) {

  /* ---- Utilitaires ---- */
  .is-desktop-only { display: none !important; }

  /* ---- Fond & base ---- */
  body {
    background: var(--bg-primary, #030303);
    /* Padding bottom = pilule (60px) + offset (18px) + mini-player (68px) + gap (10px) + safe area */
    padding-bottom: calc(60px + 18px + 68px + 10px + env(safe-area-inset-bottom, 0px));
  }

  /* ---- Navbar desktop cachée ---- */
  .navbar { display: none !important; }

  /* ---- Tab bar → floating pill ---- */
  .bottom-nav {
    display: flex !important;
    position: fixed !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 18px !important;
    height: 60px !important;
    border-radius: 9999px !important;
    background: rgba(14,14,18,0.97) !important;
    -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
    backdrop-filter: blur(32px) saturate(200%) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow:
      0 12px 50px rgba(0,0,0,0.65),
      0 4px 16px rgba(0,0,0,0.4),
      0 0 0 0.5px rgba(255,255,255,0.07) inset !important;
    z-index: 900 !important;
  }

  /* ---- Mini-player flottant ---- */
  .mini-player-bar {
    left: 14px;
    right: 14px;
    max-width: none;
    transform: none;
    margin: 0;
  }

  /* ---- Typo XL page titles ---- */
  .mobile-page-title,
  .page-title-xl {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
  }

  /* ---- Hero cards : scroll horizontal ---- */
  .hero-cards-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 24px;
    padding: 4px 24px 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .hero-cards-row::-webkit-scrollbar { display: none; }
  .hero-card-snap { scroll-snap-align: start; flex-shrink: 0; }

  /* ---- Grilles → colonne unique ---- */
  .events-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* ---- Category mosaic → 2 colonnes ---- */
  .category-mosaic {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* ---- Sections empilées ---- */
  .split-layout {
    flex-direction: column;
    gap: 20px;
  }
  .split-layout > * { width: 100% !important; }

  /* ---- Rail admin → caché, remplacé par tab bar mobile ---- */
  .admin-sidebar {
    transform: translateX(-100%) !important;
  }
  .admin-main {
    margin-left: 0 !important;
    padding-top: 60px;
  }

  /* ---- Tab bar admin mobile (6 icônes) ---- */
  .admin-mobile-tabbar {
    display: flex !important;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 18px;
    height: 60px;
    border-radius: 9999px;
    background: rgba(14,14,18,0.97);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow:
      0 12px 50px rgba(0,0,0,0.65),
      0 4px 16px rgba(0,0,0,0.4),
      0 0 0 0.5px rgba(255,255,255,0.07) inset;
    z-index: 100;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
  }
  .admin-mobile-tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,0.38);
    font-size: 9px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.22s ease;
    padding: 4px 2px;
    -webkit-tap-highlight-color: transparent;
  }
  .admin-mobile-tabbar a svg { width: 22px; height: 22px; }
  .admin-mobile-tabbar a.active { color: var(--neon-purple, #a855f7); }

  /* ---- Header mobile bouton hamburger ---- */
  .mobile-menu-btn { display: flex; }

}


/* =============================================================
   2. DESKTOP
   Cible : min-width 1024px ET pointer: fine
   ============================================================= */
@media (min-width: 1024px) and (pointer: fine) {

  /* ---- Utilitaires ---- */
  .is-mobile-only  { display: none !important; }

  /* ---- Tab bar mobile cachée ---- */
  .bottom-nav { display: none !important; }
  .mini-player-bar {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 500px !important;
    bottom: 28px !important;
  }

  /* ---- Navbar desktop — stronger glass + intentional shadow ---- */
  .navbar {
    display: flex !important;
    background: rgba(8, 8, 12, 0.94) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border-bottom: 0.5px solid rgba(255,255,255,0.08) !important;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.04),
      0 8px 40px rgba(0,0,0,0.4),
      0 2px 12px rgba(0,0,0,0.3) !important;
  }

  /* ---- Body : pas de padding bottom lié à la tab bar ---- */
  body {
    padding-bottom: 0;
  }

  /* ---- Container padding — more intentional on desktop ---- */
  .container {
    padding-left: clamp(24px, 4vw, 48px);
    padding-right: clamp(24px, 4vw, 48px);
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
  }

  /* ---- Typo desktop — extra tight for premium feel ---- */
  .mobile-page-title,
  .page-title-xl {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
  }

  /* ---- Hero cards → grille 3 colonnes sur desktop ---- */
  .hero-cards-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  .hero-card-snap { width: auto !important; }

  /* ---- Events grid → 3 colonnes, comfortable gap ---- */
  .events-grid,
  .cards-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
  }

  /* ---- Category mosaic → 4-6 colonnes ---- */
  .category-mosaic {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 18px !important;
  }

  /* ---- Hover states desktop — elevated glow ---- */
  .event-card {
    transition:
      transform 0.28s cubic-bezier(0.16,1,0.3,1),
      border-color 0.28s ease,
      box-shadow 0.28s ease;
  }
  .event-card:hover,
  .card:hover {
    transform: translateY(-6px);
    border-color: rgba(168,85,247,0.3);
    box-shadow:
      0 0 0 1px rgba(168,85,247,0.18),
      0 24px 64px rgba(168,85,247,0.2),
      0 12px 32px rgba(0,0,0,0.45);
  }

  .cat-tile:hover {
    transform: scale(1.04) translateY(-3px);
    border-color: rgba(255,255,255,0.18);
    box-shadow:
      0 20px 56px rgba(0,0,0,0.55),
      0 0 28px rgba(168,85,247,0.14);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
      0 12px 48px rgba(168,85,247,0.5),
      0 4px 16px rgba(168,85,247,0.3);
  }

  /* ---- Rail admin reste 72px ---- */
  .admin-sidebar {
    width: 72px !important;
    transform: translateX(0) !important;
  }
  .admin-main {
    margin-left: 72px !important;
  }

  /* ---- Tab bar admin mobile cachée ---- */
  .admin-mobile-tabbar { display: none !important; }

  /* ---- Mobile menu btn caché ---- */
  .mobile-menu-btn { display: none !important; }

  /* ---- Section spacing — more intentional on desktop ---- */
  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  /* ---- Split layout desktop ---- */
  .split-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
  }

}


/* =============================================================
   3. TABLETTE INTERMÉDIAIRE (1024–1279px, pointer: fine)
   ============================================================= */
@media (min-width: 1024px) and (max-width: 1279px) and (pointer: fine) {

  .events-grid,
  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }

  .category-mosaic {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }

  .hero-cards-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }

  .container {
    padding-left: clamp(20px, 3vw, 32px);
    padding-right: clamp(20px, 3vw, 32px);
  }

}


/* =============================================================
   4. LARGE DESKTOP (1440px+)
   ============================================================= */
@media (min-width: 1440px) and (pointer: fine) {

  .events-grid,
  .cards-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 28px !important;
  }

  .category-mosaic {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 16px !important;
  }

  .hero-cards-row {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 28px !important;
  }

}
