/* Mobile Layout Fixes for Is That My Man/Woman */

/* Footer Layout Fixes */

/* Fix footer text alignment and spacing */
footer {
  text-align: center !important;
}

footer .u-sheet-1 {
  text-align: center !important;
}

footer .u-text-1, footer .u-text-2 {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Keep "Use Is That My Man?" on one line */
footer .u-text-2 {
  white-space: nowrap !important;
}

/* Ensure footer link stays inline */
footer .u-btn-1 {
  display: inline !important;
  white-space: nowrap !important;
}

/* Fix any footer alignment issues on mobile */
@media (max-width: 767px) {
  footer .u-text-1 {
    width: auto !important;
    max-width: 100% !important;
  }
  
  footer .u-text-2 {
    width: auto !important;
    white-space: nowrap !important;
  }
}

.fm-site-title {
  /*background: linear-gradient(45deg, #EFC6908B, #E6BE8A);*/
  /*-webkit-background-clip: text;*/
  /*-webkit-text-fill-color: transparent;*/
  /*background-clip: text;*/
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* Header Layout and Alignment Fixes */

/* Center section-1 on the page */
.u-section-1 {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Fix header title alignment - center the titles properly */
header {
  text-align: center !important;
}

header > div {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 20px !important;
}

header h2, header h3 {
  text-align: center !important;
  margin: 0 !important;
}

/* Stack layout for screens smaller than 667px */
@media (max-width: 667px) {
  header > div {
    flex-direction: column !important;
    gap: 15px !important;
    padding: 15px 10px !important;
  }
  
  /* Make header logo smaller on mobile */
  header img {
    /*width: 120px !important;*/
    /*height: 120px !important;*/
    order: 2 !important; /* Move image below text */
  }
  
  /* Ensure text container comes first */
  header > div > div:first-child {
    order: 1 !important;
  }
  
  /* Add spacing between h2 and h3 */
  header h2 {
    margin-bottom: 8px !important;
  }
  
  header h3 {
    margin-bottom: 15px !important;
  }
}

/* For very small screens - larger icon when stacked */
@media (max-width: 575px) {
  /* Larger icon when stacked since we have more room */
  header img {
    width: 140px !important;
    height: 140px !important;
  }
  
  /* Better spacing for stacked layout */
  header > div {
    padding: 20px 15px !important;
  }
  
  /* More spacing between titles */
  header h2 {
    margin-bottom: 10px !important;
  }
  
  header h3 {
    margin-bottom: 20px !important;
  }
  
  /* Reduce large gaps around hero image */
  .u-section-1 {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    min-height: auto !important;
  }
  
  .u-section-1 .u-layout-wrap-1 {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  .u-section-1 .u-layout-cell-1 {
    min-height: auto !important;
    padding-bottom: 10px !important;
  }
  
  .u-section-1 .u-layout-cell-2 {
    min-height: auto !important;
    padding-top: 10px !important;
  }
  
  /* Center the layout content horizontally */
  .u-section-1 .u-layout {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
  }
  
  .u-section-1 .u-layout-row {
    justify-content: center !important;
    align-items: center !important;
  }
  
  /* Reduce gap spacing between subscribe button and hero image */
  .u-section-1 .u-container-layout-2 {
    padding-top: 5px !important;
  }
  
  .u-section-1 .u-image-1 {
    margin-top: 5px !important;
  }
  
  /* Also fix spacing for the second section image */
  .u-section-1 .u-image-1-1 {
    margin-top: 5px !important;
  }
  
  /* Reduce overall section padding to tighten layout */
  .u-section-1 {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
  
  /* Reduce button margin to close gap with image */
  .u-section-1 .u-btn-1 {
    margin-bottom: 15px !important;
  }
}

/* Fix for the overlapping button and text on mobile devices */
@media (max-width: 575px) {
  /* Force vertical stacking on mobile */
  .u-section-1 .u-layout-row {
    flex-direction: column !important;
  }
  
  /* Section 1 - Hero Section Mobile Layout Fix */
  .u-section-1 .u-text-4 {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  .u-section-1 .u-btn-1 {
    margin-top: 25px !important;
    margin-bottom: 20px !important;
    position: relative !important;
    z-index: 2 !important;
    clear: both !important;
  }
  
  /* Fix for second section with reversed layout */
  .u-section-1 .u-layout-cell-1:nth-child(2) .u-text-4,
  .u-section-1 .u-layout-row:nth-of-type(2) .u-text-4 {
    margin-top: 20px !important;
  }
  
  .u-section-1 .u-layout-cell-1:nth-child(2) .u-btn-1,
  .u-section-1 .u-layout-row:nth-of-type(2) .u-btn-1 {
    margin-top: 25px !important;
  }
  
  .u-section-1 .u-text-5 {
    margin-top: 40px !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  .u-section-1 .u-text-6 {
    margin-top: 20px !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Ensure proper stacking order */
  .u-section-1 .u-container-layout-1 {
    position: relative !important;
    z-index: 1 !important;
  }
  
  .u-section-1 .u-container-layout-2 {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 30px !important;
  }
  
  /* Fix image positioning */
  .u-section-1 .u-image-1,
  .u-section-1 .u-image-1-1 {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
  }
  
  /* Layout cell improvements */
  .u-section-1 .u-layout-cell-1 {
    min-height: auto !important;
    margin-bottom: 20px !important;
  }
  
  .u-section-1 .u-layout-cell-2 {
    min-height: auto !important;
    margin-top: 20px !important;
  }
  
  /* Additional spacing for content flow */
  .u-section-1 .u-text-1 {
    margin-bottom: 15px !important;
  }
  
  .u-section-1 .u-text-2 {
    margin-bottom: 15px !important;
  }
  
  .u-section-1 .u-text-3 {
    margin-bottom: 15px !important;
  }
}

/* 
 * Subscribe Button Position Fix for Section 4
 * 
 * Issue: The subscribe button after "Your information is private" text
 * centers itself across the full section width instead of aligning 
 * with the text content area.
 * 
 * Root cause: Text has 12px left/right margins, but button uses 
 * full-width centering with margin: auto
 */

/* Target the specific button that follows the privacy text */
@media (min-width: 768px) {
  .u-section-4 .u-text-8 + .u-btn-1 {
    /* Align button to the right edge of text content */
    margin-left: auto !important;
    margin-right: 12px !important;
    /* Preserve existing vertical spacing */
    margin-top: 27px !important;
    margin-bottom: 48px !important;
  }
}

/* For the specific breakpoint where layout changes occur */
@media (min-width: 992px) {
  .u-section-4 .u-text-8 + .u-btn-1 {
    /* Account for the layout adjustment at 991px breakpoint */
    margin-left: auto !important;
    margin-right: 12px !important;
  }
}

/* Ensure consistent behavior across all desktop screens */
@media (min-width: 1200px) {
  .u-section-4 .u-text-8 + .u-btn-1 {
    /* Maintain the right alignment on extra large screens */
    margin-left: auto !important;
    margin-right: 12px !important;
  }
}

/* Increase section height to prevent cutoff on wide screens */
.u-section-4 .u-sheet-1 {
  min-height: 1280px !important;
}

/* Add specific min-height for responsive breakpoints that were missing them */
@media (max-width: 1199px) {
  .u-section-4 .u-sheet-1 {
    min-height: 1200px !important;
  }
}

@media (max-width: 991px) {
  .u-section-4 .u-sheet-1 {
    min-height: 1200px !important;
  }
}

@media (max-width: 767px) {
  .u-section-4 .u-sheet-1 {
    min-height: 1200px !important;
  }
}

@media (max-width: 575px) {
  .u-section-4 .u-sheet-1 {
    min-height: 1200px !important;
  }
}

/* Adjust height for different breakpoints */
@media (min-width: 1200px) {
  .u-section-4 .u-sheet-1 {
    min-height: 1300px !important;
  }
}

@media (min-width: 1400px) {
  .u-section-4 .u-sheet-1 {
    min-height: 1400px !important;
  }
}

/* Fallback: Ensure button never exceeds text content width */
.u-section-4 .u-btn-1 {
  max-width: calc(100% - 24px);
}

/* Additional mobile optimizations for iPhone SE and similar small screens */
@media (max-width: 480px) {
  /* Even smaller screens - ensure no overlap */
  .u-section-1 .u-text-4 {
    margin-top: 25px !important;
    margin-bottom: 25px !important;
    padding: 10px !important;
  }
  
  .u-section-1 .u-btn-1 {
    margin-top: 30px !important;
    margin-bottom: 25px !important;
    padding: 18px 45px !important;
  }
  
  .u-section-1 .u-text-5 {
    margin-top: 45px !important;
  }
  
  .u-section-1 .u-container-layout-2 {
    margin-top: 40px !important;
  }
}

/* Specific fixes for iPhone SE (375px width) */
@media (max-width: 375px) {
  /* Ensure images don't overflow on small screens */
  .u-section-1 .u-image-1,
  .u-section-1 .u-image-1-1 {
    width: 240px !important;
    height: 240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  /* Adjust text widths to prevent overflow */
  .u-section-1 .u-text-3,
  .u-section-1 .u-text-4 {
    width: 100% !important;
    max-width: 320px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  /* Ensure button stays within bounds */
  .u-section-1 .u-btn-1 {
    max-width: 280px !important;
    width: auto !important;
    padding: 18px 40px !important;
  }
  
  /* Adjust container padding */
  .u-section-1 .u-container-layout-1,
  .u-section-1 .u-container-layout-2 {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Ensure text is readable and properly spaced */
@media (max-width: 575px) {
  /* Fix layout wrapper width on mobile */
  .u-section-1 .u-layout-wrap-1 {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  /* Ensure layout row doesn't exceed viewport */
  .u-section-1 .u-layout-row {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .u-section-1 .u-text-variant {
    line-height: 1.5 !important;
    margin-bottom: 15px !important;
  }
  
  .u-section-1 h2 {
    margin-bottom: 15px !important;
  }
  
  .u-section-1 h3 {
    margin-bottom: 20px !important;
  }
}
