/* =============================================================================
   RESPONSIVES DESIGN – Mobile First Breakpoints
   ============================================================================= */

/* Breakpoints:
   sm:  480px  – Smartphones Landscape
   md:  768px  – Tablets Portrait
   lg: 1024px  – Tablets Landscape / kleine Laptops
   xl: 1280px  – Desktops
*/

/* ---- MOBILE FIRST: Standard ist Mobile ---- */

/* Formular + Sidebar: auf Mobile untereinander */
.form-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-12);
  align-items: start;
}

/* Verstecke Desktop-Navigation auf Mobile */
@media (max-width: 1023px) {
  .primary-nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .header-actions .header-lang-btn {
    display: none;
  }

  /* Layout auf Mobile: keine Sidebars, alles linear */
  .layout-one-sidebar.layout-sidebar-first,
  .layout-one-sidebar.layout-sidebar-second,
  .layout-two-sidebars {
    grid-template-columns: 1fr;
    grid-template-areas:
      'content'
      'sidebar';
  }

  .layout-two-sidebars {
    grid-template-areas:
      'content'
      'sidebar-first'
      'sidebar-second';
  }

  /* Formular + Sidebar: 1 Spalte auf Mobile, Sidebar nach unten */
  .form-with-sidebar {
    grid-template-columns: 1fr;
  }

  /* Card Grid: 1 Spalte auf Mobile */
  .card-grid,
  .card-grid--2col,
  .card-grid--3col,
  .card-grid--4col {
    grid-template-columns: 1fr;
  }

  /* Footer Grid: 1 Spalte */
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .site-footer__bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  /* Hero */
  .hero {
    min-height: 400px;
  }

  .hero--primary {
    min-height: 480px;
  }

  /* Horizontale Cards werden vertikal */
  .card--horizontal {
    flex-direction: column;
  }

  .card--horizontal .card__image {
    width: 100%;
    height: 200px;
  }

  /* Sphären auf Mobile verkleinern */
  .spheres-composition--hero .sphere:nth-child(1) {
    width: 300px;
    height: 300px;
  }

  .spheres-composition--hero .sphere:nth-child(2) {
    width: 200px;
    height: 200px;
  }

  .spheres-composition--hero .sphere:nth-child(3) {
    display: none;
  }

  /* Sektion-Abstände verkleinern */
  .section {
    padding-block: var(--space-12);
  }

  .section--lg {
    padding-block: var(--space-16);
  }
}

/* ---- SM: 480px ---- */
@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* ---- MD: 768px ---- */
@media (min-width: 768px) {
  /* 2-spaltig auf Tablet */
  .card-grid--2col {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .card-grid--4col {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer 2-spaltig */
  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__bottom {
    flex-direction: row;
  }

  /* Layout Sidebar */
  .layout-one-sidebar.layout-sidebar-first,
  .layout-one-sidebar.layout-sidebar-second {
    grid-template-columns: 240px 1fr;
  }
}

/* ---- LG: 1024px ---- */
@media (min-width: 1024px) {
  /* Desktop Navigation anzeigen */
  .primary-nav {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .header-actions .header-lang-btn {
    display: flex;
  }

  /* 3-spaltig auf Laptop */
  .card-grid--3col {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid--4col {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Footer 3-spaltig */
  .site-footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Volle Layout mit Sidebars */
  .layout-one-sidebar.layout-sidebar-first {
    grid-template-columns: 280px 1fr;
    grid-template-areas: 'sidebar content';
  }

  .layout-one-sidebar.layout-sidebar-second {
    grid-template-columns: 1fr 280px;
    grid-template-areas: 'content sidebar';
  }

  .layout-two-sidebars {
    grid-template-columns: 240px 1fr 240px;
    grid-template-areas: 'sidebar-first content sidebar-second';
  }

  /* Sphären voll sichtbar */
  .spheres-composition--hero .sphere:nth-child(3) {
    display: block;
  }
}

/* ---- XL: 1280px ---- */
@media (min-width: 1280px) {
  .card-grid--4col {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Größere Sektion-Abstände */
  .section {
    padding-block: var(--space-24);
  }
}

/* ---- Zugänglichkeit: Reduzierte Bewegung ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---- Drucken ---- */
@media print {
  .site-header,
  .site-footer,
  .primary-nav,
  .breadcrumb,
  .pager,
  .sidebar,
  .nav-toggle,
  .spheres-composition,
  .button,
  .btn {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  h1, h2, h3 {
    color: #003850;
    page-break-after: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  .card {
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }
}

