/* Nordbahn.app - Installations-Hinweis (Banner + iOS-Anleitung)
   Wird nur eingeblendet, wenn pwa-install.js es erlaubt (nicht installiert,
   zweiter Besuch, nicht weggeklickt). Ohne JS bleibt alles per [hidden] aus. */

.nb-pwa-banner[hidden],
.nb-pwa-sheet[hidden] { display: none; }

/* --- Install-Tab (rechter Rand, ein-/ausklappbar) ---------------------
   „Peek"-Tab am rechten Bildschirmrand: erscheint ausgeklappt, lässt sich an
   den rechten Rand einklappen (nur der Griff schaut heraus) und per Klick auf
   den Griff wieder herausholen. Material = Glas der angehefteten Subnav
   (.va-subnav-wrap.is-stuck in components.css): 55 % Weiß, blur(10px), Navy-
   Kante .18. Bei Material-Änderungen synchron halten. Der rechte Rand sitzt am
   Viewport-Rand, daher nur links gerundet und ohne rechte Kante. */
.nb-pwa-banner {
  position: fixed;
  top: 72%;   /* im unteren Drittel, mit Abstand zur Browser-Leiste unten */
  right: 0;
  --nb-pwa-handle: 58px;                 /* Breite des immer sichtbaren Griffs (eingeklappt ~ quadratisch) */
  --nb-pwa-shift: 105%;                  /* vor dem Einblenden: komplett rechts weg */
  transform: translate(var(--nb-pwa-shift), -50%);
  z-index: 1700;   /* unter --z-backdrop (1900) und --z-modal (2000), über --z-header (100) */
  width: min(352px, calc(100vw - 16px));
  display: flex;
  align-items: stretch;
  border-radius: 14px 0 0 14px;
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(1, 42, 106, .18);
  border-right: 0;
  box-shadow: 0 10px 34px rgba(1, 66, 106, .17);
  color: var(--brand-navy, #01426a);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}

/* Browser ohne backdrop-filter (ältere Firefox-Stände): deckendes Weiss,
   sonst wäre der Text auf buntem Inhalt unlesbar. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nb-pwa-banner { background: rgba(255, 255, 255, .97); }
}
/* Eingeklappt: nur der Griff schaut rechts heraus. Ausgeklappt: voll sichtbar. */
.nb-pwa-banner.is-visible { --nb-pwa-shift: calc(100% - var(--nb-pwa-handle)); }
.nb-pwa-banner.is-visible.is-expanded { --nb-pwa-shift: 0; }

@media (prefers-reduced-motion: reduce) {
  .nb-pwa-banner { transition: none; }
  .nb-pwa-banner__chevron { transition: none; }
}

/* Griff: immer sichtbarer Teil, klappt das Panel per Klick auf/zu. */
.nb-pwa-banner__handle {
  flex: 0 0 var(--nb-pwa-handle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 0;
  background: transparent;
  border: 0;
  border-radius: 14px 0 0 14px;
  color: var(--brand-navy, #01426a);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nb-pwa-banner__handle:hover { background: rgba(1, 66, 106, .06); }
.nb-pwa-banner__handle:focus-visible { outline: 2px solid var(--brand-navy, #01426a); outline-offset: -2px; }

.nb-pwa-banner__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
}
.nb-pwa-banner__chevron {
  width: 15px;
  height: 15px;
  opacity: .55;
  transition: transform .3s ease;
}
.nb-pwa-banner.is-expanded .nb-pwa-banner__chevron { transform: rotate(180deg); }

/* Körper: Text + „Hinzufügen" + Schließen, nur im ausgeklappten Zustand relevant. */
.nb-pwa-banner__body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 2px;
}

.nb-pwa-banner__text { flex: 1; min-width: 0; }
.nb-pwa-banner__title {
  display: block;
  font-weight: 600;
  font-size: .845rem;
  line-height: 1.25;
  letter-spacing: -.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-pwa-banner__sub {
  display: block;
  font-size: .735rem;
  line-height: 1.3;
  color: #3a5064;   /* 8,30:1 auf hellem, 5,57:1 auf dunklem Grund (WCAG AA) */
  margin-top: 0;
  /* Auf sehr schmalen Geräten lieber weglassen als umbrechen. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-pwa-banner__cta {
  flex: 0 0 auto;
  background: transparent;
  color: var(--brand-navy, #01426a);
  border: 1px solid rgba(1, 66, 106, .28);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-weight: 600;
  font-size: .785rem;
  cursor: pointer;
  min-height: 34px;   /* Touch-Ziel: WCAG 2.5.8 fordert min. 24px */
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.nb-pwa-banner__cta:hover {
  background: var(--brand-orange, #F5C518);
  border-color: var(--brand-orange, #F5C518);
  color: var(--brand-orange-on, #4A3300);
}
.nb-pwa-banner__cta:focus-visible {
  outline: 2px solid var(--brand-navy, #01426a);
  outline-offset: 2px;
}

.nb-pwa-banner__close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  /* Navy statt Grau: #98a7b3 erreichte nur 2,45:1 (hell) bzw. 1,64:1 (dunkel).
     Navy liefert 10,48:1 / 7,04:1 - erfüllt WCAG AA in beiden Fällen. */
  color: var(--brand-navy, #01426a);
  opacity: .55;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.nb-pwa-banner__close:hover { background: rgba(1, 66, 106, .07); opacity: 1; }
.nb-pwa-banner__close:focus-visible { outline: 2px solid var(--brand-navy, #01426a); outline-offset: 1px; }

/* Sehr schmale Telefone: Untertitel weg, Button bleibt neben dem Titel. */
@media (max-width: 360px) {
  .nb-pwa-banner__sub { display: none; }
  .nb-pwa-banner__cta { padding: 8px 10px; }
}

/* --- iOS-Anleitung ---------------------------------------------------- */
.nb-pwa-sheet {
  position: fixed;
  inset: 0;
  z-index: 1850;   /* knapp unter --z-backdrop (1900), damit echte Modals gewinnen */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 32, 55, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s ease;
  padding: 16px;
}
.nb-pwa-sheet.is-visible { opacity: 1; }

.nb-pwa-sheet__inner {
  width: min(460px, 100%);
  background: var(--cream, #fdfaf2);
  color: var(--brand-navy, #01426a);
  border-radius: 18px;
  padding: 26px 24px 20px;
  margin-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .28);
}

.nb-pwa-sheet__title {
  font-family: var(--font-display, 'Literata', Georgia, 'Times New Roman', serif);
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  /* base.css faerbt h1-h6 explizit - eine geerbte Farbe vom Elternteil greift
     deshalb nicht. Ohne diese Zeile erschien die Überschrift schwarz. */
  color: var(--brand-navy, #01426a);
}
.nb-pwa-sheet__text {
  font-size: .95rem;
  line-height: 1.6;
  color: #3a5064;
  margin-bottom: 16px;
}
/* base.css entfernt global die Listenpunkte (ul, ol { list-style: none }).
   Statt sie zurückzuholen: eigene Schritt-Badges im Wappen-Gold. */
.nb-pwa-sheet ol {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
  counter-reset: nb-step;
  font-size: .96rem;
  line-height: 1.55;
  color: #22384a;
}
.nb-pwa-sheet ol li {
  counter-increment: nb-step;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 11px;
}
.nb-pwa-sheet ol li > span { flex: 1; }
.nb-pwa-sheet ol li::before {
  content: counter(nb-step);
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--brand-orange, #F5C518);
  color: var(--brand-orange-on, #4A3300);
  font-size: .78rem;
  font-weight: 700;
  line-height: 23px;
  text-align: center;
}
.nb-pwa-sheet__share {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -.18em;
  margin: 0 .12em;
}
.nb-pwa-sheet__close {
  width: 100%;
  background: var(--brand-navy, #01426a);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.nb-pwa-sheet__close:hover { background: #013a5e; }
.nb-pwa-sheet__close:focus-visible { outline: 3px solid var(--brand-orange, #F5C518); outline-offset: 2px; }
