/* Max Mega Menu: footer menu (location footer). Loaded after the plugin's own stylesheet on the front end and in
   the editor (inc/megamenu.php). The plugin settings for this menu are in inc/megamenu.php. */

/* Every width: the footer's contact text size (Small, over the plugin's 14px) and each row as tall as a line of it
   (line height 1.7, 24.5px; 16 Nov 2026, the user's request), over the plugin's rows (30px from
   menu_item_link_height in inc/megamenu.php, 40px on phones). Weight and colour: inc/megamenu.php. A label too long
   for its column wraps onto a second line and pushes the next link down (min-height, not a fixed height, since
   18 Nov 2026, when "Deep Tech Short Banner" overlapped the link below it). The lines of a wrapped label sit closer
   (--swiss-footer-menu-line, line height 1.35; 18 Nov 2026, the user's request) than the links do: the difference
   is padding above and below each link, so the space between links stays the 1.7 row. */
#mega-menu-wrap-footer
  #mega-menu-footer
  > li.mega-menu-item
  > a.mega-menu-link {
  --swiss-footer-menu-row: calc(var(--wp--preset--font-size--small) * 1.9);
  --swiss-footer-menu-line: calc(var(--wp--preset--font-size--small) * 1.35);
  font-size: var(--wp--preset--font-size--small) !important;
  height: auto !important;
  min-height: var(--swiss-footer-menu-row) !important;
  line-height: var(--swiss-footer-menu-line) !important;
  padding-block: calc(
    (var(--swiss-footer-menu-row) - var(--swiss-footer-menu-line)) / 2
  ) !important;
}

/* The current page's link stays muted like the others (the plugin gives it the hover colour, with no setting of
   its own) and darkens only on hover or focus. */
#mega-menu-wrap-footer
  #mega-menu-footer
  > li.mega-menu-item:is(
    .mega-current-menu-item,
    .mega-current-menu-ancestor,
    .mega-current-page-ancestor
  )
  > a.mega-menu-link:not(:hover, :focus) {
  color: var(--swiss-footer-muted) !important;
}

/* Phones: no side padding on the links (the plugin gives top-level phone links 10px, with no setting for it); the
   top and bottom padding above stays. */
@media (max-width: 768px) {
  #mega-menu-wrap-footer
    #mega-menu-footer
    > li.mega-menu-item
    > a.mega-menu-link {
    padding-inline: 0 !important;
  }
}

/* 769px and up: the links in two columns, reading down the first column and then the second (16 Nov 2026, the
   user's request). Two columns only when each can be at least --swiss-footer-menu-min wide (the widest link plus
   a little; raise it for a menu with longer link text), so a narrow Quick Links column (about 992-1180px, where
   the footer columns sit side by side at 20%) keeps one column instead of wrapping links onto two lines.
   --swiss-footer-menu-gap is the space between the two columns. */
@media (min-width: 769px) {
  #mega-menu-wrap-footer #mega-menu-footer {
    --swiss-footer-menu-min: 5rem;
    --swiss-footer-menu-gap: var(--wp--preset--spacing--3);
    columns: var(--swiss-footer-menu-min) 2 !important;
    column-gap: var(--swiss-footer-menu-gap) !important;
  }

  #mega-menu-wrap-footer #mega-menu-footer > li.mega-menu-item {
    break-inside: avoid;
  }
}

/* Footer Full No Logo (swiss/footer-full-no-logo, 18 Nov 2026): the links in the Navigation font, uppercase with a
   little letter spacing, and from 769px up in three columns (each at least --swiss-footer-menu-min wide, so fewer
   columns on narrow screens instead of wrapped labels). */
.footer-full-no-logo
  #mega-menu-wrap-footer
  #mega-menu-footer
  > li.mega-menu-item
  > a.mega-menu-link {
  font-family: var(--wp--preset--font-family--navigation) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

@media (min-width: 769px) {
  .footer-full-no-logo #mega-menu-wrap-footer #mega-menu-footer {
    --swiss-footer-menu-min: 10rem;
    columns: var(--swiss-footer-menu-min) 3 !important;
  }
}
