/* ============================================================
   EVOLIA INSTITUT — Header & Footer v2
   ============================================================ */

/* ── Top bar ── */
.site-topbar {
  background: var(--color-dark);
  color: rgba(255,255,255,.68);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-topbar .container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.site-topbar a { color: rgba(255,255,255,.68); transition: color .2s; }
.site-topbar a:hover { color: white; }
.site-topbar .topbar-pill {
  background: var(--gradient-orange);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
}

/* ── Navbar ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.97);
  box-shadow: none;
  transition: box-shadow .3s ease, background 300ms ease;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
}
.site-header::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--color-teal) 0%, #0ecfcb 40%, rgba(26,155,151,.15) 80%, transparent 100%);
}
.site-header--transparent {
  background: transparent !important;
  box-shadow: none !important;
}
.site-header--transparent .site-header::after { opacity: 0; }
.site-header--transparent .nav-links > li > a { color: rgba(255,255,255,.9); }
.site-header--transparent .nav-links > li > a:hover { background: rgba(255,255,255,.15); color: white; }
.site-header--transparent .nav-toggle span { background: white; }
.site-header.scrolled {
  background: rgba(255,255,255,.9);
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.navbar { padding: 0; }
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

/* ── Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--gradient-teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  position: relative;
  box-shadow: var(--shadow-teal);
  flex-shrink: 0;
}
.nav-logo-mark::before,
.nav-logo-mark::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 58%;
  background: rgba(255,255,255,.3);
  border-radius: 1px 1px 0 0;
}
.nav-logo-mark::before { left: 8px; }
.nav-logo-mark::after  { right: 8px; }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-dark);
  line-height: 1.1;
}
.nav-logo-sub {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-mid);
}

/* ── Nav links ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.nav-links > li { position: relative; }
.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-dark);
  border-radius: var(--radius-sm);
  transition: background .2s ease, color .2s ease;
  white-space: nowrap;
}
.nav-links > li > a:hover { background: var(--color-teal-light); color: var(--color-teal-dark); }
.nav-links > li > a .caret {
  font-size: 10px;
  opacity: .45;
  transition: transform .22s cubic-bezier(.25,.46,.45,.94), opacity .2s;
}
.nav-links > li:hover > a .caret { transform: rotate(180deg); opacity: .7; }

/* ── Dropdown ── */
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  min-width: 230px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s cubic-bezier(.25,.46,.45,.94), transform .22s cubic-bezier(.25,.46,.45,.94);
  z-index: 999;
  overflow: hidden;
  padding: 6px 0;
}
/* Triangle pointer */
.dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: white;
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
}
.nav-links > li:hover .dropdown,
.nav-links > li:focus-within .dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-dark);
  transition: background .18s ease, color .18s ease, padding-left .18s ease;
  position: relative;
}
.dropdown a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-teal);
  transform: scaleY(0);
  transition: transform .2s ease;
  border-radius: 0 2px 2px 0;
}
.dropdown a:hover {
  background: var(--color-teal-light);
  color: var(--color-teal-dark);
  padding-left: 24px;
}
.dropdown a:hover::before { transform: scaleY(1); }
.dropdown-divider { height: 1px; background: var(--color-border); margin: 6px 0; }
.dropdown-label {
  padding: 10px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-mid);
}

/* ── Nav actions ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Mobile toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: transform .28s cubic-bezier(.25,.46,.45,.94), opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero base ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
}
.hero-content {
  position: relative;
  z-index: 1;
  color: white;
}

/* ── Page hero (interior) ── */
.page-hero {
  background: var(--color-dark);
  color: white;
  padding: 80px 0 64px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,155,151,.22) 0%, transparent 65%);
}
.page-hero--teal {
  background: var(--gradient-teal);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.1);
}
.page-hero--orange { background: var(--gradient-orange); }
.page-hero .container { position: relative; z-index: 1; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  opacity: .6;
  margin-bottom: 16px;
}
.breadcrumb a { color: inherit; transition: opacity .2s; }
.breadcrumb a:hover { opacity: 1; }
.breadcrumb-sep { opacity: .5; }

/* ── Footer ── */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,.75);
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-teal);
  opacity: .4;
}
.footer-top {
  padding: 64px 0 52px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.footer-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gradient-teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-teal);
}
.footer-logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: white;
}
.footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  line-height: 1.7;
  margin-bottom: 20px;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: white;
  margin-bottom: 18px;
  padding-bottom: 12px;
  position: relative;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--gradient-orange);
  border-radius: 2px;
}
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  transition: color .2s ease, padding-left .2s ease;
  display: inline-block;
}
.footer-col ul li a:hover { color: white; padding-left: 4px; }
.footer-contact-item {
  font-size: 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(255,255,255,.55);
}
.footer-contact-item a { color: rgba(255,255,255,.55); transition: color .2s; }
.footer-contact-item a:hover { color: white; }
.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255,255,255,.3);
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Mobile floating CTA ── */
.mobile-cta-floating {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--color-border);
  z-index: 990;
  box-shadow: 0 -4px 16px rgba(0,0,0,.1);
  gap: 10px;
  align-items: center;
}
.mobile-cta-floating .btn {
  text-align: center;
  font-size: 11px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  padding: 12px 4px !important;
  white-space: nowrap;
}
.mobile-cta-floating .btn-secondary { flex: 0.7; }
.mobile-cta-floating .btn-primary { flex: 1.5; }

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--color-teal);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,155,151,.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease, background 200ms ease;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--color-teal-dark); transform: translateY(-2px); }

/* ── Focus states (accessibilité) ── */
:focus-visible {
  outline: 3px solid rgba(26,155,151,.6);
  outline-offset: 2px;
  border-radius: 2px;
}
.btn:focus-visible { outline: 3px solid rgba(26,155,151,.6); outline-offset: 3px; }

/* ── Cartes financement hauteur égale ── */
.grid-3 > .card { display: flex; flex-direction: column; }
.grid-3 > .card > p { flex: 1; }
.grid-3 > .card > a.btn { margin-top: auto; align-self: flex-start; }

/* ── Responsive mobile ── */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .dropdown { left: 0; transform: translateX(0) translateY(8px); }
  .dropdown::before { left: 24px; transform: translateX(0) rotate(45deg); }
  .nav-links > li:hover .dropdown,
  .nav-links > li:focus-within .dropdown {
    transform: translateX(0) translateY(0);
  }
}
@media (max-width: 768px) {
  .mobile-cta-floating { display: flex; }
  body { padding-bottom: 68px; }
  .back-to-top { bottom: 80px; }
  .nav-toggle { display: flex; }
  .nav-links, .nav-actions { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 228px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 24px 20px;
    overflow-y: auto;
    gap: 4px;
    z-index: 998;
    align-items: flex-start;
    justify-content: flex-start;
    box-shadow: var(--shadow-xl);
  }
  .nav-links.open + .nav-actions {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--color-border);
    z-index: 999;
  }
  .nav-links.open > li { width: 100%; }
  .nav-links.open > li > a {
    padding: 13px 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    font-size: 15px;
  }
  .dropdown {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none !important;
    box-shadow: none;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-teal-light);
    margin-top: 4px;
    display: none;
    padding: 4px 0;
  }
  .dropdown::before { display: none; }
  .nav-links.open > li.active .dropdown { display: block; }
  .dropdown a { padding: 10px 16px; font-size: 14px; }
  .dropdown a:hover { padding-left: 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .hero { padding: 72px 0; }
  .page-hero { padding: 56px 0 48px; }
}
