/* Design Apple-like — minimal, fluide, lisible */
:root {
  --bg: #fff;
  --fg: #111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --link: #0a84ff;
  --card: #f8f9fb;
  --max: 1200px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --fg: #f5f5f7;
    --muted: #9aa0a6;
    --line: #27272a;
    --link: #0a84ff;
    --card: #111214;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--max);
  margin: auto;
  padding: 24px;
}

.container .home-layout {
  max-width: 100% !important;
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: 3fr 1fr !important;
}

header.site {
  position: sticky;
  top: 0;
  background: rgba(26, 23, 43, 0.85) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
  transition: all 0.3s ease;
}

header.site.scrolled {
  background: rgba(26, 23, 43, 0.95) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

nav.bar {
  display: flex;
  align-items: stretch;
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100px;
}

.brand {
  font-weight: 800;
  letter-spacing: 1px;
  color: #7B50E6;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  margin: 0;
  margin-left: -24px;
  gap: 20px;
}

.brand-logo {
  display: block !important;
  height: 60px;
  width: auto;
  object-fit: contain;
  border-radius: 0;
}

.brand a {
  color: #7B50E6;
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0;
}

.brand-text-container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.brand-left .line-1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #7B50E6;
}

.brand-left .line-2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #7B50E6;
  padding-left: 8px;
}

.brand-left .line-3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #7B50E6;
}

.brand-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  line-height: 1.4;
  margin-top: 0;
  padding-left: 8px;
}

.brand-right span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #7B50E6;
  display: block;
  white-space: nowrap;
  transform-origin: top left;
}

.brand-right span:nth-child(1) {
  /* Apps - 2h10 */
  transform: rotate(-25deg);
}

.brand-right span:nth-child(2) {
  /* Articles - 3h15 */
  transform: rotate(-7.5deg);
}

.brand-right span:nth-child(3) {
  /* Alertes - 4h20 */
  transform: rotate(10deg);
}

.brand-right span:nth-child(4) {
  /* Astuces - 5h25 */
  transform: rotate(17deg);
}

.brand-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-main-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.brand-main {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  color: #7B50E6;
}

.brand-apps-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-apps {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  color: #7B50E6;
}

.brand-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #7B50E6;
  opacity: 0.85;
  margin-top: 2px;
}

.brand-links span {
  display: block;
  line-height: 1.4;
}

.brand a:hover {
  text-decoration: none;
  opacity: 0.9;
}

nav .spacer {
  flex: 1;
}

nav .menu {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

nav .menu a {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  /* Pill shape */
  transition: all 0.3s ease;
  text-decoration: none;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

nav .menu a:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

nav .menu a.active {
  background: #fff;
  color: #7B50E6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

nav .search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

nav .search svg {
  color: #fff;
  opacity: 0.9;
}

nav .search input[type="search"] {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  padding: 4px 8px;
  width: 200px;
  outline: none;
}

nav .search input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

nav .search input[type="search"]:focus {
  outline: none;
}

/* Menu hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 100;
  position: relative;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Card */
.hero-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 42px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.hero-card .card-cover {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  width: 100%;
}

.hero-card .pad {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card h3 {
  font-size: 32px;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-card p.excerpt {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
    margin-bottom: 24px;
  }

  .hero-card .card-cover {
    aspect-ratio: 16/9;
    height: auto;
  }

  .hero-card .pad {
    padding: 24px;
  }

  .hero-card h3 {
    font-size: 24px;
  }

  .hero-card p.excerpt {
    font-size: 16px;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 20px rgba(123, 80, 230, 0.1);
  border-color: rgba(123, 80, 230, 0.3);
}

/* Scroll Reveal Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reading Progress Bar */
#reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 1000;
  background: transparent;
  pointer-events: none;
}

#reading-progress {
  height: 100%;
  background: linear-gradient(90deg, #7B50E6, #0a84ff);
  width: 0%;
  transition: width 0.1s ease-out;
}

.card.pad {
  padding: 22px;
}

.card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  margin: 0;
  padding: 0;
  display: block;
  transition: transform 0.3s ease;
}

.card-cover:hover img {
  transform: scale(1.08);
}

.card-cover a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  overflow: hidden;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0 0 12px 0;
  letter-spacing: -.02em;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
}

h2 {
  font-size: clamp(22px, 3vw, 28px);
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Par défaut : afficher le flux desktop, masquer le flux mixte mobile */
.desktop-articles-grid {
  display: grid;
}

.mobile-mixed-grid {
  display: none;
}

.section {
  margin-top: 42px;
}

.home-layout .home-sidebar .section {
  margin-top: 0 !important;
}

.home-layout .home-articles .section {
  margin-top: 42px;
}

/* Filtrage par catégories */
.category-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
}

.category-filter h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

.category-btn {
  padding: 10px 20px;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.category-btn:hover {
  background: var(--line);
}

.category-btn.active {
  background: #7c3aed;
  color: white;
  border-color: #7c3aed;
}

.category-btn.active:hover {
  background: #6d28d9;
  border-color: #6d28d9;
}

@media (max-width: 768px) {
  .category-filter {
    gap: 8px;
  }

  .category-filter h3 {
    width: 100%;
    margin-bottom: 8px;
  }

  .category-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* Layout page d'accueil avec articles et sidebar */
.home-layout {
  display: grid !important;
  grid-template-columns: 3fr 1fr !important;
  gap: 32px !important;
  align-items: start;
  width: 100% !important;
  grid-auto-flow: row !important;
  grid-template-rows: auto !important;
}

.home-articles {
  min-width: 0;
  /* Permet au contenu de se rétrécir si nécessaire */
  grid-column: 1 !important;
  grid-row: 1 !important;
}

.home-sidebar {
  position: sticky !important;
  top: 120px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  width: 100%;
  min-width: 280px;
  display: block !important;
  visibility: visible !important;
  flex-shrink: 0;
  grid-column: 2 !important;
  grid-row: 1 !important;
  padding-bottom: 20px;
  /* Espace pour le scroll */
}

/* Style de la scrollbar pour la sidebar */
.home-sidebar::-webkit-scrollbar {
  width: 6px;
}

.home-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.home-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.home-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Section bons plans avec cadre violet */
.bons-plans-container {
  background: linear-gradient(135deg, #1A172B 0%, #4C1D95 50%, #5B21B6 100%);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 48px;
  box-shadow: var(--shadow);
}

.bons-plans-sidebar {
  background: linear-gradient(135deg, rgba(26, 23, 43, 0.95) 0%, rgba(76, 29, 149, 0.9) 100%) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 24px !important;
  box-shadow: 0 10px 30px rgba(92, 33, 182, 0.2) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  min-height: 200px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Sur mobile, retirer le fond violet de la sidebar (qui est masquée de toute façon) */
@media (max-width: 900px) {
  .bons-plans-sidebar {
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Style pour les bons plans dans le flux mixte mobile */
  .bon-plan-mobile {
    /* Pas de style spécial, utilise le même style que les articles */
  }
}

/* Animation subtile pour attirer l'attention sur mobile */
@media (max-width: 900px) {
  .bons-plans-sidebar {
    animation: fadeInUp 0.6s ease-out;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-sidebar {
  background: transparent !important;
}

.home-sidebar .section {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.bons-plans-sidebar .bons-plans-header {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bons-plans-sidebar .bons-plans-header h2 {
  color: #fff;
  margin: 0;
  font-size: 20px;
}

.bons-plans-sidebar .bons-plans-view-all {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  display: inline-block;
}

.bons-plans-sidebar .bons-plans-view-all:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  text-decoration: none;
}

.bons-plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bons-plan-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(5px);
}

.bons-plan-item:hover {
  transform: translateX(5px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.bons-plan-cover {
  width: 100%;
  height: 80px;
  overflow: hidden;
  background: var(--line);
}

.bons-plan-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.bons-plan-content {
  padding: 12px;
}

.bons-plan-content h3 {
  margin: 6px 0 3px 0;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

.bons-plan-content h3 a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  transition: color 0.2s ease;
}

.bons-plan-content h3 a:hover {
  color: #fff;
}

.bons-plan-content .tag {
  font-size: 10px;
  padding: 2px 6px;
  margin-bottom: 4px;
}

.bons-plan-content .meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  line-height: 1.3;
}

.bons-plans-sidebar>p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.bons-plans-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.bons-plans-header h2 {
  color: #fff;
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}

.bons-plans-view-all {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bons-plans-view-all:hover {
  background: #fff;
  color: #7B50E6;
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bons-plans-container .grid {
  margin-top: 0;
}

.bons-plans-container .card {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bons-plans-container>p {
  color: rgba(255, 255, 255, 0.9);
}

.bons-plans-container .card p {
  color: var(--fg);
}

@media (max-width: 1400px) {
  .home-layout {
    grid-template-columns: 2.5fr 1fr !important;
    gap: 24px;
  }
}

@media (max-width: 1200px) {
  .home-layout {
    grid-template-columns: 2fr 1fr !important;
    gap: 24px;
  }
}

@media (max-width: 900px) {

  /* Sur mobile, rendre la page d'accueil identique à la page articles */
  .home-layout {
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Masquer complètement la sidebar sur mobile */
  .home-sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }

  /* Masquer aussi la section bons plans dans la sidebar */
  .home-sidebar .bons-plans-sidebar,
  .bons-plans-sidebar,
  aside.home-sidebar,
  #bons-plans {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Simplifier la structure sur mobile pour être identique à articles.php */
  .home-articles {
    display: block !important;
    width: 100% !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .home-articles .section {
    display: block !important;
    width: 100% !important;
    margin-top: 42px !important;
    padding: 0 !important;
  }

  /* Supprimer les marges/padding supplémentaires du home-layout sur mobile */
  .home-layout {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    /* Force block layout instead of grid */
  }

  .home-articles {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Container identique à la page articles - padding réduit sur mobile */
  main.container {
    padding: 16px !important;
  }

  /* Masquer le flux desktop sur mobile */
  .desktop-articles-grid {
    display: none !important;
    visibility: hidden !important;
  }

  /* Afficher le flux mixte sur mobile en block pour éviter les soucis de grille */
  .mobile-mixed-grid {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
  }

  /* Utiliser la même grille que articles.php sur mobile */
  .home-articles .grid.cols-3,
  .mobile-mixed-grid {
    grid-template-columns: 1fr !important;
  }

  /* Styles identiques à la page articles */
  .mobile-mixed-grid .card,
  .home-articles .card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 32px 0 !important;
    /* Marge en bas pour espacer les articles */
    display: block !important;
  }

  .mobile-mixed-grid .card-cover,
  .home-articles .card-cover {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
  }

  .mobile-mixed-grid .card .pad,
  .home-articles .card .pad {
    padding: 22px !important;
  }

  .mobile-mixed-grid .card h3,
  .home-articles .card h3 {
    margin: 12px 0 !important;
  }

  .mobile-mixed-grid .card .tag,
  .home-articles .card .tag {
    font-size: 12px !important;
    padding: 4px 10px !important;
    margin-bottom: 8px !important;
  }

  .mobile-mixed-grid .card .meta,
  .home-articles .card .meta {
    font-size: 14px !important;
    margin-top: 8px !important;
  }

  /* Section identique à articles.php */
  .home-articles .section h2 {
    font-size: clamp(22px, 3vw, 28px) !important;
    margin: 0 0 12px 0 !important;
    letter-spacing: -.02em !important;
  }
}

/* --- Mobile Redesign --- */

/* 1. Hero Section Immersive */
.hero-card {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: -24px -24px 24px -24px !important;
  background: transparent !important;
  display: block !important;
  /* Stack vertically */
}

.hero-card .card-cover {
  width: 100% !important;
  aspect-ratio: 4/3 !important;
  /* Taller image */
  border-radius: 0 !important;
  margin: 0 !important;
}

.hero-card .pad {
  padding: 20px 24px !important;
  background: var(--bg) !important;
}

.hero-card h3 {
  font-size: 28px !important;
  line-height: 1.2 !important;
  margin-bottom: 12px !important;
}

.hero-card .tag {
  margin-bottom: 12px !important;
}

/* 2. Horizontal Categories (Pills) */
.mobile-categories-scroll {
  display: flex !important;
  overflow-x: auto !important;
  gap: 10px !important;
  padding: 0 24px 24px 24px !important;
  margin: 0 -24px 0 -24px !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 80px;
  /* Below header */
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.mobile-categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-pill {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Hide desktop filters on mobile */
.desktop-filters {
  display: none !important;
}

/* 3. Mobile Bons Plans Swiper */
.mobile-bons-plans-section {
  display: block !important;
  margin: 24px -24px 32px -24px !important;
  padding: 24px 0 !important;
  background: linear-gradient(to bottom, var(--bg-secondary), var(--bg));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mobile-bons-plans-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px 16px 24px;
}

.mobile-bons-plans-section h3 {
  font-size: 18px;
  margin: 0;
}

.mobile-bons-plans-section a {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.mobile-bons-plans-scroll {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 0 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-bons-plans-scroll::-webkit-scrollbar {
  display: none;
}

.mobile-bp-card {
  min-width: 160px;
  width: 160px;
  display: block;
  text-decoration: none;
}

.mobile-bp-card .bp-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--line);
}

.mobile-bp-card .bp-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-bp-card h4 {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 4. Refined Article List Spacing */
.mobile-mixed-grid {
  gap: 32px !important;
  /* More space between articles */
}

.mobile-mixed-grid .card {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.mobile-mixed-grid .card-cover {
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-mixed-grid .card .pad {
  padding: 16px 0 0 0 !important;
  /* Remove side padding */
}

/* Section identique à articles.php */
.home-articles .section h2 {
  font-size: clamp(22px, 3vw, 28px) !important;
  margin: 0 0 12px 0 !important;
  letter-spacing: -.02em !important;
}
}

/* Default state for new mobile elements (hidden on desktop) */
.mobile-categories-scroll,
.mobile-bons-plans-section {
  display: none;
}

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

footer.site .cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px;
}

.article {
  max-width: 860px;
  margin: auto;
  padding: 24px;
}

.article header {
  margin: 12px 0 18px;
}

.article p {
  margin: 0 0 16px 0;
}

.article .byline {
  color: var(--muted);
  font-size: 14px;
}

@media (min-width: 901px) and (max-width: 960px) {
  .grid.cols-3 {
    grid-template-columns: 1fr 1fr;
  }

  .grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }

  .home-articles .grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Afficher le flux desktop sur tablette */
  .desktop-articles-grid {
    display: grid !important;
  }

  .mobile-mixed-grid {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .menu-toggle {
    display: flex;
    order: -1;
    align-self: center;
  }

  nav .menu {
    display: none !important;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: linear-gradient(135deg, #1A172B 0%, #4C1D95 50%, #5B21B6 100%);
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(92, 33, 182, 0.3);
    gap: 0;
    border-radius: 0;
    backdrop-filter: blur(20px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }

  nav .menu.mobile-open {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  nav .menu a {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: left;
  }

  nav .menu a:last-child {
    border-bottom: none;
  }

  nav .search {
    display: flex !important;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: auto;
    max-width: 48px;
    padding: 8px;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    order: 10;
    transition: max-width 0.3s ease, padding 0.3s ease;
    align-self: center;
  }

  nav .search.mobile-open {
    max-width: 300px;
    padding: 8px 16px;
  }

  nav .search input[type="search"] {
    width: 0;
    padding: 0;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  }

  nav .search.mobile-open input[type="search"] {
    width: 100%;
    padding: 4px 8px;
    opacity: 1;
  }

  nav.bar {
    height: 80px;
    position: relative;
    padding: 0 16px;
    overflow: visible;
  }

  .brand {
    font-size: 16px;
    padding: 0;
    margin-left: 0;
    max-width: calc(100% - 120px);
    order: 0;
    align-self: flex-start;
    padding-top: 8px;
  }

  .brand-text-container {
    gap: 12px;
  }

  .brand-left .line-1,
  .brand-left .line-2,
  .brand-left .line-3 {
    font-size: 12px;
    line-height: 1.1;
  }

  .brand-right span {
    font-size: 9px;
    line-height: 1.2;
  }

  nav .spacer {
    order: 5;
  }

  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .grid.cols-2 {
    grid-template-columns: 1fr;
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* Ligne de partage compacte */
.share-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.share-line-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 8px;
}

.share-line-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.share-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: transparent;
}

.share-icon-btn svg {
  width: 20px;
  height: 20px;
}

.share-icon-btn[data-platform="whatsapp"] {
  background: #25D366;
  border-color: #25D366;
}

.share-icon-btn[data-platform="whatsapp"] svg {
  fill: #fff;
}

.share-icon-btn[data-platform="facebook"] {
  background: #1877F2;
  border-color: #1877F2;
}

.share-icon-btn[data-platform="facebook"] svg {
  fill: #fff;
}

.share-icon-btn[data-platform="twitter"] {
  background: #000;
  border-color: #000;
}

.share-icon-btn[data-platform="twitter"] svg {
  fill: #fff;
}

.share-icon-btn[data-platform="linkedin"] {
  background: #0A66C2;
  border-color: #0A66C2;
}

.share-icon-btn[data-platform="linkedin"] svg {
  fill: #fff;
}

.share-icon-btn[data-platform="sms"] {
  background: #34C759;
  border-color: #34C759;
}

.share-icon-btn[data-platform="sms"] svg {
  stroke: #fff;
  fill: none;
}

.share-icon-btn[data-platform="email"] {
  background: #FF3B30;
  border-color: #FF3B30;
}

.share-icon-btn[data-platform="email"] svg {
  stroke: #fff;
  fill: none;
}

.share-icon-btn[data-platform="copy"] {
  background: var(--link);
  border-color: var(--link);
}

.share-icon-btn[data-platform="copy"] svg {
  stroke: #fff;
  fill: none;
}

/* Système de partage */
.share-container {
  position: relative;
  display: inline-block;
  margin: 24px 0;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.share-button:hover {
  background: #0066cc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.share-button:active {
  transform: translateY(0);
}

.share-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
  overflow: hidden;
}

.share-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--fg);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
}

.share-option:hover {
  background: var(--card);
}

.share-option:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.share-option:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.share-option svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.share-option-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Notification de copie */
.share-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--fg);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.share-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.share-notification.error {
  background: #ff3b30;
  color: #fff;
}

@media (max-width: 640px) {
  .share-menu {
    left: auto;
    right: 0;
    min-width: 180px;
  }

  .share-button {
    padding: 10px 16px;
    font-size: 14px;
  }

  .share-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .share-line-buttons {
    width: 100%;
  }

  .share-icon-btn {
    width: 38px;
    height: 38px;
  }
}