/* =========================================
   Responsive Stylesheet â€” responsive.css
   Load AFTER style.css
   ========================================= */

/* Large laptops and smaller desktops */
@media (max-width: 1100px) {
  .container {
    width: min(960px, calc(100% - 3rem));
  }

  .hero h1 {
    font-size: clamp(2.6rem, 6vw, 4rem);
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablets */
@media (max-width: 820px) {
  .container {
    width: min(720px, calc(100% - 2.5rem));
  }

  .section {
    padding: 4rem 0;
  }

  .hero {
    padding: 5rem 0 4rem;
  }

  .navbar {
    min-height: 4.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 1.25rem;
  }
}

/* Mobile navigation helpers
   Add class="nav-toggle" to menu button and class="nav-links is-open" with JS. */
@media (max-width: 700px) {
  .container {
    width: min(100% - 2rem, 560px);
  }

  body.menu-open {
    overflow: hidden;
  }

  .navbar {
    position: relative;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    left: 0;
    z-index: 101;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.is-open {
    display: flex;
    animation: menu-in 180ms ease-out;
  }

  .nav-links a {
    padding: 0.75rem 0.85rem;
    border-radius: 0.5rem;
  }

  .nav-links a:hover {
    background: var(--surface-muted);
  }

  .section {
    padding: 3.5rem 0;
  }

  .hero {
    padding: 4.25rem 0 3.5rem;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-actions,
  .footer-content {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section-heading {
    margin-bottom: 1.75rem;
  }

  .grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.2rem;
  }

  .footer-content {
    gap: 0.7rem;
  }

  input,
  textarea,
  select {
    font-size: 16px; /* Prevents iOS zoom on input focus */
  }
}

/* Small mobile devices */
@media (max-width: 390px) {
  .container {
    width: calc(100% - 1.5rem);
  }

  .hero h1 {
    font-size: 2.15rem;
  }

  .btn {
    min-height: 2.65rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
  }

  .card {
    padding: 1rem;
  }
}

/* Touch devices: avoids sticky hover effects */
@media (hover: none) {
  .btn:hover,
  .card:hover {
    transform: none;
  }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
