/* ================================
   MOBILE PHONE NAV MENU FIX
   ================================ */
@media screen and (max-width: 479px) {
  .w-nav-menu {
    float: none !important;
    margin: 0 14px 0 auto !important;
    left: auto !important;
    right: 0 !important;
    width: 200px !important;
    position: relative !important;
    text-align: center !important;
    top: 0 !important;
    transform: none !important;
    min-width: 0 !important;
    max-width: calc(100vw - 28px) !important;
    box-sizing: border-box !important;
  }

  .w-nav[data-collapse='tiny'] .w-nav-menu {
    display: block !important;
  }
}
/* ================================
   MOBILE OPTIMIZATION CSS
   Enhanced responsive design for:
   - Tablet Portrait/Landscape (768px - 1024px)
   - Mobile Phone (< 480px)
   ================================ */

/* ================================
   TABLET LANDSCAPE (768px - 991px)
   ================================ */
@media screen and (min-width: 768px) and (max-width: 991px) {
  /* Typography - Better readability on tablets */
  h1 {
    font-size: 24px;
    letter-spacing: 3px;
    line-height: 32px;
  }

  h2 {
    font-size: 26px;
    line-height: 32px;
  }

  h3 {
    font-size: 20px;
    line-height: 28px;
  }

  p {
    font-size: 14px;
    line-height: 24px;
  }

  /* Navigation */
  .hamburger {
    min-width: 44px;
    min-height: 44px;
  }

  /* Ensure all nav links stay aligned and don't drop when active */
  .navigation-link,
  .navigation-link.w--current,
  .w-nav-link,
  .w-nav-link.w--current {
    display: inline-block !important;
    vertical-align: middle !important;
    padding-top: 20px !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    line-height: 26px !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  /* Banner */
  .banner {
    min-height: 450px;
  }

  .banner.inner-banner {
    min-height: 350px;
  }

  /* Buttons - Larger touch targets */
  .button {
    padding: 14px 20px;
    min-height: 44px;
  }

  /* Forms */
  .text-field,
  .text-area {
    min-height: 44px;
  }

  /* Grid */
  .item {
    width: 50% !important;
  }

  /* Lines */
  .line.in-left {
    margin-left: auto;
    margin-right: auto;
  }

  .line-slider {
    margin: 0 auto;
  }
}

/* ================================
   TABLET PORTRAIT (481px - 767px)
   ================================ */
@media screen and (min-width: 481px) and (max-width: 767px) {
  /* Typography adjustments */
  h1 {
    font-size: 20px;
    line-height: 28px;
    letter-spacing: 2px;
  }

  h2 {
    font-size: 22px;
    line-height: 28px;
  }

  h3 {
    font-size: 18px;
    line-height: 24px;
  }

  p {
    font-size: 13px;
    line-height: 22px;
  }

  /* Navigation */
  .hamburger {
    min-width: 40px;
    min-height: 40px;
  }

  /* Banner */
  .banner {
    min-height: 400px;
  }

  .banner.inner-banner {
    min-height: 300px;
  }

  /* Buttons */
  .button {
    padding: 12px 18px;
    min-height: 40px;
  }

  .button.button-form {
    width: 100%;
  }

  /* Sections */
  .section {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  /* Forms */
  .text-field,
  .text-area {
    min-height: 40px;
  }

  /* Grid */
  .item {
    width: 100% !important;
  }

  .logo-client {
    width: 50%;
  }

  /* Lines */
  .line.in-left {
    margin-left: auto;
    margin-right: auto;
  }

  .line-slider {
    margin: 0 auto;
  }

  /* Center heading on tablet portrait */
  .heading-2 {
    text-align: center;
  }
}

/* ================================
   MOBILE PHONE (< 480px)
   ================================ */
@media screen and (max-width: 479px) {
  /* Typography - Mobile optimized */
  h1 {
    font-size: 18px;
    letter-spacing: 1px;
    line-height: 26px;
    margin-bottom: 12px;
  }

  h2 {
    font-size: 18px;
    line-height: 24px;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 16px;
    line-height: 22px;
  }

  h4 {
    font-size: 11px;
    letter-spacing: 2px;
    line-height: 18px;
  }

  p {
    font-size: 12px;
    line-height: 20px;
  }

  /* Navigation - Light touch-friendly adjustments only */
  .hamburger {
    min-width: 44px;
    min-height: 44px;
  }

  /* Banner - Reasonable height, keep padding from original CSS */
  .banner {
    min-height: 380px;
  }

  /* Buttons - Touch targets */
  .button {
    min-height: 44px;
    padding: 12px 15px;
  }

  .button.button-form {
    width: 100%;
  }

  /* Sections - Reduce top/bottom padding */
  .section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .section.gray {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  /* Forms - Touch targets */
  .text-field,
  .text-area {
    min-height: 44px;
    padding: 10px 12px;
    width: 100% !important;
  }

  .text-area {
    min-height: 100px;
  }

  /* Items stack on mobile */
  .item {
    width: 100% !important;
  }

  .logo-client {
    width: 100%;
  }

  /* Map sizing */
  .w-widget-map {
    height: 250px;
  }

  .contact-left,
  .contact-left.left-2 {
    width: 100% !important;
  }

  /* Lines - Center them properly */
  .line.in-left {
    margin-left: auto;
    margin-right: auto;
  }

  .line-slider {
    width: 30px;
    margin: 0 auto 0 72px;
  }

  /* Footer */
  .footer {
    padding: 25px 15px;
  }

  /* Slider */
  .big-slider {
    height: 280px;
  }

  .slider-big-text {
    font-size: 16px;
    line-height: 26px;
  }

  .heading-inner {
    font-size: 18px;
    line-height: 26px;
  }

  .sub-inner {
    font-size: 12px;
    line-height: 20px;
  }
  
  /* Slider dots - move below CTA on phone */
.dots-nav {
  top: auto !important;
  bottom: -68px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
}

/* ================================
   DESKTOP (992px+)
   ================================ */
@media screen and (min-width: 992px) {
  /* Center divider line on desktop */
  .line-slider {
    margin: 0 auto;
  }
}

/* ================================
   UNIVERSAL TOUCH-FRIENDLY IMPROVEMENTS
   ================================ */

/* Ensure all interactive elements have minimum 44x44px tap target */
@media (hover: none) and (pointer: coarse) {
  a,
  button,
  input[type="button"],
  input[type="submit"],
  .button,
  .w-nav-button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 15px;
  }

  /* Improve touch spacing */
  .navigation-link {
    min-height: 44px;
    padding: 12px 10px;
  }

  .text-field,
  .text-area {
    min-height: 44px;
    padding: 12px 15px;
  }
}

/* ================================
   ACCESSIBILITY IMPROVEMENTS
   ================================ */

/* Improve focus states for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  a,
  button,
  .button,
  .navigation-link,
  .w-nav-button {
    transition: background-color 0.3s ease, color 0.3s ease;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* These would apply if dark mode support is needed */
  body {
    /* background-color: #1a1a1a;
    color: #e0e0e0; */
  }
}

/* Landscape mode optimizations */
@media (orientation: landscape) and (max-height: 500px) {
  .banner,
  .banner.inner-banner {
    height: auto;
    min-height: 250px;
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .navigation {
    padding: 8px 15px;
  }

  .slider-big-text,
  .heading-inner {
    font-size: 16px;
  }

  .button {
    padding: 8px 12px;
    font-size: 10px;
  }
}

/* ================================
   PHONE NAV HAMBURGER POSITION FIX
   ================================ */
@media screen and (max-width: 479px) {
  .hamburger.w-nav-button,
  .hamburger {
    margin-top: 0px !important;
    top: 0px !important;
    position: relative !important;
  }
}
/* Nudge divider line slightly right on phone */
@media screen and (max-width: 479px) {
  .line.in-left {
    margin-left: 110px !important;
  }
}
/* Nudge button slightly right on phone */
@media screen and (max-width: 479px) {
  .column-space .div-space {
    margin-left: 0px !important;
  }
}
/* ================================
   PHONE - SITEWIDE ALIGNMENT CLEANUP
   ================================ */
@media screen and (max-width: 479px) {
  /* Kill template's random left-push behavior */
  .line.in-left {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .button.about,
  .button.projects {
    margin-left: auto !important;
    margin-right: auto !important;
    display: inline-block !important;
  }

  .paragraph,
  .paragraph-2,
  .paragraph-3,
  .heading-2,
  .text-block,
  .text-block-2,
  .sub-title {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
  }

  .column-space,
  .column-center,
  .title-wrapper,
  .icon-wrapper,
  .div-center,
  .container-3,
  .container-4,
  .container-5 {
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  /* Images that were shoved sideways on mobile */
  .image,
  .image-2,
  .image-3,
  .image-4,
  .image-5,
  .image-6,
  .image-7,
  .image-8,
  .image-9,
  .image-10,
  .image-11,
  .image-12,
  .image-13,
  .image-14,
  .image-15,
  .image-20,
  .image-21,
  .image-23,
  .image-24 {
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
  }

  /* Keep button wrappers centered too */
  .div-space,
  .div-space.more-space,
  .div-space.center-space {
    text-align: center !important;
  }
}
/* ================================
   TABLET PORTRAIT - STACK OPEN NAV LINKS
   ================================ */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .w-nav-menu[data-nav-menu-open] .navigation-link,
  .w-nav-menu[data-nav-menu-open] .navigation-link.w--current,
  .w-nav-menu[data-nav-menu-open] .w-nav-link,
  .w-nav-menu[data-nav-menu-open] .w-nav-link.w--current {
    display: block !important;
    width: 100% !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 24px !important;
  }

  .w-nav-menu[data-nav-menu-open] {
    text-align: center !important;
  }
}
/* ================================
   IPAD PORTRAIT / TABLET ALIGNMENT CLEANUP
   ================================ */
@media screen and (min-width: 768px) and (max-width: 991px) {
  /* Reset the template's hard left/right shoves */
  .button,
  .button.about,
  .button.projects {
    margin-left: auto !important;
    margin-right: auto !important;
    display: inline-block !important;
  }

  .line.in-left {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  .column-space {
    padding-left: 20px !important;
    padding-right: 20px !important;
    margin-top: 40px !important;
    text-align: center !important;
  }

  .heading-2,
  .paragraph,
  .paragraph-2,
  .paragraph-3,
  .text-block,
  .text-block-2,
  .sub-title {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
  }

  .text-block,
  .text-block-2 {
    display: block !important;
  }

  .image,
  .image-17,
  .image-24 {
    width: 100% !important;
    max-width: 500px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }

  .container-3,
  .container-4,
  .container-5,
  .title-wrapper,
  .icon-wrapper,
  .div-center {
    padding-left: 20px !important;
    padding-right: 20px !important;
    text-align: center !important;
  }
}
/* ================================
   TABLET + PHONE - HORIZONTAL OVERFLOW FIX
   ================================ */
@media screen and (max-width: 991px) {
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  .navigation,
  .banner,
  .big-slider,
  .slide,
  .slide-wrapper,
  .section,
  .w-container,
  .w-row,
  .w-col,
  .container-2,
  .container-3,
  .container-4,
  .container-5 {
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  /* Reset common exported overflow offenders */
  .image-17,
  .image-18,
  .image-24,
  .button,
  .button.about,
  .button.projects,
  .line.in-left,
  .text-block,
  .text-block-2,
  .paragraph-2,
  .heading-2 {
    max-width: 100% !important;
  }

  .image-17,
  .image-18,
  .image-24 {
    margin-left: 0 !important;
    margin-right: auto !important;
  }
}
@media screen and (max-width: 991px) {
  .w-nav-menu {
    max-width: calc(100vw - 28px) !important;
    box-sizing: border-box !important;
  }
}
/* ================================
   PHONE - VISUALLY LIFT HAMBURGER
   WITHOUT CLIPPING
   ================================ */
@media screen and (max-width: 479px) {
  .hamburger.w-nav-button,
  .hamburger {
    top: 0 !important;
    margin-top: -30px !important;
    transform: translateY(-8px) !important;
  }
}
/* ================================
   IPAD LANDSCAPE - HOMEPAGE NAV LOGO OVERFLOW FIX
   ================================ */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .image-18 {
    max-width: 100% !important;
    width: 260px !important;
    height: auto !important;
    margin-top: -10px !important;
    margin-bottom: -20px !important;
    margin-left: 0 !important;
  }
}
@media screen and (max-width: 991px) {
  html,
  body {
    overflow-x: hidden !important;
  }
}
/* ================================
   IPAD LANDSCAPE - KEEP DESKTOP NAV LINKS ALIGNED
   ================================ */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .nav-menu {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0 !important;
  }

  .navigation-link,
  .navigation-link.w--current,
  .w-nav-link,
  .w-nav-link.w--current {
    display: flex !important;
    align-items: center !important;
    height: 46px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    line-height: 26px !important;
    box-sizing: border-box !important;
  }
}
/* ================================
   PHONE - FIX CURRENT NAV LINK ALIGNMENT
   ================================ */
@media screen and (max-width: 479px) {
  .w-nav-menu .w-nav-link,
  .w-nav-menu .navigation-link,
  .w-nav-menu .w-nav-link.w--current,
  .w-nav-menu .navigation-link.w--current {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}