/* THE TOP MENU — ONE CONTRACT, EVERY PAGE.
   Operator, 25 November 2026: "the PETS has moved left - this should never ever
   happen … this top menu from the 6 depts is global, fixed and cannot be changed.
   Never allow this to happen again." See AGENTS.md §9.11.

   The homepage loads site.css + footer.css; every other page also loads mocks.css
   and journey.css. Those sheets each carried their own header numbers, so the menu
   met different gaps depending on which page you were on: measured at 1024 on
   25 November 2026 the department pages ran .hdr__inner gap 16px / .depts gap 14px
   while the homepage ran 26px / 10px, which moved PETS by 10px and rewrapped every
   label. This sheet loads last on every page and states the department-page numbers
   once, so all pages agree.

   Do not add a page-scoped menu rule here or anywhere: no `body.home .depts …`, no
   nth-child nudge, no per-page margin, transform, gap or hide. */

@media (max-width: 1260px) {
  .hdr__inner { gap: 16px; }
  /* The department pages let the menu take the leftover width, so its labels stay on
     one line; the homepage did not, so the same seven labels wrapped into two lines
     and moved every item. Same growth on every page. */
  .depts      { gap: 14px; flex: 1 1 auto; min-width: 0; }
  .utils      { gap: 12px; flex: 0 0 auto; }
  /* mocks.css forces nowrap on the department pages only; stated here for every page
     so the same seven labels wrap at the same points. */
  .depts a    { white-space: normal; }
}
@media (max-width: 900px) {
  .depts { gap: 12px; }
}
/* Below 1260px the seven labels cannot all sit on one line without colliding with
   Search / Account / Cart, so they wrap to two lines inside their boxes — which is
   what the department pages have always done and what the operator called correct.
   Wrapping is allowed; disagreeing is not. Both page types wrap the same way because
   the gaps and the growth above are now identical. Above 1260px there is room, so the
   labels are held on one line. */
@media (min-width: 1261px) {
  .depts a { white-space: nowrap; }
}

/* Below 1260px the seven labels plus Search / Account / Cart do not fit on one line:
   measured at 1024 the space left for the menu is 465px and the labels need 527px even
   wrapped, so they collided with the pills. The site already has a menu for that: the
   department links fold into the same summary ("+") toggle that has always served the
   narrow layouts. Same rule on every page, so no page differs from another. */
@media (max-width: 1260px) {
  .depts    { display: none; }
  .mtoggle  { display: block; }
}

/* ---------- PHONE MENU (Option A, authorised 1 December 2026) --------------
   The dropdown used to be positioned inside the Menu button, which is 58px wide,
   so on a phone the panel rendered 58px wide and forced the layout viewport from
   390 to 421px. The panel now anchors to the header, which is already sticky and
   therefore the containing block, and the rows are full width at 56px.
   Mobile only: nothing here fires above 1260px, and nothing here touches the
   desktop menu geometry. */
@media (max-width: 1260px) {
  .hdr__inner { position: relative; }
  /* Phone and tablet header is the brand on the left and the Menu button on the
     right, nothing else. The pills and the account/cart links live inside the
     panel, so the bar cannot overflow the screen. Operator, 2 December 2026. */
  .utils { display: none; }
  .mtoggle { margin-left: auto; }
  .mtoggle { position: static; }
  .mtoggle__nav {
    position: absolute;
    z-index: 2;
    left: 0; right: 0; top: 100%;
    width: auto; max-width: none;
    min-width: 0;
    background: var(--expat-field, #FFFEFA);
    border-top: 1px solid var(--expat-rule, #E6E1D6);
    border-bottom: 1px solid var(--expat-rule, #E6E1D6);
    box-shadow: 0 24px 32px -24px rgba(19, 35, 60, .35);
    padding: 0 18px 8px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 72px);
    overflow: auto;
  }
  .mtoggle__nav > a {
    font-family: var(--expat-serif, Georgia, serif);
    font-size: 19px;
    line-height: 1.2;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--expat-rule, #E6E1D6);
    padding: 0;
  }
  .mtoggle__nav > a::after {
    content: "\203A";
    color: var(--expat-gold, #B08D4E);
    font-size: 20px;
    line-height: 1;
  }
  .mtoggle__tools {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    min-height: 44px;
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--expat-ink-mute, #545454);
  }
  .mtoggle__tools a {
    font-family: inherit;
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    min-height: 0;
    border: 0;
  }
  .mtoggle__tools a::after { content: none; }
  .hdr:has(.mtoggle[open])::after {
    content: "";
    z-index: 1;
    position: absolute;
    left: 0; right: 0; top: 100%;
    height: 100vh;
    background: rgba(19, 35, 60, .35);
    pointer-events: auto;
  }
}

@media (max-width: 360px) {
  .mtoggle__tools { gap: 12px; font-size: 9px; }
  .mtoggle__tools a { font-size: 9px; }
}

/* Search inside the phone menu. A plain GET form, so it works with no script. */
@media (max-width: 1260px) {
  .mtoggle__search {
    display: flex;
    gap: 8px;
    padding: 12px 0 8px;
    border-bottom: 1px solid var(--expat-rule, #E6E1D6);
  }
  .mtoggle__search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--expat-rule-2, #D9D3C6);
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: var(--expat-ink, #383838);
  }
  .mtoggle__search button {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 18px;
    border: 0;
    background: var(--expat-navy, #13233C);
    color: #FFFEFA;
    font: inherit;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
  }
  .mtoggle__cur { margin-left: auto; }
  .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
}
