/* ========================================
   SITE CHROME - the nav's menu, shared by the landing page
   (src/templates/index.html) and the other pages (LegalPage.astro).
   Markup: menuHtml in src/data/site.js; behaviour: public/site.js.
   ======================================== */

/* The menu: three dots in a pill like the language switch, opening a small
   card of links centred under it, as wide as its longest link, with a
   pointer up at the dots */
.site-menu {
  position: relative;
  display: inline-flex;
}

.site-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #111;
  cursor: pointer;
  transition: background 0.2s ease;
}

.site-menu-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.site-menu-button[aria-expanded='true'] {
  background: #111;
  color: #fff;
}

.site-menu-list {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: max-content;
  padding: 6px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow:
    0 4px 12px rgba(17, 17, 17, 0.06),
    0 16px 40px rgba(17, 17, 17, 0.12);
  transform: translateX(-50%);
  transform-origin: top center;
  animation: site-menu-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The pointer: a corner of a square turned on its side, sharing the card's
   border */
.site-menu-list::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
  border-left: 1px solid rgba(17, 17, 17, 0.08);
  border-top-left-radius: 3px;
  background: #fff;
  box-shadow: -2px -2px 4px rgba(17, 17, 17, 0.04);
  transform: translateX(-50%) rotate(45deg);
}

.site-menu-list[hidden] {
  display: none;
}

.site-menu-list a {
  padding: 10px 14px;
  text-align: left;
  line-height: 1.3;
  border-radius: 10px;
  color: #111;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-menu-list a:hover,
.site-menu-list a:focus-visible {
  background: rgba(17, 17, 17, 0.05);
}

@keyframes site-menu-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}
