/* Site header — the one place its look is defined (navigation lot, 20 Oct. 2026, docs/design/navigation-2026-10-20.md).
   Loaded last (zz_) so the earlier layers never win; the header rules they used to carry were removed the same day.
   Structure: app/views/layouts/_site_header.html.erb. Behaviour: header_scroll, home_menu, site_menu controllers. */

:root {
  --header-height: 80px;
  --header-height-compact: 64px;
  --nav-fg: #14263f;
  --nav-fg-muted: #52617a;
  --nav-accent: var(--futello-blue-dark, #0f5fc5);
  --nav-accent-soft: var(--futello-blue-soft, #e8f1fd);
  --nav-hover-bg: rgb(26 115 232 / 8%);
  --nav-border: var(--futello-border, #d7deea);
  --nav-collapse: 1024px;
}

/* ---- Bandeau -------------------------------------------------------------------------------------------------- */

.site-header {
  --header-surface: var(--color-page-background, #f7f9fc);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid transparent;
  background: var(--header-surface);
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.fintech-home .site-header:not(.site-header--application) { --header-surface: var(--futello-navy, #0b1730); }

.site-header.is-scrolled {
  border-color: #dce4ef;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 10px 28px -20px rgb(11 23 48 / 45%);
}

.site-header--application {
  position: static;
  border-color: var(--nav-border);
  background: #fff;
}

.header-inner {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wordmark { display: inline-flex; min-height: 44px; align-items: center; line-height: 0; text-decoration: none; }
.wordmark::after { content: none; }

/* Keep the brand above the mobile backdrop, which lives inside the header's stacking context. */
.brand-lockup { position: relative; z-index: 1; }

.brand-wordmark--on-dark { display: none; }
.site-header--on-dark:not(.is-scrolled) .brand-wordmark:not(.brand-wordmark--on-dark) { display: none; }
.site-header--on-dark:not(.is-scrolled) .brand-wordmark--on-dark { display: inline-block; }
.site-header--on-dark:not(.is-scrolled) .brand-lockup__slogan { color: rgb(244 247 255 / 78%); }

.application-nav { display: flex; align-items: center; gap: 1rem; font-size: .875rem; }

.nav-icon { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }

/* ---- Navigation bureau ---------------------------------------------------------------------------------------- */

.main-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.main-nav > a:not(.button),
.main-nav__trigger {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .3rem;
  padding: 0 .7rem;
  border-radius: var(--radius-sm, .5rem);
  color: var(--nav-fg);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.main-nav__trigger { cursor: pointer; list-style: none; user-select: none; }
.main-nav__trigger::-webkit-details-marker { display: none; }

.main-nav > a:not(.button):hover,
.main-nav__trigger:hover,
.main-nav__group[open] > .main-nav__trigger { color: var(--nav-accent); background: var(--nav-hover-bg); }

/* Current section: the accent colour plus a short bar, so the location never rests on a hue alone. */
.main-nav > a.is-current:not(.button),
.main-nav__trigger.is-current { color: var(--nav-accent); }

.main-nav > a.is-current:not(.button)::after,
.main-nav__trigger.is-current::after {
  content: "";
  position: absolute;
  right: .7rem;
  bottom: 5px;
  left: .7rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.main-nav__caret { width: .9rem; height: .9rem; opacity: .8; transition: transform .15s ease; }
.main-nav__group[open] .main-nav__caret { transform: rotate(180deg); }
.main-nav__group { position: relative; }

.main-nav__actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: .6rem;
  padding-left: .9rem;
  border-left: 1px solid var(--nav-border);
}

.main-nav__card-guide {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 0 .5rem;
  border-radius: var(--radius-sm, .5rem);
  color: var(--nav-fg);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav__card-guide svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.main-nav__card-guide:hover,
.main-nav__card-guide.is-current { color: var(--nav-accent); background: var(--nav-hover-bg); }
@media (max-width: 1439px) {
  .main-nav__card-guide-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.language-switch {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .35rem;
  padding: 0 .6rem;
  border: 0;
  border-radius: var(--radius-sm, .5rem);
  color: var(--nav-fg-muted);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.language-switch:hover { color: var(--nav-fg); background: var(--nav-hover-bg); }
.language-switch .nav-icon { width: 1rem; height: 1rem; opacity: .8; }

/* The one button of the header: always the Futello blue, whatever the page's own palette. */
.site-header .button--nav,
.site-header .button--nav:hover {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 1.1rem;
  border: 1px solid var(--futello-blue, #1a73e8);
  border-radius: var(--radius-pill, 999px);
  background: var(--futello-blue, #1a73e8);
  box-shadow: 0 4px 12px rgb(26 115 232 / 28%);
  color: #fff;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.site-header .button--nav:hover {
  border-color: var(--futello-blue-dark, #0f5fc5);
  background: var(--futello-blue-dark, #0f5fc5);
  box-shadow: 0 6px 16px rgb(26 115 232 / 32%);
}

/* On the navy intro band of the home page, before any scroll. */
.site-header--on-dark:not(.is-scrolled) .main-nav > a:not(.button),
.site-header--on-dark:not(.is-scrolled) .main-nav__trigger,
.site-header--on-dark:not(.is-scrolled) .main-nav__card-guide { color: #fff; }
.site-header--on-dark:not(.is-scrolled) .main-nav > a:not(.button):hover,
.site-header--on-dark:not(.is-scrolled) .main-nav__trigger:hover,
.site-header--on-dark:not(.is-scrolled) .main-nav__group[open] > .main-nav__trigger,
.site-header--on-dark:not(.is-scrolled) .main-nav__card-guide:hover { color: #fff; background: rgb(255 255 255 / 12%); }
.site-header--on-dark:not(.is-scrolled) .main-nav > a.is-current:not(.button),
.site-header--on-dark:not(.is-scrolled) .main-nav__trigger.is-current { color: #fff; }
.site-header--on-dark:not(.is-scrolled) .main-nav > a.is-current:not(.button)::after,
.site-header--on-dark:not(.is-scrolled) .main-nav__trigger.is-current::after { background: #79adf2; }
.site-header--on-dark:not(.is-scrolled) .main-nav__actions { border-left-color: rgb(244 247 255 / 22%); }
.site-header--on-dark:not(.is-scrolled) .language-switch { color: rgb(244 247 255 / 82%); }
.site-header--on-dark:not(.is-scrolled) .language-switch:hover { color: #fff; background: rgb(255 255 255 / 12%); }

/* ---- Déroulants ----------------------------------------------------------------------------------------------- */

.main-nav__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: 19.5rem;
  padding: .5rem;
  border: 1px solid var(--nav-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 36 60 / 6%), 0 14px 36px -8px rgb(11 23 48 / 22%);
  color: var(--nav-fg);
  white-space: normal;
  animation: main-nav-dropdown .16s cubic-bezier(.2, .8, .3, 1);
}

@keyframes main-nav-dropdown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.main-nav__lead {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: .75rem;
  align-items: center;
  padding: .6rem .7rem;
  border-radius: 10px;
  background: var(--nav-accent-soft);
  color: var(--futello-navy, #0b1730);
  text-decoration: none;
  transition: background-color .15s ease;
}
.main-nav__lead:hover,
.main-nav__lead:focus-visible { background: #d9e8fb; }
.main-nav__lead.is-current { box-shadow: inset 0 0 0 1.5px var(--nav-accent); }
.main-nav__lead-icon {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--nav-accent);
}
.main-nav__lead-icon .nav-icon { width: 1.2rem; height: 1.2rem; }
.main-nav__lead-copy { display: grid; gap: .1rem; min-width: 0; }
.main-nav__lead-copy strong { font-size: .9rem; font-weight: 700; line-height: 1.25; }
.main-nav__lead-copy span { color: var(--nav-fg-muted); font-size: .76rem; line-height: 1.3; }

.main-nav__section { display: grid; gap: 1px; padding-top: .45rem; }
.main-nav__section + .main-nav__section { margin-top: .35rem; border-top: 1px solid var(--nav-border); }
.main-nav__section-title {
  margin: 0;
  padding: .35rem .7rem .15rem;
  color: var(--nav-fg-muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.main-nav__section > a {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 0 .7rem;
  border-radius: var(--radius-sm, .5rem);
  color: var(--nav-fg);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.main-nav__section > a:hover,
.main-nav__section > a:focus-visible { background: #f2f5fa; color: var(--futello-navy, #0b1730); }
.main-nav__section > a.is-current { background: var(--nav-accent-soft); color: var(--nav-accent); font-weight: 700; }

/* ---- Menu mobile et tablette ---------------------------------------------------------------------------------- */

.mobile-menu { display: none; align-items: center; gap: .6rem; }

.mobile-menu__toggle {
  position: relative;
  z-index: 2;
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  background: transparent;
  color: var(--nav-fg);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.mobile-menu__toggle:hover { background: var(--nav-hover-bg); }
.mobile-menu__bars { display: grid; width: 18px; gap: 4px; }
.mobile-menu__bars i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, opacity .15s ease;
  transform-origin: center;
}
.mobile-menu.is-open .mobile-menu__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-menu.is-open .mobile-menu__bars i:nth-child(2) { opacity: 0; }
.mobile-menu.is-open .mobile-menu__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-header--on-dark:not(.is-scrolled) .mobile-menu__toggle { border-color: rgb(244 247 255 / 35%); color: #fff; }
.site-header--on-dark:not(.is-scrolled) .mobile-menu__toggle:hover { background: rgb(255 255 255 / 12%); }

.mobile-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgb(11 23 48 / 45%);
  animation: mobile-menu-fade .2s ease;
}
.mobile-menu__backdrop[hidden] { display: none; }

.mobile-menu__panel {
  position: fixed;
  top: var(--site-menu-top, var(--header-height-compact));
  right: 0;
  left: 0;
  z-index: 1;
  display: grid;
  gap: 1.1rem;
  align-content: start;
  max-height: calc(100dvh - var(--site-menu-top, var(--header-height-compact)));
  padding: 1rem 1.25rem 1.5rem;
  overflow-y: auto;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 24px 48px -24px rgb(11 23 48 / 45%);
  overscroll-behavior: contain;
  border-top: 1px solid var(--nav-border);
  background: #fff;
  color: var(--nav-fg);
  animation: mobile-menu-slide .22s cubic-bezier(.2, .8, .3, 1);
}
.mobile-menu__panel[hidden] { display: none; }

@keyframes mobile-menu-fade { from { opacity: 0; } }
@keyframes mobile-menu-slide { from { opacity: 0; transform: translateY(-8px); } }

html.site-menu-open { overflow: hidden; }

.mobile-menu__group { display: grid; gap: .5rem; }
/* Specific enough to beat the page-level heading sizes (.fintech-home h2, .fintech-site h2). */
.site-header .mobile-menu__title {
  margin: 0;
  padding: 0 .25rem;
  color: var(--nav-fg-muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mobile-menu .mobile-menu__lead,
.mobile-menu .mobile-menu__lead:hover {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
  padding: 0 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
  white-space: nowrap;
}
.mobile-menu .mobile-menu__lead.button--primary,
.mobile-menu .mobile-menu__lead.button--primary:hover { border-color: var(--futello-blue, #1a73e8); background: var(--futello-blue, #1a73e8); color: #fff; }
.mobile-menu .mobile-menu__lead.button--secondary,
.mobile-menu .mobile-menu__lead.button--secondary:hover { border: 1px solid var(--nav-border); background: #fff; color: var(--futello-navy, #0b1730); }
.mobile-menu__lead .nav-icon { width: 1.2rem; height: 1.2rem; }

.mobile-menu__links { display: grid; gap: 1px; }
.mobile-menu__links + .mobile-menu__links { margin-top: .25rem; padding-top: .25rem; border-top: 1px solid var(--nav-border); }
.mobile-menu__links a {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 0 .75rem;
  border-radius: 10px;
  color: var(--nav-fg);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.mobile-menu__links a:hover { background: #f2f5fa; }
.mobile-menu__links a[aria-current="page"] { background: var(--nav-accent-soft); color: var(--nav-accent); font-weight: 700; }
.mobile-menu__links--plain { padding-top: .25rem; border-top: 1px solid var(--nav-border); }
.mobile-menu__links--plain a { font-weight: 700; }
.mobile-menu__footer { display: flex; align-items: center; justify-content: space-between; padding-top: .5rem; border-top: 1px solid var(--nav-border); }
.mobile-menu__footer .language-switch { color: var(--nav-fg); font-size: 1rem; }

/* ---- Points de rupture ---------------------------------------------------------------------------------------- */

@media (max-width: 1023.98px) {
  .main-nav { display: none; }
  .mobile-menu { display: flex; }
}

@media (max-width: 767.98px) {
  .header-inner { min-height: var(--header-height-compact); gap: .75rem; }
  .brand-wordmark { width: 7.25rem; }
  .fintech-home .header-inner { min-height: 72px; }
  .mobile-menu__panel { padding-inline: 1rem; }
}

/* Below 480 px the button no longer fits beside the toggle: the panel's lead row carries the same action. */
@media (max-width: 479.98px) {
  .mobile-menu .mobile-menu__cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .main-nav__dropdown, .mobile-menu__panel, .mobile-menu__backdrop, .mobile-menu__bars i, .main-nav__caret { transition: none; animation: none; }
}

@media print {
  .site-header { display: none !important; }
}

/* ---- Focus ---------------------------------------------------------------------------------------------------- */

.site-header :is(a, summary, button):focus-visible {
  outline: 3px solid var(--futello-blue, #1a73e8);
  outline-offset: 2px;
}
.site-header--on-dark:not(.is-scrolled) :is(a, summary, button):focus-visible { outline-color: #fff; }

/* ---- Barre d'onglets des pages Cartes ------------------------------------------------------------------------ */
/* Same order and labels as the Cartes dropdown; rows at the 44 px floor like the rest of the navigation. */
.top-picks-section-navigation__link { min-height: 44px; }
