/* ============================================================================
   Idealys — SITE
   Header corporate, navigation, footer corporate, side-nav landing
   ============================================================================ */

/* ============================================================================
   HEADER FIXE
   ============================================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast), border-color var(--t-fast);
}

[data-theme="dark"] .site-header {
  background: rgba(13, 17, 23, 0.85);
}

@media (max-width: 768px) {
  .site-header { padding: 12px 16px; }
}

.site-header-logo {
  display: flex;
  align-items: center;
}

.site-header-logo img,
.site-header-logo svg,
.site-footer-logo img,
.site-footer-logo svg {
  height: 56px;
  width: auto;
}

.site-footer-logo img,
.site-footer-logo svg { height: 48px; }

@media (max-width: 768px) {
  .site-header-logo img,
  .site-header-logo svg { height: 44px; }
}

/* Swap logo selon thème — spécificité boostée pour battre les rules img/svg */
.site-header-logo .logo-on-light,
.site-footer-logo .logo-on-light { display: block; }
.site-header-logo .logo-on-dark,
.site-footer-logo .logo-on-dark { display: none; }
[data-theme="dark"] .site-header-logo .logo-on-light,
[data-theme="dark"] .site-footer-logo .logo-on-light { display: none; }
[data-theme="dark"] .site-header-logo .logo-on-dark,
[data-theme="dark"] .site-footer-logo .logo-on-dark { display: block; }

/* ============================================================================
   THEME TOGGLE (bouton clair/sombre dans le header)
   ============================================================================ */
/* === CTA secondaire header "Nous contacter" (ghost) === */
.site-header-contact {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  background: transparent;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  transition: all var(--t-fast);
  letter-spacing: -0.005em;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 10px;
}

.site-header-contact:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Deux boutons ghost adjacents (Diagnostic + Nous contacter) : seul le 1er
   garde margin-left:auto pour pousser le groupe a droite ; le 2e se colle. */
.site-header-contact + .site-header-contact { margin-left: 0; }

@media (max-width: 1024px) {
  .site-header-contact { display: none; }
}

/* === Nav principale === */
.site-nav {
  position: absolute;
  left: max(32px, calc((100vw - 1200px) / 2 + 32px));
  display: flex;
  align-items: center;
  gap: 32px;
}

@media (max-width: 1024px) {
  .site-nav { display: none; }
}

.site-nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  padding: 8px 4px;
  transition: color var(--t-fast);
  text-decoration: none;
}

.site-nav-link:hover,
.site-nav-link.active {
  color: var(--green);
}

/* Sous-menu (À propos, Pour qui...) */
.site-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.site-nav-submenu {
  position: absolute;
  top: 100%;
  left: -16px;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px;
  margin-top: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--t-fast);
}

.site-nav-item:hover .site-nav-submenu,
.site-nav-item:focus-within .site-nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav-submenu a {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-1);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}

.site-nav-submenu a:hover {
  background: var(--green-light);
  color: var(--green-dark);
}

[data-theme="dark"] .site-nav-submenu a:hover {
  background: rgba(0, 204, 102, 0.1);
  color: var(--green);
}

/* === CTA header === */
.site-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--green);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-full);
  transition: all var(--t-med);
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.site-header-cta:hover {
  background: var(--white);
  transform: translateY(-1px);
  color: var(--green-dark);
}

[data-theme="dark"] .site-header-cta:hover { background: #fff; }

@media (max-width: 768px) {
  .site-header-cta {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* === Burger mobile === */
.site-header-burger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-1);
}

@media (max-width: 1024px) {
  .site-header-burger { display: inline-flex; }
}

.site-mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: calc(var(--z-header) + 10);
  display: none;
  flex-direction: column;
  padding: 80px 32px 32px;
  overflow-y: auto;
}

.site-mobile-nav.open { display: flex; }

.site-mobile-nav a {
  display: block;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-1);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

/* ============================================================================
   FOOTER CORPORATE
   ============================================================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  position: relative;
  z-index: var(--z-content);
}

[data-theme="dark"] .site-footer {
  background: var(--c8);
}

/* Footer container override : permet 6 colonnes lisibles au-dessus de 1440px.
   Spécificité boostée via "body" pour battre .page-corporate .container et
   .page-operat-ready .container (qui limitent à 880px). */
body .site-footer .container {
  max-width: 1500px !important;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 1440px) {
  .site-footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

@media (max-width: 1024px) {
  .site-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 600px) {
  .site-footer-grid { grid-template-columns: 1fr; }
}

.site-footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-footer-logo svg {
  height: 32px;
  width: auto;
}

.site-footer-tagline {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  max-width: 320px;
  letter-spacing: 0.01em;
}

.site-footer-col-title {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 16px;
  white-space: nowrap;
}

.site-footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer-col a {
  font-size: 13.5px;
  color: var(--text-2);
  transition: color var(--t-fast);
}

.site-footer-col a:hover { color: var(--green); }

/* Bas du footer (légal + réseaux) */
.site-footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer-copy {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.site-footer-version {
  margin-left: 8px;
  color: inherit;
  font-feature-settings: "tnum";
}
.site-footer-version::before { content: "· "; }

.site-footer-legal-links {
  display: flex;
  gap: 20px;
  font-size: 12px;
}

.site-footer-legal-links a { color: var(--text-3); }
.site-footer-legal-links a:hover { color: var(--green); }

.site-footer-social {
  display: flex;
  gap: 12px;
}

.site-footer-social a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-s);
  border-radius: 50%;
  color: var(--text-2);
  transition: all var(--t-fast);
}

.site-footer-social a:hover {
  color: var(--green);
  border-color: var(--green);
  transform: translateY(-2px);
}

.site-footer-social svg { width: 16px; height: 16px; }

/* Badges apps mobiles (App Store + Google Play) */
.site-footer-apps {
  display: flex;
  gap: 10px;
  align-items: center;
}

.site-footer-apps a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 135px;
  height: 40px;
  overflow: hidden;
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.site-footer-apps a:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.site-footer-apps img {
  display: block;
}

/* Apple : SVG officiel sans padding interne — remplit la boîte. */
.site-footer-apps a[href*="apple.com"] img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Google : le PNG officiel embarque un "clear space" natif large.
   On le sur-dimensionne et on clip via overflow:hidden du parent pour que
   le contenu utile (logo + texte) ait la même empreinte visuelle qu'Apple. */
.site-footer-apps a[href*="play.google"] img {
  width: 175px;
  height: auto;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .site-footer-bottom { flex-direction: column; align-items: flex-start; }
  .site-footer-apps { flex-wrap: wrap; }
}

/* ============================================================================
   SIDE-NAV (vertical right, intra-page, optionnel pour pages landing-style)
   ============================================================================ */
.side-nav {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  z-index: var(--z-side-nav);
  display: flex;
  flex-direction: column;
  gap: 11px;
  pointer-events: none;
  max-height: calc(100vh - 40px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Quand le footer entre dans le viewport, on masque la side-nav pour éviter
   la superposition (classe ajoutée par site.js via IntersectionObserver). */
body.footer-in-view .side-nav {
  opacity: 0;
  visibility: hidden;
}

.side-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-decoration: none;
  pointer-events: auto;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-3);
  transition: color var(--t-fast);
  text-transform: uppercase;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--green);
}

.side-nav .nav-label { white-space: nowrap; }

.side-nav .nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-4);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.side-nav a:hover .nav-dot,
.side-nav a.active .nav-dot {
  background: var(--green);
  box-shadow: 0 0 12px rgba(0, 204, 102, 0.6);
  transform: scale(1.2);
}

@media (max-height: 800px) {
  .side-nav { gap: 9px; right: 18px; }
  .side-nav a { font-size: 10px; gap: 8px; }
  .side-nav .nav-dot { width: 7px; height: 7px; }
}

@media (max-width: 1024px) {
  .side-nav { display: none; }
}
