/* ========================================================================== */
/* ETHNOS R185 — Tchat en onglet, continents illustrés et tableau recentré   */
/* Base stricte : R184.                                                        */
/* ========================================================================== */

:root{
  --r185-edge-gap:10px;
  --r185-metric-height:126px;
}

/* -------------------------------------------------------------------------- */
/* Géométrie générale : la colonne gauche reste réservée, même Tchat fermé.   */
/* Le bloc central reste à 10 px des deux navigations blanches.               */
/* -------------------------------------------------------------------------- */
@media (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body .memberLayout{
    grid-template-columns:var(--ethnos-search-width) minmax(0,1fr) !important;
    column-gap:0 !important;
  }
  html[data-ethnos-ui="discord-r111"] body .memberWorkspace{
    grid-column:2 !important;
    align-self:start !important;
    height:calc(100% - var(--r110-dock-height,54px) - (var(--r185-edge-gap) * 2)) !important;
    min-height:0 !important;
    margin:var(--r185-edge-gap) 0 0 !important;
    overflow:hidden !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .memberWorkspace.hasBodyView{
    align-items:stretch !important;
    justify-content:stretch !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .memberWorkspace.hasBodyView > .bodyView-homeR180,
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .bodyView-homeR180 > .r180HomeContent,
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .r180MainColumn{
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .r180MainColumn{
    display:grid !important;
    grid-template-rows:minmax(0,1fr) auto auto !important;
    gap:10px !important;
    align-content:stretch !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .r180HomeHero{
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Tchat : onglet bas gauche fermé, volet bleu complet ouvert.                */
/* -------------------------------------------------------------------------- */
@media (min-width:901px){
  html body .memberExplorerPanel{
    position:fixed !important;
    z-index:91 !important;
    left:0 !important;
    bottom:var(--footer-legal,22px) !important;
    width:var(--ethnos-search-width) !important;
    min-width:var(--ethnos-search-width) !important;
    max-width:var(--ethnos-search-width) !important;
    height:var(--ethnos-card-height) !important;
    min-height:var(--ethnos-card-height) !important;
    max-height:var(--ethnos-card-height) !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    border-radius:0 15px 0 0 !important;
    background:linear-gradient(180deg,#0b3446 0%,#052130 100%) !important;
    box-shadow:12px -14px 32px rgba(0,0,0,.24) !important;
    transition:top .28s ease,bottom .28s ease,height .28s ease,max-height .28s ease,border-radius .28s ease !important;
  }
  html body .r185TchatToggle{
    appearance:none !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:12px !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 16px !important;
    border:0 !important;
    border-bottom:0 !important;
    border-radius:inherit !important;
    background:
      radial-gradient(circle at 18% 120%,rgba(49,209,207,.17),transparent 42%),
      linear-gradient(180deg,rgba(11,52,70,.98),rgba(5,33,48,.99)) !important;
    color:#fff9ef !important;
    cursor:pointer !important;
  }
  html body .r185TchatToggle h2{
    margin:0 !important;
    font-size:clamp(24px,1.7vw,32px) !important;
    line-height:1 !important;
  }
  html body .r185TchatToggleIcon{
    color:#31d1cf !important;
    font-family:Arial,sans-serif !important;
    font-size:19px !important;
    font-weight:700 !important;
    transform:rotate(0deg) !important;
    transition:transform .24s ease !important;
  }
  html body:not(.isTchatDrawerOpen) .memberExplorerBody{
    display:none !important;
  }

  html body.isTchatDrawerOpen .memberExplorerPanel{
    top:calc(var(--topbar,54px) + var(--r185-edge-gap)) !important;
    bottom:calc(var(--footer-legal,22px) + var(--r110-dock-height,54px) + var(--r185-edge-gap)) !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    border-radius:0 15px 15px 0 !important;
    box-shadow:16px 18px 42px rgba(0,0,0,.30) !important;
  }
  html body.isTchatDrawerOpen .r185TchatToggle{
    flex:0 0 64px !important;
    height:64px !important;
    border-bottom:1px solid rgba(149,205,218,.18) !important;
    border-radius:0 15px 0 0 !important;
  }
  html body.isTchatDrawerOpen .r185TchatToggleIcon{
    transform:rotate(180deg) !important;
  }
  html body.isTchatDrawerOpen .memberExplorerBody{
    display:flex !important;
    flex:1 1 auto !important;
    flex-direction:column !important;
    min-height:0 !important;
    max-height:none !important;
    height:auto !important;
    padding:0 10px 14px !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
  }

  /* Le contenu éditorial disparaît ; seuls les volets de recherche restent. */
  html body.isTchatDrawerOpen .memberWorkspace{
    display:block !important;
    overflow:hidden !important;
  }
  html body.isTchatDrawerOpen .memberWorkspace > *{
    visibility:hidden !important;
    pointer-events:none !important;
  }
  html body.isTchatDrawerOpen .memberWorkspace > .salonDrawerStage,
  html body.isTchatDrawerOpen .memberWorkspace > .salonCentralResultsWindow,
  html body.isTchatDrawerOpen .memberWorkspace > .salonRoomView{
    visibility:visible !important;
    pointer-events:auto !important;
  }
  html body.isTchatDrawerOpen .salonDrawerStage{
    inset:0 !important;
    padding:0 10px 0 0 !important;
  }
  html body.isTchatDrawerOpen .salonDrawerStack{
    height:100% !important;
    max-height:none !important;
    align-items:stretch !important;
  }
  html body.isTchatDrawerOpen .salonDrawerPanel{
    height:100% !important;
    max-height:100% !important;
  }
}

/* Espaces verticaux harmonisés et boutons continents illustrés. */
html body.isTchatDrawerOpen .salonQuickSearch{
  gap:10px !important;
  padding:24px 1px 28px !important;
}
html body.isTchatDrawerOpen .salonQuickSearch > .salonExplorerLabel{
  margin-bottom:8px !important;
}
html body.isTchatDrawerOpen .salonDeepSearch{
  padding:27px 1px 20px !important;
  border-top:1px solid rgba(149,205,218,.22) !important;
}
html body.isTchatDrawerOpen .salonDeepSearchTagline{
  margin:10px auto 17px !important;
}
html body.isTchatDrawerOpen .salonContinentShortcuts{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
}
html body.isTchatDrawerOpen .salonContinentShortcuts button{
  position:relative !important;
  isolation:isolate !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:94% !important;
  min-height:58px !important;
  margin:0 auto !important;
  padding:8px 12px !important;
  overflow:hidden !important;
  border:1px solid rgba(183,225,232,.24) !important;
  border-radius:10px !important;
  background-image:
    linear-gradient(90deg,rgba(3,22,33,.82),rgba(3,22,33,.38),rgba(3,22,33,.76)),
    var(--continent-image) !important;
  background-size:cover !important;
  background-position:center !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025),0 8px 18px rgba(0,0,0,.18) !important;
  color:#fff !important;
  text-shadow:0 2px 8px rgba(0,0,0,.92) !important;
  transition:transform .18s ease,border-color .18s ease,filter .18s ease !important;
}
html body.isTchatDrawerOpen .salonContinentShortcuts button:hover,
html body.isTchatDrawerOpen .salonContinentShortcuts button:focus-visible{
  transform:translateY(-2px) !important;
  border-color:rgba(49,209,207,.52) !important;
  filter:saturate(1.08) brightness(1.06) !important;
  outline:none !important;
}
html body.isTchatDrawerOpen .salonContinentShortcuts button span{
  position:relative !important;
  z-index:2 !important;
  color:#fff !important;
  font-size:clamp(11px,.75vw,14px) !important;
  font-weight:800 !important;
  letter-spacing:.01em !important;
}
html body.isTchatDrawerOpen .salonContinentShortcuts button small{
  position:absolute !important;
  z-index:2 !important;
  right:10px !important;
  bottom:7px !important;
  color:#ffb27c !important;
  font-size:8px !important;
  font-weight:800 !important;
}
html body.isTchatDrawerOpen .salonContinentShortcuts button:disabled{
  opacity:.72 !important;
  filter:saturate(.72) !important;
  cursor:not-allowed !important;
}
html body.isTchatDrawerOpen .salonContinentShortcuts button[data-continent="afrique"]{background-position:center 56% !important}
html body.isTchatDrawerOpen .salonContinentShortcuts button[data-continent="europe"]{background-position:center 46% !important}
html body.isTchatDrawerOpen .salonContinentShortcuts button[data-continent="amerique-nord"]{background-position:54% 48% !important}
html body.isTchatDrawerOpen .salonContinentShortcuts button[data-continent="asie"]{background-position:center 62% !important}
html body.isTchatDrawerOpen .salonContinentShortcuts button[data-continent="moyen-orient"]{background-position:center 48% !important}
html body.isTchatDrawerOpen .salonContinentShortcuts button[data-continent="amerique-sud"]{background-position:center 54% !important}
html body.isTchatDrawerOpen .salonContinentShortcuts button[data-continent="oceanie"]{background-position:center 56% !important}

/* -------------------------------------------------------------------------- */
/* Porte Monde : uniquement le grand titre et l’image.                        */
/* -------------------------------------------------------------------------- */
html body .r185PillarWorldMinimal{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  padding-bottom:16px !important;
}
html body .r185PillarWorldMinimal h3{
  max-width:78% !important;
  margin:0 !important;
  text-shadow:0 4px 16px rgba(0,0,0,.92) !important;
}

/* -------------------------------------------------------------------------- */
/* Cinq blocs bas : streaming intégré, hauteur +50 %, rangée recentrée.       */
/* -------------------------------------------------------------------------- */
html body .r183StreamingTab{
  display:none !important;
}
html body .r183MetricRow{
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:10px !important;
  width:min(94%,1200px) !important;
  margin:0 auto !important;
  align-self:end !important;
}
html body .r183MetricCard{
  min-height:var(--r185-metric-height) !important;
  height:var(--r185-metric-height) !important;
  padding:15px 15px 13px !important;
}
html body .r183MetricCard strong{
  margin-top:8px !important;
}
html body .r183MetricEvents,
html body .r183MetricSolidarity,
html body .r183MetricUniverses,
html body .r183MetricLive,
html body .r185MetricStreaming{
  background-size:cover !important;
  background-repeat:no-repeat !important;
}
html body .r183MetricEvents{background-position:46% 43% !important}
html body .r183MetricSolidarity{background-position:52% 36% !important}
html body .r183MetricUniverses{background-position:68% 44% !important}
html body .r183MetricLive{background-position:58% 38% !important}
html body .r185MetricStreaming{
  background-image:url('../assets/images/on-air-streaming.jpg') !important;
  background-position:50% 42% !important;
}
html body .r185MetricStreaming strong{
  max-width:100% !important;
  color:#ff9a5c !important;
  font-family:var(--ethnos-official-title,"Manrope",sans-serif) !important;
  font-size:clamp(10px,.78vw,15px) !important;
  font-weight:900 !important;
  letter-spacing:.035em !important;
  line-height:1.05 !important;
}
html body .r185MetricStreaming small{
  display:block !important;
  margin-top:6px !important;
  color:#fff !important;
  font-size:clamp(6px,.42vw,8px) !important;
  font-weight:800 !important;
  text-shadow:0 2px 8px rgba(0,0,0,.95) !important;
}
html body .r183MetricEvents .r184MetricMedia{object-position:46% 43% !important}
html body .r183MetricUniverses .r184MetricMedia{object-position:68% 44% !important}

/* Formats bas : +50 % conservé par rapport aux anciennes hauteurs 62/56. */
@media (max-height:820px) and (min-width:901px){
  :root{--r185-metric-height:93px}
  html body .r183MetricCard{padding:10px 11px 9px !important}
  html body .r183MetricCard strong{margin-top:5px !important}
  html body .r185MetricStreaming small{margin-top:3px !important}
}
@media (max-height:740px) and (min-width:901px){
  :root{--r185-metric-height:84px}
  html body .r183MetricCard{padding:8px 10px 7px !important}
  html body .r183MetricCard strong{margin-top:3px !important}
  html body .r185MetricStreaming p{display:none !important}
}
@media (max-width:1500px) and (min-width:901px){
  html body .r183MetricRow{width:min(96%,1040px) !important;gap:8px !important}
}
@media (max-height:820px) and (min-width:901px){
  html body.isTchatDrawerOpen .r185TchatToggle{flex-basis:52px !important;height:52px !important}
  html body.isTchatDrawerOpen .salonQuickSearch{padding:15px 0 18px !important;gap:7px !important}
  html body.isTchatDrawerOpen .salonDeepSearch{padding:18px 0 12px !important}
  html body.isTchatDrawerOpen .salonDeepSearchTagline{margin:7px auto 11px !important}
  html body.isTchatDrawerOpen .salonContinentShortcuts{gap:7px !important}
  html body.isTchatDrawerOpen .salonContinentShortcuts button{min-height:48px !important}
}

@media (max-width:900px){
  html body .r185TchatToggleIcon{display:none !important}
  html body .r183MetricRow{grid-template-columns:repeat(2,minmax(0,1fr)) !important;width:100% !important}
  html body .r183MetricCard{height:auto !important;min-height:100px !important}
}

@media (prefers-reduced-motion:reduce){
  html body .memberExplorerPanel,
  html body .r185TchatToggleIcon,
  html body.isTchatDrawerOpen .salonContinentShortcuts button{transition:none !important}
}

/* Correctifs de priorité sur les couches historiques R119/R162/R181. */
@media (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body .memberLayout{
    padding-top:0 !important;
    padding-bottom:0 !important;
  }
  html[data-ethnos-ui="discord-r111"] body .memberExplorerPanel{
    position:fixed !important;
    left:0 !important;
    top:auto !important;
    right:auto !important;
    bottom:0 !important;
    width:var(--ethnos-search-width) !important;
    min-width:var(--ethnos-search-width) !important;
    max-width:var(--ethnos-search-width) !important;
    height:var(--ethnos-card-height) !important;
    min-height:var(--ethnos-card-height) !important;
    max-height:var(--ethnos-card-height) !important;
    align-self:auto !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel{
    top:calc(var(--topbar,54px) + var(--r185-edge-gap)) !important;
    bottom:calc(var(--footer-legal,38px) + var(--r110-dock-height,54px) + var(--r185-edge-gap)) !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .memberWorkspace.hasBodyView > .bodyView-homeR180 > .r180HomeContent,
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView .memberWorkspace.hasBodyView > .bodyView-homeR180 .r180MainColumn{
    height:100% !important;
    min-height:0 !important;
    max-height:none !important;
  }
}

/* Priorité finale : ordre des continents et occupation harmonieuse du volet. */
@media (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonDeepSearch{
    display:flex !important;
    flex:1 0 auto !important;
    flex-direction:column !important;
    min-height:0 !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts{
    display:grid !important;
    flex:1 0 auto !important;
    grid-template-columns:1fr !important;
    grid-template-rows:repeat(7,minmax(58px,1fr)) !important;
    gap:10px !important;
    min-height:466px !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts button{
    order:0 !important;
    min-height:58px !important;
  }
}
@media (max-height:820px) and (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts{
    grid-template-rows:repeat(7,minmax(48px,1fr)) !important;
    gap:7px !important;
    min-height:378px !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts button{
    min-height:48px !important;
  }
}

/* Ajustement final des hauteurs illustrées : environ x2, sans coupe en 1920. */
@media (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts{
    grid-template-rows:repeat(7,minmax(56px,1fr)) !important;
    gap:9px !important;
    min-height:446px !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts button{
    min-height:56px !important;
  }
}
@media (max-height:820px) and (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts{
    grid-template-rows:repeat(7,minmax(46px,1fr)) !important;
    gap:7px !important;
    min-height:364px !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberExplorerPanel .salonContinentShortcuts button{
    min-height:46px !important;
  }
}

/* Verrou final : les anciens volets salons doivent réellement occuper le centre. */
@media (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body.isEthnosHomeView.isTchatDrawerOpen .memberWelcome.memberWorkspace,
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberWelcome.memberWorkspace{
    display:block !important;
    position:relative !important;
    align-items:initial !important;
    justify-content:initial !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberWelcome.memberWorkspace > .salonDrawerStage{
    position:absolute !important;
    z-index:12 !important;
    inset:0 !important;
    width:auto !important;
    height:auto !important;
    margin:0 !important;
    padding:0 10px 0 0 !important;
    transform:none !important;
  }
  html[data-ethnos-ui="discord-r111"] body.isTchatDrawerOpen .memberWelcome.memberWorkspace > .salonDrawerStage > .salonDrawerStack{
    width:100% !important;
    height:100% !important;
    max-height:none !important;
  }
}
