/* VIRTEON — ajustements mobile partagés.
   Chargé APRES le CSS de chaque page : ces regles ont donc le dernier mot.
   Ne s'applique qu'en dessous de 820px : l'affichage ordinateur est intact. */

@media (max-width: 820px) {

  /* ───── En-tete : logo a gauche, bouton burger a droite ───── */
  header.header {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 16px;
    background: rgba(2,6,12,.94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  header.header .brand img { width: 150px; height: auto; margin: 0; }

  header.header .navtoggle {
    display: block; flex: 0 0 auto;
    background: rgba(74,168,255,.10);
    border: 1px solid rgba(112,190,255,.30);
    border-radius: 12px; color: #fff;
    padding: 8px 13px; font-size: 19px; line-height: 1; cursor: pointer;
  }

  header.header .nav {
    position: fixed; left: 0; right: 0; top: 62px; bottom: auto;
    display: none; flex-direction: column; align-items: stretch;
    gap: 0; margin: 0; padding: 8px 20px 16px;
    background: rgba(2,8,18,.985);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(112,190,255,.28);
    max-height: calc(100vh - 62px); overflow-y: auto;
    font-size: 15px;
  }
  header.header .nav.open { display: flex; }
  header.header .nav a {
    padding: 13px 2px; text-align: left; white-space: normal;
    border-bottom: 1px solid rgba(112,190,255,.10);
  }
  header.header .nav a:last-child { border-bottom: none; }
  header.header .nav a::after { display: none; }
  header.header .nav .cta {
    margin-top: 12px; text-align: center; border-radius: 999px;
    border: 1px solid rgba(112,190,255,.28); background: rgba(74,168,255,.14);
  }
  body.nav-open { overflow: hidden; }

  /* ───── Rythme vertical des sections ───── */
  .section, .content-section, .person-section { padding: 44px 18px; }
  .page-hero { padding: 40px 18px 28px; }
  .section-header { margin-bottom: 26px; gap: 14px; }
  .section h2 { font-size: clamp(28px, 8vw, 36px); }
  .section-intro { font-size: 16px; }

  /* ───── Cartes : marges et typo resserrees ───── */
  .card, .pillar {
    min-height: 0; padding: 20px 18px; border-radius: 20px;
  }
  .cards, .pillars, .grid { gap: 14px; }
  .card h3, .pillar h3 { font-size: 19px; margin-bottom: 8px; }
  .card p, .pillar p { font-size: 15px; line-height: 1.5; }
  .icon { width: 42px; height: 42px; margin-bottom: 14px; font-size: 21px; border-radius: 13px; }
  .pillar-num { margin-bottom: 10px; }

  /* Cercles decoratifs : jolis sur grand ecran, illisibles sur petit */
  .orbit-ring, .orbit-electron { display: none !important; }

  /* Cartes courtes : deux par ligne */
  .metrics, .numbers { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .metric, .number-card { min-height: 0; padding: 16px 12px; border-radius: 18px; }
  .metric strong, .number-card strong { font-size: 22px; margin-bottom: 6px; }
  .metric span, .number-card span { font-size: 12.5px; line-height: 1.35; }

  /* Pages internes partageant assets/site.css */
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .stat { padding: 16px 12px; }
  .stat b { font-size: 22px; }
  .card { padding: 20px 18px; }

  /* ───── Blocs de texte ───── */
  .quote-block { padding: 22px 20px; }
  .narrative { gap: 22px; }
  .cloud { padding: 22px 18px; }
  .cloud p { font-size: 16px; }

  /* ───── Page Team ───── */
  .person-layout, .person-layout.reverse { gap: 24px; }
  .person-quote { padding: 20px 18px; }
  .person-info h2 { font-size: 30px; }
}

/* Tres petits ecrans : on repasse les paires en colonne unique */
@media (max-width: 380px) {
  .metrics, .numbers, .stats { grid-template-columns: 1fr; }
}

/* ═══════════════ Passe 2 : hero, carrousels, textes, pied de page ═══════════════ */
@media (max-width: 820px) {

  /* ───── Premier ecran ───── */
  .hero {
    min-height: 0;
    padding: 30px 18px 44px;
    gap: 26px;
  }
  .hero h1, .page-hero h1 { font-size: clamp(30px, 8.6vw, 40px); line-height: 1.08; }
  .hero-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px;
  }
  .hero-actions .btn { padding: 13px 10px; font-size: 12px; text-align: center; }

  /* ───── Carrousels : groupes de cartes homogenes ───── */
  .cards, .pillars, .grid.g3 {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-left: -18px; margin-right: -18px;
    padding: 2px 18px 14px;
    scrollbar-width: none;
  }
  .cards::-webkit-scrollbar, .pillars::-webkit-scrollbar,
  .grid.g3::-webkit-scrollbar { display: none; }
  .cards > *, .pillars > *, .grid.g3 > * {
    flex: 0 0 86%; scroll-snap-align: center;
  }
  .m-swipe-hint {
    display: block; margin: -6px 0 6px;
    font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
    color: rgba(255,255,255,.45);
  }

  /* ───── Textes longs replies ───── */
  .m-clamp { position: relative; overflow: hidden; }
  .m-clamp::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
    background: linear-gradient(180deg, rgba(2,6,12,0), rgba(2,6,12,.96));
    pointer-events: none;
  }
  .m-clamp.open { max-height: none !important; }
  .m-clamp.open::after { display: none; }
  .m-more {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 12px 0 4px; padding: 10px 18px;
    background: rgba(74,168,255,.12); border: 1px solid rgba(112,190,255,.30);
    border-radius: 999px; color: #cfe8ff;
    font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  }

  /* ───── Pied de page : liens sur deux colonnes ───── */
  body .site-ft .ft-cols, body .footcols {
    grid-template-columns: 1fr 1fr; gap: 10px 20px; padding: 28px 0 14px;
  }
  body .site-ft .ft-cols > :first-child,
  body .footcols > :first-child { grid-column: 1 / -1; }
  body .site-ft a, body .footcols a { font-size: 13.5px; padding: 4px 0; }
  body .site-ft h4, body .footcols h4 { margin-bottom: 8px; }
  body .site-ft .ft-bar, body .footbar { font-size: 11.5px; padding: 12px 0; }

  /* ───── Bouton Contact permanent ───── */
  body { padding-bottom: 76px; }
  .m-cta {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 55;
    display: flex; align-items: center; justify-content: center;
    padding: 15px 18px; border-radius: 999px;
    background: linear-gradient(135deg, #4aa8ff, #1f72ff);
    border: 1px solid rgba(114,220,255,.5);
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
    color: #fff; font-weight: 800; font-size: 13px;
    letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
    transition: opacity .25s, transform .25s;
  }
  .m-cta.hidden { opacity: 0; transform: translateY(80px); pointer-events: none; }
}

@media (min-width: 821px) {
  .m-cta { display: none; }
  .m-swipe-hint { display: none; }
}

/* ═══════════════ Passe 3 : carrousels etendus + page The Team ═══════════════ */
@media (max-width: 820px) {

  /* ───── Le defilement horizontal, partout ou il y a une serie de cartes ───── */
  .grid.g2, .metrics, .numbers, .stats {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-left: -18px; margin-right: -18px;
    padding: 2px 18px 14px;
    scrollbar-width: none;
  }
  .grid.g2::-webkit-scrollbar, .metrics::-webkit-scrollbar,
  .numbers::-webkit-scrollbar, .stats::-webkit-scrollbar { display: none; }
  .grid.g2 > * { flex: 0 0 86%; scroll-snap-align: center; }
  /* cartes courtes : on en voit une et demie, l'appel au balayage est evident */
  .metrics > *, .numbers > *, .stats > * {
    flex: 0 0 62%; scroll-snap-align: center;
    display: flex; flex-direction: column; justify-content: center;
    text-align: center; padding: 18px 14px;
  }
  .metric span, .number-card span, .stat span { font-size: 13px; line-height: 1.4; }

  /* ───── Page The Team : une fiche par personne ───── */
  .person-section { padding: 22px 16px; }
  .person-section:last-of-type { padding-bottom: 30px; }
  .person-layout, .person-layout.reverse {
    display: block; gap: 0;
    padding: 18px 16px 20px;
    border: 1px solid rgba(112,190,255,.20);
    border-radius: 24px;
    background: radial-gradient(120% 90% at 50% 0, rgba(74,168,255,.10), transparent 60%), #040e1c;
  }
  .person-info { padding-top: 0; }
  .role-badge { font-size: 10px; padding: 5px 12px; margin-bottom: 12px; letter-spacing: .1em; }
  .person-info h2 { font-size: 27px; margin: 0 0 2px; }
  .person-info .person-title { font-size: 14px; }

  /* la video, deplacee juste sous le nom par le script */
  .person-info .video-col { margin: 16px 0 18px; }
  .video-card { border-radius: 18px; }

  .person-quote { padding: 16px 16px; border-radius: 18px; margin-bottom: 16px; }
  .person-quote p { font-size: 15px; line-height: 1.5; }
  .person-quote cite { font-size: 11.5px; }
  .person-bio p { font-size: 15px; line-height: 1.55; margin-bottom: 12px; }
}

/* ═══════════════ Passe 4 : correctifs ═══════════════ */
@media (max-width: 820px) {

  /* Debordement du hero : les libelles doivent pouvoir passer a la ligne */
  .hero-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-actions .btn {
    white-space: normal; word-break: normal;
    font-size: 11.5px; letter-spacing: .04em; padding: 12px 8px;
    min-width: 0; max-width: 100%;
  }
  .hero, .section, .content-section, .person-section { max-width: 100%; }

  /* La mention SWIPE n'est plus utile : la carte suivante depasse deja */
  .m-swipe-hint { display: none; }

  /* Carrousels : classe posee par le script, donc prioritaire sur le CSS
     integre a chaque page, quel que soit l'ordre de chargement. */
  .m-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-left: -18px !important; margin-right: -18px !important;
    padding: 2px 18px 14px !important;
    scrollbar-width: none;
  }
  .m-scroll::-webkit-scrollbar { display: none; }
  .m-scroll > * {
    flex: 0 0 84% !important;
    scroll-snap-align: center;
    min-width: 0;
  }
  .m-scroll.compact > * { flex: 0 0 62% !important; }

  /* Fiche personne : meme principe, classe posee par le script */
  .m-person {
    display: block !important;
    padding: 18px 16px 20px !important;
    border: 1px solid rgba(112,190,255,.20) !important;
    border-radius: 24px !important;
    background: radial-gradient(120% 90% at 50% 0, rgba(74,168,255,.10), transparent 60%), #040e1c !important;
  }
  .m-person .person-info h2 { font-size: 27px !important; margin: 0 0 2px !important; }
  .m-person .video-col { margin: 16px 0 18px !important; }
}

/* ═══════════════ Passe 5 : The Team en onglets ═══════════════ */
@media (max-width: 820px) {
  .m-tabs {
    position: sticky; top: 58px; z-index: 40;
    display: flex; gap: 8px;
    margin: 0 16px 4px; padding: 10px 0;
    background: rgba(2,6,12,.94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .m-tab {
    flex: 1 1 0; min-width: 0;
    padding: 12px 8px; border-radius: 999px;
    border: 1px solid rgba(112,190,255,.28);
    background: rgba(74,168,255,.08);
    color: #cfe8ff; font: inherit; font-size: 13px; font-weight: 800;
    letter-spacing: .02em; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-tab.active {
    background: linear-gradient(135deg, #4aa8ff, #1f72ff);
    border-color: rgba(114,220,255,.5); color: #fff;
  }
  .m-hidden { display: none !important; }

  /* la video ferme la fiche */
  .m-person .video-col { margin: 20px 0 0 !important; }
  .m-video-label {
    display: block; margin: 0 0 8px;
    font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
    color: rgba(255,255,255,.5);
  }
}
