/* ============================================
   Tablet (768px and up)
   ============================================ */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-16);
  }

  .hero {
    min-height: 80vh;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .projects-grid,
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Mobile (767px and down)
   ============================================ */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  body {
    line-height: 1.5;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* ============================================
     Navbar (Mobile)
     ============================================ */
  .navbar-container {
    padding: var(--spacing-16) var(--spacing-16);
  }

  .navbar-menu {
    right: 0;
    left: 0;
    width: auto;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 0 var(--spacing-16);
  }

  .navbar-menu.active {
    padding: var(--spacing-8) var(--spacing-16) var(--spacing-16);
  }

  .nav-link.active::after {
    bottom: 0;
    height: 3px;
  }

  .nav-auth, .nav-user {
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-8);
  }

  .nav-auth .btn, .nav-user .btn {
    width: 100%;
  }

  /* ============================================
     Hero Section (Mobile)
     ============================================ */
  .hero {
    min-height: 70vh;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }

  /* ============================================
     Sections (Mobile)
     ============================================ */
  .featured-section,
  .blog-section,
  .cta-section {
    padding: var(--spacing-32) var(--spacing-16);
  }

  .featured-section h2,
  .blog-section h2,
  .cta-section h2 {
    margin-bottom: var(--spacing-24);
  }

  /* ============================================
     Grids (Mobile)
     ============================================ */
  .projects-grid,
  .posts-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-16);
  }

  /* ============================================
     Cards (Mobile)
     ============================================ */
  .project-image,
  .post-image {
    height: 150px;
  }

  .project-content,
  .post-content {
    padding: var(--spacing-16);
  }

  /* ============================================
     CTA Card (Mobile)
     ============================================ */
  .cta-card {
    padding: var(--spacing-32) var(--spacing-16);
  }

  .cta-card h2 {
    font-size: 1.5rem;
  }

  .cta-card .btn {
    width: 100%;
  }

  /* ============================================
     Footer (Mobile)
     ============================================ */
  .footer {
    padding: var(--spacing-32) var(--spacing-16);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-32);
  }

  /* ============================================
     Form (Mobile)
     ============================================ */
  .btn-block {
    width: 100%;
  }

  input, textarea, select {
    padding: 10px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* ============================================
     Modal (Mobile)
     ============================================ */
  .modal-content {
    width: 95%;
    padding: var(--spacing-24);
    border-radius: var(--radius-8);
  }

  /* ============================================
     Utilities (Mobile)
     ============================================ */
  .container {
    padding: 0 var(--spacing-16);
  }

  .text-right {
    text-align: left;
  }
}

/* ============================================
   Small Mobile (480px and down)
   ============================================ */
@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  .hero h1 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-8);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .project-card,
  .post-card {
    border: none;
    box-shadow: var(--shadow-sm);
  }

  .btn {
    padding: 10px 16px;
    min-height: 44px;
    font-size: 0.95rem;
  }

  .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: auto;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  header, footer, .navbar, .menu-toggle {
    display: none;
  }

  body {
    background-color: white;
  }

  a {
    text-decoration: underline;
  }

  .container {
    max-width: 100%;
  }
}

/* ============================================
   High DPI Screens (Retina)
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .btn {
    border: 0.5px solid;
  }
}
