/**
 * Forodyt — Mobile editorial menu
 * Overlay full-screen con tipografia Fraunces, stagger animation,
 * sincroniza con foroI18n para cambio de idioma.
 *
 * Visible solo en <= 1024px. Inyectado por mobile-menu.js basado
 * en los .nav-links existentes en la pagina.
 */

/* ===== TRIGGER ===== */
.mm-trigger {
  display: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #0B2430;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px 0;
  margin-left: 18px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mm-trigger::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 100%;
  height: 1px;
  background: #C08B3C;
  transform-origin: left;
  transform: scaleX(0.35);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.mm-trigger:hover::after,
.mm-trigger:focus-visible::after { transform: scaleX(1); }

@media (max-width: 1024px) {
  .mm-trigger { display: inline-block; }
}

/* ===== OVERLAY ===== */
.mm-overlay {
  position: fixed;
  inset: 0;
  background: #FBF8F3;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(15,107,124,0.06) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(192,139,60,0.06) 0%, transparent 45%);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0.45s;
  display: flex;
  flex-direction: column;
  padding: 26px 32px 36px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mm-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0s;
}

/* corner ornaments */
.mm-overlay::before,
.mm-overlay::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border: 1.5px solid #0B2430;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
.mm-overlay::before { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.mm-overlay::after  { bottom: 14px; right: 14px; border-left: none; border-top: none; }
.mm-overlay.is-open::before,
.mm-overlay.is-open::after { opacity: 0.55; }

/* ===== HEADER ===== */
.mm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(11, 36, 48, 0.18);
  position: relative;
  z-index: 1;
}

.mm-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: #0B2430;
  letter-spacing: -0.01em;
}
.mm-brand em {
  font-style: italic;
  font-weight: 400;
  color: #094651;
  margin-left: 6px;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.mm-close {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #0B2430;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
}
.mm-close::before {
  content: "×";
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-style: italic;
  color: #C08B3C;
  line-height: 1;
  position: relative;
  top: -1px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.mm-close:hover::before { transform: rotate(90deg); }

/* ===== LINKS ===== */
.mm-links {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  position: relative;
  z-index: 1;
}

.mm-links li {
  border-bottom: 1px solid rgba(11, 36, 48, 0.08);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.mm-overlay.is-open .mm-links li {
  opacity: 1;
  transform: translateY(0);
}

/* stagger */
.mm-overlay.is-open .mm-links li:nth-child(1) { transition-delay: 0.10s; }
.mm-overlay.is-open .mm-links li:nth-child(2) { transition-delay: 0.16s; }
.mm-overlay.is-open .mm-links li:nth-child(3) { transition-delay: 0.22s; }
.mm-overlay.is-open .mm-links li:nth-child(4) { transition-delay: 0.28s; }
.mm-overlay.is-open .mm-links li:nth-child(5) { transition-delay: 0.34s; }
.mm-overlay.is-open .mm-links li:nth-child(6) { transition-delay: 0.40s; }
.mm-overlay.is-open .mm-links li:nth-child(7) { transition-delay: 0.46s; }

.mm-links a {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: baseline;
  gap: 14px;
  padding: 22px 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 38px;
  font-weight: 400;
  color: #0B2430;
  text-decoration: none;
  letter-spacing: -0.02em;
  font-style: italic;
  line-height: 1.0;
  transition: color 0.25s, padding-left 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 380px) {
  .mm-links a { font-size: 32px; padding: 18px 0; }
}

.mm-links a:hover,
.mm-links a:focus-visible {
  color: #094651;
  padding-left: 6px;
}

.mm-num {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #C08B3C;
  font-weight: 500;
  text-transform: uppercase;
  align-self: center;
  text-align: right;
  padding-right: 4px;
  border-right: 1px solid rgba(192, 139, 60, 0.35);
}

/* ===== FOOTER ===== */
.mm-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(11, 36, 48, 0.18);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.55s,
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.55s;
  position: relative;
  z-index: 1;
}
.mm-overlay.is-open .mm-footer {
  opacity: 1;
  transform: translateY(0);
}

.mm-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #5c6c74;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mm-lang span[data-lang] {
  cursor: pointer;
  padding: 6px 4px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mm-lang span[data-lang]:hover { color: #0B2430; }
.mm-lang span[data-lang].active { color: #0B2430; font-weight: 600; }

.mm-volver {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #094651;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
}
.mm-volver::after {
  content: "→";
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-style: italic;
  color: #C08B3C;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.mm-volver:hover::after { transform: translateX(4px); }

/* lock body scroll */
body.mm-locked { overflow: hidden; }

/* ===== MOBILE NAV FIT =====
 * En mobile el nav debe caber en ~390px sin scroll horizontal.
 * El switcher de idioma SI se muestra en el header (acceso directo, sin abrir
 * el menu). Compactamos gaps y ocultamos el subtitulo de marca para que quepa.
 */
@media (max-width: 1024px) {
  .nav .lang { display: flex; align-items: center; }
  .nav-cta { gap: 12px; }
  .mm-trigger { margin-left: 6px; }
}
@media (max-width: 700px) {
  .brand-sub,
  .brand-rule { display: none; }
  .nav .lang { font-size: 10px; letter-spacing: 0.08em; }
  .nav .lang span { padding: 0 2px; }
}
@media (max-width: 400px) {
  .nav-cta { gap: 8px; }
  .nav-inner { padding-left: 16px; padding-right: 16px; }
}
