/* Menú de secciones (hamburguesa) de uic.university. Marcado en comun/menu.html; tokens de inicio/estilo.css
   («El claustro»). Mecanismos tomados de 21st.dev: el trazo que se transforma en cruz (Menu Toggle Icon, efferd, id 8718)
   y la hoja lateral con la acción al pie (Classic Header with Sheet Menu, ln-dev7, id 26888). */

.cabecera__izquierda { display: flex; align-items: center; gap: var(--e-2); min-width: 0; }
@media (min-width: 600px) { .cabecera__izquierda { gap: var(--e-3); } }

.menu-boton {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--linea-fuerte); background: color-mix(in oklab, var(--superficie) 70%, transparent);
  color: var(--tinta); cursor: pointer; padding: 0;
  transition: transform .5s var(--resorte), border-color .2s, background-color .2s;
}
.menu-boton:hover { border-color: var(--acento); }
.menu-boton:active { transform: scale(.88); }
.menu-boton svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .5s var(--sale); }
.menu-boton__trazo { stroke-dasharray: 12 63; transition: stroke-dasharray .5s var(--sale), stroke-dashoffset .5s var(--sale); }
.menu-boton[aria-expanded="true"] svg { transform: rotate(-45deg); }
.menu-boton[aria-expanded="true"] .menu-boton__trazo { stroke-dasharray: 20 300; stroke-dashoffset: -32.42px; }

.menu { position: fixed; inset: 0; z-index: 60; }
.menu[hidden] { display: none; }
.menu__velo {
  position: absolute; inset: 0; background: color-mix(in oklab, var(--sombra-boj) 55%, transparent);
  opacity: 0; transition: opacity .35s var(--sale);
}
.menu__hoja {
  position: absolute; inset: 0 auto 0 0; width: min(23rem, 88vw); display: flex; flex-direction: column;
  background: var(--superficie); color: var(--tinta); box-shadow: var(--elev-2);
  padding: max(var(--e-4), env(safe-area-inset-top)) var(--e-5) max(var(--e-5), env(safe-area-inset-bottom));
  transform: translateX(-104%); transition: transform .45s var(--sale);
  overflow-y: auto; overscroll-behavior: contain;
}
.menu.abierto .menu__velo { opacity: 1; }
.menu.abierto .menu__hoja { transform: none; }

.menu__cabeza { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); padding-bottom: var(--e-5); border-bottom: 1px solid var(--linea); }
.menu__titulo { font-family: var(--f-titulo); font-size: 1.15rem; line-height: 1.15; }
.menu__cerrar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--linea-fuerte); background: transparent; color: var(--tinta); cursor: pointer; padding: 0; }
.menu__cerrar:hover { border-color: var(--acento); }
.menu__cerrar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.menu__nav { padding-block: var(--e-4); flex: 1; }
.menu__lista, .menu__sublista { list-style: none; margin: 0; padding: 0; }
.menu__lista > li + li { border-top: 1px solid var(--linea); padding-top: var(--e-1); }
.menu__enlace {
  display: flex; align-items: center; min-height: 52px; padding-block: var(--e-2);
  font-family: var(--f-titulo); font-size: 1.5rem; line-height: 1.1; text-decoration: none; color: var(--tinta);
  transition: color .2s;
}
.menu__sublista { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--e-4); padding-bottom: var(--e-3); }
.menu__subenlace { display: flex; align-items: center; min-height: 44px; font-size: 1.0625rem; text-decoration: none; color: var(--tinta-2); transition: color .2s; }
.menu__enlace:hover, .menu__subenlace:hover { color: var(--acento); }
.menu__enlace[aria-current="page"], .menu__subenlace[aria-current="page"] { color: var(--acento); }
.menu__enlace[aria-current="page"]::before, .menu__subenlace[aria-current="page"]::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: var(--e-2); flex: none;
}

.menu__pie { display: grid; gap: var(--e-2); padding-top: var(--e-4); border-top: 1px solid var(--linea); }
.menu__cta { width: 100%; justify-content: center; }
.menu__nota { font-size: .95rem; color: var(--tinta-2); text-align: center; }

/* Entrada escalonada de los enlaces al abrir */
.menu__lista > li, .menu__pie { opacity: 0; transform: translateX(-12px); transition: opacity .35s var(--sale), transform .45s var(--resorte-suave); }
.menu.abierto .menu__lista > li, .menu.abierto .menu__pie { opacity: 1; transform: none; }
.menu.abierto .menu__lista > li:nth-child(1) { transition-delay: .08s; }
.menu.abierto .menu__lista > li:nth-child(2) { transition-delay: .13s; }
.menu.abierto .menu__lista > li:nth-child(3) { transition-delay: .18s; }
.menu.abierto .menu__pie { transition-delay: .23s; }

html.menu-abierto, html.menu-abierto body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .menu-boton svg, .menu-boton__trazo, .menu__velo, .menu__hoja, .menu__lista > li, .menu__pie { transition: none !important; }
}
