/* ===== RESPONSIVE CSS - Remote IT Helpdesk for Seniors ===== */

/* Mobile First Approach */

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  /* Disable animations on mobile except for important ones */
  *:not(img):not(.lazy) {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  
  /* Allow transformations for loaded images */
  img.loaded {
    transform: translateZ(0);
  }
  
  /* Typography adjustments */
  .hero-title {
    font-size: 1.75rem;
    padding-top: 225px;
}
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
  }
  
  /* Navbar brand conservative sizing */
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  /* Section padding reduction */
  .section {
    padding: 2rem 0;
  }
  
  /* Hero section adjustments */
  .hero-section {
    min-height: 70vh;
    text-align: center;
  }
  
  /* Card adjustments */
  .feature-card,
  .service-card,
  .price-card,
  .team-card,
  .review-card,
  .process-step,
  .career-card,
  .case-study-card,
  .coreinfo-card,
  .blog-card {
    margin-bottom: 1rem;
  }
  
  /* Contact form adjustments */
  .contact-form,
  .contact-info {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  
  /* Gallery grid mobile */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  /* Team photo size reduction */
  .team-photo {
    width: 100px;
    height: 100px;
  }
  
  /* Price value adjustment */
  .price-value {
    font-size: 1.5rem;
  }
  
  /* Feature icon size */
  .feature-icon {
    font-size: 2rem;
  }
  
  /* Footer adjustments */
  .footer {
    padding: 2rem 0 1rem;
    text-align: center;
  }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  /* Optimize animations on small devices, but don't disable completely */
  *:not(img):not(.lazy) {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
  }
  
  .hero-title {
    font-size: 2rem;
    padding-top: 225px;
}
  
  .hero-subtitle {
    font-size: 1.125rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  /* Gallery grid small devices */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-title {
    font-size: 2.25rem;
    padding-top: 225px;
}
  
  .section {
    padding: 3.5rem 0;
  }
  
  /* Gallery grid medium devices */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Process steps layout */
  .process-step {
    margin-bottom: 1rem;
  }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* Gallery grid large devices */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .hero-title {
    font-size: 2.75rem;
    padding-top: 225px;
}
  
  /* Gallery grid extra large devices */
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Landscape orientation specific adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-section {
    min-height: 100vh;
  }
  
  .section {
    padding: 2rem 0;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  /* Optimize for retina displays */
  .team-photo,
  .gallery-item img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .contact-section,
  .decorative-shape {
    display: none !important;
  }
  
  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  .hero-section {
    min-height: auto;
    page-break-after: always;
  }
  
  * {
    color: black !important;
    background: white !important;
    box-shadow: none !important;
  }
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
  :root {
    --text-dark: #000000;
    --text-light: #464243;
    --primary-blue: #0063b4;
    --primary-green: #2c9849;
  }
  
  .feature-card,
  .service-card,
  .price-card,
  .team-card,
  .review-card,
  .faq-card,
  .process-step,
  .career-card,
  .case-study-card,
  .coreinfo-card,
  .blog-card {
    border: 2px solid var(--text-dark);
  }
}

/* Focus improvements for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  .btn:focus,
  .form-control:focus,
  .nav-link:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
  }
}

/* Container max-width adjustments */
@media (min-width: 1400px) {
  .container-xl {
    max-width: 1320px;
  }
}

/* Mobile navigation improvements */
@media (max-width: 991.98px) {
  .navbar-toggler {
    border: none;
    padding: 0.5rem;
  }
  
  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(85, 151, 201, 0.25);
  }
  
  .navbar-collapse {
    padding-top: 1rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-blue);
  }
  
  .navbar-nav .nav-link:last-child {
    border-bottom: none;
  }
}

/* Touch device optimizations */
@media (pointer: coarse) {
  .btn,
  .nav-link,
  .form-control {
    min-height: 44px;
  }
  
  .feature-card,
  .service-card,
  .price-card,
  .team-card,
  .review-card,
  .process-step,
  .career-card,
  .case-study-card,
  .coreinfo-card,
  .blog-card {
    padding: 1.5rem;
  }
  
  .gallery-item {
    min-height: 200px;
  }
  
  /* Ensure tap targets for images are large enough */
  .gallery-item a,
  a.lightbox-link {
    display: block;
    min-height: 44px;
    min-width: 44px;
  }
}

/* Fix for browsers that have trouble with WebP */
@supports not (background-image: url('data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=')) {
  img[src$=".webp"] {
    visibility: hidden;
  }
  
  img[src$=".webp"].webp-loaded {
    visibility: visible;
  }
}