/* ==========================================================================
   Modern Footer Styles - FULLY RESPONSIVE
   Dark background with white text, edge-to-edge design, dynamic scaling from 1280×800 to 5120×2880
   ========================================================================== */

/* ==========================================================================
   Scroll-to-Top Button
   ========================================================================== */
.scroll-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.scroll-top-btn:active {
  transform: translateY(0);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .scroll-top-btn {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ==========================================================================
   Modern Footer
   ========================================================================== */

.modern-footer {
  position: relative;
  width: 100vw;
  left: 50%;
  margin-left: -50vw;
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  color: #ffffff;
  font-family: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Footer Main Section */
.footer-main {
  padding: clamp(40px, 5vw, 100px) 0 clamp(20px, 2.5vw, 50px); /* Dynamic vertical padding */
}

.footer-container {
  width: 100% !important; /* Full width container */
  max-width: none !important;
  margin: 0 auto;
  padding: 0 !important; /* No padding on container */
}

/* Footer Grid - matches Company Intro and NIST structure exactly */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
  gap: clamp(30px, 4vw, 80px); /* Dynamic gap */
  margin-bottom: clamp(20px, 2.5vw, 50px); /* Dynamic margin */
  width: 90% !important; /* Match content sections: 90% width */
  max-width: none !important;
  margin-left: auto;
  margin-right: auto;
  padding: 0 clamp(20px, 3vw, 80px) !important; /* Same padding as content sections */
  box-sizing: border-box !important; /* Ensure padding doesn't affect width calculation */
}

/* Column Styles */
.footer-column {
  min-width: 0;
}

/* Company Column */
.footer-company {
  padding-right: clamp(10px, 1.5vw, 30px); /* Dynamic padding */
}

.footer-logo {
  display: block;
  margin-bottom: clamp(16px, 1.8vw, 36px); /* Dynamic margin */
  max-width: clamp(140px, 12vw, 400px); /* Larger at mid-res (1792px: 215px), high-res (5120px: 400px) */
  height: auto;
  image-rendering: auto; /* Use browser's default high-quality scaling */
  transform: translateZ(0); /* Force GPU acceleration for crisp rendering */
  -webkit-backface-visibility: hidden; /* Prevent blur from sub-pixel rendering */
  backface-visibility: hidden;
}

/* ==========================================================
   Footer Logo Hover Swap — BULLETPROOF
   ========================================================== */

.footer-logo-wrap {
  position: relative;
  display: inline-block;
}

/* Base logo */
.footer-logo {
  display: block;
  transition: opacity 0.25s ease;
}

/* Hover logo stacked */
.footer-logo-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* Swap on hover */
.footer-logo-wrap:hover .footer-logo-default {
  opacity: 0;
}

.footer-logo-wrap:hover .footer-logo-hover {
  opacity: 1;
}

.footer-tagline {
  font-size: clamp(14px, 1.1vw, 28px); /* Harmonized: matches menu items max */
  line-height: 1.6; /* Standardized line-height */
  color: #b3b3b3;
  margin-bottom: clamp(16px, 1.8vw, 48px); /* Dynamic margin */
}

/* Trust Badges */
.footer-trust-badges {
  display: flex;
  gap: clamp(12px, 1.2vw, 24px); /* Dynamic gap */
  margin-top: clamp(16px, 1.8vw, 36px); /* Dynamic margin */
}

.trust-badge img {
  max-width: clamp(80px, 7vw, 140px); /* Dynamic badge size */
  height: auto;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.trust-badge img:hover {
  opacity: 1;
}

/* Footer Headings */
.footer-heading {
  font-size: clamp(15px, 1.2vw, 32px); /* Harmonized: clear hierarchy above body (14px/28px) */
  font-weight: 700;
  color: #ffffff;
  margin-bottom: clamp(16px, 1.8vw, 48px); /* Dynamic margin */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.3; /* Standardized heading line-height */
}

.footer-heading-blog {
  margin-top: clamp(20px, 2.4vw, 48px); /* Dynamic margin */
}

/* Footer Menus */
.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu li {
  margin-bottom: clamp(10px, 1vw, 20px); /* Dynamic spacing */
}

.footer-menu li:last-child {
  margin-bottom: 0;
}

.footer-menu a {
  color: #cccccc;
  text-decoration: none;
  font-size: clamp(14px, 1vw, 28px); /* Harmonized: consistent body text scale */
  line-height: 1.6; /* Standardized body line-height */
  transition: color 0.3s ease, padding-left 0.3s ease;
  display: inline-block;
}

.footer-menu a:hover {
  color: #ffffff;
  padding-left: clamp(6px, 0.6vw, 12px); /* Dynamic hover shift */
}

/* Connect Column */
.footer-contact {
  margin-bottom: clamp(16px, 1.8vw, 36px); /* Dynamic margin */
}

.footer-contact p {
  margin: 0;
}

.footer-contact a {
  color: #cccccc;
  text-decoration: none;
  font-size: clamp(14px, 1vw, 28px); /* Harmonized: matches menu items */
  line-height: 1.6; /* Standardized body line-height */
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.6vw, 16px); /* Dynamic gap */
}

.footer-contact a:hover {
  color: #ffffff;
}

.footer-contact i {
  font-size: clamp(14px, 1vw, 28px); /* Harmonized: matches text size */
}

/* Social Icons */
.footer-social {
  display: flex;
  gap: clamp(12px, 1.2vw, 24px); /* Dynamic gap */
  margin-bottom: clamp(12px, 1.2vw, 24px); /* Dynamic margin */
}

.footer-social a {
  width: clamp(36px, 2.8vw, 52px); /* Harmonized: proportional to icon size */
  height: clamp(36px, 2.8vw, 52px); /* Harmonized: proportional to icon size */
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: clamp(16px, 1.2vw, 26px); /* Harmonized: balanced with headings */
  transition: all 0.3s ease;
  text-decoration: none;
}

.footer-social a:hover {
  background: #0066cc;
  transform: translateY(clamp(-2px, -0.2vw, -4px)); /* Dynamic hover lift */
}

/* Blog List */
.footer-blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-blog-list li {
  margin-bottom: clamp(12px, 1.2vw, 24px); /* Dynamic spacing */
  padding-bottom: clamp(12px, 1.2vw, 24px); /* Dynamic padding */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-blog-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.footer-blog-list a {
  color: #cccccc;
  text-decoration: none;
  display: block;
  transition: color 0.3s ease;
}

.footer-blog-list a:hover {
  color: #ffffff;
}

.blog-title {
  display: block;
  font-size: clamp(13px, 0.95vw, 26px); /* Harmonized: slightly smaller than menu items */
  line-height: 1.5; /* Standardized small text line-height */
  margin-bottom: clamp(4px, 0.5vw, 12px); /* Dynamic margin */
  font-weight: 500;
}

.blog-date {
  display: block;
  font-size: clamp(12px, 0.85vw, 22px); /* Harmonized: accessible minimum, proportional max */
  line-height: 1.5; /* Standardized small text line-height */
  color: #888888;
}

.view-all {
  font-size: clamp(13px, 0.95vw, 26px); /* Harmonized: matches blog-title scale */
  color: #0066cc;
  font-weight: 600;
  line-height: 1.5; /* Standardized small text line-height */
}

.view-all:hover {
  color: #ffffff;
}

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: clamp(20px, 2.4vw, 48px) 0; /* Dynamic padding */
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(15px, 1.5vw, 30px); /* Dynamic gap */
  width: 90% !important; /* Match content sections: 90% width */
  max-width: none !important;
  margin-left: auto;
  margin-right: auto;
  padding: 0 clamp(20px, 3vw, 80px) !important; /* Same padding as content sections */
  box-sizing: border-box !important; /* Ensure padding doesn't affect width calculation */
}

.footer-copyright p {
  margin: 0;
  font-size: clamp(13px, 0.9vw, 24px); /* Harmonized: meta text scale */
  line-height: 1.5; /* Standardized small text line-height */
  color: #999999;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.2vw, 24px); /* Dynamic gap */
}

.footer-legal a {
  color: #cccccc;
  text-decoration: none;
  font-size: clamp(13px, 0.9vw, 24px); /* Harmonized: matches copyright scale */
  line-height: 1.5; /* Standardized small text line-height */
  transition: color 0.3s ease;
}

.footer-legal a:hover {
  color: #ffffff;
}

.footer-legal .separator {
  color: #666666;
}

/* ==========================================================================
   Responsive Design - Tablet & Mobile
   ========================================================================== */

/* Tablet: 2 columns side-by-side */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(30px, 4vw, 60px); /* Dynamic gap */
    width: 92% !important; /* Match content sections on tablets */
    box-sizing: border-box !important;
  }

  .footer-bottom-content {
    width: 92% !important; /* Match content sections on tablets */
    box-sizing: border-box !important;
  }

  .footer-company {
    grid-column: 1 / -1;
    padding-right: 0;
  }
}

/* Mobile: Stack all columns */
@media (max-width: 767px) {
  .footer-main {
    padding: clamp(40px, 10vw, 70px) 0 clamp(20px, 5vw, 40px); /* Dynamic mobile padding */
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: clamp(30px, 8vw, 50px); /* Dynamic gap */
    width: 95% !important; /* Match content sections on mobile */
    padding: 0 clamp(10px, 4vw, 20px) !important; /* Match content sections mobile padding */
    box-sizing: border-box !important;
  }

  .footer-bottom-content {
    width: 95% !important; /* Match content sections on mobile */
    padding: 0 clamp(10px, 4vw, 20px) !important; /* Match content sections mobile padding */
    box-sizing: border-box !important;
  }

  .footer-company {
    grid-column: 1;
    text-align: center;
  }

  .footer-logo {
    margin-left: auto;
    margin-right: auto;
    max-width: clamp(120px, 24vw, 280px); /* Larger for crisp display on high-DPI mobile */
  }

  .footer-tagline {
    text-align: center;
  }

  .footer-trust-badges {
    justify-content: center;
  }

  .footer-column {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  /* Mobile font adjustments */
  .footer-heading {
    font-size: clamp(16px, 5vw, 24px); /* Larger relative to viewport on mobile */
  }

  .footer-menu a,
  .footer-contact a {
    font-size: clamp(14px, 4vw, 18px); /* Mobile-optimized sizing */
  }

  .footer-tagline {
    font-size: clamp(14px, 3.8vw, 17px);
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-copyright,
  .footer-legal {
    width: 100%;
    justify-content: center;
  }

  .footer-copyright p,
  .footer-legal a {
    font-size: clamp(12px, 3.5vw, 16px); /* Mobile-optimized */
  }

  /* Mobile overrides for previously missing elements */
  .blog-title {
    font-size: clamp(13px, 3.8vw, 16px); /* Mobile-optimized */
  }

  .blog-date {
    font-size: clamp(11px, 3.2vw, 14px); /* Mobile-optimized */
  }

  .view-all,
  .footer-toggle-link {
    font-size: clamp(13px, 3.6vw, 15px); /* Mobile-optimized */
  }

  .footer-contact i {
    font-size: clamp(14px, 4vw, 18px); /* Mobile-optimized: matches contact text */
  }

  .footer-social a {
    width: clamp(36px, 10vw, 44px); /* Mobile-optimized touch target */
    height: clamp(36px, 10vw, 44px);
    font-size: clamp(16px, 4.5vw, 20px);
  }
}

/* ==========================================================================
   Show More/Less Toggle - Reuses existing footer-menu styles
   ========================================================================== */

.footer-menu-item-hidden {
  display: none;
}

.footer-menu-item-hidden.show {
  display: block;
}

.footer-more-toggle {
  margin-top: clamp(8px, 0.8vw, 16px); /* Dynamic spacing */
}

.footer-toggle-link {
  color: #0066cc !important; /* Brand color, matches .view-all */
  font-weight: 600;
  font-size: clamp(13px, 0.95vw, 26px); /* Harmonized: matches .view-all scale */
  line-height: 1.5; /* Standardized small text line-height */
}

.footer-toggle-link:hover {
  color: #ffffff !important;
  padding-left: 0 !important; /* Override default footer-menu hover */
}

/* ==========================================================================
   Footer Flyout Menu (Client Success with Categories)
   ========================================================================== */

.footer-menu-flyout {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Submenu container (each category) */
.footer-submenu {
  position: relative;
  margin-bottom: clamp(4px, 0.4vw, 8px);
}

/* Category toggle link */
.footer-submenu-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: clamp(14px, 1vw, 28px); /* Harmonized: matches menu items */
  font-weight: 600;
  padding: clamp(6px, 0.5vw, 12px) 0;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1.6; /* Standardized body line-height */
}

/* Desktop: Category labels are hover triggers only, not clickable */
@media (min-width: 992px) {
  .footer-submenu-toggle {
    cursor: default;
  }
}

.footer-submenu-toggle:hover {
  color: #c9a227 !important;
}

/* Arrow indicator */
.footer-submenu-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #888;
  margin-left: 8px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.footer-submenu.open .footer-submenu-arrow,
.footer-submenu:hover .footer-submenu-arrow {
  border-top-color: #c9a227;
}

.footer-submenu.open .footer-submenu-arrow {
  transform: rotate(180deg);
}

/* Submenu items container */
.footer-submenu-items {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.footer-submenu.open .footer-submenu-items {
  max-height: 500px;
}

/* Desktop: Show on hover */
@media (min-width: 992px) {
  .footer-submenu:hover .footer-submenu-items {
    max-height: 500px;
  }
}

/* Case study items */
.footer-submenu-items li {
  margin-bottom: clamp(4px, 0.4vw, 8px);
  padding-left: clamp(14px, 1.2vw, 24px);
}

.footer-submenu-items li:last-child {
  margin-bottom: 0;
}

.footer-submenu-items a {
  color: #cccccc;
  text-decoration: none;
  font-size: clamp(13px, 0.95vw, 26px); /* Harmonized: slightly smaller than parent toggle */
  line-height: 1.5; /* Standardized small text line-height */
  transition: color 0.3s ease, padding-left 0.3s ease;
  display: inline-block;
}

.footer-submenu-items a:hover {
  color: #ffffff;
  padding-left: clamp(4px, 0.4vw, 8px);
}

/* Mobile adjustments for flyout footer menu */
@media (max-width: 767px) {
  /* Center the flyout menu container like other footer menus */
  .footer-menu-flyout {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-submenu {
    width: auto;
    text-align: center;
  }

  .footer-submenu-toggle {
    font-size: clamp(13px, 3.5vw, 15px);
    padding: 8px 0;
    justify-content: center;
    gap: 8px;
  }

  .footer-submenu-items {
    text-align: center;
  }

  .footer-submenu-items li {
    padding-left: 0;
  }

  .footer-submenu-items a {
    font-size: clamp(12px, 3.2vw, 14px);
  }
}
