/* --- VARIABLES GLOBALES --- */
:root {
  --apps: #cf52bc;
  --apps-rgb: 207, 82, 188;
  --auto: #3a96dd;
  --auto-rgb: 58, 150, 221;
  --dataverse: #14b258;
  --dataverse-rgb: 20, 178, 88;
  --bi: #ffa500;
  --sp: #29b4a7;
  --sp-rgb: 41, 180, 167;

  --bg-main: #f8fafc;
  --bg-secondary: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(0, 0, 0, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --card-hover: #f1f5f9;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-soft: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.2);
  --text-shadow-soft: rgba(0, 0, 0, 0.2);
  --white-panel-soft: rgba(255, 255, 255, 0.03);
  --white-glow-soft: rgba(255, 255, 255, 0.1);
  --status-error: #cf4444;
  --status-success: #14b258;
  --gradient-overlay:
    radial-gradient(circle at 15% 50%, rgba(160, 85, 245, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(60, 151, 232, 0.08), transparent 25%);

  --container-max: 1200px;
  --container-pad: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  background-image: var(--gradient-overlay);
  background-attachment: scroll;
  transition:
    background-color 0.3s,
    color 0.3s;
}

body.article-open {
  overflow: hidden;
}

/* Evite le flash de la home lors d'un acces direct a /article/... */
html.article-direct-load #main-view,
html.article-direct-load .nav-wrapper,
body.article-direct-load #main-view,
body.article-direct-load .nav-wrapper {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* --- NAVIGATION GLOBALE --- */
.nav-wrapper {
  position: fixed;
  top: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1000;
  will-change: transform;
  transform: translateZ(0);
}

nav {
  background: var(--nav-bg);
  backdrop-filter: none;
  padding: 8px 25px;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: 0 10px 30px var(--shadow);
  transition: 0.3s;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: 0.3s;
  position: relative;
}

nav a:hover,
nav a.active {
  color: var(--text-main);
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--apps);
  border-radius: 50%;
}

.cta-nav {
  background: var(--apps);
  color: var(--bg-main);
  padding: 8px 20px;
  border-radius: 30px;
  font-weight: 700;
}

nav a.cta-nav {
  color: var(--bg-main);
}

nav a:focus-visible {
  outline: 2px solid var(--apps);
  outline-offset: 4px;
  border-radius: 4px;
}

/* --- FOOTER GLOBAL --- */
.footer-content {
  text-align: center;
  padding: 40px 20px;
}

.footer-copyright {
  margin-bottom: 15px;
  color: var(--text-muted);
}

.footer-links {
  font-size: 0.85rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: 0.3s;
}

.footer-link:hover {
  color: var(--apps);
}

footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 80px;
}

footer p {
  margin-bottom: 15px;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: 0.3s;
}

footer a:hover {
  color: var(--apps);
}
