/* Phone layout, added in the Repaint rebuild. Desktop (761px and up) looks exactly like the old site: outside the
   media query this file only hides the phone-only pieces. */
.m-bar, .m-contact, .m-only { display: none; }
a.tel:link, a.tel:visited { color: inherit; text-decoration: none; }
a.tel:hover { text-decoration: underline; }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { min-width: 0 !important; font-size: 15px; line-height: 1.6; color: #3d4448; overflow-x: hidden; }
  .wrapper, #maininner { width: auto !important; }
  #block-main > div { padding: 0; background: none; }
  .wrapper { padding: 0; margin: 0; }
  .m-hide, #toolbar, #headerbar, #search, #menubar-r, #totop-scroller, #breadcrumbs { display: none !important; }
  .m-only { display: block; }

  /* Header: logo left, call and menu right; stays at the top while scrolling */
  .m-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 60; height: 64px;
    padding: 0 12px 0 14px; background: #fff; border-bottom: 3px solid #87da8a; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
  .m-logo { flex: 1; min-width: 0; display: flex; align-items: center; }
  .m-logo img { height: 46px; width: auto; max-width: 100%; display: block; }
  .m-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center; background: #eef5f9; color: #2d5064 !important; }
  .m-call { background: #4e89ad; color: #fff !important; }
  .m-icon:active { filter: brightness(.9); }
  .m-close { display: none; }
  .m-open .m-close { display: inline; }
  .m-open .m-burger { display: none; }

  /* Menu: drops down under the header when the menu button is tapped */
  #header { margin: 0; padding: 0; height: auto; }
  #menubar { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 59; margin: 0; padding: 0 0 24px;
    height: auto; overflow-y: auto; background: #fff; box-shadow: none; border: 0; }
  #menubar::before, #menubar::after { display: none; }
  .m-open #menubar { display: block; }
  .m-open { overflow: hidden; }
  #menu, #menu * { float: none !important; }
  #menu, #menu ul.menu { float: none; display: block; margin: 0; padding: 0; background: none; height: auto; }
  #menu li.level1 { float: none; display: block; margin: 0; padding: 0; background: none; border: 0; border-bottom: 1px solid #edf1f3; }
  #menu a.level1, #menu span.level1 { display: block; float: none; height: auto; margin: 0; padding: 0; background: none !important;
    border: 0; border-left: 4px solid transparent; box-shadow: none; }
  #menu a.level1 > span, #menu span.level1 > span { display: block; height: auto; padding: 15px 20px; margin: 0; background: none !important;
    font-size: 16px; line-height: 1.3; text-transform: none; color: #2d5064; border: 0; }
  #menu span.separator > span { color: #8a9aa4; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 4px; }
  #menu a.level1.current, #menu a.level1.active { border-left-color: #87da8a; background: #f2faf2 !important; }
  #menu a.level1.current > span { font-weight: bold; }
  #menu .dropdown { display: block !important; position: static; width: auto !important; visibility: visible; opacity: 1;
    margin: 0; padding: 0 0 8px; background: none; border: 0; box-shadow: none; overflow: visible; }
  #menu .dropdown-bg, #menu .dropdown-bg > div, #menu .column { float: none; width: auto !important; margin: 0; padding: 0; background: none; border: 0; }
  /* The desktop dropdown animates on hover; on phones keep the list still so taps land on the link */
  #menu .dropdown, #menu .dropdown div { display: block !important; width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important; margin-top: 0 !important; margin-left: 0 !important; opacity: 1 !important; overflow: visible !important; }
  #menu ul.level2 { margin: 0; padding: 0; }
  #menu li.level2 { margin: 0; padding: 0; border: 0; background: none; }
  #menu a.level2 { display: block; padding: 10px 20px 10px 36px; margin: 0; font-size: 15px; color: #4e89ad; background: none; border: 0; }
  #menu a.level2.current { color: #2d5064; font-weight: bold; background: #f2faf2; }
  #menu a.level2 > span { background: none; padding: 0; }

  /* Content: one roomy column */
  #top-a, #top-b, #main, #content, #maininner, #sidebar-a, #sidebar-b, .grid-box { float: none !important; width: auto !important; margin: 0; }
  #top-a, #top-b, #main { padding: 16px 14px 0; }
  .grid-h, .grid-box { padding: 0 !important; }
  #main, #maininner, #content { padding-left: 0; padding-right: 0; }
  #main { padding: 16px 14px 0; }
  .mod-box { margin: 0 0 14px; }
  .mod-box > div { padding: 16px; }
  #content > .grid-block, #system { padding: 0; }
  #system { background: #fff; border-radius: 10px; padding: 18px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 14px; }
  #system .title, #system h1 { font-size: 26px; line-height: 1.25; margin: 0 0 14px; }
  #system h2, #system h3 { line-height: 1.3; }
  #system p, #system li { font-size: 15px; }
  img { max-width: 100%; height: auto; }
  #system img[style*="float"], #system img[align] { float: none !important; display: block; margin: 0 auto 16px !important; border-radius: 8px; }
  #system table, #system tbody, #system tr, #system td { display: block; width: auto !important; height: auto !important; }
  #system td:empty { display: none; }
  iframe { max-width: 100%; }
  #system iframe { width: 100% !important; height: 320px !important; border: 0; border-radius: 8px; }
  #sidebar-a .module { margin: 0 0 14px; }

  /* Home: full-width photo, then the three boxes as cards */
  #top-a .mod-box > div { padding: 8px; }
  #top-a .wk-slideshow, #top-a .slides, #top-a .slides > li { width: 100% !important; }
  #top-a .slides { height: auto !important; aspect-ratio: 700 / 300; }
  #top-a .slides img { width: 100%; height: 100%; object-fit: cover; }
  #top-b .mod-box img { width: 100%; border-radius: 6px; }
  #top-b h3 { font-size: 20px; margin-top: 10px; }

  /* Phone numbers, one tap each, at the bottom of every page */
  .m-contact { display: block; margin: 8px 14px 18px; padding: 16px; background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
  .m-contact h3 { margin: 0 0 10px; font-size: 18px; color: #2d5064; }
  .m-contact a { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; margin: 0 0 8px;
    border-radius: 8px; background: #f2faf2; border: 1px solid #d5efd6; color: #2d5064; font-weight: bold; text-decoration: none; }
  .m-contact a:first-of-type { background: #4e89ad; border-color: #4e89ad; color: #fff; }
  .m-contact a span { font-weight: normal; }
  .m-contact p { margin: 6px 0 0; font-size: 14px; color: #5d6b73; }
  #block-footer { padding: 0 0 10px; }
  #footer { margin: 0; padding: 6px 14px 20px; text-align: left; line-height: 2.1; }
  .m-btn { display: block; text-align: center; background: #4e89ad; color: #fff !important; border-radius: 999px; padding: 12px;
    font-weight: bold; text-decoration: none; margin: 4px 0 14px; }
  #system a.tel { font-weight: bold; color: #4e89ad; }
  #searchForm input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 10px; margin-bottom: 10px; }
}
