/* =========================================================================
   CAQOF - Feuille de style responsive
   -------------------------------------------------------------------------
   Contient :
   - Les ajustements par palier (breakpoints Bootstrap 5)
   - L'animation "cascade verticale a droite" (waterfall) du menu mobile
   ========================================================================= */

@media (max-width: 991.98px) {

  .main-nav .navbar-collapse {
    position: fixed;
    top: var(--header-height);
    right: 0;
    height: calc(100vh - var(--header-height));
    width: min(78vw, 320px);
    background-color: var(--caqof-white);
    box-shadow: -8px 0 24px rgba(15, 59, 114, 0.18);
    padding: 1.5rem 1.25rem;
    overflow-y: auto;

    transform: translateX(100%);
    transition: transform 0.35s ease;
    display: block !important;
  }

  .main-nav .navbar-collapse.show {
    transform: translateX(0);
  }

  .main-nav .navbar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .main-nav .navbar-nav .nav-item {
    opacity: 0;
    transform: translateY(-18px);
  }

  .main-nav .navbar-collapse.show .navbar-nav .nav-item {
    animation: waterfallDrop 0.5s ease forwards;
  }

  .main-nav .navbar-collapse.show .navbar-nav .nav-item:nth-child(1) { animation-delay: 0.05s; }
  .main-nav .navbar-collapse.show .navbar-nav .nav-item:nth-child(2) { animation-delay: 0.11s; }
  .main-nav .navbar-collapse.show .navbar-nav .nav-item:nth-child(3) { animation-delay: 0.17s; }
  .main-nav .navbar-collapse.show .navbar-nav .nav-item:nth-child(4) { animation-delay: 0.23s; }
  .main-nav .navbar-collapse.show .navbar-nav .nav-item:nth-child(5) { animation-delay: 0.29s; }
  .main-nav .navbar-collapse.show .navbar-nav .nav-item:nth-child(6) { animation-delay: 0.35s; }
  .main-nav .navbar-collapse.show .navbar-nav .nav-item:nth-child(7) { animation-delay: 0.41s; }

  @keyframes waterfallDrop {
    0%   { opacity: 0; transform: translateY(-18px); }
    60%  { opacity: 1; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background-color: rgba(15, 59, 114, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1020;
  }
  .nav-overlay.show { opacity: 1; visibility: visible; }

  .main-nav .navbar-collapse { z-index: 1025; }

  .main-nav .nav-link { padding: 0.75rem 1rem !important; }
  .main-nav .nav-link.active { display: inline-block; }
}

@media (min-width: 992px) {
  .caqof-toggler { display: none; }

  .main-nav .navbar-collapse {
    display: flex !important;
  }

  .main-nav .navbar-nav {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 1200px) {
  .hero p.lead { font-size: 1.15rem; }
}

@media (max-width: 991.98px) {
  :root { --header-height: 84px; }

  .hero { min-height: 70vh; text-align: center; }
  .hero .hero-cta { justify-content: center; display: flex; flex-wrap: wrap; }
  .hero p.lead { margin-left: auto; margin-right: auto; }

  .three-col-section .col-left,
  .three-col-section .col-right {
    margin-bottom: 2rem;
  }
}

@media (max-width: 767.98px) {
  :root { --header-height: 76px; }

  .brand-block img { height: 44px; }
  .brand-text .brand-title { font-size: 0.92rem; }
  .brand-text .brand-subtitle { font-size: 0.6rem; }

  .top-bar { font-size: 0.68rem; }
  .top-bar .slogan-flash { display: block; text-align: center; margin-bottom: 0.2rem; }
  .top-bar .lang-col { text-align: center !important; }

  .hero { min-height: 82vh; padding: 2rem 0; }
  .hero h1 { font-size: 1.7rem; }

  .col-card { padding: 1.25rem; }

  .stat-item .stat-number { font-size: 1.6rem; }

  .moment-card { height: 210px; margin-bottom: 1rem; }

  .construction-icon { font-size: 3.6rem; }

  .caqof-footer { text-align: center; }
  .social-icons { justify-content: center; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.45rem; }
  .section-pill { font-size: 0.82rem; padding: 0.45rem 1.1rem; }
}
