/* ------------------------------------------------------------------
   Optimierte CSS (Nesting-Version)
   - natives CSS-Nesting genutzt (kein SCSS)
   - & verwendet, wenn nötig (Pseudo-Klassen / compound)
   ------------------------------------------------------------------ */

:root{
  --brand: #0b4a6f;
  --nav-bg: #112;
  --panel-bg: #fff;
  --text: #0b2130;
  --text-bright: #fff;
  --content-max: 1200px;
  --gap: 2em;

  --line-height: 1.6rem;

  /* angepasste, kontraststarke Farben */
  --w-color: #0074cc;       /* blau (ersetzt rgb(0,120,212)) */
  --w-color-strong: #005ea6;/* dunklere Hover/Focus-Variante */

  --l-color: #ad5f00;       /* orange (ersetzt rgb(255,140,0)) */
  --l-color-strong: #8f4a00;/* dunklere Hover/Focus-Variante */
  --l-color-light: rgba(255, 140, 0, .1875);

  /* Read more */
  --btn-bg: #0b57d0;
  --btn-bg-hover: #094ab2;
  --btn-bg: var(--w-color-strong);
  --btn-bg-hover: var(--w-color);
  --btn-fg: #fff;
  --btn-focus: #ffbf47; /* gut sichtbarer Fokusrahmen */
  --btn-radius: .66rem;
}

/* Reset & Grund */
* { box-sizing: border-box; }
html {
  font-size: clamp(16px, 16px + .125vw, 1.5rem);
  line-height: var(--line-height);
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: #f6f7f8;
  line-height: var(--line-height);
}

/* Brand / Thumbnails */
.brand, .brand a { color: #fff; font-weight: 700; text-decoration: none; }

/* Thumbnails — klare Trennung: Separator auf dem umhüllenden <span>, nicht auf jedem Link */
.thumbnails {
  font-size: .9em;
  line-height: 1.4rem;
  display: inline-flex;
  flex-wrap: wrap;         /* falls mehrere Zeilen möglich sind */
  gap: 0;                  /* Spacing wird über ::after gesteuert */
  align-items: center;
}

/* Link-Styling (innerhalb des span) */
.thumbnails a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.thumbnails a:hover,
.thumbnails a:focus {
  /*color: var(--w-color-strong);*/
  text-decoration: underline; /* verbessert Erkennbarkeit */
  outline: none;
}

/* Primary: Separator auf den umhüllenden <span>, nicht auf jedem <a> */
.thumbnails span {
  display: inline-flex;
  align-items: center;
}

/* show middot for every span except the last one */
.thumbnails span:not(:last-child)::after {
  content: "\00B7";        /* middot = · */
  margin: 0 .65ch;         /* horizontaler Abstand (ch skaliert zu Textbreite) */
  font-weight: 400;
  color: var(--text);
  opacity: .75;            /* etwas dezent */
  pointer-events: none;    /* Separator ist dekorativ */
  vertical-align: middle;
}

/* Fallback: wenn Links direkt Kinder von .thumbnails sind (keine span wrapper) */
.thumbnails > a:not(:last-child)::after {
  content: "\00B7";
  margin: 0 .65ch;
  font-weight: 400;
  color: var(--text);
  opacity: .75;
  pointer-events: none;
  vertical-align: middle;
}

/* Textblock / Info */
.title-block {
  border-radius: .25rem .25rem 0 0;
  background-color: var(--w-color-strong);
}
.text-block {
  margin-bottom: var(--gap);
  padding: calc(var(--line-height) * .5) 1rem;
  border: 1px solid #ddd;
  
  background: #f9f9f9;
}

.text-block:has(.single-text) {border-top: 0; border-radius: 0 0 .25rem .25rem; }
.multi-text .text-block { margin-bottom: 0; border-radius: .25rem; }

.newslist {
  li a { font-weight: bold; } /* -> .newslist li a { ... } */
}

.info-box {
  padding: calc(var(--line-height) * .5) 1em;
  border-radius: 8px;
  background-color: #f0f0f0;
}

.info-box a {
  color: var(--w-color-strong) !important;
}

.text-footer {
  font-size: .9em;
  text-align: right;
}

.code-inline {
  display: inline-block;
  margin: 0;
  padding: 0 .25em;
  font-size: .9em;
  background-color: #f0f0f0;
  border-radius: 8px;
}

.filter-ui { display: grid; gap: .35rem; margin-bottom: var(--gap); }
.filter-ui label { font-weight: 600; }
.filter-ui input[type="search"] { padding: .5rem .65rem; font-size: 1rem; max-width: 480px; width: 100%; }
.meta { font-size: .9rem; color: #555; }
.no-results { font-style: italic; color: #777; margin-top: .25rem; }

li .list-columns-2 {
    display: flex;
    justify-content: space-between;
}

.list-kategorie {
  margin: auto 0;
  padding: 0 .25em;
  line-height: 1.2em;
  font-size: .9em;
  background-color: #f0f0f0;
  border-radius: 8px;
}

/* Navigation */
nav.site-nav {
  background: var(--nav-bg);
  color: #fff;
  position: relative;
  z-index: 40;
}
.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  flex-wrap: wrap;
}

/* Top-Level Menu */
ul.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  align-items: center;
}
.menu-item { position: static; }
/*
.menu-link {
  display: block;
  padding: 10px 14px;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  &:focus-visible { outline: 3px solid rgba(255,255,255,0.14); outline-offset:2px; }
  &:hover { background: rgba(255,255,255,0.04); }
}
*/
/* .menu-link soll sowohl <a> als auch <button> stylen */
.menu-link {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.menu-link:hover { background: rgba(255,255,255,0.04); }
.menu-link:focus-visible { outline: 3px solid rgba(255,255,255,0.14); outline-offset: 2px; }

/* Mega-Panel */
.mega-panel {
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  display: none;
  background: transparent;
  padding: 12px 0;
  &.open { display: block; }
}

/* Panel sichtbar machen, wenn .open gesetzt */
.mega-panel { display: none; }
.mega-panel.open { display: block; }

/* Panel-Inner */
.panel-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--panel-bg);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(2,8,23,0.16);
  padding: 20px;
  /*border-top: 4px solid var(--brand);*/
  border-top: 4px solid var(--w-color);
  border-radius: 0 0 8px 8px;
}

/* Grid */
.panel-grid {
  display: grid;
  grid-template-columns: 300px repeat(2, 1fr);
  grid-auto-rows: auto;
  gap: var(--gap);
  align-items: start;
}
.panel-thema { grid-column: 1; align-self: start; }

.panel-parent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  width: 100%;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: 2px;
  padding: .4em .6em;
  border-radius: 8px;
  background: rgba(0,120,212,.08);
  border: 1px solid rgba(0,120,212,.28);
  font-weight: 700;
  line-height: 1.2;
  transition: background .2s ease, border-color .2s ease, transform .12s ease;
  &:hover { background: rgba(0,120,212,.12); border-color: rgba(0,120,212,.45); transform: translateY(-1px); }
  &:focus-visible { outline: 3px solid rgba(0,120,212,.35); outline-offset:2px; }
}

.panel-grid :is(h3, .pseudo-h3) {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--w-color-strong);
  letter-spacing: .01em;
  line-height: var(--line-height);
}
.panel-grid :is(h4, .pseudo-h4) {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2b2f3a;
  border-bottom: 2px solid var(--w-color);
  line-height: var(--line-height);
}
.panel-grid ul { list-style: none; margin: 0; padding: 0; }
.panel-grid li { margin: 7px 0; }
.panel-grid a { color: var(--text); text-decoration: none; }
.panel-grid a:hover { text-decoration: underline; }

.w2l-win { color: var(--w-color); }
.w2l-lin { color: var(--l-color); }

/* sr-only */
.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;
}

/* Mehr lesen => Startseite */
  .read-more{
    display:inline-flex;
    align-items:center;
    gap:.5rem;
    padding:.6rem .9rem;
    border-radius:var(--btn-radius);
    background:var(--btn-bg);
    color:var(--btn-fg);
    text-decoration:none;
    font:600 0.95rem/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  }
  .read-more:hover{ background:var(--btn-bg-hover); }
  .read-more:focus-visible{
    outline:3px solid var(--btn-focus);
    outline-offset:2px;
  }
  .read-more .icon{
    width:1em; height:1em; /* skaliert mit Textgröße */
    flex:0 0 auto;
    stroke:currentColor; fill:none; stroke-width:2;
  }

  /* Utility: für zusätzlichen, nur visuell versteckten Text */
  .visually-hidden{
    position:absolute !important;
    width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
    clip:rect(0 0 0 0);white-space:nowrap;border:0;
  }

/* External links (Unicode fallback + mask) */
a.external,
a[target="_blank"] {
  text-decoration-skip-ink: auto;
  &::after {
    content: "↗";
    margin-left: .28em;
    font-size: .85em;
    vertical-align: text-bottom;
    opacity: .85;
    transition: transform .12s ease;
  }
  &:hover::after { transform: translateY(-1px); }
}

/* @supports für mask (optional: mask-Version statt Unicode) */
@supports (-webkit-mask: url("")) or (mask: url("")) {
  a.external,
  a[target="_blank"] {
    &::after {
      content: "";
      display: inline-block;
      width: .9em;
      height: .9em;
      margin-left: .28em;
      vertical-align: text-bottom;
      background-color: currentColor;
      -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='3' y='8' width='12' height='12' fill='white'/><path d='M14 3h7v7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/><path d='M10 14L21 3' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>") no-repeat center / contain;
      mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='3' y='8' width='12' height='12' fill='white'/><path d='M14 3h7v7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/><path d='M10 14L21 3' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>") no-repeat center / contain;
    }
  }
}


/* Responsive Desktop / Mobile (wie vorher) */
@media (min-width: 881px) {
  .panel-thema { height: 100%; padding-right: 2em; border-right: 1px solid #444; }

  .panel-grid:has(div:not(.panel-thema):is(:nth-child(1), :nth-child(2), :nth-child(3))) .panel-thema {grid-row: 1 / 2;}
  .panel-grid:has(div:not(.panel-thema):is(:nth-child(4), :nth-child(5), :nth-child(6))) .panel-thema {grid-row: 1 / 3;}
  .panel-grid:has(div:not(.panel-thema):is(:nth-child(7), :nth-child(8), :nth-child(9))) .panel-thema {grid-row: 1 / 4;}

  .single-text { margin: 0 auto; max-width: 45em; }
  .multi-text { display: grid; margin-bottom: var(--gap); grid-template-columns: 1fr 1fr; gap: var(--gap) 2rem; }
  ul.multi-text { padding-left: 0; list-style: none; }
}

.menu-toggle { display: none; background: transparent; border: 0; color: #fff; padding: 10px 12px; font-size: 1rem; }
@media (max-width: 880px) {
  .footer-inner, .nav-inner { padding: 8px 12px; }
  .menu-toggle { display: inline-block; }
  ul.menu {
    flex-direction: column;
    gap: 0;
    display: none;
    width: 100%;
    background: var(--nav-bg);
    margin-top: 8px;
    border-radius: 6px;
    &.open { display: flex; }
  }
  /* Mobile-Menü öffnen/schließen */
  ul.menu { display: none; }
  ul.menu.open { display: flex; }
  .menu-link { padding: 12px 16px; }
  .mega-panel { position: static; padding: 0; }
  .panel-inner { max-width: 100%; margin: 0; padding: 12px; border-radius: 6px; box-shadow: none; }
  .panel-grid { grid-template-columns: 1fr; gap: 12px; }
  .panel-parent { margin-bottom: 6px; }
  .panel-thema { grid-column: auto; grid-row: auto; align-self: auto; }
}

/* Header / Main / Footer */
.site-header-main h1, .site-header-main h2, .site-header h1 {
  font-size: 2rem; line-height: 2rem; margin: 1.6rem 0; font-weight: 700; display:inline-block; hyphens:auto; color: var(--text-bright);
}
/*.site-header:has(h1), .site-header-main:has(h1) {border-radius: .25rem .25rem 0 0; background-color: var(--w-color-strong);}*/
.site-header-main h2, .site-header h2 { font-size: 1.6rem; }
.site-header:has(h2) { margin-bottom: 0; }

/* Sonderfall! Bei .site-header h1 wird Paltz für einen Text VOR dem H1 helassen. Bei .site-header-main h1 nicht! */
.site-header h1::before { content: attr(data-prefix) "\00A0"; display:inline; font:inherit; line-height:inherit; white-space:pre; user-select:text; }
h1[data-prefix]::before { content: attr(data-prefix) "\00A0"; display:inline; font:inherit; line-height:inherit; white-space:pre; user-select:text; }

.w2l-umbruch { display: block; }

main {
  max-width: var(--content-max);
  margin: var(--gap) auto;
  padding: 0 16px;
  a { color: var(--w-color); } /* -> main a { ... } */
  a:not(.external, a[target="_blank"]) {
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }

  .line {
    display: flex;
    align-items: baseline;      /* Text-Baseline ausrichten */
    gap: .5ch;                  /* Luft links/rechts vom Füller */
  }

  .line .left,
  .line .right { white-space: nowrap; }

  .line .leader {
    flex: 1 1 auto;             /* nimmt den ganzen Restplatz */
    border-bottom: 1px dotted currentColor;  /* “Füllzeichen” */
    /*transform: translateY(-.15em);*/           /* optisch auf Baseline ziehen */
  }

  .leitarticle .line {font-weight: bold; margin-bottom: var(--line-height);}
}

.site-footer {
  background: var(--nav-bg);
  color: #fff;
  margin-top: 20px;
  a { color: #fff; } /* -> .site-footer a { ... } */
}
.footer-inner { max-width: var(--content-max); margin: 0 auto; padding: 14px 16px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0 !important; animation-iteration-count: 1 !important; }
}
