/* Smartphone allégé (essai réversible) : retirer les 2 lignes mobile-lite de index.html pour revenir en arrière.
   Ne s'applique qu'en dessous de 641 px : le PC ne change pas. */
@media (max-width: 640px) {
  body.ml { padding-bottom: 118px; }
  .ml .top-bar { display: none !important; }

  /* Un seul bouton « + » à la place des boutons flottants */
  .ml #atv-wrap, .ml #at-wa-widget, .ml #atTempFab, .ml .atv-status, .ml #adminUnlockHint, .ml #backToTop { display: none !important; }
  .ml.ml-open #atv-wrap { display: block !important; right: 4px !important; bottom: 330px !important; transform: scale(.75); transform-origin: bottom right; }
  .ml.ml-open #at-wa-widget { display: block !important; right: 14px !important; bottom: 262px !important; }
  .ml.ml-open #atTempFab { display: flex !important; right: 14px !important; bottom: 198px !important; }
  #ml-fab {
    position: fixed; right: 14px; bottom: 132px; z-index: 9999; width: 52px; height: 52px; border-radius: 50%;
    border: 0; background: #1a1a1a; color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.3); transition: transform .2s;
  }
  .ml-open #ml-fab { transform: rotate(45deg); background: #c8294a; }

  /* Flash Info : plus de vignette qui recouvre les articles ; ouverture seulement par la barre du bas */
  .ml #flash-widget-reopen { display: none !important; }
  .ml #flash-widget-root:not(.fw-expanded) { display: none !important; }

  /* Barre média (Flash Info | L'info en 30 s) + navigation */
  #ml-media { position: fixed; left: 0; right: 0; bottom: 56px; z-index: 9990; display: flex; background: #2c3442; }
  #ml-media button { flex: 1; min-height: 44px; border: 0; background: transparent; color: #fff; font: 600 13px/1 Inter, system-ui, sans-serif; display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; }
  #ml-media button + button { border-left: 1px solid rgba(255,255,255,.18); }
  #ml-media i.ml-dot { width: 8px; height: 8px; border-radius: 50%; background: #E11D2E; animation: ml-blink 1s steps(1,end) infinite; }
  @keyframes ml-blink { 50% { opacity: .25; } }
  #ml-nav { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; z-index: 9991; display: flex; background: #fff; border-top: 1px solid #e5e5e5; }
  #ml-nav button { flex: 1; border: 0; background: transparent; color: #666; font: 500 11px/1.2 Inter, system-ui, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
  #ml-nav button i { font-size: 19px; }
  #ml-nav button.on { color: #c8294a; }

  /* Puces de rubriques */
  #ml-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #ml-chips::-webkit-scrollbar { display: none; }
  #ml-chips button { flex: none; border: 0; border-radius: 16px; padding: 8px 14px; background: #f0f1f3; color: #222; font: 500 13px/1 Inter, system-ui, sans-serif; cursor: pointer; }
  #ml-chips button.on { background: #1a1a1a; color: #fff; }

  /* Cartes simplifiées : vignette à gauche, titre, date */
  .ml .news-card { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 0; box-shadow: none; border-bottom: 1px solid #eee; background: transparent; }
  .ml .news-card .news-card-img { width: 96px; min-width: 96px; height: 72px; border-radius: 8px; overflow: hidden; flex: none; }
  .ml .news-card .news-card-img img { width: 100%; height: 100%; object-fit: cover; }
  .ml .news-card .news-card-body { padding: 0; flex: 1; min-width: 0; }
  .ml .news-card .news-card-body h3 { font-size: 15px; line-height: 1.35; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ml .news-card .news-card-body p { display: none; }
  .ml .news-card .at-badge-interactif, .ml .news-card .category-tag, .ml .news-card .tags, .ml .news-card .card-tags { display: none !important; }
  .ml .news-card .card-meta { font-size: 12px; }
  .ml .news-card .news-card-body .date-badge, .ml .news-card .news-card-body [class*=badge] { font-size: 11px; padding: 2px 6px; }
  body:has(#flash-widget-root.fw-expanded) #ml-fab { display: none; }

  /* Lecteur 30 s plein écran */
  #ml-30 { position: fixed; inset: 0; z-index: 10001; background: rgba(0,0,0,.96); display: none; align-items: center; justify-content: center; flex-direction: column; }
  #ml-30.on { display: flex; }
  #ml-30 .cadre { width: min(92vw, calc((100dvh - 120px) * 9 / 16)); aspect-ratio: 9 / 16; position: relative; background: linear-gradient(180deg, #0d3b24 0%, #0B1729 48%, #3a0a12 100%); border-radius: 12px; overflow: hidden; }
  #ml-30 video { width: 100%; height: 100%; object-fit: contain; display: block; }
  #ml-30 .ttl { color: #fff; font: 600 14px/1.35 Inter, system-ui, sans-serif; margin-top: 10px; padding: 0 16px; text-align: center; max-width: 92vw; }
  #ml-30 .x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; font-size: 20px; cursor: pointer; }
}

/* Petites cartes de la une (hero-side-card) : même présentation compacte que les cartes de liste */
@media (max-width: 640px) {
  .ml .hero-side-card { display: block !important; height: auto !important; }
  .ml .hero-side-card > div { display: flex !important; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eee; height: auto !important; position: relative; }
  .ml .hero-side-card > div > img { width: 96px !important; height: 72px !important; flex: none; object-fit: cover; border-radius: 8px; position: static !important; }
  .ml .hero-side-card .hero-overlay { position: static !important; background: none !important; padding: 0 !important; flex: 1; min-width: 0; }
  .ml .hero-side-card .hero-overlay h2 { font-size: 15px; line-height: 1.35; margin: 4px 0 0; color: #1a1a1a !important; text-shadow: none !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ml .hero-side-card .category-tag { display: none !important; }
  .ml .hero-side-card .hero-meta-tag { background: none !important; color: #777 !important; font-size: 12px; padding: 0 6px 0 0; }
  .ml .hero-side-card .hero-meta-tag:nth-of-type(n+3) { display: none; }
}

/* Retours utilisateur 2026-10-18 : moins de redondances */
@media (max-width: 640px) {
  .ml .ml-hide, .ml .ml-dup { display: none !important; }
  .ml .news-column > .section-header { display: none !important; }
  .ml .sidebar { display: flex !important; flex-direction: column; }
  /* pagination (archives) : une seule ligne défilante */
  .ml .pagination { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 8px; padding: 6px 14px; justify-content: flex-start !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ml .pagination::-webkit-scrollbar { display: none; }
  .ml .pagination button { flex: none; min-width: 44px; min-height: 44px; }
  /* tags : une ligne défilante */
  .ml .tag-cloud { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 8px; padding-bottom: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ml .tag-cloud::-webkit-scrollbar { display: none; }
  .ml .tag-cloud .tag-cloud-item { flex: none; white-space: nowrap; }
  #ml-nav button { font-size: 10.5px; }
}
@media (max-width: 640px) {
  .ml .content-layout, .ml .news-column, .ml .sidebar, .ml .sidebar-widget { min-width: 0; max-width: 100%; }
  .ml .pagination, .ml .tag-cloud { max-width: 100%; box-sizing: border-box; }
}

/* v6 : 2e/3e comme les cartes de liste, vignettes Flash / 30 s, onglets, newsletter fine */
@media (max-width: 640px) {
  .ml .hero-side-card { display: none !important; }
  .ml .hero-main .category-tag { display: none !important; }
  .ml .hero-main .hero-overlay p { display: none; }
  .ml .news-card .card-meta .ml-hide, .ml .hero-meta-wrapper .ml-hide { display: none !important; }
  .ml .news-card .news-card-body h3 { -webkit-line-clamp: 3; }

  /* Flash Info en vignettes (2 x 2) */
  #ml-flash .ml-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #ml-flash .ml-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #E11D2E; margin-right: 6px; animation: ml-blink 1s steps(1,end) infinite; }
  .ml-tile { position: relative; text-align: left; border: 0; border-radius: 10px; padding: 10px 10px 8px 30px; min-height: 76px; background: #0B1729; color: #fff; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
  .ml-tile i { position: absolute; left: 10px; top: 12px; font-size: 12px; color: #E11D2E; }
  .ml-tile .ml-t { font: 600 12.5px/1.3 Inter, system-ui, sans-serif; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ml-tile small { font: 500 11px/1 Inter, system-ui, sans-serif; opacity: .7; }

  /* L'info en 30 s : seulement les vignettes (le lecteur s'ouvre en plein écran) */
  .ml .express-widget.ml-compact .ew-cadre, .ml .express-widget.ml-compact .ew-titre, .ml .express-widget.ml-compact .ew-meta, .ml .express-widget.ml-compact .ew-lien { display: none; }
  .ml .express-widget.ml-compact { padding: 14px; }
  .ml .express-widget.ml-compact .ew-vignettes { margin-top: 8px; }

  /* Onglets Brèves | Les plus lus */
  #ml-tabs { display: flex; gap: 8px; padding: 0 2px; }
  #ml-tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 22px; background: #f0f1f3; color: #222; font: 600 14px/1 Inter, system-ui, sans-serif; cursor: pointer; }
  #ml-tabs button.on { background: #1a1a1a; color: #fff; }
  .ml .ml-tab-off { display: none !important; }
  .ml .ml-brv .widget-title, .ml .ml-plus .widget-title { display: none; }
  .ml .ml-brv:not(.ml-open) #brevesList > li:nth-child(n+5) { display: none; }
  .ml .ml-brv:not(.ml-open) .breves-pagination { display: none; }
  #ml-more { width: 100%; min-height: 44px; margin-top: 6px; border: 1px solid #ddd; border-radius: 10px; background: transparent; color: #c8294a; font: 600 14px/1 Inter, system-ui, sans-serif; cursor: pointer; }

  /* Newsletter : une ligne fine */
  .ml .newsletter-widget { padding: 12px 14px; }
  .ml .newsletter-widget p { display: none; }
  .ml .newsletter-widget .widget-title { font-size: 14px; margin-bottom: 8px; }
  .ml .newsletter-widget .newsletter-form { display: flex; gap: 8px; }
  .ml .newsletter-widget .newsletter-form input { flex: 1; min-width: 0; }
}

/* v7 : même style sur les pages article, veille et revue (body[data-ml-view]) */
@media (max-width: 640px) {
  .ml[data-ml-view]:not([data-ml-view="home"]) #ml-chips { display: none; }
  .ml[data-ml-view="article"] #ml-media { display: none; }
  body.ml[data-ml-view="article"] { padding-bottom: 70px; }
  .ml[data-ml-view="article"] #ml-fab { bottom: 72px; }

  /* Article : lecture confortable, meta sur une ligne, actions côte à côte */
  .ml #articlePage .article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
  .ml #articlePage .article-meta span:has(> .fa-clock) { display: none; }
  .ml #articlePage .article-meta .meta-audio-btn, .ml #articlePage .article-meta .meta-lite-btn { flex: 1 1 44%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .ml #articlePage .back-btn { min-height: 44px; }
  .ml #articlePage .article-body, .ml #articlePage .article-body p, .ml #articlePage .article-body li { font-size: 17px; line-height: 1.7; }
  .ml #articlePage .article-body h1 { font-size: 23px; line-height: 1.3; }
  .ml #articlePage .article-body h2 { font-size: 20px; line-height: 1.35; margin: 22px 0 8px; }
  .ml #articlePage .article-body h3 { font-size: 18px; line-height: 1.35; }
  .ml #articlePage img, .ml #articlePage video, .ml #articlePage table { max-width: 100%; }

  /* Revue : en-tête sur deux lignes lisibles */
  .ml .revue-masthead { flex-direction: column !important; align-items: flex-start !important; gap: 8px; }
  .ml .revue-masthead-date { text-align: left !important; width: 100%; }
  .ml .revue-masthead-date-line { white-space: normal; }
  .ml .revue-masthead-date strong { display: inline !important; }
  .ml .revue-card-journal h2, .ml .revue-card-journal h3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

  /* Veille : bandeau de chiffres plus fin */
  .ml .v2-stats-bar { padding-top: 10px !important; padding-bottom: 10px !important; }
}

/* v8 : page article pré-rendue (lien direct) + veille allégée */
@media (max-width: 640px) {
  body.ml-ssg { padding: 0 0 70px; background: #fff; }
  #ml-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff; z-index: 50; font-family: Inter, system-ui, sans-serif; }
  #ml-top .lg { font-weight: 700; font-size: 18px; color: #1a1a1a; text-decoration: none; }
  #ml-top .lg b { color: #c8294a; }
  #ml-top .bk { font-size: 14px; font-weight: 600; color: #c8294a; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
  .ml-ssg .ssg-article { margin: 12px auto 24px; padding: 0 16px; }
  .ml-ssg .ssg-article img { border-radius: 12px; }
  .ml-ssg .ssg-article h1 { font-size: 23px; line-height: 1.3; }
  .ml-ssg .ssg-article .meta { font-size: 13px; }
  .ml-ssg .ssg-article .body, .ml-ssg .ssg-article .body p, .ml-ssg .ssg-article .body li { font-size: 17px; line-height: 1.7; }
  .ml-ssg .ssg-article .body h2 { font-size: 20px; line-height: 1.35; margin: 22px 0 8px; }
  .ml-ssg .ssg-article .body h3 { font-size: 18px; }
  #ml-nav a { flex: 1; color: #666; font: 500 11px/1.2 Inter, system-ui, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; }
  #ml-nav a i { font-size: 19px; }
  .ml[data-ml-view="veille"] .v2-add-btn { display: none !important; }
  .ml .v2-kpis { gap: 6px 14px !important; }
  .ml .v2-kpi { font-size: 12px !important; }
  .ml .v2-kpi strong { font-size: 18px !important; }
}
