/* Responsive Design Styles
   Mobile-first approach with progressive enhancement
   Breakpoints:
   - Mobile: 320px and up (base styles)
   - Tablet: 768px and up
   - Desktop: 1024px and up
   - Large Desktop: 1440px and up
*/

/* Base styles are already mobile-first in styles.css */

/* Tablet (768px and up) */
@media screen and (min-width: 768px) {
  /* Typography adjustments for tablet */
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  /* Layout adjustments */
  .container {
    padding: 0 var(--space-xl);
  }

  /* Navigation */
  .nav-links {
    display: flex;
    position: relative;
  }

  .mobile-nav-toggle {
    display: none;
  }

  /* Grid layouts */
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-content,
  .contact-content {
    grid-template-columns: 1fr 1fr;
  }

  /* Stats in about section */
  .stats {
    flex-direction: row;
  }

  /* Projects - Tablet: show 2 cards */
  .work-slider {
    gap: var(--space-lg);
  }
  
  .work-card {
    flex: 0 0 calc((100% - var(--space-lg)) / 2);
    max-width: 100%;
  }

  /* Carousel arrows */
  .carousel-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  /* Testimonials */
  .testimonial {
    padding: var(--space-xl) var(--space-xxl);
  }
}

/* Desktop (1024px and up) */
@media screen and (min-width: 1024px) {
  /* Typography */
  h1 {
    font-size: 3.5rem;
  }

  /* Layout adjustments */
  .container {
    padding: 0 var(--space-xxl);
  }

  /* Grid layouts */
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
  }

  /* Hero section */
  .hero-content {
    max-width: 900px;
  }

  /* Projects - Desktop: show 2 cards for better readability and wider content display */
  /* WCAG 2.1: Optimal line length 45-75 characters, reduce blank space, improve readability */
  .work-slider {
    gap: var(--space-xl);
  }
  
  .work-card {
    flex: 0 0 calc((100% - var(--space-xl)) / 2);
    max-width: 650px;
  }

  /* Carousel arrows - ensure they're visible on desktop */
  .carousel-arrow {
    width: 50px;
    height: 50px;
    font-size: 2rem;
  }

  /* Better spacing */
  section {
    padding: var(--space-xxl) 0;
  }
}

/* Large Desktop (1440px and up) */
@media screen and (min-width: 1440px) {
  :root {
    /* Slightly increase base font size for better readability on large screens */
    --font-size-base: 18px;
  }

  .container {
    max-width: 1400px;
  }

  /* Hero section */
  .hero-content {
    max-width: 1000px;
  }

  /* Projects - Large Desktop: wider cards for optimal content display */
  /* WCAG 2.1: Larger screens can accommodate wider cards while maintaining readability */
  .work-slider {
    gap: var(--space-xl);
  }
  
  .work-card {
    flex: 0 0 calc((100% - (2 * var(--space-xl))) / 3);
    max-width: 700px;
  }

  /* More generous spacing */
  .section {
    padding: calc(var(--space-xxl) * 1.5) 0;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .header, .footer, .hero-buttons, .slider-nav, .slider-dots {
    display: none;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  .container {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Force background images to print */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Avoid breaking inside elements */
  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }

  h2, h3 {
    page-break-after: avoid;
  }
}

/* Mobile Navigation (Add the HTML implementation in default.html) */
.mobile-nav-toggle {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

@media screen and (max-width: 767px) {
  .mobile-nav-toggle {
    display: none !important;
    visibility: hidden !important;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: flex-end;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: var(--space-xs);
    white-space: nowrap;
  }

  .back-button-container {
    bottom: var(--space-md);
    right: var(--space-md);
  }

  .back-button {
    min-width: 120px;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.9rem;
  }

  .back-text {
    font-size: 0.9rem;
  }

  .back-icon {
    font-size: 1.2rem;
  }

  /* Carousel arrows on mobile - maintain 44x44px minimum touch target (WCAG 2.1) */
  .work-slider-wrapper {
    gap: var(--space-sm);
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.5rem;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
  }

  .overlay.active {
    display: block;
  }
}
