/* MIRE–AHN Menu Pro · 2026-10-31
   Navigation drawer: independent scrolling, safe-area aware layout,
   editorial rhythm and the in-menu search field.

   Root cause of the mobile scroll bug: the drawer is a fixed 100dvh layer,
   the page behind it is locked (body.locked), the nav column was centred with
   justify-content:center and nothing inside the drawer was a scroll container.
   Content taller than the viewport (8 items + footer on iPhone with Safari
   toolbars) was clipped with no way to reach it. The content column is now the
   only scroll container; the page stays locked underneath. */

:root{
  --mm-white:var(--ma-white,#FFFFFF);
  --mm-ice:var(--ma-ice,#F6FBFF);
  --mm-sky:var(--ma-sky,#BFE9FF);
  --mm-sky-soft:var(--ma-sky-soft,#EAF7FF);
  --mm-navy:var(--ma-navy,#102A43);
  --mm-ink:var(--ma-ink,#17384F);
  --mm-muted:var(--ma-muted,#547287);
  --mm-line:var(--ma-line,rgba(23,56,79,.14));
  --mm-line-strong:var(--ma-line-strong,rgba(23,56,79,.30));
  --mm-ease:cubic-bezier(.22,.8,.24,1);
}

/* Page lock while the drawer is open (iOS Safari honours overflow on the root). */
html:has(body.menu-open){overflow:hidden;overscroll-behavior:none}
body.menu-open{overflow:hidden!important;overscroll-behavior:none}

/* ---------- Shared (all widths) ---------- */
body .ma-menu{height:auto!important;top:0!important;bottom:0!important;overflow:hidden;grid-template-rows:minmax(0,1fr)!important}
body .ma-menu .ma-menu__content{
  display:flex;flex-direction:column;min-height:0;height:100%;
  overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;scrollbar-width:none;
}
body .ma-menu .ma-menu__content::-webkit-scrollbar{display:none}
body .ma-menu .ma-menu__header{flex:0 0 auto}
/* Auto margins centre the list when it fits and never push items above the
   scroll origin when it doesn't (justify-content:center would). */
body .ma-menu .ma-menu__nav{flex:1 0 auto;justify-content:flex-start!important}
body .ma-menu .ma-menu__nav>a:first-child{margin-top:auto}
body .ma-menu .ma-menu__nav>a:last-child{margin-bottom:auto}
body .ma-menu .ma-menu__nav a{-webkit-tap-highlight-color:transparent;transition:opacity .2s ease}
body .ma-menu .ma-menu__nav a:active{opacity:.55}
body .ma-menu .ma-menu__nav a[aria-current="page"] span{font-style:normal}
body .ma-menu .ma-menu__nav a:focus-visible{outline:2px solid var(--mm-navy);outline-offset:4px}
body .ma-menu .ma-menu__footer{flex:0 0 auto}

/* ---------- Search field ---------- */
.ma-menu__search{flex:0 0 auto;margin:28px 0 8px;padding:0;scroll-margin-bottom:24px}
.ma-menu__search-label{display:block;margin:0 0 10px;font:500 10px/1 var(--f-mono,ui-monospace,monospace);letter-spacing:.16em;text-transform:uppercase;color:var(--mm-muted)}
.ma-menu__search-field{
  position:relative;display:grid;grid-template-columns:22px minmax(0,1fr) 44px;align-items:center;gap:12px;
  min-height:56px;padding:0 0 0 2px;border-bottom:1px solid var(--mm-line-strong);
  transition:border-color .25s ease;
}
.ma-menu__search-field::after{
  content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:var(--mm-navy);
  transform:scaleX(0);transform-origin:left center;transition:transform .45s var(--mm-ease);
}
.ma-menu__search-field:focus-within::after{transform:scaleX(1)}
.ma-menu__search-icon{width:20px;height:20px;color:var(--mm-navy);opacity:.82}
.ma-menu__search input{
  -webkit-appearance:none;appearance:none;width:100%;min-width:0;height:52px;margin:0;padding:0;
  border:0;border-radius:0;background:transparent;box-shadow:none;outline:0;
  font:400 17px/1.3 var(--f-serif,Georgia,serif);letter-spacing:-.005em;color:var(--mm-navy);
  caret-color:var(--mm-navy);
}
.ma-menu__search input::placeholder{color:var(--mm-muted);opacity:1;font-style:italic}
.ma-menu__search input::-webkit-search-decoration,
.ma-menu__search input::-webkit-search-cancel-button{-webkit-appearance:none;display:none}
.ma-menu__search button{
  display:grid;place-items:center;width:44px;height:44px;margin:0;padding:0;
  border:1px solid transparent;border-radius:50%;background:transparent;color:var(--mm-navy);cursor:pointer;
  -webkit-tap-highlight-color:transparent;transition:background .25s ease,border-color .25s ease,transform .25s var(--mm-ease);
}
.ma-menu__search button svg{width:18px;height:18px}
.ma-menu__search-field:focus-within button{background:var(--mm-sky);border-color:var(--mm-sky)}
.ma-menu__search button:hover{background:var(--mm-sky-soft);border-color:var(--mm-line)}
.ma-menu__search button:active{transform:scale(.94)}
.ma-menu__search button:focus-visible{outline:2px solid var(--mm-navy);outline-offset:2px}

/* ---------- Mobile (phones) ---------- */
@media (max-width:760px){
  /* Calm fade + short drop instead of a full-height curtain. Transform is
     still animated so app.js can wait for its transitionend. */
  body .ma-menu{
    transform:translate3d(0,-12px,0)!important;opacity:0!important;
    transition:opacity .34s ease,transform .5s var(--mm-ease),visibility 0s .5s!important;
  }
  body .ma-menu.open{
    transform:translate3d(0,0,0)!important;opacity:1!important;
    transition:opacity .3s ease,transform .5s var(--mm-ease),visibility 0s!important;
  }
  body .ma-menu .ma-menu__visual{display:none}
  body .ma-menu .ma-menu__content{
    padding:0 max(22px,env(safe-area-inset-right)) 0 max(22px,env(safe-area-inset-left))!important;
    background:var(--mm-white)!important;
  }
  body .ma-menu .ma-menu__header{
    position:sticky;top:0;z-index:3;
    height:calc(68px + env(safe-area-inset-top))!important;padding-top:env(safe-area-inset-top);
    margin:0 calc(-1 * max(22px,env(safe-area-inset-right))) 0 calc(-1 * max(22px,env(safe-area-inset-left)));
    padding-inline:max(22px,env(safe-area-inset-left)) max(22px,env(safe-area-inset-right));
    background:rgba(255,255,255,.94);-webkit-backdrop-filter:saturate(1.4) blur(14px);backdrop-filter:saturate(1.4) blur(14px);
    border-bottom:1px solid var(--mm-line)!important;
  }
  body .ma-menu .ma-menu__header img{width:124px}
  body .ma-menu .ma-menu__close{width:44px!important;height:44px!important}

  body .ma-menu .ma-menu__nav{padding:10px 0 0!important}
  body .ma-menu .ma-menu__nav>a:first-child{margin-top:0}
  body .ma-menu .ma-menu__nav>a:last-child{margin-bottom:0}
  body .ma-menu .ma-menu__nav a{
    grid-template-columns:30px minmax(0,1fr)!important;gap:10px!important;align-items:center!important;
    min-height:60px!important;padding:11px 0!important;border-bottom:1px solid var(--mm-line)!important;
  }
  body .ma-menu .ma-menu__nav span{
    font-size:clamp(31px,9.4vw,42px)!important;line-height:1.04!important;letter-spacing:-.02em;
    color:var(--mm-navy);overflow-wrap:anywhere;
  }
  body .ma-menu .ma-menu__nav small{
    font:500 10px/1 var(--f-mono,ui-monospace,monospace)!important;letter-spacing:.12em;color:var(--mm-muted)!important;
  }
  body .ma-menu .ma-menu__nav b{display:none!important}

  .ma-menu__search{margin:30px 0 6px}

  body .ma-menu .ma-menu__footer{
    display:block!important;min-height:0!important;margin-top:auto;
    padding:22px 0 calc(16px + env(safe-area-inset-bottom));border-top:0!important;
  }
  body .ma-menu .ma-menu__footer>div:first-child{display:none!important}
  body .ma-menu .ma-menu__footer>div:last-child{
    display:flex!important;flex-wrap:wrap;justify-content:flex-start!important;gap:0 22px;width:100%;
    border-top:1px solid var(--mm-line);padding-top:6px;
  }
  body .ma-menu .ma-menu__footer a{
    display:inline-flex;align-items:center;min-height:44px;min-width:44px;
    font:500 10px/1.2 var(--f-mono,ui-monospace,monospace)!important;letter-spacing:.14em;
    color:var(--mm-ink)!important;-webkit-tap-highlight-color:transparent;
  }

  /* Editorial entrance: items rise in sequence. */
  body .ma-menu.open .ma-menu__nav a,
  body .ma-menu.open .ma-menu__search,
  body .ma-menu.open .ma-menu__footer{animation:mmRise .6s var(--mm-ease) both}
  body .ma-menu.open .ma-menu__nav a:nth-child(1){animation-delay:.05s}
  body .ma-menu.open .ma-menu__nav a:nth-child(2){animation-delay:.08s}
  body .ma-menu.open .ma-menu__nav a:nth-child(3){animation-delay:.11s}
  body .ma-menu.open .ma-menu__nav a:nth-child(4){animation-delay:.14s}
  body .ma-menu.open .ma-menu__nav a:nth-child(5){animation-delay:.17s}
  body .ma-menu.open .ma-menu__nav a:nth-child(6){animation-delay:.2s}
  body .ma-menu.open .ma-menu__nav a:nth-child(n+7){animation-delay:.23s}
  body .ma-menu.open .ma-menu__search{animation-delay:.26s}
  body .ma-menu.open .ma-menu__footer{animation-delay:.3s}
}

/* Short landscape phones: single column, no decorative panel. */
@media (min-width:761px) and (max-height:520px) and (pointer:coarse){
  body .ma-menu{grid-template-columns:1fr!important}
  body .ma-menu .ma-menu__visual{display:none}
  body .ma-menu .ma-menu__header{position:sticky;top:0;z-index:3;height:64px!important;background:var(--mm-white)}
  body .ma-menu .ma-menu__nav span{font-size:34px!important}
  body .ma-menu .ma-menu__footer a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px}
  body .ma-menu .ma-menu__footer{padding-bottom:env(safe-area-inset-bottom)}
}

@keyframes mmRise{from{opacity:0;transform:translate3d(0,10px,0)}to{opacity:1;transform:none}}

@media (prefers-reduced-motion:reduce){
  body .ma-menu,body .ma-menu.open{transition:opacity .01s linear,visibility 0s!important}
  body .ma-menu.open .ma-menu__nav a,body .ma-menu.open .ma-menu__search,body .ma-menu.open .ma-menu__footer{animation:none}
  .ma-menu__search-field::after,.ma-menu__search button{transition:none}
}

/* The nav already carries Contact; avoid repeating it in the drawer footer. */
body .ma-menu:has(.ma-menu__nav a[href="/contact.html"]) .ma-menu__footer a[href="/contact.html"]{display:none!important}

/* Search results panel field: no native blue cancel glyph / focus box. */
#searchPanel #searchInput{-webkit-appearance:none;appearance:none;border-radius:0}
#searchPanel #searchInput::-webkit-search-decoration,
#searchPanel #searchInput::-webkit-search-cancel-button{-webkit-appearance:none;display:none}
#searchPanel #searchInput:focus,#searchPanel #searchInput:focus-visible{outline:none;box-shadow:0 1px 0 var(--mm-navy)}
