/**
 * RESPONSIVE STYLES
 * 
 * Media queries and responsive adjustments for different screen sizes.
 * Uses mobile-first approach (base styles are mobile, then scale up).
 */

/* ===== SMALL PHONES (< 375px) ===== */
@media (max-width: 374px) {
  :root {
    --font-size-5xl: 2rem;
    --font-size-4xl: 1.75rem;
  }
  
  .hero-title {
    font-size: var(--font-size-4xl);
  }
}

/* ===== LARGE PHONES (640px+) ===== */
@media (min-width: 640px) {
  /* Project grid: 2 columns */
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Hero actions side by side */
  .hero-actions {
    flex-direction: row;
  }
}

/* ===== TABLETS (768px+) ===== */
@media (min-width: 768px) {
  /* Show desktop navigation */
  .main-nav {
    display: block;
  }
  
  /* Hide mobile menu */
  .mobile-menu-toggle {
    display: none;
  }
  
  /* Larger container padding */
  .container {
    padding: 0 var(--space-xl);
  }
  
  /* Profile photo larger */
  .profile-photo {
    width: 200px;
    height: 200px;
  }
  
  /* Footer horizontal layout */
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  
  /* Settings grid more columns */
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
  /* Project grid: 3 columns */
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Larger container padding */
  .container {
    padding: 0 var(--space-2xl);
  }
  
  /* Navigation spacing */
  .nav-list {
    gap: var(--space-2xl);
  }
  
  /* Larger hero - only bottom padding to match About page */
  .hero {
    padding-bottom: var(--space-4xl);
  }
  
  /* Settings grid 3 columns */
  .settings-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== LARGE DESKTOP (1440px+) ===== */
@media (min-width: 1440px) {
  /* Even larger bottom spacing for big screens */
  .hero {
    padding-bottom: 6rem;
  }
  
  /* 4 column grid for projects on very large screens */
  .project-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  /* Hide navigation and footer when printing */
  .site-header,
  .site-footer,
  .back-link,
  .project-links,
  .mobile-menu-toggle {
    display: none !important;
  }
  
  /* Reset colors for print */
  body {
    background: white;
    color: black;
  }
  
  /* Remove shadows and borders */
  * {
    box-shadow: none !important;
    border-color: #ccc !important;
  }
  
  /* Page breaks */
  h2, h3 {
    page-break-after: avoid;
  }
  
  img {
    page-break-inside: avoid;
  }
}

/* ===== REDUCED MOTION ===== */
/* Respect user's motion preferences */
@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;
  }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  :root {
    --border-primary: #ffffff;
    --text-secondary: #ffffff;
  }
  
  .btn-primary {
    border: 2px solid white;
  }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
  /* Reduce vertical spacing on landscape mobile */
  .hero {
    min-height: auto;
    padding-bottom: var(--space-2xl);
  }
  
  .profile-photo {
    width: 100px;
    height: 100px;
  }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
  /* Ensure all interactive elements are large enough for touch */
  button,
  a,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .project-card:hover {
    transform: none;
  }
  
  .gallery-item:hover img {
    transform: none;
  }
}
