/* DM Sans, selbst ausgeliefert (kein Abruf bei Google). Schrift: DM Sans,
   SIL Open Font License 1.1, https://openfontlicense.org */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/DMSans-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/DMSans-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/DMSans-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/DMSans-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/DMSans-ExtraBold.ttf") format("truetype");
}

html, body {
  margin: 0;
  background: #FFFFFF;
  color: #1C2340;
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
a { color: #1A35A3; text-decoration: none; }
a:hover { color: #1F3FC3; text-decoration: underline; }
input, select, button, textarea { font-family: inherit; }

/* Nav links: only underline-free, color set by JS for active state */
.nav-link:hover { text-decoration: none; color: #1A35A3 !important; }
.nav-link.active { color: #1A35A3 !important; background: rgba(31,63,195,0.10) !important; }

/* Hover utility classes, replacing the design tool's non-standard style-hover */
.hover-a35a3:hover { background: #1A35A3 !important; text-decoration: none; }
.hover-e8ecf9:hover { background: #E8ECF9 !important; text-decoration: none; }
.hover-white12:hover { background: rgba(255,255,255,0.12) !important; text-decoration: none; }
.hover-262f55:hover { background: #262F55 !important; text-decoration: none; }

.tile { transition: background 0.15s ease; }

#zum-formular:hover,
#test-eintragen:hover { background: #1A35A3; }
#ver-neu:hover { background: rgba(31,63,195,0.08); }

/* FAQ */
.faq-item { padding: 20px 0; border-bottom: 1px solid rgba(28,35,64,0.12); cursor: pointer; }
.faq-row { display: flex; justify-content: space-between; gap: 16px; font-weight: 700; font-size: 17px; }
.faq-row span:first-child { flex: 1 1 auto; min-width: 0; }
.faq-row span:last-child { color: #62667A; flex-shrink: 0; }
.faq-answer { margin: 10px 0 0; font-size: 16px; line-height: 1.55; color: #464A5C; }

/* Rollen-Chips (Veranstalter-Formular) */
#rollen span { transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease; }

@media (max-width: 520px) {
  header nav { gap: 2px; }
  header a[data-nav] { padding: 8px 10px !important; font-size: 14px !important; }
}

/* Auf dem Desktop bleiben die drei Links direkte Flex-Kinder der nav.
   Erst unter 431 px wird daraus eine eigene Zeile. */
.site-nav-links { display: contents; }

@media (max-width: 430px) {
  header > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 12px !important;
    padding: 10px 16px 6px !important;
  }

  header > div > a:first-child,
  header > div > a:first-child[data-nav] {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    min-width: 0;
    min-height: 44px;
    padding: 0 !important;
    z-index: 1;
  }

  header nav {
    display: grid !important;
    grid-column: 1 / -1;
    grid-row: 1 / span 2;
    grid-template-columns: subgrid;
    grid-template-rows: subgrid;
    align-items: center;
    gap: 2px 12px !important;
    margin-left: 0 !important;
    min-width: 0;
    pointer-events: none;
  }

  .site-nav-links {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 4px 0 8px;
    scroll-padding-inline: 8px;
    pointer-events: auto;
  }

  header nav a.nav-link {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px !important;
    font-size: max(15px, 0.9375rem) !important;
    scroll-margin-inline: 8px;
    pointer-events: auto;
  }

  header nav a[data-nav="test"] {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin-left: 0 !important;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    padding: 11px 16px !important;
    font-size: max(15px, 0.9375rem) !important;
    pointer-events: auto;
    position: relative;
    z-index: 1;
  }

  header a:focus-visible {
    outline: 2px solid #1F3FC3;
    outline-offset: 3px;
  }

  header nav a.nav-link:focus-visible {
    outline-offset: -2px;
  }

  header nav a[data-nav="test"]:focus-visible {
    outline-color: #1C2340;
    outline-offset: 3px;
  }
}

/* Ohne Subgrid (sehr alte Browser): Knopf bleibt in der Linkzeile,
   nichts überlappt das Logo. */
@media (max-width: 430px) {
  @supports not (grid-template-columns: subgrid) {
    header > div {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 4px !important;
    }

    header nav {
      display: flex !important;
      flex-wrap: nowrap !important;
      align-items: center;
      gap: 4px !important;
      width: 100%;
      min-width: 0;
      margin-left: 0 !important;
      pointer-events: auto;
    }

    .site-nav-links {
      display: flex;
      flex: 1 1 auto;
      min-width: 0;
      overflow-x: auto;
    }

    header nav a[data-nav="test"] {
      position: static;
      flex: 0 0 auto;
      margin-left: 8px !important;
    }
  }
}
