/* Shared accessibility and small-screen refinements.
   Linked by the page builders and by scripts/einbau-navigation.mjs. */

.sprunglink {
  position: fixed;
  inset: .5rem auto auto .5rem;
  z-index: 1000;
  max-width: calc(100vw - 1rem);
  padding: .7rem 1rem;
  border: 2px solid var(--tinte, #141210);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--tinte, #141210);
  font: 800 .9rem/1.2 var(--f-body, 'Karla', system-ui, sans-serif);
  text-decoration: none;
  translate: 0 calc(-100% - 1rem);
}

.sprunglink:focus {
  translate: 0 0;
  outline: 3px solid var(--cta, #d81577);
  outline-offset: 2px;
}

.eingabe-fehler {
  grid-column: 1 / -1;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.probieren .feld {
  flex-wrap: wrap;
}

.probieren .feld .eingabe-fehler {
  order: 3;
  flex-basis: 100%;
}

.probieren .feld input {
  max-width: calc(100% - 2rem);
}

@media (max-width: 30rem) {
  /* Keep rotated card artwork inside the page without creating a nested
     scroll container or hiding the page's own horizontal step navigation. */
  main:has(.abschnitt.schritte) {
    overflow-x: clip;
  }

  .karten.eins {
    grid-template-columns: minmax(0, 1fr);
  }

  .karten > .k {
    min-width: 0;
  }

  .karten > .k .tit {
    overflow-wrap: anywhere;
  }

  html[lang^="zh"] body:has(.abschnitt.schritte) .auftakt h1 {
    max-width: 12ch;
    font-size: clamp(2.15rem, 11vw, 3.1rem);
    line-height: .98;
    text-wrap: balance;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .sprunglink {
    transition: none !important;
  }

  .wellen .w1,
  .wellen .w2,
  .wellen .w3,
  .wellen .w4,
  .blasen i {
    animation: none !important;
    transform: none !important;
    will-change: auto !important;
  }
}
