/* ==========================================================================
   Responsive Design - Mobile First Approach
   ========================================================================== */

/* ==========================================================================
   Breakpoint Variables and Base Mobile Styles (320px+)
   ========================================================================== */

/* Base mobile styles are already defined in style.css */
/* This file contains additional responsive adjustments */

/* ==========================================================================
   Mobile Navigation Enhancements
   ========================================================================== */

/* Mobile menu backdrop effect */
.nav::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: -1;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.nav.active::before {
  opacity: 1;
  visibility: visible;
}

/* Enhanced mobile navigation styles */
@media (max-width: 768px) {
  /* Mobile menu toggle enhancements */
  .mobile-menu-toggle {
    position: relative;
    z-index: var(--z-fixed);
  }
  
  /* Navigation menu enhancements */
  .nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 4px 20px var(--shadow-medium);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: var(--z-dropdown);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  
  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  /* Navigation list enhancements */
  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: var(--space-4) 0;
  }
  
  .nav-list li {
    width: 100%;
    margin-bottom: 0;
  }
  
  /* Navigation link enhancements */
  .nav-link {
    display: block;
    width: 100%;
    padding: var(--space-4) var(--space-6);
    text-align: center;
    border-radius: 0;
    border-bottom: 1px solid var(--light-gray);
    font-size: var(--text-base);
    transition: all var(--transition-normal);
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  .nav-link:hover,
  .nav-link:focus {
    background-color: rgba(230, 126, 34, 0.1);
    color: var(--accent-orange);
  }
  
  .nav-link.active {
    background-color: rgba(230, 126, 34, 0.15);
    color: var(--accent-orange);
    font-weight: var(--font-semibold);
  }
  
  .nav-link.active::after {
    display: none;
  }
  
  /* Hamburger animation states */
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background-color: var(--accent-orange);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background-color: var(--accent-orange);
  }
  
  /* Body scroll lock when menu is open */
  body.menu-open {
    overflow: hidden;
  }
  
  /* Header background when menu is open */
  .header.menu-open {
    background-color: var(--white);
    box-shadow: 0 2px 10px var(--shadow-medium);
  }
  
  /* Smooth slide animation for mobile menu */
  .nav {
    transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
  }
  
  /* Enhanced mobile menu item animations */
  .nav-link {
    transform: translateX(-20px);
    opacity: 0;
    transition: all var(--transition-normal);
  }
  
  .nav.active .nav-link {
    transform: translateX(0);
    opacity: 1;
  }
  
  /* Stagger animation for menu items */
  .nav.active .nav-link:nth-child(1) { transition-delay: 0.1s; }
  .nav.active .nav-link:nth-child(2) { transition-delay: 0.15s; }
  .nav.active .nav-link:nth-child(3) { transition-delay: 0.2s; }
  .nav.active .nav-link:nth-child(4) { transition-delay: 0.25s; }
  .nav.active .nav-link:nth-child(5) { transition-delay: 0.3s; }
}

/* ==========================================================================
   Small Mobile Devices (320px - 480px)
   ========================================================================== */

@media (max-width: 480px) {
  /* Container adjustments */
  .container {
    padding: 0 var(--space-3);
  }
  
  /* Typography adjustments */
  .section-title {
    font-size: var(--text-2xl);
  }
  
  .section-subtitle {
    font-size: var(--text-base);
  }
  
  /* Header adjustments */
  .header-content {
    padding: var(--space-3) 0;
    min-height: 60px;
  }
  
  .logo-text {
    font-size: var(--text-lg);
  }
  
  .logo img {
    height: 30px;
  }
  
  /* Hero section adjustments */
  .hero {
    min-height: 70vh;
  }
  
  .hero-content {
    padding: var(--space-4) var(--space-2);
  }
  
  .hero-title {
    font-size: var(--text-2xl);
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: var(--text-lg);
  }
  
  .hero-description {
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
  }
  
  /* Button adjustments */
  .btn {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
  }
  
  .hero .btn {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-base);
  }
  
  /* Section spacing */
  section {
    padding: var(--space-12) 0;
  }
  
  .section-header {
    margin-bottom: var(--space-8);
  }
}

/* ==========================================================================
   Large Mobile Devices (481px - 767px)
   ========================================================================== */

@media (min-width: 481px) and (max-width: 767px) {
  /* Container adjustments */
  .container {
    padding: 0 var(--space-4);
  }
  
  /* Hero adjustments */
  .hero {
    min-height: 80vh;
  }
  
  .hero-title {
    font-size: var(--text-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-xl);
  }
  
  /* Services grid */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  
  /* Gallery grid */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

/* ==========================================================================
   Tablet Devices (768px - 1023px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
  /* Container adjustments */
  .container {
    padding: 0 var(--space-5);
  }
  
  /* Header adjustments */
  .nav-list {
    gap: var(--space-4);
  }
  
  .nav-link {
    font-size: var(--text-sm);
    padding: var(--space-2);
  }
  
  /* Hero adjustments */
  .hero-title {
    font-size: var(--text-4xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-2xl);
  }
  
  /* About section */
  .about-content {
    gap: var(--space-10);
  }
  
  .about-text {
    padding-right: var(--space-4);
  }
  
  /* Services grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  
  /* Gallery grid */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }
  
  /* Contact grid - 2 columns on tablet */
  .contact-info {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  
  .contact-item {
    min-height: 260px;
  }
  
  /* Footer adjustments */
  .footer-content {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-8);
  }
  
  .footer-info {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: var(--space-4);
  }
}

/* ==========================================================================
   Small Desktop (1024px - 1199px)
   ========================================================================== */

@media (min-width: 1024px) and (max-width: 1199px) {
  /* Container adjustments */
  .container {
    padding: 0 var(--space-6);
  }
  
  /* Services grid */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
  
  /* Gallery grid */
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
  }
  
  /* Contact grid - optimized spacing */
  .contact-info {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
  
  .contact-item {
    min-height: 270px;
  }
}

/* ==========================================================================
   Large Desktop (1200px - 1599px)
   ========================================================================== */

@media (min-width: 1200px) and (max-width: 1599px) {
  /* Services grid */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
  
  /* Gallery grid */
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
  
  /* Contact grid - 4 equal columns for large screens */
  .contact-info {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
  }
  
  .contact-item {
    min-height: 280px;
  }
}

/* ==========================================================================
   Extra Large Desktop (1600px+)
   ========================================================================== */

@media (min-width: 1600px) {
  /* Container max-width increase */
  .container {
    max-width: 1400px;
  }
  
  /* Typography scaling */
  .hero-title {
    font-size: 3.5rem;
  }
  
  .hero-subtitle {
    font-size: var(--text-3xl);
  }
  
  .section-title {
    font-size: 2.5rem;
  }
  
  /* Services grid */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
  }
  
  /* Gallery grid */
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
  }
  
  /* Contact grid - maximum spacing for ultra wide */
  .contact-info {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-10);
  }
  
  .contact-item {
    min-height: 300px;
  }
}

/* ==========================================================================
   Ultra Wide Screens (1920px+)
   ========================================================================== */

@media (min-width: 1920px) {
  /* Container max-width increase */
  .container {
    max-width: 1600px;
  }
  
  /* Section spacing increase */
  section {
    padding: var(--space-24) 0;
  }
  
  /* Typography scaling */
  .hero-title {
    font-size: 4rem;
  }
  
  .section-title {
    font-size: 3rem;
  }
}

/* ==========================================================================
   Landscape Mobile Orientation
   ========================================================================== */

@media (max-width: 767px) and (orientation: landscape) {
  /* Hero adjustments for landscape mobile */
  .hero {
    min-height: 100vh;
  }
  
  .hero-content {
    padding: var(--space-6) var(--space-4);
  }
  
  /* Header adjustments */
  .header-content {
    min-height: 50px;
    padding: var(--space-2) 0;
  }
  
  /* Adjust body padding */
  body {
    padding-top: 50px;
  }
  
  /* Mobile menu adjustments */
  .nav {
    top: 50px;
  }
  
  /* Smaller hamburger menu for landscape */
  .mobile-menu-toggle {
    width: 25px;
    height: 20px;
  }
  
  .mobile-menu-toggle span {
    height: 2px;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  /* Hide navigation and interactive elements */
  .header,
  .mobile-menu-toggle,
  .hero-cta,
  .contact-actions,
  .social-links,
  .footer-social {
    display: none !important;
  }
  
  /* Adjust colors for print */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
  
  /* Ensure text is readable */
  .hero-title,
  .hero-subtitle,
  .hero-description {
    color: black !important;
  }
  
  /* Page breaks */
  section {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  /* Remove animations and transitions */
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   High DPI / Retina Display Adjustments
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp images on high DPI displays */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  /* Adjust thin borders for better visibility */
  .nav-link.active::after {
    height: 3px;
  }
  
  .mobile-menu-toggle span {
    height: 4px;
  }
}

/* ==========================================================================
   Accessibility and Motion Preferences
   ========================================================================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  /* Remove all animations and transitions */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  /* Remove hover transforms */
  .card:hover,
  .service-card:hover,
  .gallery-item:hover,
  .contact-item:hover {
    transform: none !important;
  }
  
  /* Remove parallax and complex animations */
  .hero-background {
    transform: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  /* Increase contrast for better accessibility */
  .btn {
    border-width: 3px;
  }
  
  .nav-link:focus,
  .btn:focus {
    outline: 3px solid var(--accent-orange);
    outline-offset: 3px;
  }
}

/* ==========================================================================
   Container Query Support (Future Enhancement)
   ========================================================================== */

/* Note: Container queries are not yet widely supported but included for future enhancement */
/* These will activate when browser support improves */

@supports (container-type: inline-size) {
  .services {
    container-type: inline-size;
  }
  
  @container (max-width: 600px) {
    .services-grid {
      grid-template-columns: 1fr;
    }
  }
  
  @container (min-width: 601px) and (max-width: 900px) {
    .services-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @container (min-width: 901px) {
    .services-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}