/* Phone and tablet header tweaks, loaded on every page by layouts/site.php. */

/* Burger: the lines turn into a close (X) while the menu is open (site.js sets aria-expanded) */
.hd-burger .bg-x{display:none}
.hd-burger[aria-expanded="true"] .bg-l{display:none}
.hd-burger[aria-expanded="true"] .bg-x{display:inline}

/* The mobile menu (burger, 960px and under): js/mnav.js builds .mnav, a search box and one ▾ list per
   section. The desktop mega menu panels are not used there. */
.mnav{display:none}
@media (max-width:960px){
  /* header stays a square, full-width bar when scrolled (desktop turns it into a floating rounded pill) */
  .hd.float .hd-bar{max-width:100%;margin-top:0;height:66px;border-radius:0;border-color:transparent;border-bottom-color:rgba(0,0,0,.08);
    box-shadow:0 6px 18px -12px rgba(15,23,42,.25)}
  /* only once mnav.js has run (it adds .mnav-on): if that file is missing, the old menu still works */
  html.mnav-on .hd .mm{display:none!important}
  /* pointer-events:auto: the header (.hd, chrome.css) is pointer-events:none so only its bar takes taps;
     without this every tap on the menu fell through to the overlay behind it and closed the menu */
  /* square panel, full width, straight under the 66px header bar */
  .mnav:not([hidden]){pointer-events:auto;display:block;position:fixed;left:0;right:0;top:calc(66px + env(safe-area-inset-top,0px));z-index:80;
    max-height:calc(100vh - 66px);max-height:calc(100dvh - 66px - env(safe-area-inset-top,0px));
    overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#fff;border-radius:0;border-top:1px solid #eee;
    box-shadow:0 18px 40px -18px rgba(15,23,42,.35);font-family:Inter,system-ui,sans-serif;animation:mn-in .2s ease-out}
  @keyframes mn-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
  .mn-search{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:10px;padding:14px 16px;background:#fafafa;border-bottom:1px solid #eee}
  .mn-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:inherit;font-size:16px;color:#111}
  .mn-search input::placeholder{color:#8a8f98}
  .mn-search svg{width:20px;height:20px;flex:none;color:#333;padding-left:12px;border-left:1px solid #ddd;box-sizing:content-box}
  .mn-list{list-style:none;margin:0;padding:6px 0}
  .mn-sec[hidden]{display:none}
  .mn-btn{display:flex;align-items:center;justify-content:space-between;width:100%;padding:14px 22px;border:0;background:none;font:inherit;font-size:17px;font-weight:500;color:#1f2329;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .mn-btn:active{background:#f5f6f8}
  .mn-ch{width:14px;height:14px;flex:none;transition:transform .2s;color:#111}
  .mn-btn[aria-expanded="true"]{color:#005be8}
  .mn-btn[aria-expanded="true"] .mn-ch{transform:rotate(180deg);color:#005be8}
  .mn-sub{padding:2px 14px 12px}
  .mn-sub[hidden]{display:none}
  .mn-grp[hidden],.mn-it[hidden]{display:none}
  .mn-h{margin:8px 8px 4px;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#8a8f98}
  .mn-it{display:flex;align-items:center;gap:12px;padding:10px 8px;border-radius:0;color:#111;text-decoration:none;-webkit-tap-highlight-color:transparent}
  .mn-it:active{background:#f3f6fb}
  .mn-ic{display:grid;place-items:center;width:34px;height:34px;flex:none}
  .mn-ic svg{width:30px;height:30px}
  .mn-it b{display:block;font-size:15.5px;font-weight:500;line-height:1.25}
  .mn-it small{display:block;margin-top:2px;font-size:12.5px;line-height:1.35;color:#6b7079}
  .mn-none{margin:4px 22px 14px;color:#6b7079;font-size:14px}
  .mn-none[hidden]{display:none}
  .mn-demo{display:flex;align-items:center;justify-content:center;margin:6px 16px 16px;height:50px;border-radius:0;background:#0b0b0b;color:#fff;font-weight:600;font-size:15.5px;text-decoration:none}
  /* the page behind stays still while the menu is open */
  html:has(#ov.on){overflow:hidden}
  /* the floating Book a demo / WhatsApp buttons and the bot don't sit on top of the open menu */
  #ov.on ~ .mcbdemo,#ov.on ~ .mcbwa,#ov.on ~ .mcbbot{display:none!important}
}

/* Phones (700px and under): the header's language switcher and "Book a demo" button are hidden; a
   floating "Book a demo" button sits at the bottom instead (app/views/partials/bot.php, css/bot.css).
   In the homepage's "Mobile ecosystem" section only the line "Five apps for everyone…" is hidden. */
@media (max-width:700px){
  .hd .lg-sw,
  .hd .hd-r > a.cta{display:none!important}
  #apps .ap-p{display:none!important}
  /* homepage hero badge ("AI-Powered Institution Management Software") on one line */
  .h-badge{white-space:nowrap;max-width:100%;gap:6px;padding-right:10px;font-size:clamp(10.5px,3.3vw,12.5px)}
  .h-badge b.hlb{font-size:inherit;padding-left:8px;white-space:nowrap}
}
