/**
 * Responsive CSS for Renato Reis Portfolio Theme
 * Mobile-first approach with progressive enhancement
 */

/* ==========================================================================
   Mobile First Base Styles (320px and up)
   ========================================================================== */

/* Already defined in main.css as base styles */

/* ==========================================================================
   Small Mobile (375px and up)
   ========================================================================== */

@media (min-width: 375px) {
  .hero-title {
    font-size: var(--font-size-5xl);
  }
  
  .hero-stats {
    justify-content: space-between;
  }
}

/* ==========================================================================
   Large Mobile (425px and up)
   ========================================================================== */

@media (min-width: 425px) {
  .container {
    padding: 0 var(--space-8);
  }
  
  .hero-actions {
    justify-content: flex-start;
  }
  
  .work-filters {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Tablet Portrait (768px and up)
   ========================================================================== */

@media (min-width: 768px) {
  /* Typography adjustments */
  .hero-title {
    font-size: var(--font-size-6xl);
  }
  
  .section-title {
    font-size: var(--font-size-5xl);
  }
  
  /* Header adjustments */
  .mobile-menu-toggle {
    display: none;
  }
  
  .nav-menu {
    display: flex;
  }
  
  /* Hero section */
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
  
  .hero-stats {
    justify-content: flex-start;
  }
  
  /* Grid adjustments */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .expertise-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Contact section */
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Tablet Landscape (1024px and up)
   ========================================================================== */

@media (min-width: 1024px) {
  /* Container adjustments */
  .container {
    padding: 0 var(--space-12);
  }
  
  /* Section spacing */
  .section {
    padding: var(--space-24) 0;
  }
  
  /* Grid adjustments */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .expertise-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Desktop (1200px and up)
   ========================================================================== */

@media (min-width: 1200px) {
  /* Grid adjustments */
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Hero section enhancements */
  .hero-content {
    gap: var(--space-16);
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   Large Desktop (1440px and up)
   ========================================================================== */

@media (min-width: 1440px) {
  /* Container max-width already handled by CSS variables */
  
  /* Enhanced spacing */
  .section {
    padding: var(--space-32) 0;
  }
  
  .section-header {
    margin-bottom: var(--space-20);
  }
}

/* ==========================================================================
   Mobile-Specific Styles (max-width: 767px)
   ========================================================================== */

@media (max-width: 767px) {
  /* Typography */
  html {
    font-size: 14px;
  }
  
  .hero-title {
    font-size: var(--font-size-4xl);
    line-height: var(--line-height-tight);
  }
  
  .section-title {
    font-size: var(--font-size-3xl);
  }
  
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
  
  /* Header */
  .header-content {
    padding: var(--space-3) 0;
  }
  
  .logo {
    font-size: var(--font-size-xl);
  }
  
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-4);
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .language-switcher {
    margin-top: var(--space-4);
    justify-content: center;
  }
  
  /* Hero section */
  .hero {
    min-height: 100vh;
    padding: var(--space-20) 0 var(--space-16) 0;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-12);
    text-align: center;
  }
  
  .hero-visual {
    order: -1;
  }
  
  .hero-image {
    width: 280px;
    height: 280px;
  }
  
  .hero-stats {
    justify-content: center;
    gap: var(--space-6);
  }
  
  .hero-stat-number {
    font-size: var(--font-size-2xl);
  }
  
  .hero-actions {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
  }
  
  /* Sections */
  .section {
    padding: var(--space-16) 0;
  }
  
  .section-header {
    margin-bottom: var(--space-12);
  }
  
  /* Grids */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .expertise-grid,
  .work-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  /* Cards */
  .card {
    padding: var(--space-6);
  }
  
  /* Work section */
  .work-filters {
    justify-content: center;
    gap: var(--space-2);
  }
  
  .filter-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
  }
  
  /* Contact section */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  
  .contact-method {
    padding: var(--space-4);
  }
  
  .contact-icon {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-lg);
  }
  
  .contact-form {
    padding: var(--space-6);
  }
  
  /* Footer */
  .footer {
    padding: var(--space-12) 0 var(--space-6) 0;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
}

/* ==========================================================================
   Tablet-Specific Styles (768px to 1023px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
  /* Hero adjustments for tablet */
  .hero-image {
    width: 350px;
    height: 350px;
  }
  
  /* Adjust grid gaps */
  .expertise-grid,
  .work-grid {
    gap: var(--space-6);
  }
  
  /* Contact form adjustments */
  .contact-form {
    padding: var(--space-6);
  }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn {
    min-height: 48px;
    padding: var(--space-4) var(--space-6);
  }
  
  .nav-link {
    padding: var(--space-3) var(--space-2);
  }
  
  .language-btn {
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
  }
  
  .form-input,
  .form-textarea,
  .form-select {
    min-height: 48px;
    padding: var(--space-4);
  }
  
  /* Remove hover effects */
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }
  
  .work-card:hover .work-image {
    transform: none;
  }
  
  .work-card:hover .work-overlay {
    opacity: 0;
  }
  
  .btn-primary:hover {
    transform: none;
  }
  
  .contact-method:hover {
    transform: none;
  }
}

/* ==========================================================================
   High DPI / Retina Displays
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp rendering on high DPI displays */
  .hero-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  /* Hide non-essential elements */
  .header,
  .mobile-menu-toggle,
  .language-switcher,
  .scroll-indicator,
  .hero-actions,
  .work-filters,
  .contact-form,
  .social-links {
    display: none !important;
  }
  
  /* Adjust colors for print */
  body {
    color: #000 !important;
    background: #fff !important;
  }
  
  .hero,
  .section {
    background: #fff !important;
  }
  
  /* Ensure good contrast */
  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
  }
  
  /* Page breaks */
  .section {
    page-break-inside: avoid;
  }
  
  .card {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  /* Disable animations for users who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .scroll-indicator {
    animation: none;
  }
  
  .hero-decoration {
    animation: none;
  }
  
  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Dark Mode Support (if enabled)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  /* Note: This theme is designed for light mode primarily
     Dark mode can be added as a future enhancement */
}

/* ==========================================================================
   Landscape Orientation (Mobile)
   ========================================================================== */

@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: var(--space-12) 0;
  }
  
  .hero-content {
    gap: var(--space-8);
  }
  
  .hero-image {
    width: 200px;
    height: 200px;
  }
  
  .section {
    padding: var(--space-12) 0;
  }
}

/* ==========================================================================
   Very Small Screens (320px and below)
   ========================================================================== */

@media (max-width: 320px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .hero-image {
    width: 240px;
    height: 240px;
  }
  
  .hero-stats {
    gap: var(--space-4);
  }
  
  .card {
    padding: var(--space-4);
  }
  
  .contact-form {
    padding: var(--space-4);
  }
}

/* ==========================================================================
   Ultra-wide Screens (1920px and up)
   ========================================================================== */

@media (min-width: 1920px) {
  /* Prevent content from becoming too wide */
  .container {
    max-width: 1400px;
  }
  
  /* Increase section padding for better proportions */
  .section {
    padding: var(--space-32) 0;
  }
  
  /* Adjust hero for ultra-wide */
  .hero-content {
    max-width: 1400px;
    margin: 0 auto;
  }
}