/* =====================================================================
   COMMON.CSS - Styles partagés par toutes les pages
   Site institutionnel - Louis Watum Kabamba, Ministre des Mines (RDC)
   Direction artistique : institutionnel premium, glassmorphism clair,
   palette drapeau RDC (bleu dominant, or accent, rouge micro-détails).
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* 1. VARIABLES                                                        */
/* ------------------------------------------------------------------ */
:root {
  /* Bleus */
  --blue-950: #031C33;
  --blue-900: #00294D;
  --blue-800: #003D7A;
  --blue-700: #0057A8; /* primaire */
  --blue-600: #006BBF;
  --blue-500: #0085CA; /* drapeau */
  --blue-100: #D6EAF8;
  --blue-50:  #EBF5FC;

  /* Ors */
  --gold-700: #B8860B;
  --gold-600: #D4A017; /* accent principal */
  --gold-500: #F5C400;
  --gold-400: #FFD100; /* drapeau */
  --gold-100: #FDF3D0;

  /* Rouges */
  --red-700: #B3121F;
  --red-600: #CE1126; /* accent institutionnel */
  --red-500: #EF3340; /* drapeau */
  --red-50:  #FDEBEC;

  /* Neutres */
  --ink: #0B1220;
  --slate-600: #475569;
  --slate-400: #94A3B8;
  --mist: #F4F7FB;
  --white: #FFFFFF;

  /* Glassmorphism clair */
  --glass-bg: rgba(255, 255, 255, 0.68);
  --glass-border: rgba(0, 87, 168, 0.14);
  --glass-shadow: 0 8px 32px rgba(0, 41, 77, 0.10);
  --glass-blur: blur(14px);

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #00294D 0%, #0057A8 55%, #0085CA 100%);
  --grad-gold: linear-gradient(90deg, #D4A017 0%, #FFD100 100%);
  --grad-flag: linear-gradient(90deg,
      #0085CA 0%, #0085CA 33.33%,
      #FFD100 33.33%, #FFD100 66.66%,
      #CE1126 66.66%, #CE1126 100%);
  --hero-overlay: linear-gradient(115deg, rgba(3,28,51,0.94) 0%, rgba(0,41,77,0.82) 48%, rgba(0,87,168,0.55) 100%);

  /* Rythme */
  --radius: 1.25rem;
  --shadow-card: 0 20px 45px -25px rgba(0, 41, 77, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------------ */
/* 2. BASE                                                            */
/* ------------------------------------------------------------------ */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background-color: var(--mist);
  color: var(--ink);
  overflow-x: hidden;
}

/* Fond atmosphérique subtil (voile bleu + halo or) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% -5%, rgba(0, 87, 168, 0.07), transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(212, 160, 23, 0.06), transparent 40%);
  pointer-events: none;
}

h1, h2, h3, h4, .font-display { font-family: 'Cormorant Garamond', serif; letter-spacing: -0.01em; }

::selection { background: var(--gold-400); color: var(--blue-950); }

/* Focus visible accessible */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; display: block; }

/* ------------------------------------------------------------------ */
/* 3. GLASSMORPHISME                                                  */
/* ------------------------------------------------------------------ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}

/* ------------------------------------------------------------------ */
/* 4. NAVBAR                                                          */
/* ------------------------------------------------------------------ */
#navbar { transition: padding .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease); }
.nav-glass {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0, 87, 168, 0.10);
  box-shadow: 0 8px 30px rgba(0, 31, 63, 0.07);
}
.nav-monogram {
  background: var(--grad-hero);
  box-shadow: 0 6px 18px -6px rgba(0, 41, 77, 0.6);
}
.nav-link { position: relative; transition: color .3s var(--ease); }
.nav-link::after {
  content: '';
  position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 2px; border-radius: 2px;
  background: var(--gold-500);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--blue-700); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* Transitions de couleur (bascule sommet <-> défilé) */
#navbar .flex.flex-col > span,
#mobile-menu-btn { transition: color .3s var(--ease); }

/* --- État TRANSPARENT : navbar au sommet, par-dessus un hero sombre ---
   Le texte passe en clair pour un contraste lisible ; une fois .nav-glass
   activé au scroll (fond blanc), on retrouve le texte foncé par défaut. */
#navbar:not(.nav-glass) .flex.flex-col > span:first-child { color: #fff; }
#navbar:not(.nav-glass) .flex.flex-col > span:last-child { color: rgba(255, 255, 255, 0.72); }
#navbar:not(.nav-glass) .nav-link { color: rgba(255, 255, 255, 0.88); }
#navbar:not(.nav-glass) .nav-link:hover,
#navbar:not(.nav-glass) .nav-link.active { color: #fff; }
#navbar:not(.nav-glass) #mobile-menu-btn { color: #fff; }

/* Menu mobile ouvert : la navbar surplombe le panneau clair -> logo foncé */
#navbar.menu-open .flex.flex-col > span:first-child { color: var(--blue-900); }
#navbar.menu-open .flex.flex-col > span:last-child { color: var(--slate-400); }

/* Menu mobile */
#mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.6rem; padding: 2rem;
  background: rgba(244, 247, 251, 0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s var(--ease);
}
#mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-link {
  opacity: 0; transform: translateY(12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
#mobile-menu.open .mobile-link { opacity: 1; transform: translateY(0); }
#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: .05s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: .10s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: .15s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: .20s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: .25s; }
#mobile-menu.open .mobile-link:nth-child(6) { transition-delay: .30s; }

/* ------------------------------------------------------------------ */
/* 5. BOUTONS                                                         */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 600; line-height: 1; cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
  border: none; text-decoration: none;
}
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:hover { background: var(--blue-800); transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(0, 61, 122, .55); }
.btn-gold { background: var(--grad-gold); color: var(--blue-950); font-weight: 700; box-shadow: 0 10px 24px -12px rgba(212, 160, 23, .6); }
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -12px rgba(212, 160, 23, .75); }
.btn-outline { border: 1.5px solid rgba(255, 255, 255, .55); color: #fff; background: rgba(255, 255, 255, .04); }
.btn-outline:hover { background: rgba(255, 255, 255, .14); border-color: #fff; transform: translateY(-3px); }
.btn-ghost { color: var(--blue-900); }
.btn-ghost:hover { color: var(--gold-700); }

/* ------------------------------------------------------------------ */
/* 6. TITRES & DÉCORATEURS                                            */
/* ------------------------------------------------------------------ */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase;
}
.title-underline { position: relative; padding-bottom: .85rem; }
.title-underline::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 74px; height: 3px; border-radius: 2px;
  background: var(--grad-gold);
}
.title-underline.center::after { left: 50%; transform: translateX(-50%); }
.flag-strip { height: 4px; width: 100%; background: var(--grad-flag); }

/* Filet drapeau vertical (accent de bloc) */
.flag-rule { width: 4px; border-radius: 4px; background: var(--grad-flag); }

/* ------------------------------------------------------------------ */
/* 7. HERO INTERNE (pages secondaires)                               */
/* ------------------------------------------------------------------ */
.hero-inner {
  position: relative;
  display: flex; align-items: flex-end;
  min-height: 60vh;
  overflow: hidden;
  background: var(--grad-hero);
}
.hero-inner__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%;
  z-index: 0;
}
.hero-inner__overlay { position: absolute; inset: 0; z-index: 1; background: var(--hero-overlay); }
.hero-inner__grid {
  position: absolute; inset: 0; z-index: 1; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to top, transparent, black 60%);
  -webkit-mask-image: linear-gradient(to top, transparent, black 60%);
}
.hero-inner__content { position: relative; z-index: 2; }
.breadcrumb {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--gold-400); font-size: .78rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* 8. CARTE STAT / COMPTEUR                                           */
/* ------------------------------------------------------------------ */
.stat-icon {
  width: 3rem; height: 3rem; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-100); color: var(--gold-700);
}
.counter-value { font-weight: 800; color: var(--gold-600); font-family: 'Cormorant Garamond', serif; }

/* ------------------------------------------------------------------ */
/* 9. TIMELINE (puces)                                               */
/* ------------------------------------------------------------------ */
.tl-dot {
  width: 15px; height: 15px; border-radius: 9999px;
  border: 3px solid #fff; box-shadow: 0 0 0 3px var(--blue-100);
  flex-shrink: 0;
}
.tl-dot.blue { background: var(--blue-700); }
.tl-dot.gold { background: var(--gold-500); box-shadow: 0 0 0 3px var(--gold-100); }
.tl-dot.red  { background: var(--red-600); box-shadow: 0 0 0 3px var(--red-50); }

/* ------------------------------------------------------------------ */
/* 10. BLOC CITATION                                                 */
/* ------------------------------------------------------------------ */
.quote-block {
  position: relative;
  border-left: 4px solid var(--gold-500);
}
.quote-block .quote-mark { color: var(--gold-500); opacity: .55; }

/* ------------------------------------------------------------------ */
/* 11. BADGE VALEUR                                                  */
/* ------------------------------------------------------------------ */
.value-badge {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.25rem; border-radius: 9999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.value-badge:hover { border-color: var(--gold-500); transform: translateY(-3px); }
.value-badge i { color: var(--gold-600); }

/* ------------------------------------------------------------------ */
/* 12. BANDE CTA                                                     */
/* ------------------------------------------------------------------ */
.cta-band { position: relative; overflow: hidden; background: var(--grad-hero); }
.cta-band__img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center 28%;
  opacity: .26; filter: grayscale(.15);
}
.cta-band__overlay {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(120deg, rgba(3,28,51,.93) 0%, rgba(0,41,77,.78) 55%, rgba(0,87,168,.55) 100%);
}
.cta-band::before {
  content: ''; position: absolute; inset: 0; z-index: 1; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ------------------------------------------------------------------ */
/* 13. CADRE PHOTO PREMIUM                                           */
/* ------------------------------------------------------------------ */
.photo-frame { position: relative; }
.photo-frame__img {
  position: relative; z-index: 2;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.photo-frame__accent {
  position: absolute; z-index: 1;
  inset: 18px -18px -18px 18px;
  border-radius: var(--radius);
  background: var(--grad-gold);
  opacity: .35;
}

/* ------------------------------------------------------------------ */
/* 14. FOOTER                                                        */
/* ------------------------------------------------------------------ */
.site-footer { background: var(--blue-950); color: var(--blue-100); }
.footer-link { transition: color .25s var(--ease), padding-left .25s var(--ease); }
.footer-link:hover { color: var(--gold-400); }
.footer-monogram { background: var(--grad-gold); color: var(--blue-950); }

/* ------------------------------------------------------------------ */
/* 15. BACK TO TOP                                                   */
/* ------------------------------------------------------------------ */
#back-to-top {
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
#back-to-top.hidden-btt { opacity: 0; transform: translateY(20px); pointer-events: none; }
#back-to-top:hover { background: var(--blue-700); color: #fff; }

/* ------------------------------------------------------------------ */
/* 16. REVEAL ON SCROLL (vanilla, sans dépendance)                   */
/*     Progressive enhancement : masqué uniquement si JS actif       */
/*     (html.js). Sans JS, tout le contenu reste visible.            */
/* ------------------------------------------------------------------ */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
html.js [data-reveal="left"]  { transform: translateX(-32px); }
html.js [data-reveal="right"] { transform: translateX(32px); }
html.js [data-reveal="zoom"]  { transform: scale(.94); }
html.js [data-reveal].revealed { opacity: 1; transform: none; }

/* Cascade hero (accueil) - animation CSS pure, jouée au chargement.
   Indépendante du JS pour garantir l'affichage du hero. */
html.js .hero-anim { opacity: 0; transform: translateY(30px); animation: heroRise .9s var(--ease) forwards; }
html.js .hero-anim.d1 { animation-delay: .10s; }
html.js .hero-anim.d2 { animation-delay: .22s; }
html.js .hero-anim.d3 { animation-delay: .34s; }
html.js .hero-anim.d4 { animation-delay: .46s; }
html.js .hero-anim.d5 { animation-delay: .58s; }
@keyframes heroRise { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ */
/* 17. SCROLLBAR                                                     */
/* ------------------------------------------------------------------ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--mist); }
::-webkit-scrollbar-thumb { background: var(--blue-100); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-500); }

/* ------------------------------------------------------------------ */
/* 18. ACCESSIBILITÉ - reduced motion                                */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero-anim { opacity: 1 !important; transform: none !important; }
}
