/* Recoloured for the 'plastica' profile by .scripts/export_exhibitor_list_standalone.php:
   orange brand palette -> blue around #00aeef. Contrast figures in the comments below were
   written for the original orange colours; the blue ones give the same or better contrast. */
/**
 * @file: assets/css/mobile.css
 * @description: Canonical mobile-first responsive stylesheet for SYSKEVASIA Expo.
 *               Referenced by src/views/layouts/main.php (design-system foundation).
 *               Depends on assets/css/global.css tokens.
 * @tags: #mobile #responsive #css #design-system
 */

/* ============================================
   MOBILE-FIRST BASE STYLES
   ============================================ */

/* Mobile base (default - 320px+) */
:root {
  --mobile-padding: 16px;
  --mobile-gap: 12px;
  --touch-target-min: 44px;
}

/* Touch-friendly interactions */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
}

/* Ensure smooth scrolling on mobile */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* overflow-x removed from body — it breaks position:sticky; html handles it */

/* ============================================
   MOBILE TYPOGRAPHY
   ============================================ */

/* Mobile font sizes - optimized for readability */
body {
  font-size: 16px;
  line-height: 1.6;
}

h1 {
  font-size: 2rem; /* 32px */
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem; /* 24px */
  line-height: 1.3;
  margin-bottom: 0.875rem;
}

h3 {
  font-size: 1.25rem; /* 20px */
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

p {
  font-size: 1rem; /* 16px */
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ============================================
   MOBILE LAYOUT - SINGLE COLUMN
   ============================================ */

.container {
  padding-left: var(--mobile-padding);
  padding-right: var(--mobile-padding);
  max-width: 100%;
}

/* Stack all flex/grid layouts on mobile */
.hero-content,
.about-content,
.services-grid,
.team-grid,
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: var(--mobile-gap);
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: block;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Hamburger animation */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding-top: 80px;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile navigation links */
.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  list-style: none;
}

.mobile-nav a {
  display: block;
  padding: 16px 24px;
  min-height: var(--touch-target-min);
  font-size: 1.125rem;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  transition: background 0.2s ease;
}

.mobile-nav a:active {
  background: #f5f5f5;
}

/* ============================================
   TOUCH-FRIENDLY BUTTONS
   ============================================ */

button,
.btn,
a[role="button"] {
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: 12px 24px;
  touch-action: manipulation;
  user-select: none;
}

/* Increase touch targets for links */
nav a,
.nav-link {
  padding: 12px 16px;
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
}

/* ============================================
   MOBILE HERO SECTION
   ============================================ */

.hero {
  min-height: 60vh;
  padding: 60px var(--mobile-padding) 40px;
}

.hero-content {
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.hero-buttons .btn {
  width: 100%;
}

/* ============================================
   MOBILE SECTIONS
   ============================================ */

section {
  padding: 40px var(--mobile-padding);
}

.section-title {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* ============================================
   MOBILE CARDS & GRIDS
   ============================================ */

.card {
  padding: 20px;
  margin-bottom: 16px;
}

.services-grid,
.team-grid,
.exhibitors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ============================================
   MOBILE IMAGES
   ============================================ */

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

/* Lazy loading placeholder */
img[data-src] {
  background: #f0f0f0;
  min-height: 200px;
}

img.lazy-loaded {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   MOBILE CAROUSEL/SLIDER
   ============================================ */

.carousel {
  position: relative;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease;
}

.carousel-slide {
  min-width: 100%;
  scroll-snap-align: start;
}

.carousel-controls {
  display: none; /* Hide on mobile, use swipe gestures */
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  border: none;
  padding: 0;
  transition: background 0.2s ease;
}

.carousel-dot.active {
  background: #0066cc;
}

/* ============================================
   MOBILE FORMS
   ============================================ */

input,
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px; /* Prevent zoom on iOS */
  min-height: var(--touch-target-min);
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 16px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

/* ============================================
   MOBILE FOOTER
   ============================================ */

footer {
  padding: 40px var(--mobile-padding) 20px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-section {
  text-align: center;
}

/* ============================================
   MOBILE UTILITIES
   ============================================ */

.hide-mobile {
  display: none !important;
}

.show-mobile {
  display: block !important;
}

/* Prevent horizontal scroll */
.overflow-hidden-mobile {
  overflow-x: hidden;
}

/* ============================================
   TABLET BREAKPOINT (768px+)
   ============================================ */

@media (min-width: 768px) {
  :root {
    --mobile-padding: 24px;
    --mobile-gap: 16px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero {
    min-height: 70vh;
    padding: 80px var(--mobile-padding) 60px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }

  .hero-buttons .btn {
    width: auto;
  }

  /* 2-column grid for tablets */
  .services-grid,
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  /* Show desktop nav, hide mobile menu */
  .mobile-menu-toggle {
    display: none;
  }

  .mobile-menu {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .mobile-nav {
    flex-direction: row;
  }

  .mobile-nav a {
    border: none;
    padding: 12px 16px;
  }

  section {
    padding: 60px var(--mobile-padding);
  }

  .carousel-controls {
    display: flex;
  }
}

/* ============================================
   DESKTOP BREAKPOINT (1024px+)
   ============================================ */

@media (min-width: 1024px) {
  :root {
    --mobile-padding: 32px;
    --mobile-gap: 24px;
  }

  .container {
    max-width: 1200px;
    margin: 0 auto;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  .hero {
    min-height: 80vh;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  /* 3-column grid for desktop */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .team-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }

  section {
    padding: 80px var(--mobile-padding);
  }

  .hide-mobile {
    display: block !important;
  }

  .show-mobile {
    display: none !important;
  }
}

/* ============================================
   LARGE DESKTOP (1440px+)
   ============================================ */

@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }

  h1 {
    font-size: 3.5rem;
  }

  .hero h1 {
    font-size: 4rem;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce animations on mobile for performance */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* GPU acceleration for smooth animations */
.carousel-track,
.mobile-menu,
.mobile-menu-toggle span {
  transform: translateZ(0);
  will-change: transform;
}

/* Optimize font rendering on mobile */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
