/* ===========================
   RESET & BASE
   =========================== */
html, body { margin: 0; padding: 0; }
*, *::before, *::after { box-sizing: border-box; }
body { background: #f8f9fa; }

/* ===========================
   THEME (couleurs du logo)
   =========================== */
:root{
  --bs-primary:  #273674;           /* bleu marine */
  --bs-primary-rgb: 39, 54, 116;
  --bs-secondary:#DE081E;           /* rouge */
  --bs-secondary-rgb: 222, 8, 30;
  --bs-info:     #CCD8E3;           /* bleu clair */
  --bs-dark:     #1a224a;

  --bs-link-color:       var(--bs-primary);
  --bs-link-hover-color: #1E2A66;

  /* Compat rétro */
  --primary:   var(--bs-primary);
  --secondary: var(--bs-secondary);
}

/* Badge doux si votre Bootstrap n’a pas .bg-primary-subtle */
.bg-primary-subtle {
  background-color: rgba(var(--bs-primary-rgb), 0.12) !important;
  color: var(--bs-primary) !important;
}

/* Navigation + boutons outline */
.navbar .nav-link.active{
  color: var(--bs-secondary) !important;
  font-weight: 600;
}
.btn-outline-primary{
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
}

/* Dégradé réutilisable */
.bg-gradient-primary{
  background: linear-gradient(100deg,
    var(--bs-primary) 0%,
    #33469b 45%,
    var(--bs-secondary) 100%
  );
}

/* ===========================
   HERO / CAROUSEL
   =========================== */
/* Hauteur header sticky pour calcul (adaptez si besoin) */
header.sticky-top { --header-h: 72px; }

/* Slider plein écran moins le header */
.hero-full { min-height: calc(100vh - var(--header-h)); }

/* Le carrousel occupe toute la hauteur */
.hero-full .carousel-inner,
.hero-full .carousel-item { height: 100%; }

/* La boîte d'aspect-ratio par slide */
.hero-media { height: 100%; }

/* Image responsive couvrante */
.hero-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-carousel { isolation: isolate; }
.carousel-item { position: relative; }
.carousel-item::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.45));
  pointer-events:none;
}
.carousel-item > .hero-media > img{
  transform-origin: center;
  animation: kenburns 12s ease-in-out both;
  will-change: transform;
}
@keyframes kenburns {
  0%   { transform: scale(1.05); }
  100% { transform: scale(1.15); }
}

/* Caption position & style */
.carousel-caption{
  text-align:left;
  left: 6%;
  right:auto;
  bottom: 12%;
}
.caption-glass{
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
@media (max-width: 991.98px){
  .carousel-caption{ left: 5%; right: 5%; bottom: 8%; }
  header.sticky-top { --header-h: 64px; }
}

/* ===========================
   CARTES SERVICES
   =========================== */
.service-card{
  border: 1px solid rgba(39,54,116,.15);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease;
}
.service-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,.08);
  border-color: rgba(222,8,30,.35);
}
.service-card .card-title{ color: var(--bs-primary); }
.service-media{
  height: 200px;
  background:#f6f7fb;
}
@media (min-width: 1200px){
  .service-media{ height: 180px; }
}

/* ===========================
   UTILITAIRES
   =========================== */
.object-cover{ object-fit: cover; }

/* ===========================
   REVEAL ON SCROLL
   =========================== */
.reveal-up, .reveal-fade{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.reveal-fade { transform: none; }
.is-visible{
  opacity: 1;
  transform: none;
}
/* ===== Header moderne ===== */
header.sticky-top.nav-elevate{
  backdrop-filter: saturate(180%) blur(6px);
  -webkit-backdrop-filter: saturate(180%) blur(6px);
  background: rgba(255,255,255,.92) !important;
}
.navbar .nav-link{
  padding: .6rem .75rem;
  position: relative;
}
.navbar .nav-link::after{
  content:'';
  position:absolute;
  left:.75rem; right:.75rem; bottom:.35rem;
  height:2px;
  background: var(--bs-secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.navbar .nav-link:hover::after,
.navbar .nav-link.active::after{
  transform: scaleX(1);
}
.dropdown-menu{
  border-radius: .75rem;
  box-shadow: 0 16px 40px rgba(255, 2, 2, 0.723);
}

/* Conserve la logique de hauteur pour le slider plein écran */
header.sticky-top { --header-h: 72px; }
@media (max-width: 991.98px){ header.sticky-top { --header-h: 64px; } }

/* Stretched-link exige que le parent soit positionné */
.card-entity { position: relative; }
.card-entity .card-body { position: relative; z-index: 2; }



/* Mega dropdown */
.dropdown-mega{ width: min(980px, calc(100vw - 2rem)); }

.card-entity{
  display: block; /* ancre bloc */
  border: 1px solid rgba(39,54,116,.12);
  border-radius: .9rem;
  overflow: hidden;
  background: #fff;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-entity:hover{
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.08);
  border-color: rgba(222,8,30,.3);
}
.card-entity .card-title{ color: var(--bs-primary); }
/* ===============================
   HERO – Optimisation mobile
   (sans effet sur desktop)
   =============================== */

/* <= XL : passe en 16:9 pour gagner en hauteur d’image */
@media (max-width: 1199.98px){
  #heroCarousel .ratio-21x9{
    --bs-aspect-ratio: 56.25%; /* 16:9 */
  }
}

/* <= MD : petits ajustements de typo/espaces */
@media (max-width: 767.98px){
  .carousel-caption{
    left: 6%;
    right: 6%;
    bottom: 8%;
  }
  .caption-glass{
    padding: 1rem 1.1rem;
  }
  .caption-glass h1,
  .carousel-caption h2{
    font-size: 1.35rem;
    line-height: 1.2;
  }
  .caption-glass .lead{
    font-size: .95rem;
  }
  .caption-glass .btn{
    padding: .55rem .9rem;
    font-size: .95rem;
    border-radius: .6rem;
  }
}

/* <= SM : priorité à l’image, légende très compacte */
@media (max-width: 575.98px){
  /* plus de hauteur utile à l’image */
  .hero-full{
    min-height: calc(78vh - var(--header-h));
  }
  /* ratio plus haut pour exposer davantage l’image */
  #heroCarousel .ratio-21x9{
    --bs-aspect-ratio: 70%; /* entre 16:9 et 4:3 */
  }
  /* recadrage centré de l’image */
  #heroCarousel .object-cover{
    object-position: center;
  }

  /* légende compacte et moins opaque pour laisser voir l’image */
  .carousel-caption{
    left: 5%;
    right: 5%;
    bottom: 6%;
  }
  .caption-glass{
    padding: .85rem 1rem;
    background: rgba(0,0,0,.20);     /* un peu plus transparent */
    border-color: rgba(255,255,255,.15);
  }
  .caption-glass h1,
  .carousel-caption h2{
    font-size: 1.15rem;
    line-height: 1.18;
    margin-bottom: .35rem;
  }
  /* On masque la phrase "lead" pour dégager l’image */
  .caption-glass .lead{
    display: none;
  }
  /* On garde un seul bouton principal sur mobile */
  .caption-glass .btn-outline-light{
    display: yes;
  }
  .caption-glass .btn{
    padding: .5rem .85rem;
    font-size: .9rem;
  }

  /* commandes & indicateurs plus discrets */
  .carousel-control-prev,
  .carousel-control-next{
    width: 14%;
  }
  .carousel-indicators [data-bs-target]{
    width: 8px; height: 8px; border-radius: 50%;
  }
}
