/* ---------- Fahrtenbuch: Farben & Schrift ----------
   Helles, kühles Kartenpapier, Tinte als Textfarbe, das Logo-Violett nur für die Route,
   Links und den wichtigsten Knopf. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2-variations"), url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
:root {
  --paper: #EEF0EC;      /* Kartenweiß */
  --ink: #1B1F2A;        /* Tinte */
  --contour: #C9CEC4;    /* Höhenlinie */
  --forest: #3E5C4A;     /* Waldgrün */
  --route: #7C3AED;      /* Routen-Violett (Logo) */
  --thread: #E8B53A;     /* Stickgarn-Gelb, nur auf den Abzeichen */
  --muted: #5B6170;      /* Nebentext, aus Tinte abgeleitet, gut lesbar */
  --font: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --content: 74rem;      /* gemeinsame Inhaltsbreite, mittig */
  --pad: max(var(--gutter), (100% - var(--content)) / 2);
  --on-route: #fff;      /* Schrift auf violetten Flächen */
  color-scheme: light;
}
/* Dunkles Design "Nachtkarte": dunkles Blaugrau statt Schwarz, helleres Violett für gute Lesbarkeit.
   Gesetzt wird data-theme von einem kleinen Skript im <head> und vom Schalter oben rechts (main.js). */
:root[data-theme="dark"] {
  --paper: #151922;
  --ink: #E7E9E4;
  --contour: #2C3340;
  --forest: #5E8C6F;
  --route: #A98BFF;
  --muted: #A2A8B4;
  --on-route: #14111F;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
  font-optical-sizing: auto;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--route); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--route); color: var(--on-route); }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }

.fb-skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.fb-skip:focus { top: 1rem; }
.fb-loading { padding: 6rem var(--gutter); color: var(--muted); }

/* ---------- Kopfzeile ---------- */
.fb-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.fb-logo img { width: 34px; height: 34px; }
.fb-nav { display: flex; gap: .25rem clamp(.9rem, 2.5vw, 2rem); flex-wrap: wrap; justify-content: flex-end; font-size: .95rem; margin-left: auto; }

/* Hell/Dunkel-Schalter oben rechts */
.fb-theme {
  position: relative; flex: none; width: 3rem; height: 1.65rem; padding: 0; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 999px; background: transparent;
}
.fb-theme-knob {
  position: absolute; top: 2px; left: 2px; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
  transition: transform .25s cubic-bezier(.3, 1.3, .5, 1);
}
.fb-theme svg { width: .8rem; height: .8rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fb-theme .fb-moon, :root[data-theme="dark"] .fb-theme .fb-sun { display: none; }
:root[data-theme="dark"] .fb-theme .fb-moon { display: block; }
:root[data-theme="dark"] .fb-theme-knob { transform: translateX(1.35rem); }
.fb-nav a { text-decoration: none; color: var(--muted); padding: .2rem 0; }
.fb-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--route); text-underline-offset: 6px; text-decoration-thickness: 2px; }
/* Burger-Menü: nur auf schmalen Bildschirmen. Das Menü klappt unter der Kopfzeile auf. */
.fb-burger { display: none; }
@media (max-width: 40rem) {
  .fb-top { gap: .5rem; }
  .fb-theme { margin-left: auto; }
  .fb-burger {
    display: grid; place-content: center; gap: 5px; flex: none; width: 2.75rem; height: 2.75rem;
    padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer;
  }
  .fb-burger span { display: block; width: 1.4rem; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s, opacity .2s; }
  .is-open .fb-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .is-open .fb-burger span:nth-child(2) { opacity: 0; }
  .is-open .fb-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .fb-nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; flex-wrap: nowrap; gap: 0; padding: .25rem var(--pad) 1rem; font-size: 1.15rem;
    background: var(--paper); border-bottom: 1px solid var(--contour); box-shadow: 0 16px 24px -18px rgba(0, 0, 0, .4);
    visibility: hidden; opacity: 0; transform: translateY(-.5rem);
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
  .is-open .fb-nav { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
  .fb-nav a { padding: .85rem 0; color: var(--ink); border-bottom: 1px solid var(--contour); }
  .fb-nav a:last-child { border-bottom: 0; }
}

/* ---------- Hero: Name + Foto ---------- */
.fb-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(2rem, 7vh, 5rem) var(--pad) clamp(3rem, 8vh, 5rem); }
/* Hintergrund: Höhenlinien wie auf einer Wanderkarte und ein gestrichelter Pfad, der zum Foto führt */
.fb-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.fb-hero-contours path { fill: none; stroke: var(--contour); stroke-width: 1.6; }
.fb-hero-trail { fill: none; stroke: var(--route); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 14; opacity: .55; }
@media (max-width: 52rem) { .fb-hero-trail { display: none; } }
.fb-hero-grid { display: grid; gap: 2rem clamp(2rem, 6vw, 6rem); align-items: center; }
@media (min-width: 52rem) {
  .fb-hero { min-height: calc(100vh - 4.5rem); display: grid; align-items: center; }
  .fb-hero-grid { grid-template-columns: minmax(0, 1fr) auto; }
}
.fb-portrait { margin: 0; width: clamp(15rem, 32vw, 27rem); aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--contour); }
.fb-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
@media (max-width: 52rem) { .fb-portrait { order: -1; width: min(18rem, 75%); } }
.fb-name {
  font-size: clamp(3.4rem, 10vw, 8rem); font-weight: 800; font-stretch: 88%;
  letter-spacing: -0.04em; line-height: .9;
}
.fb-name span { display: block; }
.fb-intro { margin-top: 1.75rem; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 34ch; }
.fb-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.fb-btn {
  display: inline-flex; align-items: center; min-height: 2.9rem; padding: .7rem 1.3rem;
  border: 1.5px solid var(--ink); border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: .975rem; color: var(--ink); background: transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.fb-btn:hover { background: var(--ink); color: var(--paper); }
.fb-btn-main { background: var(--route); border-color: var(--route); color: var(--on-route); }
.fb-btn-main:hover { background: var(--ink); border-color: var(--ink); }

/* Karte */
.fb-map { margin: 0; color: var(--route); }
.fb-map svg { width: 100%; height: auto; overflow: visible; }
.fb-contours path { fill: none; stroke: var(--contour); stroke-width: 1.2; }
.fb-route { fill: none; stroke: var(--route); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fb-route-next { fill: none; stroke: var(--route); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; }
.fb-stop circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.fb-stop-letter { font: 700 14px var(--font); fill: var(--ink); text-anchor: middle; }
.fb-stop-label { font: 600 17px var(--font); fill: var(--ink); }
.fb-stop-year { font: 400 14px var(--font); fill: var(--muted); font-variant-numeric: tabular-nums; }
.fb-next-label { fill: var(--route); }
/* Auf dem Handy wird die Karte kleiner skaliert: Beschriftung dafür größer setzen */
@media (max-width: 40rem) { .fb-stop-label { font-size: 22px; } .fb-stop-year { font-size: 18px; } .fb-stop-letter { font-size: 16px; } }
/* Bis die Karte ins Bild kommt, sind nur die Höhenlinien zu sehen; dann tauchen die Stationen nacheinander auf */
.fb-map.is-waiting .fb-stop, .fb-map.is-waiting .fb-route-next, .fb-map.is-waiting .fb-next-label { opacity: 0; }
.fb-map.is-drawing .fb-stop { opacity: 0; animation: fb-stop .35s ease-out forwards; animation-delay: calc(.25s + var(--d) * .62s); }
.fb-map.is-drawing .fb-route-next, .fb-map.is-drawing .fb-next-label { opacity: 0; animation: fb-stop .6s ease-out 2.5s forwards; }
@keyframes fb-stop { to { opacity: 1; } }

/* ---------- Abschnitte ---------- */
.fb-section { padding: clamp(3.5rem, 9vh, 6rem) var(--pad); border-top: 1px solid var(--contour); }
.fb-section h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; font-stretch: 80%; letter-spacing: -0.03em; text-align: center; }
.fb-lead { margin-top: .75rem; color: var(--muted); max-width: 52ch; }
.fb-section .fb-lead, .fb-empty { text-align: center; margin-inline: auto; }

/* Stationen-Liste und Karte nebeneinander; die Karte bleibt beim Scrollen stehen */
.fb-route-grid { display: grid; gap: 2rem clamp(2rem, 5vw, 5rem); margin-top: 2.5rem; align-items: start; }
@media (min-width: 56rem) {
  .fb-route-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .fb-route-grid .fb-map { position: sticky; top: 6rem; }
}
@media (max-width: 56rem) { .fb-route-grid .fb-map { order: -1; } }
.fb-when { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fb-empty { margin-top: 1.25rem; color: var(--muted); }
.fb-link { display: inline-block; margin-top: 1rem; font-weight: 600; color: var(--route); text-underline-offset: 4px; }

/* Stationen: dieselben Buchstaben wie auf der Karte */
.fb-stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.fb-station { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1.25rem; position: relative; padding-bottom: 2.25rem; }
.fb-station::before { content: ""; position: absolute; left: calc(1.25rem - 1px); top: 2.5rem; bottom: .25rem; width: 2px; background: var(--route); opacity: .35; }
.fb-station:last-child { padding-bottom: 0; }
.fb-station:last-child::before { display: none; }
.fb-mark {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center;
  border: 2.5px solid var(--ink); background: var(--paper); font-weight: 700;
}
.fb-station h3 { font-size: 1.35rem; font-weight: 700; margin-top: .15rem; }
.fb-where { font-weight: 500; }
.fb-desc { margin-top: .5rem; color: var(--muted); max-width: 60ch; }
.fb-next .fb-mark { border-style: dashed; border-color: var(--route); }
.fb-next h3 { color: var(--route); }
.fb-station:nth-last-child(2)::before { background: none; border-left: 2px dashed var(--route); opacity: .6; }

/* Abzeichen: gestickte Aufnäher wie auf der Pfadfinder-Kluft */
/* Raster in Fünfergruppen: oben 2 breite, darunter 3 schmalere Abzeichen */
.fb-badges { margin-top: 3rem; display: grid; gap: 3.5rem 2rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fb-badge { grid-column: span 2; text-align: center; }
.fb-badge:nth-child(5n + 1), .fb-badge:nth-child(5n + 2) { grid-column: span 3; }
@media (max-width: 52rem) {
  .fb-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-badge, .fb-badge:nth-child(5n + 1), .fb-badge:nth-child(5n + 2) { grid-column: span 1; }
}
@media (max-width: 34rem) { .fb-badges { grid-template-columns: minmax(0, 1fr); } }
.fb-badge-top { position: relative; display: grid; justify-items: center; }
.fb-badge .fb-media { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--contour); }
.fb-badge .fb-media img, .fb-badge .fb-media video { width: 100%; height: 100%; object-fit: cover; }
.fb-badge p { margin: 1.25rem auto 0; color: var(--muted); max-width: 42ch; }
.fb-badge.has-media p { margin-top: 5rem; }

/* Das Abzeichen selbst: dicker Garnrand, Stichnaht, Titel im Bogen, Symbol, drei Sterne */
.fb-patch {
  width: clamp(8.5rem, 14vw, 10rem); height: auto; overflow: visible;
  transform: rotate(var(--tilt)); transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
  filter: drop-shadow(0 6px 10px rgba(27, 31, 42, .18));
}
.fb-badge:hover .fb-patch { transform: rotate(0deg) scale(1.04); }
.fb-patch-rim { fill: var(--thread); }
.fb-patch-body { stroke: rgba(0, 0, 0, .18); stroke-width: 2; }
.fb-patch-stitch { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 2.5; stroke-dasharray: 5 5; }
.fb-patch-title { font-family: var(--font); font-weight: 800; fill: var(--thread); letter-spacing: .02em; }
.fb-patch-icon { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fb-patch-stars { fill: var(--thread); }
/* Feste Farben: die Abzeichen sehen im hellen und im dunklen Design gleich aus */
.fb-patch-0 .fb-patch-body { fill: #3E5C4A; }
.fb-patch-1 .fb-patch-body { fill: #7C3AED; }
.fb-patch-2 .fb-patch-body { fill: #1B1F2A; }
/* Mit Foto: das Abzeichen sitzt halb auf der unteren Bildkante */
.fb-badge.has-media .fb-patch { position: absolute; bottom: -4.25rem; }
.fb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Unterwegs: Fotostreifen zum seitlichen Scrollen */
.fb-moments { margin-top: 2rem; overflow: hidden; border-radius: 14px; }
.fb-moments-track { position: relative; display: flex; gap: 1rem; will-change: transform; }
.fb-moments-track img {
  flex: none; height: clamp(16rem, 38vw, 26rem); width: auto; border-radius: 14px; background: var(--contour);
  opacity: .45; transition: opacity .6s;
}
.fb-moments-track img.is-active { opacity: 1; }
.fb-moments-nav { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.25rem; }

/* Ladebalken: zeigt, wie lange das Foto noch zu sehen ist */
.fb-moments-progress { width: clamp(6rem, 18vw, 10rem); height: 3px; border-radius: 3px; background: var(--contour); overflow: hidden; }
.fb-moments-progress span { display: block; height: 100%; background: var(--route); transform-origin: left; animation: fb-progress 4s linear forwards; }
.is-paused-hover .fb-moments-progress span, .is-paused-away .fb-moments-progress span { animation-play-state: paused; }
.fb-moments-nav.is-still .fb-moments-progress { display: none; }
@keyframes fb-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.fb-arrow {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink); transition: background .2s, color .2s;
}
.fb-arrow svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fb-arrow:hover { background: var(--ink); color: var(--paper); }

/* Projekte */
.fb-projects { margin-top: 2.5rem; display: grid; gap: 3.5rem; }
.fb-project { display: grid; gap: 1.5rem 3rem; align-items: start; }
@media (min-width: 52rem) {
  .fb-project { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .fb-project:nth-child(even) .fb-media { order: 2; }
}
.fb-project .fb-media { aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: var(--contour); }
.fb-project .fb-media img, .fb-project .fb-media video { width: 100%; height: 100%; object-fit: cover; }
.fb-media-empty { height: 100%; display: grid; place-items: center; color: var(--muted); }
.fb-project h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; font-stretch: 85%; letter-spacing: -0.02em; margin: .3rem 0 .9rem; }
.fb-project-text p + p { margin-top: .9rem; }
.fb-project-text > p:not(.fb-when) { max-width: 60ch; }

/* Blog */
.fb-posts { list-style: none; margin: 2rem auto 0; padding: 0; display: grid; gap: 1rem; max-width: 46rem; }
.fb-posts a { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; text-decoration: none; padding: .5rem 0; }
.fb-posts img { width: clamp(5.5rem, 14vw, 8rem); aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.fb-post-text { display: grid; gap: .15rem; }
.fb-post-title { font-size: 1.3rem; font-weight: 700; }
.fb-post-excerpt { color: var(--muted); }
.fb-posts a:hover .fb-post-title { text-decoration: underline; text-decoration-color: var(--route); text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* Kontakt */
.fb-contact { text-align: center; }
.fb-contact h2 { font-size: clamp(2.6rem, 8vw, 6rem); font-stretch: 75%; }
.fb-contact .fb-actions, .fb-contact .fb-social { justify-content: center; }
.fb-social { display: flex; gap: .75rem; margin-top: 1.75rem; }
.fb-social .social-icon {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1.5px solid var(--ink); color: var(--ink); transition: background .2s, color .2s;
}
.fb-social .social-icon svg { width: 1.1rem; height: 1.1rem; }
.fb-social .social-icon:hover { background: var(--ink); color: var(--paper); }

/* Fußzeile */
.fb-footer { padding: 1.5rem var(--pad) 2rem; border-top: 1px solid var(--contour); color: var(--muted); font-size: .9rem; }
.fb-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }

/* ---------- Blogbeitrag, Impressum, Datenschutz ---------- */
.fb-article { max-width: 44rem; margin: 0 auto; padding: clamp(2.5rem, 7vh, 4.5rem) var(--gutter) clamp(4rem, 10vh, 6rem); box-sizing: content-box; }
.fb-back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 2.5rem; }
.fb-back:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--route); text-underline-offset: 5px; }
.fb-article h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; font-stretch: 80%; letter-spacing: -0.03em; margin-top: .4rem; }
.fb-article > .fb-lead { font-size: 1.2rem; margin-top: 1rem; }
.fb-cover { width: 100%; max-height: 70vh; object-fit: cover; border-radius: 18px; margin-top: 2.5rem; }
.fb-prose { margin-top: 2.5rem; font-size: 1.125rem; line-height: 1.7; }
.fb-prose > * + * { margin-top: 1.1em; }
.fb-prose h2, .fb-prose h3 { margin-top: 2em; font-size: 1.4rem; font-weight: 700; line-height: 1.25; text-align: left; }
.fb-prose a { color: var(--route); text-underline-offset: 3px; }
.fb-prose ul, .fb-prose ol { padding-left: 1.25rem; }
.fb-prose img { border-radius: 14px; }
.fb-prose blockquote { margin-left: 0; padding-left: 1.25rem; border-left: 3px solid var(--route); color: var(--muted); }
.fb-article-end { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--contour); }
.fb-footer nav { display: flex; gap: 1.5rem; }
.fb-footer a { text-decoration: none; }
.fb-footer a:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fb-map .fb-stop, .fb-map .fb-route-next, .fb-map .fb-next-label { animation: none !important; opacity: 1 !important; }
}
