/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%; /* Safari, Chrome, Edge */
  -moz-text-size-adjust: 100%; /* Firefox */
  text-size-adjust: 100%; /* Standard */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  font-size: 16px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   MOBILE MENU SETUP (HIDDEN BY DEFAULT)
   ============================================ */
#menu-toggle {
  display: none;
}

#services-toggle {
  display: none;
}

#blog-toggle {
  display: none;
}

.menu-icon {
  display: none;
  width: 30px;
  height: 30px;
  cursor: pointer;
  position: relative;
  z-index: 102;
}

.menu-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background: #000000;
  margin: 6px 0;
  transition: 0.3s;
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
}

/* FORCE MAIN DROPDOWN LINKS TO USE FULL WIDTH */
.nav-main-content,
.nav-main-content > a,
.nav-main-content > .has-dropdown,
.nav-main-content > .has-dropdown > .dropdown-toggle {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* ============================================
   MOBILE RESPONSIVE STYLES (≤768px)
   ============================================ */
@media (max-width: 768px) {
  /* MOBILE: Show hamburger icon */
  .menu-icon {
    display: block;
    flex-direction: column;
    justify-content: space-around;
  }

  /* MOBILE: Main navigation menu (slides in from right when hamburger clicked) */
  .nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 101;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* MOBILE: Main menu content container */
  .nav-main-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 80px 0 0 0;
    min-height: 100%;
  }

  /* MOBILE: Regular nav links (Accueil, À Propos, Contact) */
  .nav-main-content > a {
    width: 100%;
    padding: 1rem 20px;
    border-bottom: 1px solid #e5e7eb;
    display: block;
    text-align: center;
    text-decoration: none;
    color: #4b5563;
  }

  /* MOBILE: Dropdown wrapper (Services, Blog) */
  .nav-main-content > .has-dropdown {
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
  }

  /* MOBILE: Dropdown toggle buttons (Services ▼, Blog ▼) */
  .nav-main-content > .has-dropdown > .dropdown-toggle {
    width: 100%;
    padding: 1rem 20px;
    display: block;
    text-align: center;
    color: #4b5563;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
  }

  /* MOBILE: Dropdown arrow */
  .dropdown-arrow {
    font-size: 1rem;
    display: inline !important;
    margin-left: 0.5rem;
    transition: transform 0.3;
  }

  /* MOBILE: Submenu (hidden by default, expands below when clicked) */
  .dropdown-menu {
    display: none;
    position: static;
    background: #f9fafb;
    width: 100%;
    padding: 0;
  }

  /* MOBILE: Submenu links */
  .dropdown-menu a {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
    text-decoration: none;
    color: #4b5563;
    text-align: center;
    display: block;
  }

  /* MOBILE: Hide back button (not needed for accordion) */
  .back-button {
    display: none !important;
  }

  /* MOBILE: Show Services submenu when checkbox checked */
  #services-toggle:checked ~ .nav .services-menu {
    display: block;
  }

  /* MOBILE: Show Blog submenu when checkbox checked */
  #blog-toggle:checked ~ .nav .blog-menu {
    display: block;
  }

  /* MOBILE: Rotate arrow when submenu open */
  #services-toggle:checked
    ~ .nav
    .has-dropdown
    .services-menu
    ~ .dropdown-toggle
    .dropdown-arrow,
  #blog-toggle:checked
    ~ .nav
    .has-dropdown
    .blog-menu
    ~ .dropdown-toggle
    .dropdown-arrow {
    transform: rotate(180deg);
  }

  /* MOBILE: Emergency CTA button */
  .header-cta {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
    margin-left: 0;
  }

  /* MOBILE: Open main nav when hamburger clicked */
  #menu-toggle:checked ~ .nav {
    display: flex;
    right: 0; /* Slide nav into view */
  }

  /* MOBILE: Animate hamburger to X when menu open */
  #menu-toggle:checked ~ .menu-icon span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
  }

  #menu-toggle:checked ~ .menu-icon span:nth-child(2) {
    opacity: 0;
  }

  #menu-toggle:checked ~ .menu-icon span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
  }

  /* MOBILE: Show dark overlay when menu open */
  #menu-toggle:checked ~ .menu-overlay {
    display: block;
  }

  /* MOBILE: Smaller hero text */
  .hero-section h1 {
    font-size: 2rem;
  }

  /* MOBILE: Single column blog grid */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile: softer colors and better tap targets */
  .nav {
    background: #ffffff;
  }

  .nav-main-content > a,
  .nav-main-content > .has-dropdown > .dropdown-toggle {
    color: #475569; /* Slate 600 */
    font-weight: 600;
  }

  .nav a:hover,
  .nav-main-content > .has-dropdown > .dropdown-toggle:focus {
    color: #1d4ed8; /* Blue 600 */
  }

  .dropdown-arrow {
    color: #64748b; /* Slate 500 */
  }

  .dropdown-menu {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
  }

  .dropdown-menu a {
    color: #475569 !important;
  }

  .dropdown-menu a:hover {
    background: #eef2ff; /* Indigo 100 */
    color: #1d4ed8 !important;
  }

  /* Ensure comfortable tap targets */
  .nav-main-content > a,
  .nav-main-content > .has-dropdown > .dropdown-toggle,
  .dropdown-menu a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Keyboard focus */
  .nav a:focus-visible,
  .dropdown-toggle:focus-visible,
  .dropdown-menu a:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
  }
}

/* ============================================
   DESKTOP NAVIGATION
   ============================================ */
.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-main-content {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav a {
  color: #4b5563;
  text-decoration: none;
  transition: color 0.3s;
}

.nav a:hover {
  color: #2563eb;
}

.header-cta {
  background: #ef4444;
  color: white !important;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
}

/* ============================================
   DESKTOP DROPDOWN MENU (CLICK TO OPEN)
   ============================================ */
.has-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0rem;
  cursor: pointer;
  color: #475569; /* softer than pure black (Slate 600) */
  transition: color 0.3s;
  background: none;
  border: none;
  font-size: 1rem;
  padding: 0;
  font-family: inherit;
}

.dropdown-toggle:hover {
  color: #2563eb;
}

.dropdown-arrow {
  font-size: 0.75rem;
  transition: transform 0.3s;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100%);
  left: 0;
  background: #f8fafc; /* was white */
  border: 1px solid #e5e7eb; /* add subtle border */
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  min-width: 250px;
  border-radius: 10px;
  padding: 1rem 0;
  z-index: 1000;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 2rem;
  color: #475569 !important; /* was too dark */
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
  background: #eef2ff; /* soft hover */
  color: #1d4ed8 !important;
}

/* Desktop click-to-open dropdown */
#services-toggle:checked ~ .nav .has-dropdown .services-menu,
#blog-toggle:checked ~ .nav .has-dropdown .blog-menu {
  display: block;
}

#services-toggle:checked ~ .nav .has-dropdown .dropdown-arrow,
#blog-toggle:checked ~ .nav .has-dropdown .dropdown-arrow {
  transform: rotate(180deg);
}

.back-button {
  display: none; /* Hidden on desktop */
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: #1e3a8a;
  color: white;
  padding: 3rem 1rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #e0e7ff;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

/* ============================================
   ADDITIONAL STYLES
   ============================================ */
.header {
  background: #f3f4f6; /* was #f9fafb */
  border-bottom: 1px solid #e5e7eb; /* add visible separator */
  padding: 0.5rem 0;
}
.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #111827;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo img {
  height: 60px;
}
.company-name {
  color: #000000;
  font-size: 1.25rem;
  font-weight: 700;
}
.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav a {
  color: #000000;
  text-decoration: none;
  transition: color 0.3s;
}
.nav a:hover {
  color: #2563eb;
}
.header-cta {
  background: #ef4444;
  color: white !important;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
}
.breadcrumb {
  padding: 1.5rem 0;
  font-size: 0.875rem;
  color: #6b7280;
}
.breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}
.breadcrumb span {
  margin: 0 0.5rem;
}
.cta-box {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 2.5rem;
  border-radius: 12px;
  margin: 3rem 0;
  text-align: center;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}
.cta-box h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: white;
}
.cta-box p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}
.cta-button {
  display: inline-block;
  background: #055#2563eb;
  color: #ffffff;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  transition: all 0.3s;
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.footer {
  background: #1e3a8a;
  color: #e0e7ff;
  padding: 3rem 1rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: white;
}
.footer-section ul {
  list-style: none;
}
.footer-section li {
  margin-bottom: 0.5rem;
}
.footer-section a {
  color: #e0e7ff;
  text-decoration: none;
  transition: color 0.3s;
}
.footer-section a:hover {
  color: white;
}
.footer-bottom {
  border-top: 1px solid rgb(255, 255, 255);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
}
.risk-list {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

/* Global tap target minimums (Google 44x44) */
@media (hover: none), (pointer: coarse) {
  :where(
      a[href],
      button,
      [role="button"],
      input[type="button"],
      input[type="submit"],
      input[type="reset"],
      label[for],
      .dropdown-toggle,
      .header-cta,
      .dropdown-menu a
    ) {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Ensure the hamburger is large enough */
  .menu-icon {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 768px) {
  .article-title {
    font-size: 2rem;
  }
  .nav {
    display: none;
  }
  .article-content {
    padding: 2rem 1.5rem;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ensure overlay isn’t covering mobile */
#menu-toggle:not(:checked) ~ .menu-overlay { display: none !important; pointer-events: none !important; }

/* force hero visible while we debug */
@media (hover: none), (pointer: coarse) {
  .hero { display: block !important; opacity: 1 !important; visibility: visible !important; min-height: 50vh !important; background-attachment: scroll !important; }
}
