/* ==========================================
   SARENSYS - Responsive Stylesheet
   Mobile-First Responsive Design
   ========================================== */

/* ==========================================
   MOBILE NAVIGATION (< 1024px)
   ========================================== */

@media (max-width: 1023px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-10) var(--space-4) var(--space-4);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right var(--transition-base);
    z-index: 1001;
    overflow-y: auto;
  }

  .nav-menu--open {
    right: 0;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    width: 100%;
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-gray-light);
  }

  .nav-menu a.active::after {
    display: none;
  }

  .nav-menu a.active {
    background: var(--color-gray-bg);
    color: var(--color-orange);
  }

  .mobile-menu-toggle {
    display: flex;
    z-index: 1002;
  }

  .lang-switcher {
    order: -1;
  }
}

/* ==========================================
   TABLET (640px - 1023px)
   ========================================== */

@media (min-width: 640px) and (max-width: 1023px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fields-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-detail-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================
   MOBILE ONLY (< 640px)
   ========================================== */

@media (max-width: 639px) {
  /* Typography Adjustments */
  :root {
    --text-5xl: 2rem;      /* 32px */
    --text-4xl: 1.75rem;   /* 28px */
    --text-3xl: 1.5rem;    /* 24px */
  }

  /* Container Padding */
  .container {
    padding: 0 var(--space-3);
  }

  /* Hero Section */
  .hero {
    min-height: 80vh;
  }

  .hero__content {
    padding: var(--space-4);
  }

  .hero__cta {
    flex-direction: column;
    width: 100%;
  }

  .hero__cta .btn {
    width: 100%;
  }

  /* Page Hero */
  .page-hero {
    height: 30vh;
    min-height: 250px;
  }

  /* Section Spacing */
  section {
    padding: var(--space-6) 0;
  }

  /* Grids */
  .services-grid,
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .fields-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .service-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  /* Buttons */
  .btn-large {
    padding: 14px 32px;
    font-size: var(--text-base);
  }

  /* Cards */
  .service-card,
  .project-card {
    margin-bottom: var(--space-3);
  }

  .service-card {
    padding: var(--space-4);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

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

  .footer-links,
  .footer-contact {
    text-align: left;
  }

  .social-links {
    justify-content: center;
  }

  /* Modal */
  .modal {
    padding: var(--space-2);
  }

  .modal__content {
    padding: var(--space-4);
  }

  /* Project Filters */
  .project-filters {
    gap: var(--space-1);
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: var(--text-sm);
  }

  /* Form */
  .contact-grid {
    grid-template-columns: 1fr !important;
  }
}

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

@media (min-width: 1024px) {
  /* Hide mobile menu toggle */
  .mobile-menu-toggle {
    display: none;
  }

  /* 3-column grids */
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hover effects enabled */
  .card:hover,
  .project-card:hover,
  .service-card:hover {
    transform: translateY(-4px);
  }

  /* Section spacing */
  section {
    padding: var(--space-12) 0;
  }
}

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

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

  /* Even larger spacing for very wide screens */
  section {
    padding: var(--space-16) 0;
  }

  /* 4-column grid for services on very large screens */
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  .site-header,
  .site-footer,
  .hero__cta,
  .btn,
  .lang-switcher,
  .mobile-menu-toggle,
  .social-links {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
    color: #000;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  section {
    page-break-inside: avoid;
  }
}

/* ==========================================
   REDUCED MOTION (Accessibility)
   ========================================== */

@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;
  }

  .card:hover,
  .project-card:hover,
  .service-card:hover {
    transform: none;
  }
}

/* ==========================================
   HIGH CONTRAST MODE (Accessibility)
   ========================================== */

@media (prefers-contrast: high) {
  :root {
    --color-text: #000000;
    --color-gray: #4A4A4A;
  }

  .btn {
    border-width: 3px;
  }

  a {
    text-decoration: underline;
  }
}

/* ==========================================
   LANDSCAPE ORIENTATION ON MOBILE
   ========================================== */

@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
  }

  .page-hero {
    height: 50vh;
  }
}
