/* ========================================
   RESPONSIVE.CSS - Media Queries
   ======================================== */

/* ========================================
   MOBILE (< 640px)
   ======================================== */

@media (max-width: 640px) {
  /* Typography Scale Down */
  :root {
    --text-5xl: 40px;
    --text-4xl: 36px;
    --text-3xl: 28px;
    --text-2xl: 22px;
    --text-xl: 18px;
  }

  /* Navigation */
  .navigation {
    height: 64px;
  }

  .nav-container {
    padding: 0 var(--space-3);
  }

  .logo {
    font-size: var(--text-xl);
  }

  /* Mobile Menu Toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-primary);
    flex-direction: column;
    padding: var(--space-3);
    gap: var(--space-2);
    transform: translateY(-100%);
    transition: transform var(--transition-base);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-links a {
    font-size: var(--text-base);
    padding: var(--space-2) 0;
  }

  /* Hero */
  .hero {
    padding: var(--space-8) var(--space-3);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  /* Projects Grid */
  .projects-section {
    padding: var(--space-6) var(--space-3);
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  /* Blog Grid */
  .blog-section {
    padding: var(--space-6) var(--space-3);
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .blog-image {
    height: 180px;
  }

  /* About Intro Section */
  .about-intro {
    padding: var(--space-8) var(--space-3);
  }

  .about-intro-container {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    text-align: center;
  }

  .about-intro-image img {
    max-width: 300px;
    margin: 0 auto;
  }

  .faraday-quote {
    font-size: var(--text-lg);
  }

  .about-intro-content .cta-button {
    align-self: center;
    margin-left: 0;
  }

  /* Project Card */
  .project-image {
    height: 200px;
  }

  /* Project Detail Page */
  .project-hero {
    max-height: 300px;
  }

  .project-article {
    padding: var(--space-4) var(--space-3);
  }

  .project-article-title {
    font-size: var(--text-3xl);
  }

  .project-meta {
    flex-wrap: wrap;
    font-size: var(--text-xs);
  }

  /* Typography */
  h1 {
    font-size: var(--text-4xl);
    line-height: 1.2;
  }

  h2 {
    font-size: var(--text-3xl);
    margin-top: var(--space-6);
  }

  h3 {
    font-size: var(--text-2xl);
    margin-top: var(--space-4);
  }

  /* Technical Specs */
  .technical-spec {
    font-size: 13px;
    padding: var(--space-2);
  }

  /* Spacing */
  .container {
    padding: 0 var(--space-3);
  }

  /* Paragraphs */
  p {
    max-width: 100%;
  }

  blockquote {
    font-size: var(--text-lg);
    padding-left: var(--space-2);
    margin: var(--space-3) 0;
  }

  /* Footer */
  .footer {
    padding: var(--space-6) var(--space-3);
    margin-top: var(--space-8);
  }
}

/* ========================================
   TABLET (640px - 1024px)
   ======================================== */

@media (min-width: 640px) and (max-width: 1024px) {
  /* Typography Scale */
  :root {
    --text-5xl: 48px;
    --text-4xl: 40px;
    --text-3xl: 30px;
  }

  /* Navigation */
  .nav-container {
    padding: 0 var(--space-4);
  }

  /* Hero */
  .hero {
    padding: var(--space-12) var(--space-4);
  }

  /* Projects Grid */
  .projects-section {
    padding: var(--space-8) var(--space-4);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  /* About Intro Section */
  .about-intro {
    padding: var(--space-8) var(--space-4);
  }

  .about-intro-container {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }

  .about-intro-image img {
    max-width: 350px;
    margin: 0 auto;
  }

  .faraday-quote {
    font-size: var(--text-xl);
  }

  .about-intro-content .cta-button {
    align-self: center;
    margin-left: 0;
  }

  /* Project Detail Page */
  .project-article {
    padding: var(--space-6) var(--space-4);
  }

  .breadcrumb {
    padding: var(--space-3) var(--space-4);
  }

  .project-navigation {
    padding: var(--space-6) var(--space-4) var(--space-8);
  }

  /* Container */
  .container {
    padding: 0 var(--space-4);
  }
}

/* ========================================
   DESKTOP (> 1024px)
   ======================================== */

@media (min-width: 1024px) {
  /* Full size as defined in main.css */

  /* Projects Grid */
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Enhance Technical Callouts */
  .technical-spec {
    font-size: 15px;
    padding: var(--space-4);
  }

  /* Better spacing for large screens */
  .hero {
    padding: var(--space-16) var(--space-6);
  }

  .projects-section {
    padding: var(--space-12) var(--space-6);
  }
}

/* ========================================
   WIDE SCREENS (> 1280px)
   ======================================== */

@media (min-width: 1280px) {
  /* Container */
  .container {
    max-width: 1280px;
  }

  /* Projects Grid - Keep at 3 columns but with better spacing */
  .projects-grid {
    gap: var(--space-6);
  }

  /* Hero */
  .hero {
    padding: var(--space-16) var(--space-8);
  }

  /* Project Article */
  .project-article {
    padding: var(--space-8) var(--space-6);
  }
}

/* ========================================
   ULTRA-WIDE SCREENS (> 1536px)
   ======================================== */

@media (min-width: 1536px) {
  /* Optional: Even more spacing for ultra-wide displays */
  .hero {
    padding: 128px var(--space-12);
  }

  .projects-section {
    padding: var(--space-16) var(--space-12);
  }
}

/* ========================================
   PRINT STYLES (Optional)
   ======================================== */

@media print {
  /* Hide navigation and non-essential elements */
  .navigation,
  .mobile-menu-toggle,
  .cta-button,
  .back-link,
  .footer {
    display: none;
  }

  /* Optimize typography for print */
  body {
    color: #000;
    background: #fff;
  }

  /* Expand containers for full width */
  .container,
  .project-article {
    max-width: 100%;
    padding: 0;
  }

  /* Prevent page breaks inside elements */
  .project-card,
  .technical-spec,
  figure {
    page-break-inside: avoid;
  }

  /* Show URLs for links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 80%;
  }

  /* Remove link underlines */
  a {
    text-decoration: none;
    color: #000;
  }
}

/* ========================================
   ACCESSIBILITY - REDUCE MOTION
   ======================================== */

@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;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   DARK MODE SUPPORT (Optional Future Enhancement)
   ======================================== */

@media (prefers-color-scheme: dark) {
  /* Uncomment and customize when implementing dark mode */
  /*
  :root {
    --color-background: #1a1a1a;
    --color-primary: #f5f5f5;
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #b0b0b0;
  }
  */
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
  /* Increase contrast for accessibility */
  :root {
    --color-primary: #000000;
    --color-text-primary: #000000;
    --color-background: #ffffff;
    --color-border: #000000;
  }

  .project-card {
    border: 2px solid #000000;
  }

  button,
  .btn {
    border: 2px solid #000000;
  }
}
