/* ==========================================================================
   Responsive Styles — Covers all common screen sizes
   ----------------------------------------------------------------------------
   Breakpoint map:
     ≥1920px   4K / ultra-wide monitors          (.container wider, larger fonts)
     1440-1919 Large desktop / iMac
     1200-1439 Standard desktop / laptop        (default base styles)
     1025-1199 Small laptop / iPad Pro 12.9" landscape
     992-1024  iPad/tablet landscape
     769-991   iPad / large tablet portrait     (still horizontal nav)
     481-768   Mobile / large phone             (HAMBURGER NAV)
     376-480   Standard phone (iPhone 12/13/14)
     321-375   Small phone (iPhone SE, mini)
     ≤320      Extra small / legacy
   ========================================================================== */


/* ==========================================================================
   ULTRA-WIDE / 4K  (≥1920px)
   ========================================================================== */
@media (min-width: 1920px) {
  .container { max-width: 1480px; }
  body { font-size: 17px; }
  .hero { min-height: 82vh; }
  .hero h1 { font-size: clamp(2.5rem, 3vw, 4rem); }
  .card-image { height: 280px; }
}


/* ==========================================================================
   LARGE DESKTOP  (1440-1919px)
   ========================================================================== */
@media (min-width: 1440px) and (max-width: 1919px) {
  .container { max-width: 1320px; }
  .hero h1 { font-size: clamp(2.2rem, 3.4vw, 3.4rem); }
}


/* ==========================================================================
   STANDARD DESKTOP / LAPTOP  (1200-1439px)
   Default styles — minimal overrides
   ========================================================================== */
@media (max-width: 1439px) and (min-width: 1200px) {
  .container { max-width: 1200px; }
}


/* ==========================================================================
   SMALL LAPTOP / iPad Pro 12.9" landscape  (1025-1199px)
   ========================================================================== */
@media (max-width: 1199px) {
  .container { max-width: 100%; padding: 0 1.5rem; }
  .nav-menu { gap: 1.25rem; }
  .nav-menu a { font-size: 0.9rem; }
  .brand img { height: 110px; }
  .hero h1 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); }
}


/* ==========================================================================
   iPad / TABLET  (769-1024px) — landscape and portrait
   Covers: iPad Mini, iPad, iPad Air, iPad Pro 11", iPad Pro 12.9" portrait
   Still uses horizontal nav (no hamburger yet)
   ========================================================================== */
@media (max-width: 1024px) {
  .container { padding: 0 1.25rem; }

  /* Grids — 2 columns on tablet */
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  /* Header */
  .brand img { height: 96px; }
  .nav-wrap { padding: 0.5rem 0; }
  .nav-menu { gap: 1rem; }
  .nav-menu a { font-size: 0.85rem; padding: 0.4rem 0; }
  .nav-menu a.btn { padding: 0.5rem 1rem !important; font-size: 0.85rem; }

  /* Hero */
  .hero { min-height: 60vh; padding: 2rem 0; }
  .hero-content { padding: 1.5rem 1.25rem; }
  .hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
  .hero p { font-size: 1rem; }

  /* Page hero */
  .page-hero { padding: 3rem 0 2.5rem; }

  /* Section spacing */
  .section { padding: 4rem 0; }
  .section-subtitle { margin-bottom: 2rem; }

  /* Cards */
  .card-image { height: 220px; }

  /* Forms */
  .form-wrap { padding: 2rem; max-width: 100%; }

  /* CTA banner */
  .cta-banner { padding: 2.5rem 1.5rem; }
  .cta-banner h2 { font-size: 1.5rem; }

  /* Feature image */
  .feature-image { max-width: 100%; max-height: 400px; }

  /* Center footer logo on tablet & mobile */
  .footer-brand { text-align: center; }
  .footer-brand img { margin-left: auto; margin-right: auto; }
  .footer-brand .social-links { justify-content: center; }
}


/* ==========================================================================
   LARGE TABLET PORTRAIT / SMALL TABLET  (769-991px)
   Slight further tightening
   ========================================================================== */
@media (max-width: 991px) {
  .nav-menu { gap: 0.8rem; }
  .nav-menu a { font-size: 0.8rem; }
  .brand img { height: 88px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   MOBILE  (481-768px)  — HAMBURGER NAV
   Covers: iPhone Plus, Pixel, large Android phones
   ========================================================================== */
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }

  .nav-toggle { display: block; font-size: 1.75rem; padding: 0.25rem 0.5rem; }
  .nav-wrap {
    padding: 8px 0;
    min-height: 136px;
    box-sizing: border-box;
  }
  .site-header { overflow: visible; }

  .nav-menu:not(.open) {
    display: none !important;
  }

  .nav-menu.open {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
  }

  .nav-menu a {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(91, 31, 74, 0.08);
    font-size: 0.95rem;
  }

  .brand img {
    height: 120px;
    width: auto;
    max-height: 120px;
    display: block;
  }

  .hero { min-height: 65vh; padding: 1.5rem 0; }
  .hero h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .hero p { font-size: 0.95rem; }

  .page-hero { padding: 2.5rem 0 2rem; }

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

  .form-row { grid-template-columns: 1fr; }

  .form-wrap { padding: 1.5rem; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .social-links { justify-content: center; }
  .footer-contact li a { justify-content: center; }

  .gallery-grid { grid-template-columns: 1fr; }

  .cta-banner { padding: 2rem 1.25rem; }
  .cta-banner h2 { font-size: 1.4rem; }

  .feature-image { max-height: 360px; }

  /* Contact two-column collapses */
  .contact-grid { grid-template-columns: 1fr !important; }

  /* Stats labels readability */
  .stat-number { font-size: 2rem; }
  .stat-label { font-size: 0.8rem; }
}


/* ==========================================================================
   STANDARD PHONE  (376-480px)
   Covers: iPhone 12/13/14, Pixel standard, most Android
   ========================================================================== */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .brand img { height: 104px; max-height: 104px; }
  .nav-wrap { min-height: 120px; }
  .container { padding: 0 1rem; }
  .section { padding: 2.5rem 0; }
  .form-wrap { padding: 1.25rem; }
  .feature-image { max-height: 300px; }

  .hero h1 { font-size: 1.6rem; line-height: 1.2; }
  .hero p { font-size: 0.9rem; }

  .section-title { font-size: 1.4rem; }

  .card-image { height: 180px; }
  .card-body { padding: 1rem 1.25rem 1.25rem; }
  .card-body h3 { font-size: 1.05rem; }

  .category-card { padding: 1.5rem 1rem; }
  .category-icon { width: 56px; height: 56px; font-size: 1.5rem; }
}


/* ==========================================================================
   SMALL PHONE  (321-375px)
   Covers: iPhone SE, iPhone 12/13 Mini
   ========================================================================== */
@media (max-width: 375px) {
  .brand img { height: 88px; max-height: 88px; }
  .nav-wrap { min-height: 104px; }
  .container { padding: 0 0.85rem; }

  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: 0.85rem; }

  .btn { padding: 0.7rem 1.4rem; font-size: 0.9rem; }

  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 0.9rem; padding: 0.65rem 0.85rem; }

  .form-wrap { padding: 1rem; }

  .stat-number { font-size: 1.75rem; }
}


/* ==========================================================================
   EXTRA SMALL / LEGACY  (≤320px)
   Covers: very old Android, Apple Watch web view, narrow embedded views
   ========================================================================== */
@media (max-width: 320px) {
  .brand img { height: 76px; max-height: 76px; }
  .nav-wrap { min-height: 92px; }
  .container { padding: 0 0.65rem; }

  .hero h1 { font-size: 1.25rem; }
  .hero p { font-size: 0.8rem; }
  .hero-actions { gap: 0.5rem; }

  .section { padding: 2rem 0; }
  .section-title { font-size: 1.2rem; }

  .nav-toggle { font-size: 1.5rem; }
  .nav-menu a { font-size: 0.9rem; padding: 0.75rem 0.5rem; }

  .form-wrap { padding: 0.85rem; }
  .form-group label { font-size: 0.85rem; }
}


/* ==========================================================================
   ORIENTATION-SPECIFIC TWEAKS
   Landscape phone — reduce hero vertical space so content is visible
   ========================================================================== */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: 110vh; padding: 1rem 0; }
  .page-hero { padding: 2rem 0 1.5rem; }
  .brand img { height: 60px; max-height: 60px; }
  .nav-wrap { min-height: 76px; }
}


/* ==========================================================================
   HIGH-DPI / RETINA  (sharper rendering)
   ========================================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
}


/* ==========================================================================
   PRINT  (clean printable version)
   ========================================================================== */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .cta-banner,
  .hero-actions,
  .form-wrap button { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .hero, .page-hero { background: none !important; color: #000 !important; padding: 1rem 0; }
  .hero h1, .page-hero h1 { color: #000 !important; }
  a { color: #000; text-decoration: underline; }
  .container { max-width: 100%; padding: 0; }
}


/* ==========================================================================
   USER PREFERENCE — 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;
  }
}
