/* ==========================================================================
   Full-screen main menu (after Art of Documentary).
   A curtain drops from the top; every line rises out of a mask, staggered by --i.
   Column A = pages, B = sub-groups of the hovered page (large), C = third level.
   Phones: one column at a time (data-level a → b → c) with a back button.
   ========================================================================== */
.mmenu {
  position: fixed; inset: 0; z-index: 60;
  background:
    radial-gradient(70% 60% at 85% 0%, rgb(131 205 32 / .07), transparent 70%),
    var(--night);
  color: var(--white);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .6s var(--ease-io), visibility 0s .6s;
}
.mmenu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .75s var(--ease-io); }
html.mm-open { overflow: hidden; }

.mmenu__inner {
  height: 100%; max-width: 1440px; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  padding: calc(var(--header-h) + 5vh) var(--gutter) 26px;
}
.mmenu__grid {
  flex: 1; display: grid; align-items: start;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr) minmax(200px, 300px);
  gap: clamp(32px, 5vw, 96px);
}
.mmenu__col { min-width: 0; }
.mmenu__col--b, .mmenu__col--c { display: grid; grid-template-rows: auto auto auto; align-content: start; }

.mmenu__eyebrow {
  display: inline-block; margin: 0 0 20px; font-size: 13px; font-weight: 650; color: var(--green);
  text-decoration: none; letter-spacing: .02em;
}
html[lang="en"] .mmenu__eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
a.mm-all:hover { color: var(--green-hi); text-decoration: underline; text-underline-offset: 4px; }

.mm-pages, .mm-big, .mm-small { margin: 0; padding: 0; list-style: none; }

/* every line rises out of its mask */
.mm-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-block: .06em .12em; }
.mm-mask > span { display: inline-block; transform: translateY(108%); transition: transform .35s var(--ease-io); }
.mmenu.is-open .mm-pages .mm-mask > span { transform: none; transition: transform .8s var(--ease-out) calc(.3s + var(--i, 0) * 45ms); }

/* A — pages */
.mm-a {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; text-decoration: none;
  font-size: 17px; font-weight: 550; color: rgb(255 255 255 / .62); transition: color .25s;
}
.mm-a:hover, .mm-a:focus-visible, .mm-a.is-active { color: var(--white); }
.mm-a.is-active { color: var(--green); }
.mm-count { font-style: normal; font-size: 12px; font-weight: 600; opacity: .55; }

/* B / C panels share one grid cell; only the active one shows */
.mm-panel { grid-row: 2; grid-column: 1; visibility: hidden; pointer-events: none; transition: visibility 0s .35s; }
.mm-panel.is-active { visibility: visible; pointer-events: auto; transition: none; }
.mmenu.is-open .mm-panel.is-active .mm-mask > span { transform: none; transition: transform .75s var(--ease-out) calc(.06s + var(--i, 0) * 45ms); }
.mmenu.is-open.is-opening .mm-panel.is-active .mm-mask > span { transition-delay: calc(.38s + var(--i, 0) * 45ms); }

.mm-big li + li { margin-top: 2px; }
.mm-b {
  display: inline-flex; align-items: center; gap: .35em; text-decoration: none; color: var(--white);
  font-family: var(--font-display); font-size: clamp(28px, 3vw, 52px); font-weight: 760; line-height: 1.32;
  transition: color .25s;
}
html[lang="en"] .mm-b { font-weight: 420; line-height: 1.12; letter-spacing: -.015em; }
.mm-b .arrow { width: .5em; height: .5em; opacity: .5; }
.mm-b:hover, .mm-b:focus-visible, .mm-b.is-active { color: var(--green); }

.mm-small li + li { margin-top: 4px; }
.mm-small a { display: inline-block; padding: 2px 0; font-size: 14.5px; line-height: 1.6; color: rgb(255 255 255 / .78); text-decoration: none; transition: color .2s; }
/* a long group (the magazine's cities, a clinic's doctors): two columns, so the whole list fits the screen */
.mm-small--cols { columns: 2; column-gap: 28px; }
.mm-small--cols li { break-inside: avoid; }
.mm-small--cols li + li { margin-top: 0; }
.mm-small--cols li { padding-block: 2px; }
.mm-small a:hover, .mm-small a:focus-visible { color: var(--green); }

/* hover preview: one portrait per page in a vertical film strip; it slides to the hovered page
   and collapses downwards when the pointer leaves the page list (after Art of Documentary) */
.mm-visual {
  grid-row: 2; grid-column: 1; justify-self: end; width: min(100%, 280px); aspect-ratio: 3 / 4;
  overflow: hidden; border-radius: 4px; background: rgb(255 255 255 / .04);
  clip-path: inset(100% 0 0 0); transition: clip-path .5s var(--ease-io);
}
.mm-visual.is-on { clip-path: inset(0 0 0 0); transition: clip-path .7s var(--ease-out); }
.mmenu.has-c .mm-visual { clip-path: inset(100% 0 0 0); }
.mm-visual__strip { height: 100%; transform: translateY(calc(var(--idx, 0) * -100%)); transition: transform .85s var(--ease-out); }
.mm-visual__item { position: relative; height: 100%; margin: 0; }
.mm-visual__item img { width: 100%; height: 100%; object-fit: cover; }
.mm-visual__item figcaption {
  position: absolute; inset: 0 0 auto; padding: 12px 14px 28px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--white); background: linear-gradient(to bottom, rgb(4 12 32 / .7), transparent);
}
html[lang="en"] .mm-visual__item figcaption { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }

.mm-cta { grid-row: 3; justify-self: start; margin-top: 40px; }
.mm-cta .arrow { width: 1em; height: 1em; }

.mm-back {
  grid-row: 1; display: none; align-items: center; gap: 8px; margin-bottom: 18px; padding: 0;
  border: 0; background: none; color: rgb(255 255 255 / .7); font-size: 14px; font-weight: 600; cursor: pointer;
}
[dir="rtl"] .mm-back .arrow { transform: none; }
[dir="ltr"] .mm-back .arrow { transform: scaleX(-1); }

.mmenu__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  margin-top: 28px; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / .12);
  font-size: 13px; color: rgb(255 255 255 / .6);
}
.mmenu__langs { display: flex; gap: 18px; margin: 0; padding: 0; list-style: none; }
.mmenu__langs a { text-decoration: none; }
.mmenu__langs a[aria-current], .mmenu__langs a:hover { color: var(--green); }

/* ---------- phones / small tablets: drill-down ---------- */
@media (max-width: 899px) {
  .mmenu__inner { padding-top: calc(var(--header-h) + 18px); }
  .mmenu__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mmenu__col { grid-area: 1 / 1; transition: opacity .35s, transform .45s var(--ease-out), visibility 0s .45s; }
  .mmenu__col:not(.is-current) { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(calc(var(--dirx, 1) * 24px)); }
  [dir="rtl"] .mmenu__col:not(.is-current) { --dirx: -1; }
  .mmenu__col.is-current { transition: opacity .35s, transform .45s var(--ease-out); }
  .mm-back { display: inline-flex; }
  .mm-visual { display: none; }
  .mm-a { font-size: 24px; font-weight: 700; color: var(--white); padding: 6px 0; }
  .mm-a .mm-count { font-size: 12px; }
  .mm-b { font-size: clamp(26px, 7vw, 34px); }
  .mm-small a { font-size: 18px; padding: 6px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mmenu, .mmenu.is-open, .mm-mask > span, .mmenu__col, .mm-visual, .mm-visual__strip { transition: none !important; }
  .mmenu { clip-path: none; }
  .mm-mask > span { transform: none; }
}
