/* Reisespur – gemeinsame Ergänzungen für alle Seiten
   Navigation (Desktop + Handy), Album-Galerie, Lightbox, Handy-Feinschliff.
   Wird nach den seiteneigenen Styles geladen und ergänzt diese. */

:root {
  --blau: #1f6991;
  --blau-dunkel: #174f6e;
  --text: #1c1c1e;
  --grau: #6e6e73;
  --flaeche: #f5f5f7;
  --linie: #e5e5ea;
  --papier: #fbf8f2;
  --plus: #c27a1a;
  --topbar-h: 60px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[id] { scroll-margin-top: 20px; }
a, button { -webkit-tap-highlight-color: rgba(31,105,145,0.15); }
img { max-width: 100%; height: auto; }

/* ---------- Kopfzeile / Navigation ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  position: relative;
}
.topbar .brand { display: none; }
.topbar .mainnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 0;
}
.topbar .mainnav a[aria-current="page"] { color: var(--text); }
.topbar .mainnav a[aria-current="page"]::after { width: 100%; background: #f4b942; }
.topbar .langswitch { margin-left: auto; flex: 0 0 auto; }
.menu-toggle { display: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Handy und schmale Fenster ---------- */
@media (max-width: 760px) {
  body {
    margin: 0 auto 32px;
    padding: 0 18px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    font-size: 17px;
  }
  [id] { scroll-margin-top: calc(var(--topbar-h) + 14px); }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 10px;
    margin: 0 -18px 24px;
    margin-left: calc(-1 * max(18px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(18px, env(safe-area-inset-right)));
    padding: 8px 12px 8px 18px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    min-height: var(--topbar-h);
    box-sizing: border-box;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--linie);
  }
  .topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.08rem;
    min-height: 44px;
  }
  .topbar .brand img { width: 30px; height: 30px; border-radius: 7px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
  .topbar .langswitch button { min-height: 36px; padding: 6px 12px; }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    padding: 0;
  }
  .menu-toggle:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
  .menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after {
    display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform 0.22s ease, opacity 0.18s ease;
  }
  .menu-toggle .bars { position: relative; }
  .menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle .bars::before { top: -7px; }
  .menu-toggle .bars::after { top: 7px; }
  .topbar.open .menu-toggle .bars { background: transparent; }
  .topbar.open .menu-toggle .bars::before { transform: translateY(7px) rotate(45deg); }
  .topbar.open .menu-toggle .bars::after { transform: translateY(-7px) rotate(-45deg); }

  /* Ohne JavaScript: Menü als wischbare Zeile unter der Kopfzeile */
  html:not(.js) .topbar { flex-wrap: wrap; }
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .topbar .mainnav {
    order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; gap: 18px; padding: 4px 0 6px;
  }
  html:not(.js) .topbar .mainnav a { white-space: nowrap; }

  /* Mit JavaScript: aufklappendes Menü */
  html.js .topbar .mainnav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    padding: 6px 18px 16px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    background: #fff;
    border-bottom: 1px solid var(--linie);
    box-shadow: 0 18px 30px rgba(0,0,0,0.10);
    max-height: calc(100vh - var(--topbar-h));
    max-height: calc(100dvh - var(--topbar-h));
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  html.js .topbar.open .mainnav {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }
  html.js .topbar .mainnav a {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 4px;
    font-size: 1.08rem;
    color: var(--text);
    border-bottom: 1px solid #f0f0f2;
  }
  html.js .topbar .mainnav a:last-child { border-bottom: 0; }
  html.js .topbar .mainnav a::after { display: none; }
  html.js .topbar .mainnav a[aria-current="page"] { color: var(--blau); font-weight: 700; }
  html.js .topbar .mainnav a[aria-current="page"]::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f4b942; margin-right: 10px;
  }
  .nav-scrim {
    position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.18);
    opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .nav-scrim.show { opacity: 1; visibility: visible; transition: opacity 0.2s ease, visibility 0s; }

  /* Inhalte */
  h1 { font-size: 1.75rem; line-height: 1.2; }
  h2 { font-size: 1.25rem; line-height: 1.3; }
  .hero-claim { font-size: 1.4rem !important; margin-top: 18px !important; }
  .app-header { margin-bottom: 8px; }
  .cta a.store { flex: 1 1 220px; text-align: center; }
  a.store { min-height: 48px; box-sizing: border-box; display: inline-flex !important; align-items: center; justify-content: center; margin-bottom: 8px; }
  .screenshots img { width: 100%; }
  .ui { white-space: normal; }
  .features { grid-template-columns: 1fr; gap: 10px; }
  .more-apps { grid-template-columns: 1fr; }
  footer a { display: inline-block; padding: 8px 4px; }
  .hero-book { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .topbar .mainnav, .nav-scrim, .menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after { transition: none !important; }
}

/* ---------- Kleine Kennzeichen ---------- */
.tag-plus, .tag-free {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 2px 7px;
  vertical-align: middle;
  line-height: 1.4;
}
.tag-plus { color: #fff; background: var(--plus); }
.tag-free { color: var(--blau); background: #e6f0f6; }

.new-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--papier);
  border: 1px solid #eadfcd;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  min-height: 36px;
  box-sizing: border-box;
}
.new-pill b { background: #a34538; color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; letter-spacing: 0.04em; }
.new-pill:hover { border-color: #d8c7aa; }

/* ---------- Album-Abschnitt ---------- */
.album {
  margin: 36px -20px 0;
  padding: 26px 20px 28px;
  background: var(--papier);
  border-radius: 20px;
}
.album h2 { margin-top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.album .lead { margin: 6px 0 0; color: #3a3a3c; }
.album h3 { font-size: 1rem; font-weight: 600; margin: 26px 0 10px; }

.gallery-wrap { position: relative; margin-top: 18px; }
.gallery {
  display: flex;
  gap: 16px;
  margin: 0 -20px;
  padding: 4px 20px 14px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 20px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.gallery li { flex: 0 0 216px; scroll-snap-align: start; }
.gallery a.page {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 22px rgba(60,40,10,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery a.page:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 14px 28px rgba(60,40,10,0.16); }
.gallery a.page:focus-visible { outline: 3px solid var(--blau); outline-offset: 3px; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 1414; object-fit: cover; }
.gallery .cap { margin: 10px 2px 0; font-size: 0.9rem; line-height: 1.45; color: var(--grau); }
.gallery .cap strong { display: block; color: var(--text); font-size: 0.98rem; }

.gal-btn {
  position: absolute;
  top: calc(50% - 40px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.2s ease;
}
.gal-btn:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.gal-btn[disabled] { opacity: 0; pointer-events: none; }
.gal-btn.prev { left: -8px; }
.gal-btn.next { right: -8px; }
.swipe-hint { display: none; font-size: 0.85rem; color: var(--grau); margin: 2px 0 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0; padding: 0; list-style: none; }
.swatches li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border-radius: 999px; background: #fff;
  font-size: 0.9rem; border: 1px solid #efe7d8;
}
.swatches i { width: 20px; height: 20px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { background: #fff; border-radius: 14px; padding: 14px 16px; border: 1px solid #efe7d8; counter-increment: s; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: #a34538; color: #fff; font-weight: 700; margin-bottom: 8px;
}
.steps strong { display: block; }
.steps span { color: var(--grau); font-size: 0.93rem; }

/* ---------- Stile im Vergleich ---------- */
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.style-card { background: var(--flaeche); border-radius: 14px; padding: 14px 16px; }
.style-card.is-new { background: var(--papier); box-shadow: inset 0 0 0 2px #e7d6bd; }
.style-card strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 1.02rem; }
.style-card span.d { color: var(--grau); font-size: 0.93rem; line-height: 1.45; display: block; }

@media (max-width: 760px) {
  .album { margin: 30px -18px 0; padding: 22px 18px 24px; border-radius: 0; }
  .gallery { margin: 0 -18px; padding: 4px 18px 12px; scroll-padding: 0 18px; gap: 14px; scrollbar-width: none; }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery li { flex-basis: 70%; max-width: 300px; }
  .gal-btn { display: none; }
  .swipe-hint { display: block; }
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .steps li { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; align-items: start; }
  .steps li::before { margin: 0; grid-row: span 2; }
  .styles { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 380px) {
  .styles { grid-template-columns: 1fr; }
}
@media (hover: none) { .gal-btn { display: none; } .swipe-hint { display: block; } }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: rgba(18,18,20,0.94);
  color: #fff;
}
.lightbox::backdrop { background: rgba(18,18,20,0.94); }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 8px;
  padding-top: max(56px, calc(env(safe-area-inset-top) + 48px));
  touch-action: pan-y pinch-zoom;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.lb-cap { flex: 1 1 auto; font-size: 0.95rem; line-height: 1.4; color: #e5e5ea; text-align: center; }
.lb-cap strong { color: #fff; display: block; }
.lb-count { display: block; font-size: 0.8rem; color: #a1a1a6; margin-top: 2px; }
.lb-btn {
  flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.14); color: #fff;
  font-size: 1.35rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.lb-btn:hover { background: rgba(255,255,255,0.24); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); }
body.lb-open { overflow: hidden; }

/* Beispiel-Reisebuch im Album-Abschnitt */
.sample-intro { margin: 18px 0 8px; color: #3a3a3c; }
.cta.sample { margin: 0 0 4px; }
.sample-alt { margin: 0 0 18px; font-size: .95em; }
a.store[hidden], .sample-alt a[hidden] { display: none !important; }

/* Preis für Reisespur Plus */
.price-note { margin: 4px 0 14px; color: #3a3a3c; }
.price-note a { color: inherit; }
.price-tag { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: #f4b942; color: #1d1d1f; font-size: .6em; font-weight: 600; vertical-align: middle; }
