/* DELTA-SIERRA MARS V6.50 — LIVE VISUAL RECOVERY CONTRACT
   Purpose: force the wide-desktop header back into the same centered shell as the Mars portal
   and guarantee readable hero typography even when legacy CSS or cached contracts are present. */
:root{
  --ds-v650-shell-max:1480px;
  --ds-v650-shell-gutter:32px;
  --ds-v650-hero-title:#ffffff;
  --ds-v650-hero-copy:#f5f8fc;
  --ds-v650-hero-link:#9fd8ff;
}

/* Critical contrast recovery. Reset both color and WebKit fill because older visual contracts
   can independently control text fill. */
html#ds-mars-root body.mars-site .mars-hero :is(h1,.mars-hero__title),
html#ds-mars-root body.mars-page .mars-hero :is(h1,.mars-hero__title){
  color:var(--ds-v650-hero-title)!important;
  -webkit-text-fill-color:var(--ds-v650-hero-title)!important;
  background:none!important;
  -webkit-background-clip:border-box!important;
  background-clip:border-box!important;
  opacity:1!important;
  filter:none!important;
  mix-blend-mode:normal!important;
  text-shadow:0 3px 18px rgba(0,0,0,.88),0 1px 3px rgba(0,0,0,.96)!important;
}
html#ds-mars-root body .mars-hero :is(.mars-lead,.mars-hero__lead,.mars-hero__intro,p){
  color:var(--ds-v650-hero-copy)!important;
  -webkit-text-fill-color:var(--ds-v650-hero-copy)!important;
}
html#ds-mars-root body .mars-hero :is(.mars-lead,.mars-hero__lead,.mars-hero__intro,p) a{
  color:var(--ds-v650-hero-link)!important;
  -webkit-text-fill-color:var(--ds-v650-hero-link)!important;
  text-decoration-color:currentColor!important;
  text-decoration-thickness:.09em!important;
  text-underline-offset:.16em!important;
}

/* Wide desktop: one centered shell. Nothing important is positioned against viewport edges. */
@media (min-width:1440px){
  html#ds-mars-root body .mars-header__inner.site-header__actions{
    box-sizing:border-box!important;
    width:min(var(--ds-v650-shell-max),calc(100% - (2 * var(--ds-v650-shell-gutter))))!important;
    max-width:var(--ds-v650-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding:.72rem 0!important;
    display:grid!important;
    grid-template-columns:minmax(205px,230px) minmax(0,1fr) auto auto!important;
    grid-template-areas:"brand nav language support"!important;
    align-items:center!important;
    gap:.55rem 1rem!important;
  }
  html#ds-mars-root body .mars-header__inner.site-header__actions>.ds-mars-home-brand{
    grid-area:brand!important;justify-self:start!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important;
  }
  html#ds-mars-root body .mars-header__inner.site-header__actions>.site-nav{
    grid-area:nav!important;justify-self:stretch!important;width:100%!important;max-width:none!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important;min-width:0!important;
  }
  html#ds-mars-root body .mars-header__inner.site-header__actions>.site-language-switcher{
    grid-area:language!important;justify-self:end!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important;
  }
  html#ds-mars-root body .mars-header__inner.site-header__actions>.btn-soutien{
    grid-area:support!important;justify-self:end!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important;white-space:nowrap!important;
  }
  html#ds-mars-root body .mars-header__inner.site-header__actions .site-nav__inner{
    width:100%!important;display:flex!important;align-items:center!important;justify-content:center!important;flex-wrap:wrap!important;gap:.28rem .42rem!important;margin:0!important;
  }
}

/* Medium desktop: keep the same centered shell, but let navigation use a clean second row. */
@media (min-width:1180px) and (max-width:1439px){
  html#ds-mars-root body .mars-header__inner.site-header__actions{
    box-sizing:border-box!important;
    width:calc(100% - 40px)!important;
    max-width:1180px!important;
    margin-left:auto!important;margin-right:auto!important;
    padding:.65rem 0!important;
    display:grid!important;
    grid-template-columns:minmax(205px,1fr) auto auto!important;
    grid-template-areas:"brand language support" "nav nav nav"!important;
    align-items:center!important;gap:.55rem .9rem!important;
  }
  html#ds-mars-root body .mars-header__inner.site-header__actions>.ds-mars-home-brand{grid-area:brand!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important}
  html#ds-mars-root body .mars-header__inner.site-header__actions>.site-language-switcher{grid-area:language!important;justify-self:end!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important}
  html#ds-mars-root body .mars-header__inner.site-header__actions>.btn-soutien{grid-area:support!important;justify-self:end!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important}
  html#ds-mars-root body .mars-header__inner.site-header__actions>.site-nav{grid-area:nav!important;width:100%!important;max-width:none!important;margin:0!important;position:relative!important;inset:auto!important;transform:none!important}
  html#ds-mars-root body .mars-header__inner.site-header__actions .site-nav__inner{justify-content:flex-start!important;flex-wrap:wrap!important}
}

/* Small desktop/tablet: avoid any reintroduction of edge-anchored positioning. */
@media (max-width:1179px){
  html#ds-mars-root body .mars-header__inner :is(.ds-mars-home-brand,.site-nav,.site-language-switcher,.btn-soutien){position:relative!important;inset:auto!important;transform:none!important}
}
