/**
 * Mobile UI/UX Overhaul - OnFire Academy (FO)
 * ===========================================
 * Reglas globales móvil: momentum scroll, scroll containers, reduced-motion.
 * Las variables --safe-* y touch targets están en layout.html.
 */

/* MOBILE: momentum scrolling en contenedores con scroll (iOS) */
.scroll-touch {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* MOBILE: respetar preferencia de reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* MOBILE: feedback visual en tap para elementos interactivos */
@media (max-width: 768px) {
  .btn:active,
  .nav-link:active,
  button:active,
  a.btn:active {
    opacity: 0.9;
    transform: scale(0.98);
  }
  .btn-primary:active { opacity: 0.95; }
  .mobile-nav-toggle:active span {
    opacity: 0.8;
  }
}

/* Responsive: solo aplicar reglas móviles en viewport pequeño */
@media (max-width: 768px) {
  /* Asegurar que contenedores con overflow permitan scroll nativo */
  main {
    overflow-x: hidden;
  }

  /* Footer compacto en móvil: menos altura, no tapa contenido (p. ej. study) */
  footer {
    padding-top: 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px) + 0.5rem);
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    font-size: 0.8rem;
    border-top-width: 1px;
  }

  footer .logo {
    font-size: 1rem;
    margin-bottom: 0.4rem;
  }

  footer .social-links {
    margin: 0.4rem 0;
    font-size: 1.15rem;
    gap: 0.75rem;
  }

  footer p {
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0.5rem 0 0;
  }

  footer .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Navegadores móviles nativos (touch): footer mínimo para no tapar contenido */
@media (max-width: 768px) and (hover: none) {
  footer {
    padding-top: 0.6rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px) + 0.35rem);
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    font-size: 0.75rem;
    min-height: 0;
  }

  footer .logo {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
  }

  footer .social-links {
    margin: 0.25rem 0;
    font-size: 1rem;
    gap: 0.5rem;
  }

  footer p {
    font-size: 0.7rem;
    line-height: 1.35;
    margin: 0.35rem 0 0;
  }
}
