/* Responsive Design - Mobile First Approach */

/* Extra Small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Typography */
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  p {
    font-size: 0.9rem;
  }
  
  /* Header */
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 0;
    text-align: center;
  }
  
  /* Hero Section */
  #hero {
    min-height: 80vh;
    text-align: center;
  }
  
  .hero-content h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  .hero-content p {
    font-size: 0.95rem;
  }
  
  /* Sections */
  .section-padding {
    padding: 2rem 0;
  }
  
  .section-title h2 {
    font-size: 1.5rem;
  }
  
  /* Cards and Items */
  .service-card,
  .price-card,
  .team-member,
  .feature-item {
    margin-bottom: 1.5rem;
  }
  
  .service-image {
    height: 150px;
    font-size: 2rem;
  }
  
  .service-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: center;
  }
  
  .hero-image img {
    max-height: 250px;
  }
  
  .service-price {
    font-size: 1.5rem;
  }
  
  .price-value {
    font-size: 2rem;
  }
  
  .team-photo {
    width: 120px;
    height: 120px;
    font-size: 2rem;
  }
  
  .team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }
  
  /* Contact Form */
  .contact-form {
    padding: 1.5rem;
  }
  
  .contact-info {
    padding: 1.5rem;
    margin-top: 2rem;
  }
  
  /* Blog Cards */
  .blog-image {
    height: 150px;
    font-size: 1.5rem;
  }
  
  .blog-content {
    padding: 1.5rem;
  }
  
  /* FAQ */
  .faq-item {
    padding: 1.5rem;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  /* Hero adjustments */
  #hero {
    min-height: 85vh;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  /* Service cards */
  .service-image {
    height: 180px;
  }
  
  .service-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  .team-photo {
    width: 140px;
    height: 140px;
  }
  
  .team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
  }
  
  .hero-image img {
    max-height: 300px;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Hero */
  #hero {
    min-height: 90vh;
  }
  
  .hero-content h1 {
    font-size: 2.25rem;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
  }
  
  /* Cards in rows */
  .service-card {
    min-height: 400px;
  }
  
  .price-card {
    min-height: 450px;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* Hero full height */
  #hero {
    min-height: 100vh;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  /* Service cards equal height */
  .service-card {
    min-height: 420px;
  }
  
  .price-card {
    min-height: 480px;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .hero-content h1 {
    font-size: 3rem;
  }
  
  .hero-content p {
    font-size: 1.1rem;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
  }
  
  /* Service cards */
  .service-card {
    min-height: 450px;
  }
  
  .price-card {
    min-height: 500px;
  }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  #hero {
    min-height: 70vh;
  }
  
  .section-padding {
    padding: 2rem 0;
  }
  
  .navbar-collapse {
    max-height: 60vh;
    overflow-y: auto;
  }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .service-image,
  .team-photo,
  .gallery-item,
  .blog-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  #header,
  #footer {
    display: none;
  }
  
  .section-padding {
    padding: 1rem 0;
  }
  
  .page-break {
    page-break-before: always;
  }
  
  * {
    color: black !important;
    background: white !important;
    box-shadow: none !important;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-decoration,
  .hero-decoration:before {
    animation: none;
  }
  
  .service-card:hover,
  .team-member:hover,
  .feature-item:hover,
  .case-item:hover,
  .career-item:hover,
  .info-item:hover,
  .blog-card:hover,
  .gallery-item:hover,
  .btn:hover {
    transform: none;
  }
  
  .price-card.featured {
    transform: none;
  }
}

/* Dark mode considerations (if needed in future) */

/* Container max-width adjustments for better content flow */
@media (min-width: 1400px) {
  .container,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl,
  .container-xxl {
    max-width: 1320px;
  }
}

/* Specific adjustments for form elements on mobile */
@media (max-width: 767.98px) {
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .btn {
    min-height: 44px; /* Touch target size */
    min-width: 44px;
  }
}

/* Navigation improvements for touch devices */
@media (hover: none) and (pointer: coarse) {
  .nav-link {
    padding: 1rem;
  }
  
  .btn {
    padding: 1rem 2rem;
  }
}

/* Flexbox fallbacks for older browsers */
@supports not (display: grid) {
  .gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .gallery-item {
    flex: 1 1 250px;
    max-width: calc(33.333% - 1rem);
  }
  
  @media (max-width: 768px) {
    .gallery-item {
      max-width: calc(50% - 0.5rem);
    }
  }
  
  @media (max-width: 480px) {
    .gallery-item {
      max-width: 100%;
    }
  }
} 

body {
    overflow-x: hidden;
}

/* Additional Image Responsiveness */
@media (max-width: 767.98px) {
  .gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  
  .blog-image {
    height: 180px !important;
  }
  
  .blog-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-image img {
    max-height: 350px;
  }
  
  .gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* Ensure all images fit properly in containers */
.service-image img,
.team-photo img,
.gallery-item img,
.hero-image img,
.blog-image img {
  transition: transform 0.3s ease !important;
}

/* Image loading fallback */
img[src=""],
img:not([src]) {
  opacity: 0;
}

/* Image error handling */
img {
  image-rendering: auto;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}