/* Correctifs ciblés Communauté / Profil — chargé après vxg-community.css. */

/* Les médias décoratifs ne doivent jamais intercepter l'action « Modifier la couverture ». */
html.vxg-member-page .vxg-mp-hero::before,
html.vxg-member-page .vxg-mp-hero::after,
html.vxg-member-page .vxg-mp-cover,
html.vxg-member-page .vxg-mp-generated-cover,
html.vxg-member-page .vxg-mp-empty-cover{pointer-events:none}
html.vxg-member-page .vxg-mp-media-edit.cover{z-index:9;pointer-events:auto}

/* Le hero ne forme plus un contexte global au-dessus des tabs. Ses morceaux visuels
   restent au premier plan individuellement ; seules les actions montent à l'ouverture. */
html.vxg-member-page .vxg-mp-head{z-index:auto}
html.vxg-member-page .vxg-mp-avatar,
html.vxg-member-page .vxg-mp-id,
html.vxg-member-page .vxg-mp-actions{position:relative;z-index:5}
html.vxg-member-page.vxg-mp-owner-menu-open .vxg-mp-actions{z-index:140}
html.vxg-member-page.vxg-mp-owner-menu-open .vxg-mp-owner-menu{z-index:142}

/* Tracks réguliers : pas de colonnes poussées aux extrêmes par space-between. */
html.vxg-community-page ul.grid-temp.vxg-cm-grid,
html.vxg-member-page ul.grid-temp.vxg-mp-member-grid{justify-content:start!important}
@media (max-width:1023px){
  html.vxg-community-page ul.grid-temp.vxg-cm-grid,
  html.vxg-member-page ul.grid-temp.vxg-mp-member-grid{
    grid-template-columns:repeat(auto-fill,minmax(138px,1fr))!important;
    column-gap:10px!important;
    row-gap:16px!important
  }
}
@media (max-width:429px){
  html.vxg-community-page ul.grid-temp.vxg-cm-grid,
  html.vxg-member-page ul.grid-temp.vxg-mp-member-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    column-gap:8px!important;
    row-gap:14px!important
  }
}
@media (max-width:559px){
  :is(html.vxg-community-page,html.vxg-member-page) .vxg-mc{max-width:none}
}

/* /my/friends/ : pagination KVS conservée comme moteur, remplacée visuellement
   par un sentinel d'autoload et un état de reprise explicite. */
html.vxg-friends-autoload-ready .vxg-my-friends>.load-more{
  width:1px!important;
  height:1px!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  opacity:0!important;
  pointer-events:none!important
}
html .vxg-friends-autoload{display:none;align-items:center;justify-content:center;gap:9px;min-height:44px;margin:12px 0 0;color:var(--muted-foreground);font-size:12px;font-weight:700}
html .vxg-friends-autoload[data-state="loading"],
html .vxg-friends-autoload[data-state="error"]{display:flex}
html .vxg-friends-autoload[data-state="idle"],
html .vxg-friends-autoload[data-state="complete"]{display:block;width:100%;height:1px;min-height:1px;margin:0;overflow:hidden;opacity:0}
html .vxg-friends-autoload__spinner{display:block;width:17px;height:17px;border:2px solid color-mix(in oklab,var(--foreground) 16%,transparent);border-top-color:var(--primary-glow);border-radius:50%;animation:vxgFriendsSpin .72s linear infinite}
html .vxg-friends-autoload button{display:none;min-height:38px;padding:0 14px;border:1px solid var(--border);border-radius:9999px;background:#0b0b0b;color:var(--foreground);font:800 12px/1 Inter,sans-serif;cursor:pointer}
html .vxg-friends-autoload[data-state="error"] .vxg-friends-autoload__spinner{display:none}
html .vxg-friends-autoload[data-state="error"] button{display:inline-flex;align-items:center;justify-content:center}
@keyframes vxgFriendsSpin{to{transform:rotate(360deg)}}

/* La demande reçue devient un dock compact au-dessus de la navigation mobile. */
@media (max-width:767px){
  html.vxg-member-page.vxg-mp-has-friend-dock .vxg-mp-actions{z-index:198}
  html.vxg-member-page .vxg-mp-actions.is-visitor.has-friend-request>.sub-btn,
  html.vxg-member-page .vxg-mp-actions.is-visitor.has-friend-request>.msg,
  html.vxg-member-page .vxg-mp-actions.is-visitor.has-friend-request>.vxg-mp-visitor-more{grid-row:1}
  html.vxg-member-page .vxg-mp-actions.is-visitor.has-friend-request>.vxg-mp-friend-inline.is-received{
    position:fixed;
    right:max(10px,env(safe-area-inset-right,0px));
    bottom:calc(var(--vxg-mobile-bottomnav-clearance,90px) + 6px);
    left:max(10px,env(safe-area-inset-left,0px));
    z-index:198;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto;
    align-items:center;
    gap:8px;
    width:auto;
    min-width:0;
    margin:0;
    padding:9px 10px;
    border:1px solid color-mix(in oklab,var(--primary) 34%,var(--border));
    border-radius:16px;
    background:color-mix(in oklab,#0b0b0b 94%,transparent);
    box-shadow:0 14px 38px rgba(0,0,0,.5);
    -webkit-backdrop-filter:blur(16px) saturate(135%);
    backdrop-filter:blur(16px) saturate(135%);
    transition:opacity .18s,transform .18s
  }
  html.vxg-member-page .vxg-mp-friend-inline.is-received>.generic-error:not(.hidden){
    grid-column:1/-1;
    grid-row:2;
    width:100%
  }
  html.vxg-member-page .vxg-mp-friend-inline-copy{gap:8px}
  html.vxg-member-page .vxg-mp-friend-inline-icon{flex-basis:32px;width:32px;height:32px;border-radius:9px}
  html.vxg-member-page .vxg-mp-friend-inline-copy strong{font-size:12px}
  html.vxg-member-page .vxg-mp-friend-inline-copy small{max-width:38vw;font-size:9.5px}
  html.vxg-member-page .vxg-mp-friend-inline-actions{
    display:flex;
    grid-column:2;
    grid-row:1;
    gap:6px;
    width:auto
  }
  html.vxg-member-page .vxg-mp-friend-inline-actions .vxg-mp-btn{
    width:auto;
    min-height:44px;
    height:44px;
    padding:0 10px;
    font-size:11px
  }
  html.vxg-member-page.vxg-mp-has-friend-dock .wrapper{padding-bottom:calc(var(--vxg-mobile-bottomnav-clearance,90px) + 80px)}
  html.vxg-member-page body.nav-open .vxg-mp-friend-inline.is-received{opacity:0;pointer-events:none;transform:translateY(10px)}
}
@media (max-width:399px){
  html.vxg-member-page .vxg-mp-friend-inline.is-received{padding-left:9px}
  html.vxg-member-page .vxg-mp-friend-inline-icon{display:none}
  html.vxg-member-page .vxg-mp-friend-inline-copy small{max-width:34vw}
  html.vxg-member-page .vxg-mp-friend-inline-actions .vxg-mp-btn{padding:0 9px}
  html.vxg-member-page .vxg-mp-friend-inline-actions .vxg-mp-btn svg{display:none}
}
@media (prefers-reduced-motion:reduce){
  html .vxg-friends-autoload__spinner{animation-duration:1.5s}
  html.vxg-member-page .vxg-mp-friend-inline.is-received{transition:none}
}

/* Profil V31 : hero full-bleed desktop, navigation plate et niveaux KVS. */
html.vxg-member-page .profile{margin-bottom:0}
@media (min-width:1024px){
  html.vxg-member-hero-page .main{padding-top:0!important}
  html.vxg-member-page .profile{padding:0 0 22px}
  html.vxg-member-page .profile>.container{width:100%;max-width:none!important;margin:0;padding:0}
  html.vxg-member-page .vxg-mp-panel{width:100%;max-width:none;margin:0!important;padding:0}
  html.vxg-member-page .vxg-mp-hero{width:100%;margin:0!important;border-radius:0}
  html.vxg-member-page .vxg-mp-head{padding-right:clamp(20px,2vw,32px);padding-left:clamp(20px,2vw,32px)}
}

/* Bandeau sticky sans l’aspect d’une section/card imbriquée. */
html.vxg-member-page .vxg-mp-tabs-wrap{
  position:sticky;
  top:var(--vxg-header-h,64px)!important;
  z-index:120;
  margin:0 -10px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:color-mix(in oklab,#0a0a0a 92%,transparent)!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:blur(14px) saturate(130%);
  backdrop-filter:blur(14px) saturate(130%)
}
html.vxg-member-page .vxg-mp-tabsbar{width:100%;max-width:none;margin:0;padding:8px 10px;border:0;border-bottom:1px solid color-mix(in oklab,var(--border) 72%,transparent);border-radius:0;background:transparent;box-shadow:none}
@media (min-width:801px){
  html.vxg-member-page .vxg-mp-tabs-wrap{margin-right:-15px!important;margin-left:-15px!important}
  html.vxg-member-page .vxg-mp-tabsbar{padding-right:15px;padding-left:15px}
}
@media (min-width:1024px){
  html.vxg-member-page .vxg-mp-tabs-wrap{margin-right:-24px!important;margin-left:-24px!important}
  html.vxg-member-page .vxg-mp-tabsbar{padding-right:24px;padding-left:24px}
}
@media (max-width:1023px){
  html.vxg-member-page .vxg-mp-tabs-wrap{top:env(safe-area-inset-top,0px)!important}
}

/* Niveau du profil : status_id=3 => VIP, membre actif => Plus. */
:is(html.vxg-member-page,html.vxg-community-page) .vxg-member-tier{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:22px;padding:0 8px;border:1px solid color-mix(in oklab,var(--foreground) 18%,transparent);border-radius:9999px;background:color-mix(in oklab,#0a0a0a 82%,transparent);color:var(--muted-foreground);font:850 9.5px/1 Inter,sans-serif;letter-spacing:.065em;text-transform:uppercase;text-shadow:none;white-space:nowrap}
:is(html.vxg-member-page,html.vxg-community-page) .vxg-member-tier--plus{border-color:color-mix(in oklab,var(--primary) 38%,transparent);background:color-mix(in oklab,var(--primary) 9%,#0a0a0a);color:var(--primary-glow)}
:is(html.vxg-member-page,html.vxg-community-page) .vxg-member-tier--vip{border-color:transparent;background:var(--gradient-brand);color:#fff;box-shadow:0 5px 16px color-mix(in oklab,var(--primary) 20%,transparent)}
html.vxg-member-page .vxg-mp-h1>.vxg-member-tier{min-height:23px;transform:translateY(1px)}
:is(html.vxg-member-page,html.vxg-community-page) .vxg-mc-name>.vxg-mc-tier{min-height:18px;padding:0 5px;color:#fff;font-size:7.5px;line-height:1;letter-spacing:.045em}

html.vxg-member-page .vxg-mp-actions .vxg-mp-vip-cta{border-color:color-mix(in oklab,var(--primary) 42%,var(--border));background:linear-gradient(145deg,color-mix(in oklab,var(--primary) 15%,#0a0a0a),#0a0a0a 72%);color:#fff}
html.vxg-member-page .vxg-mp-actions .vxg-mp-vip-cta:hover{border-color:var(--primary);background:color-mix(in oklab,var(--primary) 20%,#0a0a0a);color:#fff}
html.vxg-member-page .vxg-mp-actions .vxg-mp-vip-cta:focus-visible{outline:3px solid color-mix(in oklab,var(--primary) 42%,transparent);outline-offset:2px}
@media (max-width:640px){
  html.vxg-member-page .vxg-mp-owner-actions{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px;width:100%}
  html.vxg-member-page .vxg-mp-owner-actions .vxg-mp-edit-main{grid-column:1;grid-row:1;width:100%}
  html.vxg-member-page .vxg-mp-owner-actions .vxg-mp-owner-more{grid-column:2;grid-row:1}
  html.vxg-member-page .vxg-mp-owner-actions .vxg-mp-vip-cta{grid-column:1/-1;grid-row:2;width:100%}
}

/* URL partenaire absente : information neutre, jamais de faux lien. */
html .vxg-av-way-actions .vxg-av-action-unavailable{display:inline-flex;align-items:center;min-height:34px;padding:0 12px;border:1px dashed color-mix(in oklab,var(--foreground) 17%,transparent);border-radius:9999px;color:var(--muted-foreground);font-size:11.5px;font-weight:650;cursor:default}
