/* Responsive Design - Mobile First */

/* Tablets (768px and up) */
@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

/* Large Screens (1024px and up) */
@media (min-width: 1024px) {
  .container {
    padding: 0;
  }
}

/* Mobile Optimizations (below 640px) */
@media (max-width: 639px) {
  h1, .display-1 {
    font-size: var(--font-size-3xl);
  }
  
  h2, .heading-1 {
    font-size: var(--font-size-2xl);
  }
  
  h3, .heading-2 {
    font-size: var(--font-size-xl);
  }
  
  .hero-title {
    font-size: var(--font-size-4xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-base);
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  .section {
    padding: var(--space-2xl) var(--space-md);
  }
  
  .section-title {
    font-size: var(--font-size-2xl);
  }
  
  .card {
    padding: var(--space-md);
  }
  
  .nav {
    height: auto;
    padding: var(--space-md) var(--space-md);
  }
  
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-bg-primary);
    flex-direction: column;
    gap: 0;
    width: 100%;
    border-top: 1px solid var(--color-divider);
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .nav-item {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-divider);
  }
  
  .sidebar-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
    top: auto;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .btn-block {
    width: 100%;
  }
}

/* Tablets (640px to 1024px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sidebar-layout {
    grid-template-columns: 200px 1fr;
    gap: var(--space-lg);
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: var(--space-xl) var(--space-lg);
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-sm);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-md);
  }
}

/* Reduced 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;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
  :root {
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
  
  button,
  a,
  input {
    border-width: 2px;
  }
}

/* Print Styles */
@media print {
  body {
    background-color: white;
  }
  
  .header,
  .footer,
  .nav,
  .btn-block {
    display: none;
  }
  
  a {
    text-decoration: underline;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  .card {
    page-break-inside: avoid;
  }
}
