/* =====================================================
   Mobile-Optimierungen (Mobile-First-Verbesserungen)
   Wird nach main.css und theme.css geladen.
   Achtung: greift NUR additiv ein, baut keine bestehenden
   Desktop-Styles ab.
===================================================== */

/* ===== Globale Mobile-Defaults ===== */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  overflow-x: hidden; /* Schutz gegen versehentliches horizontales Scrollen */
}
img, svg, video, iframe { max-width: 100%; height: auto; }

/* Touch-Targets: Mindesthöhe für anklickbare Elemente */
a, button, input[type="submit"], .nav-link, .btn, .btn-orange,
.btn-hero-cta, .btn-hero-kontakt, .nav-link-pill,
.projekt-listenitem__link, .projekt-cta-item__link {
  -webkit-tap-highlight-color: rgba(254, 181, 93, 0.25);
}

/* ===== Burger-Button (immer im DOM, nur ≤900px sichtbar) ===== */
.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  width: 48px;
  height: 48px;
  padding: 12px;
  cursor: pointer;
  position: relative;
  z-index: 60;
  border-radius: 12px;
  transition: background .2s ease;
}
.nav-toggle:hover { background: rgba(0,0,77,0.06); }
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2.5px;
  background: currentColor;
  margin: 5px auto;
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.site-header.is-hero .nav-toggle { color: #fff; }
.site-header.is-static .nav-toggle,
.site-header.is-scrolled .nav-toggle { color: #00004D; }

/* Burger → X */
.site-header.nav-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.site-header.nav-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ===== Tablet & Mobile Breakpoint (<= 900px) ===== */
@media (max-width: 900px) {
  :root { --pad: 20px; }

  /* Header zeigt Burger, Nav wird zum Drawer */
  .nav-toggle { display: block; }
  .header-grid { gap: 12px; }

  .nav-right {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(320px, 86vw);
    background: #00004D;
    color: #fff;
    padding: 96px 28px 28px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    transform: translateX(110%);
    transition: transform .3s ease;
    box-shadow: -20px 0 60px rgba(0,0,0,0.3);
    z-index: 50;
    overflow-y: auto;
  }
  .site-header.nav-open .nav-right {
    transform: translateX(0);
  }
  .nav-right .nav-link {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff !important;
    transition: background .2s ease;
  }
  .nav-right .nav-link:hover,
  .nav-right .nav-link.active {
    background: rgba(255,255,255,0.08);
  }
  .nav-right .nav-link-pill {
    margin-top: 12px;
    margin-left: 0 !important;
    color: #00004D !important;
    text-align: center;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FEB55D 0%, #ffc878 100%);
  }

  /* Nav-Backdrop */
  body.is-nav-open::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0, 0, 77, 0.5);
    backdrop-filter: blur(2px);
    z-index: 49;
    animation: navBackdropIn .25s ease;
  }
  @keyframes navBackdropIn { from { opacity: 0; } to { opacity: 1; } }

  /* ===== Hero ===== */
  .hero {
    height: auto;
    min-height: 560px;
    padding: 100px 0 60px;
  }
  .hero-inner {
    padding-top: 0;
    padding-bottom: 60px;
  }
  .hero-title { font-size: clamp(34px, 8vw, 52px); }
  .hero-subtitle { font-size: clamp(16px, 4.5vw, 22px); }
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }
  .btn-hero-cta,
  .btn-hero-kontakt {
    width: 100%;
    justify-content: space-between;
    height: 56px;
  }
  .hero-discover { display: none; }

  /* ===== Sections allgemein ===== */
  .section { padding: 48px 0; }
  .section-features { padding: 56px 0; }
  .section-mission, .section-branchen, .history-section,
  .values-section, .vision-section, .team-section,
  .cta-section, .projects-section, .projekte-liste-section,
  .contact-section, .legal-section {
    padding: 60px 0;
  }

  /* ===== Features-Grid ===== */
  .features-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .feature-card { padding: 28px 22px; }

  /* ===== Branchen ===== */
  .branchen-grid { grid-template-columns: 1fr !important; gap: 32px; }
  .branchen-image { max-width: 100%; }
  .branchen-content { text-align: left; }
  .branchen-item:hover { transform: translateY(-2px); }
  .btn-branchen { width: 100%; justify-content: center; }

  /* ===== Mission ===== */
  .mission-card { padding: 40px 22px; }
  .mission-circle-1, .mission-circle-2 { display: none; }
  .mission-highlights {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .mission-highlight { width: 100%; justify-content: flex-start; }
  .btn-mission { width: 100%; justify-content: center; }

  /* ===== FAQ ===== */
  .benefits { grid-template-columns: 1fr !important; gap: 32px; }
  .benefits-media { height: 280px; }
  .cta-on-image {
    right: 16px; bottom: 16px;
    height: 52px; padding: 0 12px 0 18px;
    font-size: 13px;
  }

  /* ===== Vision / Werte / Team / Timeline ===== */
  .vision-grid,
  .timeline,
  .team-grid { grid-template-columns: 1fr !important; gap: 24px; }
  .values-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .vision-card, .value-card, .team-card { padding: 32px 22px; }
  .timeline-year { font-size: 48px; }

  /* ===== CTA ===== */
  .cta-card { padding: 48px 22px; }
  .cta-title { font-size: clamp(26px, 6vw, 36px); }

  /* ===== Subpage-Hero ===== */
  .subpage-hero { padding: 130px 0 60px; min-height: 380px; }
  .subpage-hero-title { font-size: clamp(32px, 8vw, 48px); }
  .subpage-hero-subtitle { font-size: 16px; }

  /* ===== Projekte-Liste & CTA-Item ===== */
  .projekt-listenitem,
  .projekt-cta-item {
    grid-template-columns: 1fr !important;
    padding: 22px;
    gap: 22px;
    min-height: 0;
  }
  .projekt-listenitem__bild,
  .projekt-cta-item__icon {
    aspect-ratio: 16 / 10;
    width: 100%;
  }
  .projekt-listenitem__title,
  .projekt-cta-item__title { font-size: 22px; }
  .projekt-listenitem__text,
  .projekt-cta-item__text { font-size: 15px; }
  .projekt-listenitem__link,
  .projekt-cta-item__link {
    align-self: stretch;
    justify-content: center;
    width: 100%;
  }

  /* ===== Projekt-Grid (auf der Projekte-Seite, falls noch genutzt) ===== */
  .projects-grid { grid-template-columns: 1fr !important; }
  .floating-circle-1, .floating-circle-2 { width: 240px; height: 240px; }
  .floating-circle-3, .floating-circle-4 { display: none; }

  /* ===== Kontakt ===== */
  .contact-grid { grid-template-columns: 1fr !important; gap: 32px; }
  .contact-info-card,
  .contact-form-section { padding: 28px 22px; }
  .contact-info-item { padding: 14px; gap: 14px; }
  .contact-info-icon-wrapper { width: 44px; height: 44px; }
  .form-row { grid-template-columns: 1fr !important; gap: 14px !important; }
  .is-form input[type="submit"],
  .wpcf7-form input[type="submit"] {
    width: 100%;
    padding: 16px 24px;
  }

  /* Eingabefelder: 16px Schrift verhindert iOS-Auto-Zoom */
  .is-form input,
  .is-form textarea,
  .wpcf7-form input,
  .wpcf7-form textarea { font-size: 16px; }

  /* ===== Impressum / Datenschutz ===== */
  .legal-section { padding-top: 110px; }
  .legal-card { padding: 28px 22px; border-radius: 18px; }
  .legal-title { font-size: 28px; margin-bottom: 24px; }

  /* ===== Footer ===== */
  .footer { padding: 56px 0 24px; }
  .footer-grid { gap: 36px !important; }
  .footer-text { max-width: none; }
  .footer-map iframe { height: 220px; }

  /* ===== Container-Padding ===== */
  .container { width: calc(100% - 32px); }
}

/* ===== Sehr kleine Smartphones (≤ 480px) ===== */
@media (max-width: 480px) {
  :root { --pad: 16px; }
  .container { width: calc(100% - 24px); }

  .hero { min-height: 520px; padding: 80px 0 48px; }
  .hero-title { font-size: clamp(28px, 9vw, 42px); line-height: 1.1; }
  .hero-subtitle { font-size: 15px; }

  .feature-card,
  .vision-card,
  .value-card,
  .team-card,
  .legal-card,
  .contact-info-card,
  .contact-form-section,
  .branchen-content,
  .cta-card { padding: 24px 18px; }

  .mission-card { padding: 32px 18px; }
  .mission-title { font-size: clamp(26px, 7vw, 36px); }

  .features-title { font-size: clamp(26px, 7vw, 38px); }
  .branchen-title,
  .history-title,
  .values-title,
  .team-title { font-size: clamp(26px, 7vw, 36px); }
  .section-title { font-size: clamp(26px, 7vw, 38px); }

  .timeline-year { font-size: 40px; }
  .timeline-title { font-size: 18px; }
  .vision-card-title { font-size: 22px; }

  .subpage-hero { padding: 110px 0 50px; min-height: 320px; }
  .subpage-hero-title { font-size: clamp(28px, 8.5vw, 40px); }
  .subpage-hero-subtitle { font-size: 15px; line-height: 1.55; }
  .subpage-hero-kicker { font-size: 11px; }

  .footer-info-item { font-size: 13px; gap: 10px; }
  .copyright { font-size: 11px; text-align: center; }
  .footer-bottom-row { grid-template-columns: 1fr; }

  /* Buttons: full-width für Daumen-Erreichbarkeit */
  .btn-orange { width: 100%; justify-content: center; }
  .btn-hero-cta,
  .btn-hero-kontakt { font-size: 15px; }

  /* Lightbox-Adjustments */
  .lightbox { padding: 12px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-contact { padding: 20px; min-width: auto; }
}

/* ===== Reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .logo-track { animation: none !important; }
}
