/* Mobile layout fixes for Duda desktop HTML.
   The desktop CSS already toggles header visibility via .showOnLarge / .showOnMedium
   based on the .responsiveTablet body class — this file fixes the layout *content*
   below the header (column stacking, image overflow, font sizing, etc.) and styles
   the hamburger drawer that we re-populate via JS. */

/* Universal: prevent horizontal overflow from any unconstrained element */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe, svg { max-width: 100%; height: auto; }

/* Hamburger drawer base styling. Hidden by default; opens via .open class. */
#hamburger-drawer.hamburger-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-height: 0;
  overflow: hidden;
  background: #fff;
  z-index: 99999;
  transition: max-height 0.3s ease, box-shadow 0.3s ease;
  box-shadow: none;
}
#hamburger-drawer.hamburger-drawer.open {
  max-height: 100vh;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
/* Nav-cloned-into-drawer: simple vertical list */
#hamburger-drawer .mobile-cloned-nav {
  list-style: none;
  margin: 0;
  padding: 16px 0;
}
#hamburger-drawer .mobile-cloned-nav li { border-bottom: 1px solid #eee; }
#hamburger-drawer .mobile-cloned-nav li:last-child { border-bottom: 0; }
#hamburger-drawer .mobile-cloned-nav a {
  display: block;
  padding: 14px 24px;
  color: #222;
  text-decoration: none;
  font-size: 1.05em;
}
#hamburger-drawer .mobile-cloned-nav a:hover,
#hamburger-drawer .mobile-cloned-nav a:focus { background: #f5f5f5; }
#hamburger-drawer .mobile-cloned-nav .submenu-indent { padding-left: 40px; font-size: .95em; color: #555; }

/* Hamburger button: ensure it's visible and styled so users can tell it's a button */
button.layout-drawer-hamburger {
  background: transparent;
  border: 0;
  padding: 12px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
}
button.layout-drawer-hamburger .hamburger__slice {
  display: block;
  width: 24px;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
button.layout-drawer-hamburger[aria-expanded="true"] .hamburger__slice:nth-child(1) { transform: translateY(8px) rotate(45deg); }
button.layout-drawer-hamburger[aria-expanded="true"] .hamburger__slice:nth-child(2) { opacity: 0; }
button.layout-drawer-hamburger[aria-expanded="true"] .hamburger__slice:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* When drawer is open, prevent body from scrolling underneath */
body.drawer-open { overflow: hidden; }

/* Mobile breakpoint adjustments. Duda's @media rules already handle some of this,
   but its mobile-specific rules are scoped to .dmMobileBody which our pages don't have. */
@media (max-width: 767px) {
  /* Force grid columns to stack vertically. Duda uses a 12-col grid where small-X
     should already give full width on mobile, but inline widths and flex-basis can win. */
  .dmRespColsWrapper { flex-direction: column !important; flex-wrap: wrap !important; }
  .dmRespCol { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; padding-left: 0 !important; padding-right: 0 !important; }

  /* Reasonable horizontal breathing room on the rows */
  .dmRespRow, .dmRespRowsWrapper > .dmRespRow {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Constrain headings so they don't overflow */
  h1, h2, h3, h4 { word-wrap: break-word; overflow-wrap: break-word; }
  h1 { font-size: 1.9em !important; line-height: 1.2 !important; }
  h2 { font-size: 1.5em !important; line-height: 1.25 !important; }
  h3 { font-size: 1.25em !important; }

  /* Tabs widget on home: stack tab labels in 2x2 grid */
  .widget-7b2ba5 nav.nav { display: flex !important; flex-wrap: wrap !important; }
  .widget-7b2ba5 .tab-label { flex: 1 1 50% !important; min-width: 50%; padding: 12px !important; }
  .widget-7b2ba5 .tab-label h4 { font-size: 1em !important; margin: 0 !important; }

  /* Footer: stack columns */
  .dmFooterContainer .dmRespCol { text-align: center !important; margin-bottom: 16px !important; }

  /* Buttons full-width-ish on mobile */
  .dmButtonLink, .dmDefaultGradient, .button-class { display: inline-block !important; max-width: 100%; }

  /* Header buttons (call/schedule) often render side by side on desktop—stack on mobile */
  #hamburger-header .dmRespCol { margin-bottom: 8px !important; }

  /* Make sure logo doesn't dominate */
  #hamburger-header img,
  .hamburger-header img { max-height: 80px !important; width: auto !important; }

  /* Long-form text spacing */
  p { line-height: 1.5; }

  /* Reduce huge desktop padding on big container sections */
  .dmRespRow.fullBleedMode { padding-left: 0 !important; padding-right: 0 !important; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.6em !important; }
  h2 { font-size: 1.35em !important; }
  /* Tabs become a single column on tiny screens */
  .widget-7b2ba5 .tab-label { flex: 1 1 100% !important; min-width: 100%; }
}
