/* ============================================================
   portail-mobile.css — responsive mobile des pages redesign (portail/)
   À charger APRÈS les styles de page. Marche de pair avec portail-mobile.js
   (qui pose les classes .pm-header/.pm-aside/.pm-body/.pm-main + le hamburger).
   Les pages sont en styles INLINE → overrides en !important.
   Breakpoint mobile : ≤ 820px.
   ============================================================ */

/* Hamburger + voile + en-tête de tiroir + footer mobile (cachés en desktop) */
#mobBurger { display: none; }
.pm-drawer-head, .pm-dh-space, .pm-mobile-footer { display: none; }

/* Piliers cliquables sous les agents (desktop + mobile) */
.agent-pilier { transition: background .15s ease, border-color .15s ease, color .15s ease; }
.agent-pilier:hover { background: #FBEEDD; border-color: #E2C9A4; color: #C75A24; }
/* « Voir le CV » après le prénom (sans soulignement) */
.agent-cv { transition: color .15s ease; }
.agent-cv:hover { color: #A8481A; }
#mobOverlay { display: none; position: fixed; inset: 0; background: rgba(40,28,18,0.45); z-index: 90; }
#mobOverlay.mob-show { display: block; }

@media (max-width: 820px) {
  /* — Header compact : hamburger + logo + profil ; casquettes (mpc-seg) cachées — */
  #mobBurger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: none; border: none; background: transparent;
    color: #4A3326; cursor: pointer; border-radius: 10px; margin-right: 2px;
  }
  #mobBurger:active { background: #EADBC4; }
  .pm-header { flex-wrap: wrap !important; height: auto !important; padding: 8px 12px !important; gap: 8px !important; }
  /* Switcher d'espace : barre pleine largeur VISIBLE sous le logo (plus dans le burger) */
  .pm-header .mpc-seg { display: flex !important; order: 10; flex: 0 0 calc(100% + 24px) !important; width: auto !important; max-width: none !important; margin: 0 -12px !important; border-radius: 0 !important; }
  .pm-header .mpc-seg .seg-on, .pm-header .mpc-seg .seg-off, .pm-header .mpc-seg #cockpitSlot > * { flex: 1 1 0 !important; text-align: center !important; justify-content: center !important; font-size: 12px !important; padding: 7px 6px !important; white-space: nowrap; }
  .pm-header .mpc-seg .seg-on { background: #2E2018 !important; border-radius: 999px !important; }   /* onglet actif (le thumb est masqué sur mobile) */
  .pm-header .mpc-seg #cockpitSlot { display: contents !important; }
  .pm-header .seg-thumb { display: none !important; }
  .pm-header [style*="margin-right: 50px"],
  .pm-header [style*="margin-right:50px"] { margin-right: 0 !important; }
  /* Bouton « Abonnements » : compact sur mobile pour tenir sur la ligne hamburger/logo/avatar */
  .pm-header .abo-hdr-btn, .pm-header .mpc-abo-btn { font-size: 10.5px !important; padding: 5px 10px !important; gap: 5px !important; }
  .pm-header .abo-hdr-btn img, .pm-header .mpc-abo-btn img { display: none !important; }  /* vignette capsule : desktop uniquement */
  /* Avatar : on conserve la pastille (photo) mais on masque nom/rôle pour tout tenir sur une seule ligne */
  .pm-header #hdrName, .pm-header #hdrSub, .pm-header #mpcName, .pm-header #mpcSub { display: none !important; }

  /* — Corps : on déstacke (la sidebar devient un tiroir, le contenu prend toute la largeur) — */
  .pm-body { display: block !important; }
  .pm-main { padding: 18px 16px !important; }

  /* Logo : tasse seule sur mobile (le wordmark wrappe à l'étroit) */
  .pm-wordmark { display: none !important; }
  /* Éléments volontairement masqués sur mobile (ex. gros titre du greeting) */
  .pm-hide-mobile { display: none !important; }
  /* Nudges desktop qui cassent en mobile (ex. KPI « en cours » poussé de 200px) */
  .pm-main [style*="right: 200px"], .pm-main [style*="right:200px"], .pm-main [style*="right: 251px"], .pm-main [style*="right:251px"] { right: 0 !important; position: static !important; }

  /* — Sidebar → tiroir off-canvas — */
  .pm-aside {
    position: fixed !important; top: 0 !important; left: 0 !important; bottom: 0 !important;
    height: 100vh !important; width: 286px !important; max-width: 86vw !important;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 100;
    overflow-y: auto; background: #F2E9D9 !important;
    box-shadow: 0 0 44px rgba(40,28,18,0.25); padding: 18px 16px !important;
  }
  .pm-aside.mob-open { transform: translateX(0); }

  /* En-tête du tiroir : logo centré (avec ®) en haut ; le nom de l'espace est SOUS la chip tél. (centré) */
  .pm-drawer-head { display: block !important; padding: 4px 2px 12px; }
  .pm-dh-logo { display: flex; align-items: center; justify-content: center; gap: 9px; }
  .pm-dh-logo img { height: 30px; width: auto; display: block; }
  .pm-dh-logo span { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; color: #5A3A26; }
  .pm-dh-logo sup { font-size: 9px; color: #E2723B; }
  .pm-dh-space { display: block !important; text-align: center; margin: 6px 0 12px; font-size: 13px; font-weight: 700; color: #4A3326; }

  /* — Agents (espace-personnel/entreprise) : EMPILÉS PLEINE LARGEUR,
       carte horizontale (avatar capsule à gauche · prénom + piliers à droite) — */
  .pm-agents { position: static !important; grid-template-columns: 1fr !important; max-width: none !important; gap: 14px !important; margin: 14px 0 6px !important; }
  .pm-agents > div { margin: 0 !important; flex-direction: row !important; align-items: flex-start !important; text-align: left !important; gap: 18px !important; justify-content: flex-start !important; }
  .pm-agents > div:last-of-type { flex-direction: row-reverse !important; }   /* Luciano (dernier DIV — ignore le post-it <aside> de l'Entreprise) : avatar à gauche aussi (DOM = texte,image) */
  .pm-agents > div > div { flex: 1 1 auto !important; margin: 0 !important; align-items: flex-start !important; text-align: left !important; right: auto !important; min-width: 0 !important; }
  /* Le texte descend pour que la ligne « périmètre » (rôle) tombe au centre vertical de l'avatar */
  .pm-agents > div > div:not(:has(> img)) { margin-top: 11px !important; }
  .pm-agents > div > div > div:last-child { align-items: flex-start !important; }   /* piliers alignés à gauche (override Luciano flex-end) */
  /* Luciano : prénom AVANT « Voir le CV » sur mobile (l'inversion du DOM ne vaut qu'en desktop) */
  .pm-agents > div:last-of-type .agent-cv { order: 1 !important; }
  /* Avatars en CAPSULE ronde : portrait tête/buste zoomé depuis l'image plein corps.
     Le div cliquable (qui contient l'image) devient un masque rond ; l'image est
     agrandie puis recalée sur le visage par les marges. */
  .pm-agents > div > div:has(> img) { width: 104px !important; height: 104px !important; flex: none !important; border-radius: 50% !important; overflow: hidden !important; border: 2px solid #FFFDF9 !important; box-shadow: 0 3px 12px rgba(74,51,38,0.16) !important; background: #FBEEDD !important; }
  .pm-agents img { width: 250px !important; height: auto !important; max-width: none !important; margin: -6px 0 0 -73px !important; display: block !important; }
  .pm-agents [style*="radial-gradient"] { display: none !important; }   /* ombre au sol → off */

  /* Footer mobile : contact + confidentialité sous les agents */
  .pm-mobile-footer { display: flex !important; flex-direction: column; align-items: center; gap: 14px; margin: 6px 0 26px; padding-top: 20px; border-top: 1px solid #E3D4BD; }
}
