/* css/myMenu.css — generated by render-mymenu per ST-myMenu-DevGuide-001.
   Desktop = horizontal bar. Mobile (<48rem) = full-screen overlay.
   Uses --brand-* tokens with fallbacks; the stylist re-skins, NEVER regresses
   the structure/behaviour (see the skill's "Pitfalls"). */
:root {
  --MenuPulsanteDim: 3rem;
  --MenuColore: var(--brand-primary, #111827);
  --MenuFondo: var(--brand-surface, #FFFFFF);
  --MenuAccent: var(--brand-accent-strong, var(--brand-primary, #0E4D92));
  --MenuOverlayA: var(--brand-primary, #0A192F);
  --MenuOverlayB: var(--brand-secondary, #0D2A4A);
  --MenuOnDark: var(--brand-on-dark, #E6F1FF);
  --MenuAccentDark: var(--brand-accent, #0EA5E9);
  /* Stylist sets this to e.g. brightness(0) invert(1) for a dark line-art
     logo shown on the dark overlay; default keeps the logo untouched. */
  --MenuLogoFilter: brightness(0) invert(1);  /* navy LC mark → light on the dark overlay */
}

.myMenu { background: transparent; }

/* Set by myMenu.js while the full-screen overlay is open */
body.myMenu-locked { overflow: hidden; }

/* Desktop: panel is layout-transparent; brand mark + social row are
   mobile-overlay only (desktop has the header logo + footer socials) */
.myMenu-panel { display: contents; }
.myMenu-social,
.myMenu-brand { display: none; }

.myMenu-list {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  align-items: center;
}
.myMenu-list a {
  color: var(--MenuColore);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.375rem 0;
}
.myMenu-list .is-current a { color: var(--MenuAccent); }
.myMenu-list .is-cta a {
  color: var(--MenuFondo);
  background: var(--MenuAccent);
  padding: 0.625rem 1.25rem;
  border-radius: 0.625rem;
  font-weight: 700;
}
@media (hover: hover) {
  .myMenu-list a:hover { color: var(--MenuAccent); }
}
.myMenu-list a:focus-visible {
  outline: 0.1875rem solid var(--MenuAccent);
  outline-offset: 0.125rem;
  border-radius: 0.25rem;
}

/* ---- Hamburger button — symmetric X by construction --------------------
   All 3 bars share the EXACT same centre (50%,50%); the closed hamburger is
   just the top/bottom bar offset by 0.5rem. The "X" is therefore symmetric
   with NO guessed translate distance. */
.myMenu-toggle {
  display: none;
  position: relative;
  background: none;
  border: 0;
  width: var(--MenuPulsanteDim);
  height: var(--MenuPulsanteDim);
  cursor: pointer;
  padding: 0;
}
.myMenu-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5rem;
  height: 0.1875rem;
  border-radius: 0.125rem;
  background: var(--MenuColore);
  transition: transform 0.25s ease, opacity 0.2s ease, background-color 0.25s ease;
}
.myMenu-toggle span:nth-child(1) { transform: translate(-50%, calc(-50% - 0.5rem)); }
.myMenu-toggle span:nth-child(2) { transform: translate(-50%, -50%); }
.myMenu-toggle span:nth-child(3) { transform: translate(-50%, calc(-50% + 0.5rem)); }

@media (max-width: 47.999rem) {
  /* Fixed in BOTH states with identical coords: opening only morphs the
     bars (no position-type switch) → no lateral jump. Above the overlay. */
  .myMenu-toggle {
    display: block;
    position: fixed;
    top: 0.875rem;
    right: clamp(0.75rem, 4vw, 2.5rem);
    z-index: 60;
  }
  .myMenu.is-open .myMenu-toggle span { background: #FFFFFF; }
  .myMenu.is-open .myMenu-toggle span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
  .myMenu.is-open .myMenu-toggle span:nth-child(2) { opacity: 0; }
  .myMenu.is-open .myMenu-toggle span:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

  /* Full-screen overlay — brand gradient + soft accent glow. 3 zones.
     position:fixed → fills the VIEWPORT. KEEP every ancestor (header[role=
     banner], .myMenu, body) free of transform / filter / backdrop-filter /
     perspective / contain / will-change at mobile widths, or that ancestor
     becomes this panel's containing block and the overlay shrinks to its box
     (e.g. the ~4.5rem sticky header → "open menu shows only the top strip").
     See Pitfall #8. */
  .myMenu-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    inset: 0;
    z-index: 55;
    isolation: isolate;
    padding: clamp(3rem, 9vh, 5rem) clamp(1.5rem, 8vw, 3rem) clamp(2.5rem, 6vh, 4rem);
    background:
      radial-gradient(55rem 38rem at 50% 20%, color-mix(in srgb, var(--MenuAccentDark) 20%, transparent), transparent 62%),
      linear-gradient(160deg, var(--MenuOverlayA) 0%, var(--MenuOverlayB) 100%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.75rem);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0.28s;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .myMenu-brand,
  .myMenu-list,
  .myMenu-social { position: relative; z-index: 1; }

  .myMenu.is-open .myMenu-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s;
  }

  /* Brand mark (top zone) */
  .myMenu-brand {
    display: block;
    flex: 0 0 auto;
    margin: 0.25rem 0 0.5rem;
  }
  .myMenu-brand img {
    display: block;
    height: 3rem;
    width: auto;
    filter: var(--MenuLogoFilter);
    opacity: 0.95;
  }

  /* ---- Open overlay = editorial "frontispiece" ---------------------------
     Title-page rhythm: brand mark + a short brass rule, a serif index of the
     pages anchored near the top (not floating in the middle), and a quiet
     mono metadata signature pinned to the foot so the composition is balanced
     top-to-bottom instead of leaving a void under the masthead. */
  .myMenu-list {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.1rem, 1.4vh, 0.6rem);
    width: 100%;
    margin-top: clamp(2rem, 7vh, 4.5rem);
  }
  /* Short brass rule between the masthead and the index */
  .myMenu-list::before {
    content: "";
    width: 2.25rem;
    height: 0.0625rem;
    background: var(--MenuAccentDark);
    opacity: 0.85;
    margin-bottom: clamp(1.75rem, 5vh, 3rem);
  }
  .myMenu-list li {
    width: 100%;
    text-align: center;
    /* orchestrated open: each index line settles in, fast + subtle */
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .myMenu-list a {
    position: relative;
    display: inline-block;
    font-family: 'IBM Plex Serif', Georgia, serif;
    color: var(--MenuOnDark);
    font-size: clamp(1.6rem, 7vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.15;
    padding: 0.5rem 1.25rem;
    transition: color 0.22s ease;
  }
  .myMenu-list .is-current a {
    color: var(--brass-on-dark, var(--MenuAccentDark));
    font-weight: 600;
  }
  /* Active page: a slim brass hairline (not a heavy bar) */
  .myMenu-list .is-current a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.25rem;
    transform: translateX(-50%);
    width: 1.5rem;
    height: 0.0625rem;
    background: var(--MenuAccentDark);
  }
  /* CTA pill kept for menus that use one (none on this brand) */
  .myMenu-list .is-cta a {
    margin-top: 1rem;
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 1rem;
    color: var(--MenuAccentDark);
    background: transparent;
    border: 0.09375rem solid var(--MenuAccentDark);
    border-radius: 999px;
    padding: 0.75rem 2.5rem;
    font-weight: 600;
    letter-spacing: 0;
  }
  .myMenu-list .is-cta a::after { content: none; }
  @media (hover: hover) {
    .myMenu-list a:hover { color: var(--brass-on-dark, var(--MenuAccentDark)); }
    .myMenu-list .is-cta a:hover {
      background: color-mix(in srgb, var(--MenuAccentDark) 14%, transparent);
      color: var(--MenuAccentDark);
    }
  }
  .myMenu-list a:focus-visible {
    outline: 0.1875rem solid var(--MenuAccentDark);
    outline-offset: 0.125rem;
    border-radius: 0.25rem;
  }
  /* Index lines settle in once the overlay is open (staggered) */
  .myMenu.is-open .myMenu-list li { opacity: 1; transform: none; }
  .myMenu.is-open .myMenu-list li:nth-child(1) { transition-delay: 0.06s; }
  .myMenu.is-open .myMenu-list li:nth-child(2) { transition-delay: 0.11s; }
  .myMenu.is-open .myMenu-list li:nth-child(3) { transition-delay: 0.16s; }
  .myMenu.is-open .myMenu-list li:nth-child(4) { transition-delay: 0.21s; }
  .myMenu.is-open .myMenu-list li:nth-child(5) { transition-delay: 0.26s; }
  .myMenu.is-open .myMenu-list li:nth-child(6) { transition-delay: 0.31s; }

  /* Quiet metadata signature pinned to the foot (mono = data/eyebrow, on-brand) */
  .myMenu-panel::after {
    content: "CUNEF Universidad · Madrid";
    margin-top: auto;
    padding-top: clamp(1.5rem, 5vh, 3rem);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--on-dark-soft, #BFC6D0);
    z-index: 1;
  }

  /* Social row (bottom zone) — separated by a hairline */
  .myMenu-social {
    display: flex;
    list-style: none;
    margin: 1.75rem auto 0;
    padding: 1.5rem 0 0;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 16rem;
    border-top: 0.0625rem solid color-mix(in srgb, var(--MenuOnDark) 16%, transparent);
  }
  .myMenu-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.875rem;
    height: 2.875rem;
    border-radius: 50%;
    color: var(--MenuOnDark);
    border: 0.0625rem solid color-mix(in srgb, var(--MenuOnDark) 28%, transparent);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  }
  .myMenu-social svg { display: block; width: 1.375rem; height: 1.375rem; }
  @media (hover: hover) {
    .myMenu-social a:hover {
      color: var(--MenuAccentDark);
      border-color: var(--MenuAccentDark);
      background-color: color-mix(in srgb, var(--MenuAccentDark) 14%, transparent);
    }
  }
  .myMenu-social a:focus-visible {
    outline: 0.1875rem solid var(--MenuAccentDark);
    outline-offset: 0.1875rem;
  }
}

/* Respect reduced-motion: keep it functional, drop the motion */
@media (prefers-reduced-motion: reduce) {
  .myMenu-toggle span,
  .myMenu-panel,
  .myMenu.is-open .myMenu-panel { transition: none; }
  .myMenu-panel { transform: none; }
  /* No entrance stagger: index lines are shown immediately */
  .myMenu-list li { opacity: 1; transform: none; transition: none; }
}
