/* Header + footer normalisation for the 2017 bundle.
   Every page now renders the same header partial; `header.css` carries the modern
   header rules extracted from site.css, and this file fixes what legacy.css does
   differently underneath it. Page content is untouched. */

/* Bootstrap 3 gives .row a ::before/::after clearfix pair. Inside a flex container
   those become two extra flex items, so space-between spaces four items instead of
   two - which is why the header and footer blocks sat oddly inset. */
#masthead .row::before, #masthead .row::after,
#mastfoot .row::before, #mastfoot .row::after {
  content: none;
  display: none;
}

/* ---- header ------------------------------------------------------------- */
/* legacy.css carries `#masthead.site-header{position:fixed!important}` and
   `body.page2 .site-header{background-color:#8b5cf6!important;position:fixed!important}`,
   written for the header this bundle used to ship. !important can only be answered
   with !important, so the shared header restates its own layout here - including the
   sticky behaviour, which sticky.css cannot win against on these three pages. */
#masthead.site-header,
body.page2 #masthead.site-header {
  position: sticky !important;
  top: 0 !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  z-index: 1030 !important;
  padding: 0 !important;
  background-color: #fff !important;
  border-bottom: 1px solid #979797;
}
/* The shared header markup uses Bootstrap 4 utilities (.d-flex, .justify-content-*,
   .align-items-*) that simply do not exist in the 2017 bundle, so the bar collapsed
   to the left. These rules restate what those utilities would have done. */
#masthead .container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 15px;
}
#masthead .row.d-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#masthead .ct-logo { display: flex; align-items: center; }
#masthead .ct-menu { display: flex; align-items: center; justify-content: flex-end; }
#masthead .ct-menu .recherche { margin-left: 82.5px; }
/* BS3 rows carry -15px gutters that the modern markup neutralises with .mx-0,
   a utility this bundle does not have. */
#masthead .row { margin-left: 0; margin-right: 0; }
#masthead .site-logo { width: 150px; height: 40px; }

/* legacy.css floats #mainnav and its items, and paints the links white at 14px. */
#masthead #mainnav { float: none; display: block; flex: 0 0 auto; }
#masthead #mainnav > ul { display: flex; align-items: center; margin: 0; padding: 0; }
/* legacy.css floats the items and pads them 0 14px; restate the modern spacing at a
   specificity that beats it. The values are in px, not rem: the root font-size is
   15px on the modern pages and 10px here, so header.css's rem values resolve short. */
#masthead #mainnav > ul > li { float: none; padding: 0 34.5px; }
#masthead #mainnav > ul > li:first-child { padding-left: 0; }
#masthead #mainnav > ul > li:last-child { padding-right: 0; }
/* legacy.css renders nav links as 40px-padded blocks; the modern header keeps them
   inline so the flex row can centre them. */
#masthead #mainnav ul li a {
  display: inline;
  padding: 0;
  color: #000;
  font-family: myriadsetprosemibold, sans-serif;
  font-size: 15px;
  font-weight: normal;
}
#masthead #mainnav ul li a:hover { color: #007aff; }
#masthead .ct-menu .recherche .img-fluid { width: 18px; }

/* ---- footer ------------------------------------------------------------- */
/* the modern footer is 12.15px/thin on black; legacy renders 20px, so the same
   markup came out nearly twice as tall */
#mastfoot.site-footer {
  background: #000;
  color: #fff;
  padding: 0;
  font-size: 12.15px;
  line-height: 1.5;
}
#mastfoot .widget { font-size: 12.15px; line-height: 1.5; }
#mastfoot .container-fluid {
  /* header.css already gives #mastfoot .row a 70px height, same as the modern
     pages; only the horizontal inset needs restating. */
  padding: 0 64px 0 38px;
  position: relative;
  max-width: none;
  margin: 0;
}
#mastfoot .container-fluid > .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  margin: 0;
  width: 100%;
}
#mastfoot .widget {
  margin: 0; padding: 0; float: none;
  width: auto; max-width: none; flex: 0 1 auto;   /* legacy.css pins .widget to a column width */
}
#mastfoot #sidebar-2 { display: flex; align-items: center; gap: 14px; }
/* legacy.css paints #sidebar-2 links as blocks with their own background,
   which showed as a grey chip on the black bar */
#mastfoot a { color: #fff; text-decoration: none; display: inline; background: none; }
#mastfoot a:hover { text-decoration: underline; }
#mastfoot .tg-fb, #mastfoot .tg-linkedin { font-size: 18px; line-height: 1; }
#mastfoot .go-top { position: absolute; right: 20px; bottom: 100%; margin-bottom: 12px; }

/* /smart/ is shorter than the viewport, which left a band of page background under
   the footer. A column flex wrapper pushes the footer down only when there is room. */
.page2 #page, .page2 .site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page2 #page > * { flex: 0 0 auto; }   /* nothing may be squashed to make room */
.page2 #mastfoot { margin-top: auto; }

@media (max-width: 700px) {
  #mastfoot .container-fluid { flex-direction: column; text-align: center; }
}
