/* ––––––––––––––––––––––––––––––––––––––––––––– */
/* Mobile Footer Optimization Styles */
/* ––––––––––––––––––––––––––––––––––––––––––––– */

/* Mobile-First Footer Layout */
@media (max-width: 767px) {
  /* Footer container mobile optimization */
  footer > div > div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    /* padding-top handled in responsive sections below */
  }
  
  /* Newsletter section mobile styling */
  footer h2 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
  }
  
  /* Newsletter form - simple desktop-like style adapted for dark footer */
  .gform_wrapper.mora_subscribe_wrapper {
    margin-top: 2rem !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Fields container - with border */
  .gform_wrapper.mora_subscribe_wrapper .gform_body {
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-top-left-radius: 0.25rem !important;
    border-top-right-radius: 0.25rem !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gfield {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: none !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gfield:last-child {
    border-bottom: none !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gfield_label {
    color: white !important;
    font-size: 0.75rem !important;
    padding: 0.5rem 1rem 0 !important;
    margin: 0 !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gfield_required {
    color: #ff6b6b !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .ginput_container {
    padding: 0 1rem 0.5rem !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
  }

  .gform_wrapper.mora_subscribe_wrapper input[type="text"],
  .gform_wrapper.mora_subscribe_wrapper input[type="email"] {
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    height: 2rem !important;
    line-height: 2rem !important;
    font-size: 1rem !important;
    background: transparent !important;
    color: white !important;
    box-shadow: none !important;
    outline: none !important;
  }

  .gform_wrapper.mora_subscribe_wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
  }

  .gform_wrapper.mora_subscribe_wrapper input:focus {
    outline: none !important;
    box-shadow: none !important;
  }

  /* Footer outside the bordered area */
  .gform_wrapper.mora_subscribe_wrapper .gform_footer {
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    border: none !important;
  }

  /* Use more specific selectors to override Gravity Forms styles */
  footer .gform_wrapper.mora_subscribe_wrapper .gform_button,
  footer .gform_wrapper.mora_subscribe_wrapper button[type="submit"],
  footer .gform_wrapper.mora_subscribe_wrapper input[type="submit"],
  footer #gform_submit_button_5 {
    width: 100% !important;
    height: 50px !important;
    font-size: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #6494CE !important;
    background-color: #6494CE !important;
    color: white !important;
    border: none !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  footer .gform_wrapper.mora_subscribe_wrapper .gform_button:hover,
  footer .gform_wrapper.mora_subscribe_wrapper button[type="submit"]:hover,
  footer .gform_wrapper.mora_subscribe_wrapper input[type="submit"]:hover,
  footer #gform_submit_button_5:hover {
    background: #5a84b8 !important;
    background-color: #5a84b8 !important;
  }

  footer .gform_wrapper.mora_subscribe_wrapper .gform_button:active,
  footer .gform_wrapper.mora_subscribe_wrapper button[type="submit"]:active,
  footer .gform_wrapper.mora_subscribe_wrapper input[type="submit"]:active,
  footer #gform_submit_button_5:active {
    background: #4f749e !important;
    background-color: #4f749e !important;
  }
}

/* Mobile Navigation Sections */
@media (max-width: 767px) {
  /* Navigation section styling - only for sections with sub-links */
  footer .space-y-8 > div:has(ul),
  footer .space-y-8 > div:has(.space-y-3) {
    padding: 1.5rem 1rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
  }

  /* Sections without sub-links - simple text styling */
  footer .space-y-8 > div:not(:has(ul)):not(:has(.space-y-3)) {
    padding: 0;
    background: none;
    border: none;
    margin-bottom: 2rem;
    text-align: center;
  }

  /* Headings for sections without sub-links */
  footer .space-y-8 > div:not(:has(ul)):not(:has(.space-y-3)) h3 {
    font-size: 1.125rem !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    color: #ffffff !important;
  }
  
  /* Navigation headings - only for sections with sub-links */
  footer .space-y-8 > div:has(ul) h3,
  footer .space-y-8 > div:has(.space-y-3) h3 {
    font-size: 1.125rem !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
  }
  
  /* Navigation links */
  footer .space-y-3 li a,
  footer .space-y-3 li span {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    display: block !important;
    padding: 0.75rem 1rem !important;
    margin: -0.75rem -1rem !important;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    text-align: center !important;
    color: #EAF3FF !important;
  }
  

  
  /* Consistent vertical spacing */
  footer .space-y-12 > * + * {
    margin-top: 3rem !important;
  }
  
  footer .space-y-8 > * + * {
    margin-top: 2rem !important;
  }
}

/* Mobile Social Media Section */
@media (max-width: 767px) {
  .footer-social-icons {
    padding: 2rem 1rem !important;
    margin-top: 3rem !important;
  }
  
  .footer-social-icons a {
    min-height: 48px !important;
    min-width: 48px !important;
    width: 48px !important;
    height: 48px !important;
  }
  
  .footer-social-icons img {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Mobile Copyright Section */
@media (max-width: 767px) {
  footer .border-t {
    margin-top: 3rem !important;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  footer .border-t p {
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    padding: 0 1rem;
  }
}

/* Mobile Back-to-Top Button */
@media (max-width: 767px) {
  .back-to-top-button {
    bottom: 15px !important;
  }
  
  .back-to-top-button a {
    width: 48px !important;
    height: 48px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
  }
  
  .back-to-top-button a:hover,
  .back-to-top-button a:focus {
    background-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  }
  
  .back-to-top-button img {
    width: 24px !important;
    height: 24px !important;
  }
}

/* Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
  footer .md\:grid-cols-2 > div {
    padding: 1rem;
  }
  
  footer .space-y-3 li a {
    padding: 0.5rem 0.75rem !important;
    margin: -0.5rem -0.75rem !important;
    text-align: left !important;
  }
  
  footer h2 {
    font-size: 2rem !important;
    text-align: center !important;
  }
  
  footer h3 {
    font-size: 1rem !important;
    text-align: left !important;
  }
  
  .footer-social-icons a {
    width: 40px !important;
    height: 40px !important;
  }
  
  .footer-social-icons img {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Enhanced Social Media Styling */
.footer-social-icons {
  padding: 1rem 0;
}

.footer-social-icons a {
  position: relative;
  transition: all 0.3s ease;
  transform-origin: center;
}

.footer-social-icons a:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(100, 148, 206, 0.3);
}

.footer-social-icons a:focus {
  outline: 2px solid #6494CE;
  outline-offset: 2px;
}

/* Accessibility improvements */
@media (max-width: 767px) {
  footer a:focus {
    outline: 2px solid #6494CE;
    outline-offset: 2px;
    border-radius: 0.25rem;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Ensure proper body layout */
body {
  position: static !important;
  height: auto !important;
  min-height: 100vh !important;
}

/* ––––––––––––––––––––––––––––––––––––––––––––– */
/* Teardrop SVG Positioning Fix */
/* ––––––––––––––––––––––––––––––––––––––––––––– */

/* Ensure teardrop SVG doesn't overlap content */
footer .relative {
  position: relative;
}

/* Mobile teardrop adjustments */
@media (max-width: 767px) {
  footer .absolute.top-0 svg {
    width: 20rem !important;
    height: 2.5rem !important;
  }

  footer .absolute.top-0 {
    top: 0 !important;
    margin-top: -3px !important;
  }

  /* Ensure content starts below the teardrop - 120px SVG height + 3rem spacing */
  footer .px-4 {
    padding-top: 11rem !important; /* 176px - enough for 120px teardrop + 3rem spacing */
  }
}

/* Tablet teardrop adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  footer .absolute.top-0 svg {
    width: 25rem !important;
    height: 2.75rem !important;
  }

  footer .px-4 {
    padding-top: 8rem !important; /* 128px - adjusted for tablet teardrop */
  }

  /* Tablet newsletter form adjustments */
  .gform_wrapper.mora_subscribe_wrapper .gform_button {
    min-width: 220px !important;
    height: 56px !important;
    font-size: 15px !important;
  }
}

/* Desktop - maintain original spacing */
@media (min-width: 1024px) {
  footer .px-4 {
    padding-top: 8rem !important; /* 128px - enough for desktop teardrop + spacing */
  }

  /* Desktop newsletter form adjustments */
  .gform_wrapper.mora_subscribe_wrapper .gform_button {
    min-width: 240px !important;
    height: 52px !important;
    font-size: 14px !important;
  }

  .gform_wrapper.mora_subscribe_wrapper .gform_footer {
    margin-top: 1.5rem !important; /* Less spacing on desktop */
  }
}

@media (max-width: 768px) {
  .gform_wrapper.mora_subscribe_wrapper .gfield_label {
    margin-left: 0 !important;
  }
}