/* ══════════════════════════════════════════════════════════════
   LATINOS FC — Global Responsive & Navigation Styles
   Mobile-first · 8px rhythm · Glass dark theme
   ══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --color-surface:                 #0f1418;
  --color-surface-container:       #1b2024;
  --color-surface-container-high:  #252b2f;
  --color-on-surface:              #dee3e9;
  --color-primary:                 #89ceff;
  --color-on-primary:              #00344d;
  --color-outline-variant:         #3e4850;
  --color-gold:                    #D4AF37;

  --ease-spring: cubic-bezier(.16, 1, .3, 1);
  --dur-fast:  150ms;
  --dur-base:  250ms;
  --dur-slow:  380ms;
}

/* ── Base ───────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  overflow-x: clip;     /* clip no rompe position:sticky (hidden sí puede) */
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
  min-height: 100dvh;
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Overflow guard ─────────────────────────────────────────── */
section,
footer {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ── Focus ring (keyboard navigation) ──────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ══════════════════════════════════════════════════════════════
   HAMBURGER BUTTON
   ══════════════════════════════════════════════════════════════ */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background var(--dur-fast) ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, .06);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition:
    transform var(--dur-base) var(--ease-spring),
    opacity   var(--dur-fast) ease;
  transform-origin: center;
}

/* Hamburger → X animation */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE DROPDOWN MENU
   ══════════════════════════════════════════════════════════════ */
.nav-mobile-menu {
  background: rgba(15, 20, 24, .97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(62, 72, 80, .55);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
  overflow: hidden;

  /* Closed state */
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    max-height  var(--dur-slow) var(--ease-spring),
    opacity     var(--dur-base) ease,
    visibility  0s linear var(--dur-base);
}

.nav-mobile-menu.is-open {
  max-height: 480px;
  opacity: 1;
  visibility: visible;
  transition:
    max-height  var(--dur-slow) var(--ease-spring),
    opacity     var(--dur-base) ease,
    visibility  0s linear 0s;
}

.nav-mobile-inner {
  padding: 8px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Individual menu links */
.nav-mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 48px;           /* WCAG touch target */
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 2px solid transparent;

  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(222, 227, 233, .7);

  transition:
    color        var(--dur-fast) ease,
    background   var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    transform    var(--dur-fast) ease;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-mobile-menu a:hover,
.nav-mobile-menu a:focus-visible {
  color: var(--color-primary);
  background: rgba(137, 206, 255, .06);
  border-left-color: var(--color-primary);
  transform: translateX(4px);
  outline: none;
}

.nav-mobile-menu a.is-active {
  color: var(--color-primary);
  border-left-color: var(--color-gold);
  background: rgba(137, 206, 255, .05);
}

/* ── Desktop: hide mobile-only elements ─────────────────────── */
@media (min-width: 768px) {
  .nav-toggle,
  .nav-mobile-menu {
    display: none !important;
  }
}

/* ── Nav scroll shadow (aparece al hacer scroll) ────────────── */
nav {
  transition: box-shadow 250ms ease;
}
nav.nav-scrolled {
  box-shadow: 0 2px 24px rgba(0, 0, 0, .55);
}

/* ── Logo link ──────────────────────────────────────────────── */
.nav-brand {
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:focus-visible {
  outline: 2px solid var(--color-primary);
  border-radius: 4px;
  outline-offset: 3px;
}

/* ── Divisor dentro del menú móvil ──────────────────────────── */
.nav-mobile-divider {
  height: 1px;
  background: rgba(62, 72, 80, .5);
  margin: 8px 16px;
}

/* ── Botón Ingresar dentro del menú móvil ───────────────────── */
.nav-mobile-menu a.nav-mobile-ingresar {
  background: var(--color-gold);
  color: #0f1418;
  border-left: none;
  transform: none;
  justify-content: center;
  margin: 4px;
}
.nav-mobile-menu a.nav-mobile-ingresar:hover,
.nav-mobile-menu a.nav-mobile-ingresar:focus-visible {
  background: #e8c347;
  color: #0f1418;
  border-left-color: transparent;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE UTILITIES
   ══════════════════════════════════════════════════════════════ */

/* Images declare their own dimensions to avoid layout shift (CLS) */
img[width][height] {
  height: auto;
}

/* Readable line lengths on all screens */
p, li {
  max-width: 75ch;
}

/* Tables scroll horizontally instead of breaking layout */
table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── iOS safe-area padding for footer ───────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* ══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .marquee-track {
    animation: none;
  }
}
