/* =========================================================================
   HISWACA Congo - Design System (version statique)
   Reproduit fidèlement le thème Tailwind/shadcn d'origine (src/index.css).
   Chargé APRÈS Bootstrap pour que ces règles aient priorité.
   ========================================================================= */

:root {
  /* Couleurs institutionnelles HISWACA - Nouveau logo */
  --hiswaca-blue-dark: 200 64% 28%;
  --hiswaca-blue: 197 100% 44%;
  --hiswaca-green: 88 52% 48%;
  --hiswaca-green-light: 88 52% 58%;
  --hiswaca-green-dark: 88 52% 32%;
  /* Jaune et rouge HISWACA (utilisés dans les badges/charts d'origine) */
  --hiswaca-yellow: 54 100% 49%;
  --hiswaca-red: 355 85% 57%;

  /* Mode Public - Fond clair */
  --background: 200 20% 98%;
  --foreground: 200 47% 11%;

  --card: 0 0% 100%;
  --card-foreground: 200 47% 11%;

  --popover: 0 0% 100%;
  --popover-foreground: 200 47% 11%;

  --primary: 197 100% 44%;
  --primary-foreground: 0 0% 100%;

  --secondary: 200 20% 96%;
  --secondary-foreground: 200 47% 11%;

  --muted: 200 15% 93%;
  --muted-foreground: 200 16% 40%;

  --accent: 88 52% 48%;
  --accent-foreground: 0 0% 100%;

  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;

  --border: 200 20% 88%;
  --input: 200 20% 88%;
  --ring: 197 100% 44%;

  --radius: 0.5rem;

  --nav-bg: 0 0% 100%;
  --nav-foreground: 200 47% 11%;
  --nav-border: 200 20% 90%;

  --focus-ring: 197 100% 44%;

  --gestion-bg: 200 64% 18%;
  --gestion-foreground: 200 20% 98%;
  --gestion-border: 200 50% 25%;

  --chart-1: 197 100% 44%;
  --chart-2: 88 52% 48%;
  --chart-3: 200 64% 28%;
  --chart-4: 88 52% 58%;
  --chart-5: 197 80% 60%;
}

/* Aligne les couleurs Bootstrap sur la palette HISWACA pour éviter les
   collisions d'utilitaires (.text-primary / .bg-primary / .border-primary). */
:root {
  --bs-primary: hsl(197 100% 44%);
  --bs-primary-rgb: 0, 163, 224;
  --bs-link-color: hsl(197 100% 44%);
  --bs-link-hover-color: hsl(200 64% 28%);
}

/* ---- Base ---------------------------------------------------------------- */
* { border-color: hsl(var(--border)); }

html { scroll-behavior: smooth; }

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Montserrat', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px hsl(var(--focus-ring));
  border-radius: 4px;
}

/* ---- Container HISWACA (remplace celui de Bootstrap) -------------------- */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 100%;
}
@media (min-width: 640px) { .container { padding-left: 1.5rem; padding-right: 1.5rem; max-width: 640px; } }
@media (min-width: 768px) { .container { padding-left: 2rem; padding-right: 2rem; max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1400px) { .container { max-width: 1400px; } }

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 100;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ---- Hero plein écran (accueil) ---------------------------------------- */
.hero-full {
  min-height: 90vh;
  display: flex;
  align-items: center;
}
@media (max-width: 640px) {
  .hero-full { min-height: auto; }
}
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg,
      hsl(var(--hiswaca-blue-dark) / 0.95) 0%,
      hsl(var(--hiswaca-blue-dark) / 0.80) 42%,
      hsl(var(--hiswaca-blue) / 0.45) 72%,
      hsl(var(--hiswaca-green) / 0.42) 100%);
}
.hero-grad-text {
  background: linear-gradient(90deg, hsl(var(--hiswaca-green-light)), hsl(var(--hiswaca-blue)) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 1;
}
.hero-blob-1 { width: 420px; height: 420px; background: hsl(var(--hiswaca-green)); top: -120px; right: -100px; }
.hero-blob-2 { width: 360px; height: 360px; background: hsl(var(--hiswaca-blue)); bottom: -140px; left: -80px; }
.hero-scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1.5rem;
  opacity: 0.8;
  z-index: 5;
  animation: hero-bob 2s ease-in-out infinite;
}
.hero-scroll:hover { opacity: 1; color: #fff; }
@keyframes hero-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---- Hero de page unifié (cohérent avec l'accueil) --------------------- */
.page-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(115deg,
    hsl(var(--hiswaca-blue-dark)) 0%,
    hsl(var(--hiswaca-blue-dark)) 38%,
    hsl(var(--hiswaca-green-dark)) 100%);
}
.page-hero::before, .page-hero::after {
  content: "";
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}
.page-hero::before { width: 340px; height: 340px; background: hsl(var(--hiswaca-green)); top: -120px; right: -80px; }
.page-hero::after { width: 300px; height: 300px; background: hsl(var(--hiswaca-blue)); bottom: -130px; left: -70px; }
.page-hero > * { position: relative; z-index: 1; }
.page-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(4px);
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
}

/* ---- Topbar (bandeau supérieur défilant) ------------------------------- */
.hiswaca-topbar {
  background: hsl(var(--hiswaca-blue-dark));
  color: #fff;
  font-size: 0.78rem;
  border-bottom: 1px solid hsl(var(--hiswaca-blue) / 0.35);
}
.hiswaca-topbar .topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 38px;
}
.topbar-contact { display: none; gap: 1.25rem; white-space: nowrap; flex-shrink: 0; }
.topbar-contact a { color: rgba(255,255,255,0.85); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; transition: color 0.2s; }
.topbar-contact a:hover { color: #fff; }
@media (min-width: 768px) { .topbar-contact { display: flex; } }

.topbar-marquee { position: relative; flex: 1; overflow: hidden; min-width: 0; -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); }
.topbar-track { display: inline-flex; white-space: nowrap; will-change: transform; animation: topbar-scroll 36s linear infinite; }
.topbar-track:hover { animation-play-state: paused; }
.topbar-group { display: inline-flex; align-items: center; }
.topbar-group > span { padding: 0 1rem; color: rgba(255,255,255,0.92); }
.topbar-sep { opacity: 0.45; color: hsl(var(--hiswaca-green-light)); }
@keyframes topbar-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.topbar-social { display: none; gap: 0.85rem; flex-shrink: 0; }
.topbar-social a { color: rgba(255,255,255,0.8); transition: color 0.2s, transform 0.2s; }
.topbar-social a:hover { color: #fff; transform: translateY(-1px); }
@media (min-width: 768px) { .topbar-social { display: flex; } }

/* ---- Header amélioré (esprit d'origine conservé) ----------------------- */
.hiswaca-header { box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04); }
.hiswaca-header.is-scrolled { box-shadow: 0 6px 20px -8px hsl(var(--foreground) / 0.18); }
.hiswaca-header .nav-link { position: relative; font-weight: 500; }
.hiswaca-header .nav-link::after {
  content: "";
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: 0.35rem;
  height: 2px;
  border-radius: 2px;
  background: hsl(var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.hiswaca-header .nav-link:hover::after,
.hiswaca-header .nav-link.active::after { transform: scaleX(1); }

/* ---- Footer moderne ---------------------------------------------------- */
.hiswaca-footer {
  position: relative;
  background:
    radial-gradient(1200px 320px at 15% 0%, hsl(var(--hiswaca-blue) / 0.18), transparent 60%),
    linear-gradient(180deg, hsl(var(--hiswaca-blue-dark)) 0%, #11324a 100%);
}
.hiswaca-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--hiswaca-blue)), hsl(var(--hiswaca-green)) 60%, hsl(var(--hiswaca-yellow)));
}
.ftr-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  position: relative;
}
.ftr-title::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 34px; height: 2px;
  border-radius: 2px;
  background: hsl(var(--hiswaca-green));
}
.ftr-contact {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  transition: color 0.2s;
}
.ftr-contact i { color: hsl(var(--hiswaca-green-light)); }
.ftr-contact:hover { color: #fff; }

.ftr-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.ftr-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 0.3rem 0;
  transition: color 0.2s, transform 0.2s;
}
.ftr-link i { font-size: 0.7rem; color: hsl(var(--hiswaca-green-light)); transition: transform 0.2s; }
.ftr-link:hover { color: #fff; }
.ftr-link:hover i { transform: translateX(3px); }

.ftr-news { display: flex; align-items: stretch; max-width: 340px; border-radius: 0.6rem; overflow: hidden; background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18); }
.ftr-news input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: #fff; font-size: 0.875rem; padding: 0.6rem 0.85rem; }
.ftr-news input::placeholder { color: rgba(255,255,255,0.55); }
.ftr-news button { flex-shrink: 0; border: none; background: hsl(var(--hiswaca-green)); color: #fff; padding: 0 1rem; cursor: pointer; transition: background 0.2s; }
.ftr-news button:hover { background: hsl(var(--hiswaca-green-dark)); }

.ftr-social {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: all 0.25s;
}
.ftr-social:hover { background: #fff; color: hsl(var(--hiswaca-blue-dark)); transform: translateY(-2px); }

.ftr-bottom { border-top: 1px solid rgba(255,255,255,0.12); }
.ftr-legal { color: rgba(255,255,255,0.6); text-decoration: none; transition: color 0.2s; }
.ftr-legal:hover { color: #fff; }

/* ---- Navigation --------------------------------------------------------- */
.nav-public {
  background: hsl(var(--nav-bg));
  color: hsl(var(--nav-foreground));
  border-color: hsl(var(--nav-border));
}
.nav-gestion {
  background: hsl(var(--gestion-bg));
  color: hsl(var(--gestion-foreground));
  border-color: hsl(var(--gestion-border));
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: color 0.2s, background-color 0.2s;
  color: hsl(var(--nav-foreground) / 0.75);
  text-decoration: none;
}
.nav-link:hover {
  color: hsl(var(--nav-foreground));
  background: hsl(var(--secondary));
}
.nav-link.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

/* ---- Burger button ------------------------------------------------------ */
.burger-btn {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 0.375rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
}
.burger-btn span {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 9999px;
  transition: all 0.3s;
  background: currentColor;
}
.burger-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---- Gradients HISWACA -------------------------------------------------- */
.bg-hiswaca-gradient {
  background: linear-gradient(135deg, hsl(var(--hiswaca-blue-dark)) 0%, hsl(var(--hiswaca-blue)) 50%, hsl(var(--hiswaca-green)) 100%);
}
.bg-hiswaca-gradient-light {
  background: linear-gradient(135deg, hsl(var(--hiswaca-blue) / 0.1) 0%, hsl(var(--hiswaca-green) / 0.1) 100%);
}

/* ---- Animations (keyframes d'origine) ----------------------------------- */
@keyframes slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.animate-slide-down { animation: slide-down 0.2s ease-out; }
.animate-fade-in { animation: fade-in 0.2s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse-soft 2s cubic-bezier(0.4,0,0.6,1) infinite; }

/* ---- Utilitaires repris de l'index.css d'origine ------------------------ */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---- GSAP reveal (état initial avant animation) ------------------------- */
.reveal { opacity: 0; }
.reveal-up { opacity: 0; transform: translateY(30px); }
.reveal-left { opacity: 0; transform: translateX(-30px); }
.reveal-scale { opacity: 0; transform: scale(0.95); }
/* Si JS désactivé, on rend tout visible */
.no-js .reveal, .no-js .reveal-up, .no-js .reveal-left, .no-js .reveal-scale {
  opacity: 1; transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-up, .reveal-left, .reveal-scale { opacity: 1 !important; transform: none !important; }
}

/* ---- Offcanvas mobile nav (Bootstrap) custom ---------------------------- */
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 0.5rem;
  color: hsl(var(--foreground) / 0.8);
  text-decoration: none;
  transition: all 0.2s;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

/* Empêche Bootstrap d'imposer sa typo */
body, .btn, .nav-link { font-family: 'Montserrat', system-ui, sans-serif; }

/* ---- Carrousel d'actualités : points de pagination --------------------- */
.news-dot {
  height: 0.5rem;
  width: 0.5rem;
  border: none;
  padding: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s;
  cursor: pointer;
}

/* Ordonnancement accueil (indépendant du CDN Tailwind) :
   mobile = contenu d'abord, desktop = sidebar à gauche */
/* mobile : premier ; desktop : dernier */
.home-content, .lg-order-last { order: 1; }
/* mobile : dernier ; desktop : premier */
.home-sidebar, .lg-order-first { order: 2; }
@media (min-width: 1024px) {
  .home-sidebar, .lg-order-first { order: 1; }
  .home-content, .lg-order-last { order: 2; }
}

/* Carte news featured : slides empilés en absolu */
[data-news-carousel] [data-slide] {
  transition: opacity 0.5s ease;
}

/* Bootstrap reset doux : on garde les marges de titres à zéro comme Tailwind */
h1, h2, h3, h4, h5, h6, p, ul, figure { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
