.ka-footer {
  background-color: #0c1424;
  color: #e5e7eb;
  font-family: var(--font-body, 'Inter', sans-serif);
  margin: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Container - adjusted to 85% width as requested */
.ka-footer-container {
  width: 85%; /* Changed from 92% to 85% as requested */
  max-width: 1600px; /* Increased slightly to accommodate the more spaced out columns */
  margin: 0 auto;
  padding: 0;
}

/* Main Footer Section with appropriate spacing */
.ka-footer-main {
  padding: 70px 0 50px;
}

/* Modern Grid Layout with increased spacing between columns */
.ka-footer-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 60px; /* Increased from 40px to 60px for better spacing between columns */
}

/* Brand Column - spans 3 grid columns for better proportions */
.ka-footer-brand {
  grid-column: span 3;
}

/* Content Columns - adjusted to span 3 columns each for better balance */
.ka-footer-column {
  grid-column: span 3;
}

@media (max-width: 1199px) {
  .ka-footer-grid {
    gap: 40px; /* Slightly reduced gap on smaller screens */
  }
}

@media (max-width: 991px) {
  .ka-footer-brand {
    grid-column: 1 / -1;
  }

  .ka-footer-column {
    grid-column: span 4;
  }
}

@media (max-width: 767px) {
  .ka-footer-column {
    grid-column: 1 / -1;
  }

  .ka-footer-grid {
    gap: 35px;
  }

  .ka-footer-container {
    width: 90%; /* Slightly wider on mobile for more readable text */
  }
}

/* Fixed logo styling */
.ka-footer-logo {
  max-width: 180px;
  height: auto;
  display: block;
  margin-bottom: 24px; /* Increased spacing below logo */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Brand description with appropriate styling */
.ka-brand-description {
  color: #d1d5db;
  font-size: 14px;
  line-height: 1.6;
  max-width: 360px;
  margin: 16px 0 0;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* Column headings with improved spacing */
.ka-footer-heading {
  color: #ffffff;
  font-family: var(--font-heading, 'Interstate', sans-serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 24px; /* Increased bottom margin for better spacing */
  padding-bottom: 12px; /* Slightly increased padding */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.3px;
  position: relative;
}

/* Decorative element for headings */
.ka-footer-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 40px;
  height: 3px;
  background-color: #8a181a;
}

/* Links container with improved spacing */
.ka-footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Increased from 10px for better spacing between links */
}

/* Support for dynamically rendered content from CMS */
.ka-footer-links a,
.ka-footer-links p,
.ka-footer-links div,
.ka-footer-links span {
  color: #d1d5db;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 3px 0;
}

.ka-footer-links a {
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  display: inline-block;
  position: relative;
}

.ka-footer-links a:hover,
.ka-footer-links a:focus {
  color: #ffffff;
  padding-left: 5px;
}

/* Remove default styling from lists */
.ka-footer-links ul,
.ka-footer-links ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ka-footer-links li {
  margin: 0;
  padding: 0;
}

/* Contact styling for address column with better spacing */
.ka-footer-contact {
  color: #d1d5db;
  font-size: 14px;
  line-height: 1.6;
}

.ka-footer-contact p {
  margin: 0 0 10px; /* Increased from 8px for better spacing */
}

.ka-footer-contact p:last-child {
  margin-bottom: 0;
}

/* TOP button positioned between main footer and bottom bar */
.ka-top-button-container {
  position: relative;
  text-align: center;
  height: 0;
}

.ka-btn-back-to-top {
  position: absolute;
  left: 50%;
  top: -20px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #8a181a;
  color: #cfcece;
  border: none;
  border-radius: 2px;
  min-width: 80px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-heading, 'Interstate', sans-serif);
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.ka-btn-back-to-top:hover,
.ka-btn-back-to-top:focus {
  background-color: #8a181a;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.ka-btn-back-to-top:active {
  transform: translateX(-50%) translateY(0);
}

/* Footer Bottom Bar with improved spacing */
.ka-footer-bottom {
  background-color: #070d18;
  padding: 22px 0; /* Increased from 20px for better vertical spacing */
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ka-footer-bottom-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

/* Copyright text */
.ka-footer-copyright {
  color: #9ca3af;
  font-size: 13px;
  letter-spacing: 0.2px;
}

/* Bottom right section containing privacy and social links */
.ka-footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 40px; /* Increased from 30px for better spacing */
  flex-wrap: wrap;
}

/* Privacy Policy Link */
.ka-privacy-link {
  color: #9ca3af;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.ka-privacy-link:hover,
.ka-privacy-link:focus {
  color: #ffffff;
  text-decoration: underline;
}

/* Social Media Section with improved spacing */
.ka-social-media {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ka-social-label {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.ka-social-icons {
  display: flex;
  gap: 14px; /* Increased from 12px for better spacing between icons */
  align-items: center;
}

.ka-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transition: all 0.2s ease-in-out;
}

.ka-social-icon:hover,
.ka-social-icon:focus {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: #ffffff;
}

.ka-social-icon svg {
  width: 16px;
  height: 16px;
}

/* Support for CMS-rendered content - ensure proper styling regardless of HTML structure */
.ka-footer [class*='tinyMce'],
.ka-footer [class*='editor'],
.ka-footer [class*='rich-text'] {
  margin: 0;
  padding: 0;
}

/* Support for XhtmlString rendering from Optimizely with better spacing */
.ka-footer-links > div > p {
  margin: 0 0 10px 0; /* Increased from 8px for better spacing */
}

.ka-footer-links > div > p:last-child {
  margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .ka-footer-main {
    padding: 50px 0 40px;
  }

  .ka-footer-bottom-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
  }

  .ka-footer-bottom-right {
    flex-direction: column;
    gap: 20px;
  }

  .ka-social-media {
    flex-direction: column;
    gap: 10px;
  }

  .ka-footer-brand,
  .ka-footer-column {
    text-align: center;
  }

  .ka-brand-description,
  .ka-footer-logo {
    margin-left: auto;
    margin-right: auto;
  }

  .ka-footer-heading::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .ka-footer-bottom-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
  }
}

/* High contrast mode and accessibility support */
@media (prefers-contrast: more) {
  .ka-footer {
    border-top: 2px solid #ffffff;
  }

  .ka-footer-links a,
  .ka-footer-links p,
  .ka-footer-links div,
  .ka-footer-links span,
  .ka-brand-description,
  .ka-footer-contact p {
    color: #ffffff;
  }

  .ka-footer-bottom {
    border-top: 2px solid #ffffff;
  }

  .ka-footer-copyright,
  .ka-privacy-link {
    color: #ffffff;
  }
}

/* Focus visibility for keyboard navigation */
.ka-footer a:focus-visible,
.ka-btn-back-to-top:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
