/* ==========================================
   RESPONSIVE DESIGN - Mobile First
   ========================================== */

/* ========== MOBILE (0px - 640px) ========== */
@media (max-width: 640px) {
  /* Navbar optimization */
  header .container {
    height: 90px;
    padding: 0 var(--spacing-md);
  }

  .logo img {
    height: 110px !important;
  }

  /* Larger touch targets */
  .btn {
    min-height: 48px;
    min-width: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  a {
    min-height: 44px;
    display: inline-block;
  }

  /* Better spacing on mobile */
  section {
    padding: 2rem 0 !important;
  }

  h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.25rem, 4vw, 2rem);
  }

  h3 {
    font-size: clamp(1rem, 3vw, 1.5rem);
  }

  /* Hero Section mobile */
  .hero {
    min-height: 70vh;
  }

  .hero__wrapper {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  .hero__content {
    text-align: center;
    max-width: 100%;
  }

  .hero__image {
    padding-left: 0;
    justify-content: center;
  }

  .hero__image img {
    max-width: 100%;
    height: auto;
  }

  .hero__cta {
    justify-content: center;
  }

  /* About Section mobile */
  .about-grid {
    grid-template-columns: 1fr;
  }

  /* Form optimization */
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .form-group {
    margin-bottom: 1.5rem;
  }

  /* Two column becomes one */
  .two-column {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  /* Features Section mobile - Bild nach unten, Icons über Text */
  .features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  .features-image {
    order: 2;
  }

  .features-content {
    order: 1;
  }

  .feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
  }

  /* Grid adjustments */
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  /* Container padding */
  .container {
    padding: 0 var(--spacing-md);
  }

  /* Hide desktop nav */
  nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Scroll padding for mobile */
  html {
    scroll-padding-top: 90px;
  }

  /* Footer logo center on mobile */
  footer .logo {
    text-align: center;
    justify-content: center;
  }
}

/* ========== TABLET (641px - 1024px) ========== */
@media (min-width: 641px) and (max-width: 1024px) {
  header .container {
    height: 100px;
    padding: 0 var(--spacing-lg);
  }

  .logo img {
    height: 140px !important;
  }

  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-column {
    grid-template-columns: 1fr 1fr;
  }

  /* Features Section tablet */
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  .features-image {
    order: 2;
    max-width: 100%;
  }

  .features-content {
    order: 1;
  }

  .feature-item {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    gap: var(--spacing-2xl);
  }

  .hero__wrapper {
    grid-template-columns: 1fr 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
  }

  nav {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  html {
    scroll-padding-top: 100px;
  }
}

/* ========== DESKTOP (1025px and up) ========== */
@media (min-width: 1025px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  nav {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .nav--mobile {
    display: none;
  }

  .two-column {
    grid-template-columns: 1fr 1fr;
  }

  .hero__wrapper {
    grid-template-columns: 1fr 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== ULTRA WIDE (1401px and up) ========== */
@media (min-width: 1401px) {
  .container {
    max-width: 1400px;
  }

  section {
    padding: clamp(4rem, 12vw, 8rem) 0;
  }
}

/* ========== PRINT ========== */
@media print {
  header,
  footer,
  .no-print {
    display: none;
  }

  body {
    background-color: white;
  }

  a {
    text-decoration: underline;
  }
}

/* ========== LIGHT/DARK MODE PREFERENCE ========== */
@media (prefers-color-scheme: dark) {
  /* Can be extended for dark mode support */
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== HIGH CONTRAST ========== */
@media (prefers-contrast: more) {
  body {
    color: var(--color-primary);
    background-color: var(--color-white);
  }

  a {
    text-decoration: underline;
  }
}

/* ========== TOUCH DEVICES ========== */
@media (hover: none) and (pointer: coarse) {
  .btn {
    padding: 1rem 2rem;
    min-height: 48px;
  }

  .card {
    cursor: pointer;
  }
}

/* ========== SCREEN READERS ========== */
@media screen and (prefers-contrast: more) {
  .btn:focus-visible {
    outline-width: 3px;
    outline-offset: 3px;
  }
}
