@font-face {
  font-display: swap;
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/courier-prime-v11-latin-regular.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/work-sans-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Work Sans';
  font-style: italic;
  font-weight: 500;
  src: url('fonts/work-sans-latin-500-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-300-italic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-300-normal.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-500-italic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-600-italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* === Root Variables & Theme Setup === */
:root {
  /* Konstante Farben */
  --const-color-header-footer-bg: #52547a;
  --const-color-white: #f0f2f5;
  --const-color-nav-active-bg: #60618e;
  --const-color-text-on-footer: #e0e0e0;
  --const-color-red: #f22020;
  --const-color-blue: #522fed;
  --const-color-orange: #ffa500;
  --const-color-yellow: #ffff00;
  --const-color-green: #00ff00;
  --const-color-violet: #6600a1;
  --const-color-crimson: #dc143c;
  --const-color-grey-blue: #8384b9;
  /* Light Mode Farben */
  color-scheme: light;
  --lm-color-page-background: #dbe0ec;
  --lm-color-nav-background: #f0f2f5;
  --lm-color-btt-background: #60618e;
  --lm-color-tag-background: #f0f2f5;
  --lm-color-text-primary: #404160;
  --lm-color-text-secondary: #626277;
  --lm-color-link-text: #52547a;
  --lm-color-post-title: #6600a1;
  --lm-color-post-heading: #60618e;
  --lm-color-border: #a3abbd;
  --lm-color-nav-link-bg: #dbe0ec;
  --lm-color-nav-link-bg-hover: #a3abbd;
  --lm-color-nav-link-border: #7475a3;
  --lm-color-opt-sum-bg: #60618e;
  --lm-color-opt-sum-bg-hover: #7475a3;
  --lm-font-weight-text-primary: 400;
}

/* Dark Mode via Systempräferenz */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --lm-color-page-background: #24262b;
    --lm-color-nav-background: #2d3035;
    --lm-color-btt-background: #7475a3;
    --lm-color-tag-background: #24262b;
    --lm-color-text-primary: #e4e6ea;
    --lm-color-text-secondary: #adb5bd;
    --lm-color-link-text: #aeb2d8;
    --lm-color-post-title: #b38aff;
    --lm-color-post-heading: #aeb2d8;
    --lm-color-border: #626277;
    --lm-color-nav-link-bg: #24262b;
    --lm-color-nav-link-bg-hover: #60618e;
    --lm-color-nav-link-border: #626277;
    --lm-color-opt-sum-bg: #52547a;
    --lm-color-opt-sum-bg-hover: #60618e;
    --lm-font-weight-text-primary: 300;
  }
}

/* Dark Mode via JS Toggle */
html[data-theme="dark"] {
  color-scheme: dark;
  --lm-color-page-background: #24262b;
  --lm-color-nav-background: #2d3035;
  --lm-color-btt-background: #7475a3;
  --lm-color-tag-background: #24262b;
  --lm-color-text-primary: #e4e6ea;
  --lm-color-text-secondary: #adb5bd;
  --lm-color-link-text: #aeb2d8;
  --lm-color-post-title: #b38aff;
  --lm-color-post-heading: #aeb2d8;
  --lm-color-border: #626277;
  --lm-color-nav-link-bg: #24262b;
  --lm-color-nav-link-bg-hover: #60618e;
  --lm-color-nav-link-border: #626277;
  --lm-color-opt-sum-bg: #52547a;
  --lm-color-opt-sum-bg-hover: #60618e;
  --lm-font-weight-text-primary: 300;
}

/* Light Mode via JS Toggle */
html[data-theme="light"] {
  color-scheme: light;
  --lm-color-page-background: #dbe0ec;
  --lm-color-nav-background: #f0f2f5;
  --lm-color-btt-background: #60618e;
  --lm-color-tag-background: #f0f2f5;
  --lm-color-text-primary: #404160;
  --lm-color-text-secondary: #626277;
  --lm-color-link-text: #52547a;
  --lm-color-post-title: #6600a1;
  --lm-color-post-heading: #60618e;
  --lm-color-border: #a3abbd;
  --lm-color-nav-link-bg: #dbe0ec;
  --lm-color-nav-link-bg-hover: #a3abbd;
  --lm-color-nav-link-border: #7475a3;
  --lm-color-opt-sum-bg: #60618e;
  --lm-color-opt-sum-bg-hover: #7475a3;
  --lm-font-weight-text-primary: 400;
}

/* === Grundlegende Styles === */
html {
  box-sizing: border-box;
  font-size: 62.5%;
  overflow-y: scroll;
  scroll-behavior: auto;
  /*min-height: 100.05%;*/
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 320px; /* Verhindert das Zerstören des Layouts bei extrem schmalen App-Fenstern */
  font-family: Inter, Helvetica, sans-serif;
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.6rem);
  line-height: 1.6;
  color: var(--lm-color-text-primary);
  font-weight: var(--lm-font-weight-text-primary);
  background: var(--lm-color-page-background);
  position: relative;
  overflow-x: hidden;
}

body.is-scroll-locked {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

main {
  flex: 1 0 auto;
}

.container {
  max-width: 110rem;
  padding: 0 clamp(1.2rem, 0.4rem + 2.5vw, 2.4rem);
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: .5em;
  margin: .5em;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: 1001;
  background: var(--lm-color-nav-background);
  color: var(--lm-color-text-primary);
  outline: 2px solid var(--lm-color-link-text);
}

a {
  color: var(--lm-color-post-heading);
  text-decoration: underline;
}

a:hover,
a:focus {
  text-decoration: none;
  outline: none;
}

a:focus-visible {
  outline: 2px solid var(--lm-color-post-heading);
  outline-offset: 2px;
  text-decoration: underline;
}

.cent {
  text-align: center;
}

.alignright {
  text-align: right;
}

.color-red {
  color: var(--const-color-red);
}

.color-blue {
  color: var(--const-color-blue);
}

.color-orange {
  color: var(--const-color-orange);
}

.color-yellow {
  color: var(--const-color-yellow);
}

.color-green {
  color: var(--const-color-green);
}

.color-violet {
  color: var(--const-color-violet);
}

.color-crimson {
  color: var(--const-color-crimson);
}

.emoin {
  width: 1.8em;
  height: 1.8em;
  vertical-align: middle;
  padding-bottom: 0.2em;
}

.div-box01,
.div-box02,
.div-box03 {
  margin: clamp(1.6rem, 1vw + 1rem, 2.4rem) 0;
  border: 0.1rem solid var(--lm-color-border);
}

.div-box01 {
  padding: 0.4rem 1.4rem 2.2rem 1.4rem;
}

.div-box02 {
  padding: 0 1.4rem 2.4rem 1.4rem;
}

.div-box03 {
  padding: 0.4rem 1.4rem;
}

.spacer-01 {
  margin-top: clamp(1.6rem, 1.5vw + 1rem, 2.6rem);
  margin-bottom: clamp(1.2rem, 1vw + 0.8rem, 2rem);
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1.6rem;
}

table {
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0.8rem auto 1.6rem auto;
}

table,
td {
  border: 0.1rem solid var(--lm-color-border);
}

td {
  padding: 0;
  text-align: center;
}

td.bgcolor-grey {
  background-color: var(--const-color-grey-blue);
}

td p {
  margin: 0;
  padding: 0.8rem 1.2rem;
  text-align: center;
}

/* Header */
.header {
  background: var(--const-color-header-footer-bg);
  padding: 1.6rem 0;
  position: relative;
}

.header__container {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.header__logo {
  width: clamp(5rem, 2rem + 7.5vw, 8rem);
  height: clamp(5rem, 2rem + 7.5vw, 8rem);
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.header__title {
  margin: 0;
  font-family: 'Courier Prime', Courier, monospace;
  font-weight: normal;
  font-size: clamp(2rem, 1.2rem + 2.5vw, 3rem);
  line-height: 1.1;
  color: var(--const-color-white);
}

.header__tagline {
  margin: .2rem 0 0;
  font-family: Inter, Helvetica, sans-serif;
  font-size: clamp(1.2rem, 0.8rem + 1.25vw, 1.6rem);
  font-style: italic;
  color: var(--const-color-white);
}

/* Meta Navigation Links (top right) */
.meta-nav-container {
  position: absolute;
  top: 0;
  right: 1rem;
  display: flex;
  gap: clamp(0.5rem, 0.2rem + 1vw, 1rem);
  padding: 0.4rem 1rem;
}

.meta-nav-link {
  color: var(--const-color-text-on-footer);
  font-size: clamp(1rem, 0.7rem + 1vw, 1.3rem);
  text-decoration: none;
}

.meta-nav-link:hover {
  text-decoration: underline;
  color: var(--const-color-white);
}

/* Theme-Toggle-Button */
.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  margin-top: clamp(0rem, 2rem - 2.5vw, 1.2rem);
  gap: clamp(0.2rem, 0.1rem + 0.5vw, 0.5rem);
  min-height: clamp(2.0rem, 1rem + 2.5vw, 3.4rem);
  padding: 0 clamp(0.6rem, 0.2rem + 1vw, 1.4rem) 0 clamp(0.5rem, 0.1rem + 1vw, 1.2rem);
  border-radius: 999px;
  border: 1px solid var(--const-color-nav-active-bg);
  background: var(--const-color-nav-active-bg);
  color: var(--const-color-white);
  cursor: pointer;
  user-select: none;
  transition: background .1s ease;
}

.theme-toggle:hover {
  background: var(--const-color-header-footer-bg);
  border: 1px solid var(--const-color-text-on-footer);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--const-color-white);
  outline-offset: 2px;
}

.theme-text {
  font-size: clamp(1.1rem, 0.7rem + 1.2vw, 1.6rem);
  white-space: nowrap;
}

/* SVG */
.theme-icon {
  display: block;
  width: clamp(1.2rem, 0.8rem + 1.2vw, 2.4rem);
  height: clamp(1.2rem, 0.8rem + 1.2vw, 2.4rem);
}

/* Reihenfolge beibehalten! zuerst alles leerzeichnen */
.theme-icon * {
  fill: none;
  stroke: var(--const-color-white);
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* dann gezielt füllen */
.theme-icon .sun circle,
.theme-icon .moon {
  fill: var(--const-color-white);
  stroke: none;
}

.theme-icon .sun {
  opacity: 1;
}

.theme-icon .moon {
  opacity: 0;
}

html[data-theme="dark"] .theme-icon .sun {
  opacity: 0;
}

html[data-theme="dark"] .theme-icon .moon {
  opacity: 1;
}

.theme-icon .sun,
.theme-icon .moon {
  transition: opacity .12s ease;
}

@media (prefers-reduced-motion: reduce) {

  .theme-icon .sun,
  .theme-icon .moon,
  .theme-toggle {
    transition: none;
  }
}

/* Navigation */
.nav {
  background: var(--lm-color-nav-background);
  padding: 1rem 0;
  border-bottom: 1px solid var(--lm-color-border);
}

.nav__list {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-cent {
  justify-content: center;
}

.nav-cent .emoin {
  width: 1.4em;
  height: 1.4em;
  padding-bottom: 0;
  display: block;
  /* Verhindert Inline-Abstände */
}

.nav-cent .nav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4em;
}

.nav__link {
  display: inline-block;
  font-size: clamp(1.1rem, 0.6rem + 1.5vw, 1.8rem);
  font-weight: 500;
  padding: .4rem 1rem;
  background: var(--lm-color-nav-link-bg);
  border: 1px solid var(--lm-color-nav-link-border);
  border-radius: 4px;
  color: var(--lm-color-link-text);
  text-decoration: none;
}

.nav__link:hover,
.nav__link:focus {
  border: 1px solid var(--lm-color-nav-link-bg-hover);
  font-weight: 500;
  text-decoration: none;
}

.nav__link:hover {
  color: var(--const-color-white);
  background: var(--const-color-nav-active-bg);
}

.nav__link.active,
.nav__link[aria-current=page] {
  background: var(--const-color-nav-active-bg);
  border: 1px solid var(--const-color-nav-active-bg);
  color: var(--const-color-white);
  font-weight: 500;
}

/* Post */
.post {
  padding: clamp(1.2rem, 4vw, 3.2rem) 0;
}

.post__container {
  max-width: 80rem;
  margin: 0 auto;
  padding: clamp(1.2rem, 0.4rem + 2.5vw, 2.4rem);
}

.post__header {
  margin-bottom: clamp(1.6rem, 1.5vw + 1rem, 2.4rem);
  padding-bottom: clamp(1rem, 1vw + 0.6rem, 1.6rem);
  border-bottom: 1px solid var(--lm-color-border);
}

h1.post__title,
h2.post__title {
  margin: 0;
  font-size: clamp(2rem, 1.5rem + 1.5vw, 3rem);
  font-weight: 500;
  line-height: clamp(2.6rem, 2rem + 2vw, 4.2rem);
  color: var(--lm-color-post-title);
}

.post__title--single {
  margin: clamp(1.2rem, 1vw + 0.8rem, 2rem) 0 clamp(1.6rem, 1.5vw + 1rem, 2.4rem) 0;
}

.post__meta {
  margin: 0;
  font-size: clamp(1.1rem, 0.9rem + 0.6vw, 1.4rem);
  text-align: right;
  color: var(--lm-color-text-secondary);
}

h1,
h2 {
  font-family: 'Work Sans', Helvetica, sans-serif;
}

h2 {
  margin-bottom: clamp(0.4rem, 0.5vw + 0.2rem, 0.8rem);
  font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.2rem);
  font-weight: 500;
  line-height: clamp(2.4rem, 2rem + 1.25vw, 3.4rem);
  color: var(--lm-color-post-heading);
}

strong {
  color: var(--lm-color-text-secondary);
  font-weight: 500;
}

em {
  font-style: italic;
}

/* Optional HTML */
.optional__html {
  margin-top: clamp(-4rem, -0.6rem - 4.2vw, -2rem);
}

.optional__html h3 {
  margin-bottom: clamp(0.3rem, 0.4vw + 0.2rem, 0.6rem);
  font-size: clamp(1.7rem, 1.4rem + 0.9vw, 2.4rem);
  font-weight: 500;
  line-height: clamp(2.4rem, 2rem + 1.25vw, 3.4rem);
  color: var(--lm-color-post-heading);
}

.optional__html p {
  font-size: clamp(1.2rem, 0.8rem + 1.1vw, 1.7rem);
  line-height: clamp(1.8rem, 1.1rem + 2vw, 2.8rem);
}

.optional__html hr.hr-optional-html {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.optional__html details {
  border: none;
  margin-top: clamp(2rem, 1.5vw + 1.5rem, 3.2rem);
  margin-bottom: 3rem;
}

details ul li {
  line-height: clamp(2.2rem, 1.8rem + 1.25vw, 2.8rem);
}

.optional__html details ul li a {
  font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.8rem);
}

.optional__html details summary {
  position: relative;
  font-size: clamp(1.6rem, 1.3rem + 0.9vw, 2rem);
  font-weight: 500;
  line-height: 200%;
  color: var(--const-color-white);
  background-color: var(--lm-color-opt-sum-bg);
  border: 1px solid var(--lm-color-opt-sum-bg);
  border-radius: 4px;
  cursor: pointer;
  padding-left: 1.6rem;
}

.optional__html details summary:hover {
  background-color: var(--lm-color-opt-sum-bg-hover);
}

.optional__html details summary span {
  vertical-align: top;
  font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.8rem);
  font-weight: 400;
  font-style: italic;
  padding-left: 1rem;
}

.optional__html details summary::marker,
.optional__html details summary::-webkit-details-marker {
  color: var(--const-color-white);
}

.optional__html details summary::after {
  position: absolute;
  top: 0;
  right: 1.6rem;
  content: '+';
  font-size: clamp(2.4rem, 2rem + 1.25vw, 3rem);
  font-weight: 400;
  color: var(--const-color-white);
  transition: transform .2s;
}

.optional__html details[open] summary::after {
  transform: rotate(45deg);
}

/* Post Content */
.post__content {
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.8rem);
  line-height: clamp(2.2rem, 1.8rem + 1.2vw, 3rem);
}

.post__content--single {
  margin: 4rem 0 3.2rem 0;
}

.post__content::after {
  content: "";
  display: table;
  clear: both;
}

.clear-float-left {
  clear: left;
}

.clear-float-right {
  clear: right;
}

.clear-both {
  clear: both;
}

.post__content h2,
.post__content h3,
.post__content h4 {
  margin: clamp(2rem, 2vw + 1rem, 3.2rem) 0 clamp(0.8rem, 1vw + 0.4rem, 1.2rem);
  color: var(--lm-color-post-heading);
}

.post__content h2 {
  font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.6rem);
  font-weight: 500;
}

.post__content h3 {
  font-size: clamp(1.6rem, 1.3rem + 0.9vw, 2.2rem);
  font-weight: 500;
  margin-top: clamp(2.4rem, 1.6rem + 2.5vw, 4.8rem);
  border-top: 1px dashed var(--lm-color-border);
  padding-top: 1.6rem;
}

.post__content h4 {
  font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.9rem);
  font-weight: 600;
  margin-top: clamp(2rem, 1.6rem + 1vw, 3.2rem);
  line-height: clamp(2rem, 1.6rem + 1.2vw, 3rem);
  font-style: italic;
  color: var(--lm-color-text-secondary);
}

.post__content h4.h4-first-on-top {
  margin-top: 0;
  padding-top: 0.4rem;
}

hr {
  border: none;
  border-top: 1px solid var(--lm-color-border);
  margin: 0;
}

hr.hr-margin-bottom-2-6-rem {
  margin-bottom: 2.6rem;
}

/* Divider Spacing Utilities */
hr.hr--image-sep {
  margin-top: 3.2rem;
}

hr.hr--thumb-sep {
  margin-top: -0.8rem;
  margin-bottom: -1.6rem;
}

hr.hr--content-sep {
  margin-top: 2.4rem;
}

/* Exakte vertikale Zentrierung des Textes zwischen hr--content-sep und hr--bottom-sep */
hr.hr--content-sep+p {
  /* Setzt den Browser-Standard-Abstand zurück, um die Mathematik nicht zu verfälschen */
  margin-top: 0;

  /* Spiegelt exakt den dynamischen Abstand der unteren Linie wider (+ 1rem Puffer für kleine Displays) */
  padding-top: clamp(1.4rem, 2vw + 0.4rem, 2.6rem);
  padding-bottom: 1rem;
}

hr.hr--bottom-sep {
  margin-top: -1.6rem;
  margin-bottom: -1.6rem;
}

hr.hr--bottom-pag {
  margin-top: -1.6rem;
  margin-bottom: 2.6rem;
}

div.div-left-right-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: clamp(1.6rem, 1.5vw + 1rem, 2.6rem);
  gap: 1rem;
}

div.div-left-right-buttons--bottom {
  margin-top: clamp(3.2rem, 3vw + 2rem, 6rem);
  margin-bottom: clamp(2.4rem, 2vw + 1rem, 4rem);
}

div.div-left-right-buttons--top {
  margin: clamp(0.3rem, 0.2vw + 0.2rem, 0.5rem) 0 clamp(2rem, 2vw + 1rem, 3.2rem) 0;
}

div.div-left-right-buttons span {
  margin: 0 1rem;
}

/* Neu: Wenn es zwei Links gibt, wird der zweite sauber rechtsbündig formatiert */
div.div-left-right-buttons a:last-of-type:not(:first-of-type) {
  text-align: right;
}

/* Modernes Pillen-Design für die Galerie-Navigation (Vor/Zurück) analog zu den Thumbnail-Labels */
div.div-left-right-buttons .nav__link {
  font-size: clamp(1.2rem, 1vw + 0.8rem, 1.4rem);
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.6rem;
  border-radius: 2rem;
  color: var(--lm-color-link-text);
  background-color: var(--lm-color-nav-background);
  border: 1px solid var(--lm-color-border);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

div.div-left-right-buttons .nav__link:hover:not(.active),
div.div-left-right-buttons .nav__link:focus:not(.active) {
  background-color: var(--lm-color-link-text);
  color: var(--lm-color-page-background);
  border-color: var(--lm-color-link-text);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Deaktivierte Buttons (z.B. wenn es kein vorheriges Bild gibt) */
div.div-left-right-buttons .nav__link.active {
  background-color: transparent;
  color: var(--lm-color-text-secondary);
  border-color: transparent;
  cursor: default;
  opacity: 0.5;
  box-shadow: none;
}

.post__content p,
.post__content ul,
.post__content ol {
  margin-bottom: clamp(1.4rem, 1vw + 1rem, 2rem);
  font-weight: var(--lm-font-weight-text-primary);
}

.post__content p:last-child,
.post__content ul:last-child,
.post__content ol:last-child {
  margin-bottom: 0;
}

.post__content ul,
.post__content ol {
  padding-left: 3rem;
  margin-right: 0;
  overflow: hidden;
}

@media screen and (max-width: 768px) {

  details ul {
    padding-left: 2.4rem;
  }
}

.post__content li,
details ul li {
  margin-bottom: 1.2rem;
}

/* === Post Images === */
.post__image {
  position: relative;
  margin: clamp(1.2rem, 1vw + 0.8rem, 1.6rem) 0 clamp(1.6rem, 1.5vw + 1rem, 2.4rem);
  display: block;
  width: auto;
  max-width: 100%;
  clear: both;
}

.post__image img,
.post__image video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0.6rem;
}

/* Border Comic-Bilder */
.post__image.image--comic img {
  border: 10px solid #ffffff;
  box-sizing: border-box;
}

img.img-border-05rem-white {
  border: 0.5rem solid #ffffff;
  box-sizing: border-box;
}

/* Ende Border Comic-Bilder */

.post__image.image--layout-float-left {
  float: left;
  margin-right: clamp(1rem, 3vw, 2.4rem);
  margin-left: 0;
  margin-top: 0.6rem;
  margin-bottom: 1.6rem;
  clear: none;
}

.post__image.image--layout-float-right {
  float: right;
  margin-left: clamp(1rem, 3vw, 2.4rem);
  margin-right: 0;
  margin-top: 0.6rem;
  margin-bottom: 1.6rem;
  clear: none;
}

/* Bild im Float rechts IN der Figure */
.post__image.image--layout-float-right img {
  margin-left: auto;
  margin-right: 0;
}

.post__image.image--layout-center {
  max-width: 75%;
  margin-left: auto;
  margin-right: auto;
  float: none;
  clear: both;
}

/* Bild IN der zentrierten Figure zentrieren */
.post__image.image--layout-center img {
  margin-left: auto;
  margin-right: auto;
}

/* Width Utility Klassen (wirken auf Figure - überschreiben width:auto) */
/* Figur auf 50% bzw. 75% setzen */
.post__image.image--width-50 {
  width: 50%;
  max-width: 50%;
}

.post__image.image--width-75 {
  width: 75%;
  max-width: 75%;
}

/* Bild in diesen Figuren immer 100% Breite geben*/
.post__image.image--width-50 img,
.post__image.image--width-75 img {
  display: block;
  width: 100% !important;
  height: auto;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
}

/* Bild OHNE HTML width-Attribut soll die Figure füllen, wenn width-* gesetzt ist */
.post__image.image--width-50 img:not([width]),
.post__image.image--width-75 img:not([width]) {
  width: 100%;
  margin-left: 0;
  /* Keine Zentrierung, wenn es füllt */
  margin-right: 0;
}

/* Responsive Anpassung für Layouts/Widths OHNE layout--keep-on-mobile*/
@media screen and (max-width: 768px) {

  .post__image.image--width-50:not(.layout--keep-on-mobile),
  .post__image.image--width-75:not(.layout--keep-on-mobile) {
    width: 100%;
    max-width: 100%;
    float: none;
    margin-left: 0;
    margin-right: 0;
    clear: both;
  }

  .post__image.image--layout-float-left:not([class*='image--width-']):not(.layout--keep-on-mobile),
  .post__image.image--layout-float-right:not([class*='image--width-']):not(.layout--keep-on-mobile) {
    width: 100%;
    max-width: 100%;
    float: none;
    margin-left: 0;
    margin-right: 0;
    clear: both;
  }
}

/* Expanded State (wird durch JS auf Figure getoggelt) */
.post__image.is-expanded {
  width: 100%;
  max-width: 100%;
  float: none;
  margin-left: 0;
  margin-right: 0;
  clear: both;
}

.post__image.is-expanded img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-left: 0;
  margin-right: 0;
}

/* Single Thumbnail Centered */
.post__thumbnails-single {
  display: flex;
  justify-content: center;
  margin: clamp(2rem, 2vw + 1rem, 3.2rem) 0;
}

.post__thumbnails-single img {
  width: 25%;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* Pagination Centered List */
.post__content .post__pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: clamp(2rem, 2vw + 1rem, 3.2rem) 0;
  padding: 0;
  list-style: none;
}

/* === Grid Wrapper für Bild mit Text links/rechts === */
.grid-wrapper-for-image {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.6rem;
  /* Behält den Standard-Gap für den 3-Spalten-Modus */
  align-items: start;
  margin-bottom: 1rem;
  transition: grid-template-columns 0.4s ease;
}

/* ----- STYLES FÜR DEN GETOGGELTEN ZUSTAND (IMMER GÜLTIG) ----- */
.grid-wrapper-for-image.layout-toggled {
  grid-template-columns: 1fr;
  row-gap: 0;
}

.grid-wrapper-for-image.layout-toggled .post__image {
  margin-block: 0.6rem;
}

/* ----- ENDE STYLES FÜR DEN GETOGGELTEN ZUSTAND ----- */

@media screen and (max-width: 768px) {

  /* 1-Spalten-Layout: NUR automatisch via Klasse (wenn nicht schon getoggelt) */
  .grid-wrapper-for-image.grid-wrapper--one-column-on-mobile:not(.layout-toggled) {
    grid-template-columns: 1fr;
    row-gap: 0.8rem;
  }

  /* Margins oben/unten für automatische mobile Variante reduzieren (wenn nicht schon getoggelt) */
  .grid-wrapper-for-image.grid-wrapper--one-column-on-mobile:not(.layout-toggled) .post__image {
    margin-block: 0.8rem;
  }

  /* Falls Du ein .image--layout-center zentrieren willst (gilt für beide Fälle auf mobil) */
  .grid-wrapper-for-image.grid-wrapper--one-column-on-mobile>.post__image.image--layout-center,
  .grid-wrapper-for-image.layout-toggled>.post__image.image--layout-center {
    margin-inline: auto;
  }
}

/* Image Meta & Caption */
.post__image-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.8rem;
}

.post__image-caption {
  font-size: clamp(1.1rem, 0.7rem + 1vw, 1.5rem);
  line-height: 1.4;
  font-weight: 400;
  margin: 0;
  color: var(--lm-color-text-secondary);
  flex-grow: 1;
  text-align: left;
}

.post__image-meta.meta--centered {
  justify-content: center;
  text-align: center;
}

.post__image-meta.meta--centered .post__image-caption {
  flex-grow: 0;
}

.post__image-caption code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  border: none;
  color: inherit;
}

.post__image-caption a {
  color: var(--lm-color-text-secondary);
  text-decoration: underline;
}

.post__image-caption a:hover,
.post__image-caption a:focus {
  color: var(--lm-color-link-text);
}

.post__image-caption a:focus-visible {
  outline: 1px dotted var(--lm-color-link-text);
  outline-offset: 2px;
  text-decoration: none;
}

/* Button Styling - Grid Layout Toggle (Legacy) */
.grid-layout-toggle {
  appearance: none;
  background: var(--lm-color-nav-background);
  border: 1px solid var(--lm-color-link-text);
  border-radius: 5px;
  padding: 0.1rem 0.4rem 0.2rem 0.4rem;
  margin: 0;
  font: inherit;
  cursor: pointer;
  font-size: 1.8rem;
}

.grid-layout-toggle:hover {
  color: var(--lm-color-nav-background);
  background: var(--lm-color-link-text);
}

.grid-layout-toggle:focus {
  outline: none;
}

/* Modernes Styling für den Zoom-Button */
.zoom-toggle-button {
  appearance: none;
  margin: 0;
  cursor: pointer;
  font-size: 0;
  color: transparent;
  width: clamp(2rem, 1.8rem + 0.5vw, 2.4rem);
  height: clamp(2rem, 1.8rem + 0.5vw, 2.4rem);
  padding: 0;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border: 1px solid var(--lm-color-link-text);
  background: var(--lm-color-nav-background);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* SVG Icon über CSS Maskierung - übernimmt automatisch die CSS Farben! */
.zoom-toggle-button::before {
  content: "";
  display: block;
  width: clamp(1.1rem, 0.9rem + 0.5vw, 1.4rem);
  height: clamp(1.1rem, 0.9rem + 0.5vw, 1.4rem);
  background-color: var(--lm-color-link-text);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cpolyline points='9 21 3 21 3 15'/%3E%3Cline x1='21' y1='3' x2='14' y2='10'/%3E%3Cline x1='3' y1='21' x2='10' y2='14'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cpolyline points='9 21 3 21 3 15'/%3E%3Cline x1='21' y1='3' x2='14' y2='10'/%3E%3Cline x1='3' y1='21' x2='10' y2='14'/%3E%3C/svg%3E");
  -webkit-mask-size: cover;
  mask-size: cover;
  transition: background-color 0.2s ease;
}

.zoom-toggle-button:hover,
.zoom-toggle-button:focus {
  background: var(--lm-color-link-text);
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.zoom-toggle-button:hover::before,
.zoom-toggle-button:focus::before {
  background-color: var(--lm-color-nav-background);
}

/* === Post Footer & Co === */
.post__footer {
  margin-top: clamp(2rem, 2vw + 1rem, 3.2rem);
  padding-top: clamp(1.6rem, 1.5vw + 1rem, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 1.5vw + 1rem, 2.4rem);
  border-top: 1px solid var(--lm-color-border);
}

.post__footer h3 {
  margin: 0 0 1.2rem;
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--lm-color-post-heading);
}

.post__tags {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--lm-color-border);
}

.categories-heading {
  margin-top: clamp(2rem, 1.5vw + 1.6rem, 2.4rem);
  margin-bottom: clamp(1rem, 0.8rem + 1vw, 1.4rem);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem);
  font-weight: 500;
  line-height: 1.4;
}

.post__tags-list,
.post__share-list,
.footer__nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post__tags-list,
.post__share-list {
  line-height: clamp(2.4rem, 1.6rem + 2.5vw, 3.6rem);
}

.post__tags-list li a,
.post__share-list li a {
  text-decoration: none;
}

.post__tag {
  display: inline-block;
  padding: 0 clamp(0.8rem, 0.4rem + 1.25vw, 1.4rem);
  margin: 0.3rem 0.1rem;
  font-size: clamp(1rem, 0.7rem + 1vw, 1.5rem);
  font-weight: 600;
  border-radius: 1.2rem;
  transition: background-color .2s, color .2s, border-color .2s;
  color: var(--lm-color-link-text);
  background: var(--lm-color-tag-background);
  border: 1px solid var(--lm-color-btt-background);
}

.post__tag:hover,
.post__tag:focus {
  background: var(--lm-color-btt-background);
  color: var(--const-color-white);
  border-color: var(--lm-color-btt-background);
  text-decoration: none;
}

.post__tag:focus-visible {
  outline: 2px solid var(--lm-color-link-text);
  outline-offset: 1px;
}

.post__share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  transition: transform .2s, opacity .2s;
  color: var(--lm-color-link-text);
  background: transparent;
  border: none;
}

.post__share-link img {
  width: 2.4rem;
  height: 2.4rem;
  display: block;
}

.post__share-link:hover,
.post__share-link:focus {
  text-decoration: none;
  background: transparent;
  transform: scale(1.1);
  opacity: 0.8;
}

.post__share-link:focus-visible {
  outline: 2px solid var(--lm-color-link-text);
  outline-offset: 1px;
  transform: scale(1.1);
  opacity: 1;
}

/* Cards */
.cat-articles,
.tag-articles {
  width: 100%;
  margin-block-end: 2rem;
}

.cat-articles-list,
.tag-articles-list {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3rem;
}

ul.cat-articles-list,
ul.tag-articles-list {
  padding-left: 0;
  margin-left: 0;
}

.cat-articles-list>.list-entry,
.tag-articles-list>.list-entry {
  position: relative;
  width: calc(25% - 6px);
  max-width: 380px;
  padding: 0;
  background-color: var(--lm-color-nav-background);
  border-radius: 7px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  align-content: flex-start;
}

.list-entry .thumb {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 16 / 9;
  border-radius: 7px 7px 0 0;
  overflow: hidden;
  background: var(--lm-color-nav-background);
}

.list-entry .thumb>img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* SVGs: einpassen statt beschneiden (bleiben z.B. quadratisch) */
.list-entry .thumb>img[src$=".svg"] {
  object-fit: contain;
}

.cat-articles-list>.list-entry a,
.tag-articles-list>.list-entry a {
  display: inline-block;
  text-decoration: none;
  padding: 1rem 0.6rem;
  color: var(--lm-color-link-text);
  font-size: clamp(1.3rem, 1rem + 0.9vw, 1.6rem);
  line-height: clamp(2rem, 1.5rem + 1vw, 2.6rem);
}

/* Gesamte Karte klickbar machen */
.cat-articles-list>.list-entry a::after,
.tag-articles-list>.list-entry a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cat-articles-list>.list-entry a:hover,
.tag-articles-list>.list-entry a:hover {
  color: var(--lm-color-link-text);
  text-decoration: underline;
}

.cat__description,
.tag__description {
  padding-bottom: 2rem;
}

/* Tablet: 3 Karten */
@media screen and (max-width: 900px) {

  .cat-articles-list>.list-entry,
  .tag-articles-list>.list-entry {
    width: calc(33.333% - 5.33px);
  }
}

/* Smartphone: 2 Karten */
@media screen and (max-width: 600px) {

  .cat-articles-list>.list-entry,
  .tag-articles-list>.list-entry {
    width: calc(50% - 4px);
  }
}

/* Kleine Displays: 1 Karte */
@media screen and (max-width: 380px) {

  .cat-articles-list>.list-entry,
  .tag-articles-list>.list-entry {
    width: 100%;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: clamp(1.2rem, 0.5rem + 2vw, 3.2rem) 0;
  margin-top: auto;
  background: var(--const-color-header-footer-bg);
  color: var(--const-color-text-on-footer);
  border-top: 1px solid var(--lm-color-border);
}

.footer__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.8rem, 0.4rem + 1vw, 1.6rem);
}

.footer p {
  margin: 0;
  font-size: clamp(1.1rem, 0.7rem + 1vw, 1.5rem);
  color: var(--const-color-text-on-footer);
}

.footer__nav-link {
  font-size: clamp(1.1rem, 0.7rem + 1vw, 1.5rem);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  color: var(--const-color-text-on-footer);
  text-decoration: none;
}

.footer__nav-link:hover {
  color: var(--const-color-white);
  text-decoration: underline;
}

.footer__nav-link:focus {
  color: var(--const-color-white);
  text-decoration: none;
}

.footer__nav-link:focus-visible {
  outline: 2px solid var(--const-color-white);
  outline-offset: 1px;
}

/* Hide verification-only links (e.g., Mastodon rel=me) */
.verification-only {
  display: none;
}

/* Back-to-Top */
.back-to-top {
  position: fixed;
  bottom: 3rem;
  right: 3rem;
  z-index: 999;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--const-color-text-on-footer);
  background-color: var(--lm-color-btt-background);
  color: var(--const-color-white);
  font-size: 2rem;
  /* wirkt nur auf Fallback-Text, nicht auf SVG */
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease,
    background-color 0.2s,
    border-color 0.2s;
}

.back-to-top.is-visible {
  opacity: 0.8;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
  opacity: 1;
  outline: none;
  background-color: var(--lm-color-btt-background);
  border: 2px solid var(--const-color-white);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--lm-color-link-text);
  outline-offset: 2px;
  border: 2px solid var(--const-color-white);
}

@media screen and (max-width: 768px) and (min-height: 600px) {
  .back-to-top {
    bottom: 10rem;
  }
}

/* SVG soll sich automatisch einfärben */
.back-to-top svg {
  display: block;
  fill: currentColor;
  width: 2.8rem;
  height: 2.8rem;
}

/* === Filmstrip Layout === */
.post__thumbnails-filmstrip {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 1vw + 0.5rem, 1.6rem);
  margin: clamp(2rem, 2vw + 1rem, 3.2rem) 0;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  /* Nutzt die gesamte Breite des Containers */
}

.post__thumbnails-filmstrip a {
  flex: 0 1 25%;
  /* Exakt 25% Breite für 1 bis 4 Bilder */
  min-width: 0;
  /* Verhindert, dass der Inhalt (Text/Bild) das Schrumpfen auf mobilen Geräten blockiert */
  max-width: none;
  /* Keine fixe Grenze mehr, da 25% auf jedem Viewport korrekt skalieren */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none !important;
  color: var(--lm-color-link-text);
  text-align: center;
}

.post__thumbnails-filmstrip img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 1.2rem;
}

.post__thumbnails-label {
  font-size: clamp(1.2rem, 1vw + 0.8rem, 1.4rem);
  line-height: 1.3;
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.4rem 1.2rem;
  border-radius: 2rem;
  color: var(--lm-color-link-text);
  background-color: var(--lm-color-nav-background);
  border: 1px solid var(--lm-color-border);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
  text-decoration: none;
}

.post__thumbnails-filmstrip a:hover {
  text-decoration: none !important;
  /* Unterstreichung komplett entfernen */
}

.post__thumbnails-filmstrip a:hover .post__thumbnails-label {
  background-color: var(--lm-color-link-text);
  color: var(--lm-color-page-background);
  border-color: var(--lm-color-link-text);
  text-decoration: none;
}

.post__thumbnails-filmstrip--wide a {
  flex: 0 1 32%;
  /* Exakt ~1/3 Breite. Dadurch skaliert auch ein einzelnes Bild exakt synchron mit Dreier-Reihen herunter! */
  min-width: 0;
  /* Wichtig für dynamisches Schrumpfen */
  max-width: none;
  /* Keine fixe Grenze nötig, da es prozentual skaliert */
}

/* === Z-Layer Utilities (Bookshop) === */
.div-pos-rel-z0 {
  display: flow-root;
  position: relative;
  z-index: 0;
  max-width: 1280px;
  margin: 0 auto;
}

.div-pos-rel-z0 img.img-zindex-1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 1;
}

.div-pos-rel-z0 p.cent {
  position: relative;
  z-index: 2;
  margin: 0;
}

.div-pos-rel-z0.is-expanded {
  max-width: 100%;
}

/* === Hamburger Menü & Mobile Navigation === */

/* Standard: Hamburger Button verstecken (Desktop) */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--const-color-white);
  /* Immer weiß wegen violettem Hintergrund */
  font-size: 2.4rem;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

/* Mobile Ansicht (< 768px) */
@media (max-width: 768px) {

  /* Desktop Navigation & Theme-Toggle im Header verstecken */
  .meta-nav-container,
  .nav,
  .header__container>.theme-toggle {
    display: none;
  }

  /* Hamburger Button im Header für den normalen Browser-Modus anzeigen */
  .menu-toggle {
    display: block;
  }

  /* Für Barrierefreiheit: Button für Tastaturnavigation verstecken,
     sobald das Menü ihn verdeckt hat (nach 0.3s Slide-Dauer). */
  .menu-toggle[aria-expanded="true"] {
    visibility: hidden;
    transition: visibility 0s 0.3s;
  }

  .menu-toggle[aria-expanded="false"] {
    visibility: visible;
    transition: visibility 0s 0s;
  }
} /* ENDE DER MOBILE-ANSICHT (< 768px) */

  /* Close-Button im Slide-in Menü */
  .menu-close {
    background: transparent;
    border: none;
    color: var(--lm-color-text-primary);
    cursor: pointer;
    padding: 0.5rem;
    align-self: flex-start;
    margin-top: -3rem;
    /* Schiebt das X etwas höher in das Padding des Menüs */
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-close:hover {
    color: var(--lm-color-link-hover);
  }

  /* Das mobile Menü */
  .main-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 100vw;
    /* WICHTIG: Verhindert, dass das Menü bei Zoom breiter als der Bildschirm wird */
    height: calc(100vh - 80px);
    background-color: var(--lm-color-nav-background);
    border-left: 1px solid var(--lm-color-border);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 5rem 2rem 2rem 2rem;
    transform: translateX(100%);
    /* Start: Ausgeblendet */
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: auto;
    /* Erlaubt vertikales UND horizontales Scrollen */
  }

  .main-menu.is-open {
    transform: translateX(0);
    /* Einblenden */
  }

  /* Damit horizontales Scrollen im Flex-Container bei extremem Zoom klappt */
  .main-menu > * {
    min-width: max-content;
  }

  /* Impressum & Datenschutz als flache Links */
  .main-menu .meta-nav-link {
    display: block;
    font-size: 1.4rem;
    padding: 0.8rem 1rem;
    color: var(--lm-color-link-text);
    text-decoration: none;
    border-bottom: 1px solid var(--lm-color-border);
  }

  .main-menu .meta-nav-link:hover {
    color: var(--lm-color-link-hover);
  }

  /* Haupt-Buttons behalten ihre Originalfarben (inkl. Hover), werden aber mobil zentriert */
  .main-menu .nav__link {
    display: block;
    text-align: center;
    font-size: 1.5rem;
  }

  /* Theme Toggle im mobilen Menü anpassen */
  .main-menu .theme-toggle {
    margin-top: 2rem;
    align-self: flex-start;
    margin-left: 1rem;
    /* Bündig mit dem 1rem Padding der Links darüber */
    min-height: 3.6rem;
    padding: 0 1.5rem 0 1.2rem;
  }

  .main-menu .theme-text {
    font-size: 1.4rem;
  }

  .main-menu .theme-icon {
    width: 1.8rem;
    height: 1.8rem;
  }

/* Das main-menu wird standardmäßig per transform aus dem Bildschirm geschoben.
   Es wird durch die Klasse .is-open eingeblendet.
   Früher war hier eine Desktop-Weiche (display: none), die entfernt wurde, 
   damit der Desktop "Mehr"-Button das Menü ebenfalls nutzen kann. */

/* Touch/Click Feedback für Hamburger & Close-Button */
.menu-toggle,
.menu-close {
  transition: transform 0.1s ease;
}

.menu-toggle:active,
.menu-close:active {
  transform: scale(0.9);
}

/* Fokus-Rahmen für Barrierefreiheit (nur sichtbar bei Tastaturnavigation) */
.menu-toggle:focus-visible,
.menu-close:focus-visible {
  outline: 2px dashed var(--const-color-white);
  outline-offset: 4px;
  border-radius: 4px;
}

/* === Fallback für deaktiviertes JavaScript (Modernes CSS) === */
.noscript-warning {
  background-color: var(--lm-color-nav-background);
  color: var(--lm-color-text-primary);
  border: 1px solid var(--lm-color-border);
  padding: 1rem;
  text-align: center;
  margin: 1rem;
  border-radius: 4px;
  font-size: 1.4rem;
  line-height: 1.4;
}

/* === App Bottom Navigation === */
.bottom-nav {
  display: none;
}

/* App-Modus (Standalone PWA) auf mobilen Geräten */
@media (display-mode: standalone) and (max-width: 768px) {
  /* Im App-Modus wird das Hamburger-Menü oben versteckt */
  .menu-toggle {
    display: none !important;
  }

  /* ... und dafür die Bottom-Nav eingeblendet */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--lm-color-nav-background);
    border-top: 1px solid var(--lm-color-border);
    justify-content: space-around;
    padding: 0.8rem 0;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(36, 40, 59, 0.95);
  }

  html[data-theme="light"] .bottom-nav {
    background-color: rgba(255, 255, 255, 0.95);
  }

  .bottom-nav__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--lm-color-text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    -webkit-user-select: none;
    user-select: none;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.4rem;
  }

  .bottom-nav__link:hover,
  .bottom-nav__link.active {
    color: var(--lm-color-link);
  }

  .bottom-nav__link svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Footer Padding nur im App-Modus erhöhen, damit er nicht verdeckt wird */
  .footer {
    padding-bottom: 80px; 
  }
}
.header__logo-link {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 1vw + 0.5rem, 1.6rem);
  text-decoration: none;
  color: inherit;
}
