/* Mobile Responsive Fixes for Graced Living & Events */

/* Fix header layout on mobile - prevent button overlap */
@media only screen and (max-width: 992px) {
  
  /* Fix logo text size on mobile - make it smaller to fit */
  #logo .logo-text {
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    display: block !important;
    max-width: 180px;
  }
  
  /* Adjust header flex layout for mobile */
  header .de-flex {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 15px !important;
    gap: 10px;
  }
  
  header .de-flex > .de-flex-col {
    display: flex !important;
    align-items: center !important;
  }
  
  /* Logo column - take up available space but not too much */
  header .de-flex > .de-flex-col:first-child {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 50%;
  }
  
  /* Button column - fixed width, always visible */
  header .de-flex > .de-flex-col:nth-child(3) {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex !important;
    gap: 8px;
    align-items: center;
  }
  
  /* Hide middle column (main menu) on mobile */
  header .de-flex > .de-flex-col:nth-child(2) {
    display: none !important;
  }
  
  /* Fix button positioning - remove absolute positioning */
  header .d-extra {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin: 0 !important;
  }
  
  /* Make button smaller on mobile */
  header .d-extra .btn-main {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
  }
  
  /* Menu button positioning */
  header .de-flex #menu-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin: 0 !important;
    width: 30px;
    height: 30px;
  }
  
  /* Fix logo height on mobile */
  header #logo {
    height: auto !important;
    display: block !important;
    padding: 5px 0 !important;
  }
  
  header #logo a {
    display: block !important;
    vertical-align: middle;
  }
  
  /* Ensure header has proper height */
  header.header-fullwidth {
    min-height: 60px !important;
  }
  
  /* Fix container padding */
  header .container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Extra small mobile devices */
@media only screen and (max-width: 576px) {
  
  /* Even smaller logo text on very small screens */
  #logo .logo-text {
    font-size: 0.85rem !important;
    max-width: 150px;
  }
  
  /* Smaller button on very small screens */
  header .d-extra .btn-main {
    padding: 5px 10px !important;
    font-size: 0.7rem !important;
  }
  
  /* Reduce header padding */
  header .de-flex {
    padding: 8px 10px !important;
    gap: 6px;
  }
  
  /* Smaller menu button */
  header .de-flex #menu-btn {
    width: 25px;
    height: 25px;
  }
}

/* Fix text overflow issues on landing pages */
@media only screen and (max-width: 992px) {
  
  /* Fix slider text on mobile */
  .slider-text h2 {
    font-size: 6vw !important;
    line-height: 1.3 !important;
    padding: 0 20px;
  }
  
  /* Fix section headings */
  h1 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
    word-wrap: break-word;
  }
  
  h2 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    word-wrap: break-word;
  }
  
  h3 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
    word-wrap: break-word;
  }
  
  /* Fix subheader text */
  #subheader h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
  }
  
  #subheader h4 {
    font-size: 1rem !important;
  }
  
  /* Fix property cards text overflow */
  .property-card h3,
  .de-room .d-text h3 {
    font-size: 1.3rem !important;
    line-height: 1.3 !important;
    word-wrap: break-word;
  }
  
  /* Fix event box text */
  .event-box h3 {
    font-size: 1.3rem !important;
    line-height: 1.3 !important;
  }
  
  /* Fix service box text */
  .service-box h4 {
    font-size: 1.2rem !important;
    line-height: 1.3 !important;
  }
  
  /* Ensure all text containers don't overflow */
  .container,
  .container-fluid {
    overflow-x: hidden;
  }
  
  /* Fix long words breaking layout */
  p, li, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* Fix very small mobile screens */
@media only screen and (max-width: 576px) {
  
  /* Smaller headings on tiny screens */
  h1 {
    font-size: 1.75rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  /* Smaller slider text */
  .slider-text h2 {
    font-size: 7vw !important;
  }
  
  /* Reduce padding on sections */
  section {
    padding: 40px 0 !important;
  }
  
  /* Smaller buttons */
  .btn-main,
  .btn-line {
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
  }
}

/* Fix desktop text that might be too large */
@media only screen and (min-width: 993px) {
  
  /* Ensure headings don't get too large on desktop */
  h1 {
    font-size: 2.5rem !important;
    line-height: 1.3 !important;
  }
  
  h2 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }
  
  /* Fix slider text on desktop - make it smaller and more readable */
  .slider-text h2 {
    font-size: 2.5rem !important;
    line-height: 1.3 !important;
    max-width: 800px;
    margin: 0 auto;
  }
  
  /* Fix section headings on homepage */
  section h1 {
    font-size: 2.5rem !important;
  }
  
  section h2 {
    font-size: 2rem !important;
  }
  
  /* Fix CTA section headings */
  .no-top.no-bottom h2 {
    font-size: 2rem !important;
  }
}

/* Medium desktop screens */
@media only screen and (min-width: 1200px) {
  .slider-text h2 {
    font-size: 3rem !important;
  }
  
  h1 {
    font-size: 2.8rem !important;
  }
  
  h2 {
    font-size: 2.3rem !important;
  }
}

/* Large desktop screens */
@media only screen and (min-width: 1600px) {
  .slider-text h2 {
    font-size: 3.5rem !important;
  }
  
  h1 {
    font-size: 3rem !important;
  }
  
  h2 {
    font-size: 2.5rem !important;
  }
}

/* Ensure container doesn't cause horizontal scroll */
body {
  overflow-x: hidden;
}

.container-fluid {
  padding-left: 15px;
  padding-right: 15px;
}

/* Fix any absolute positioned elements that might overflow */
@media only screen and (max-width: 992px) {
  .d-extra,
  #menu-btn {
    position: static !important;
  }
}

/* Additional mobile header fixes */
@media only screen and (max-width: 992px) {
  
  /* Force proper stacking */
  header {
    position: relative;
    z-index: 999;
  }
  
  /* Ensure logo doesn't get squished */
  #logo {
    overflow: visible !important;
  }
  
  /* Make sure button text doesn't wrap */
  .btn-main {
    white-space: nowrap !important;
  }
  
  /* Fix header background */
  header.transparent {
    background: rgba(255, 255, 255, 0.95) !important;
  }
  
  /* Ensure proper spacing */
  header .de-flex-col {
    max-height: none !important;
  }
}
