/* ════════════════════════════════════════════════════════════════
   Randnavigation – auf allen Seiten identisch, Reihenfolge fest.

   Zwei Erscheinungsformen, ein Markup:
   · ab 1200px eine schmale, mitlaufende Spalte im freien linken Rand
     (position: fixed, damit keine Seite ihr Layout ändern muss),
   · darunter eine Haarlinien-Liste im Fluss zwischen Inhalt und Fußzeile,
     in derselben Machart wie die frühere Hero-Liste der Startseite.

   Alle Tokens mit Rückfallwert, damit die Datei auf jeder Seite trägt,
   unabhängig davon, welche Variablen deren :root definiert.
   ════════════════════════════════════════════════════════════════ */

.randnav {
  position: relative;
  z-index: 1;
  padding-inline: var(--gutter, 1.25rem);
  margin-block: var(--space-6, 96px) var(--space-5, 64px);
  font-family: 'Jost', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
}

.randnav-inner {
  max-width: var(--measure, 66ch);
  margin-inline: auto;
}

/* Gruppenlabel „Für wen ich arbeite“ – Messing-Versalien wie die Sektionslabels */
.randnav-group {
  margin: 0 0 var(--space-2, 16px);
  font-weight: 500;
  font-size: var(--fs-label, .75rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--ls-label, .16em);
  color: var(--brass, #A8865A);
}

.randnav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.randnav-list + .randnav-list { margin-top: var(--space-4, 40px); }

.randnav-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 24px);
  min-height: 44px;
  padding-block: 18px;
  border-bottom: 1px solid rgba(168, 134, 90, .32);
  color: var(--ink, #16202E);
  text-decoration: none;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: .02em;
  transition: border-color 200ms ease;
}
.randnav-list:first-of-type li:first-child a {
  border-top: 1px solid rgba(168, 134, 90, .32);
}

.randnav-arrow {
  flex: none;
  font-size: 1rem;
  line-height: 1;
  color: var(--brass, #A8865A);
  transition: transform 200ms ease;
}

.randnav-list a:hover,
.randnav-list a:focus-visible { border-bottom-color: rgba(168, 134, 90, .85); }
.randnav-list a:hover .randnav-arrow,
.randnav-list a:focus-visible .randnav-arrow { transform: translateX(4px); }

.randnav-list a:focus-visible {
  outline: 2px solid var(--brass, #A8865A);
  outline-offset: 3px;
}

/* Aktuelle Seite – Messing im Text, sonst keine Fläche */
.randnav-list a[aria-current="page"] {
  font-weight: 500;
  border-bottom-color: rgba(168, 134, 90, .85);
}
.randnav-list a[aria-current="page"] .randnav-arrow { color: var(--ink, #16202E); }

/* ── Rand-Spalte ───────────────────────────────────────────────────
   Die Spalte hängt am selben Mittelpunkt wie die Textspalte, hält also
   auf jeder Fensterbreite denselben Abstand zur Satzkante. Der max()-
   Wert fängt schmale Fenster ab, in denen der Rand nicht mehr reicht. */
@media (min-width: 1200px) and (min-height: 640px) {
  .randnav {
    position: fixed;
    top: 50%;
    left: max(1.25rem, calc(50% - 37rem));
    width: 11.5rem;
    max-height: 86vh;
    overflow-y: auto;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    z-index: 2;
  }
  .randnav-inner { max-width: none; }
  .randnav-group { margin-bottom: var(--space-1, 8px); }

  .randnav-list + .randnav-list { margin-top: var(--space-3, 24px); }
  .randnav-list + .randnav-list::before {
    content: "";
    display: block;
    width: 32px;
    border-top: 1px solid var(--brass, #A8865A);
    opacity: .4;
    margin-bottom: var(--space-2, 16px);
  }

  .randnav-list a {
    display: block;
    min-height: 0;
    padding-block: 7px;
    border: 0;
    font-size: .9375rem;
    line-height: 1.35;
    color: var(--slate, #5E6877);
    transition: color 200ms ease;
  }
  .randnav-list:first-of-type li:first-child a { border-top: 0; }
  .randnav-list a:hover,
  .randnav-list a:focus-visible { color: var(--ink, #16202E); }
  .randnav-list a[aria-current="page"] { color: var(--ink, #16202E); }

  /* Der Pfeil trägt in der Rand-Spalte nichts – er bleibt der Liste vorbehalten */
  .randnav-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .randnav-list a,
  .randnav-arrow { transition: none; }
  .randnav-list a:hover .randnav-arrow,
  .randnav-list a:focus-visible .randnav-arrow { transform: none; }
}

@media print {
  .randnav { display: none; }
}
