:root {
  --page-bg: #daf5f5;
  --panel-bg: #ffffff;
  --text: #1F2527;
  --muted: #434B4D;
  --cta: #bc3d27;
  --cta-hover: #bc3d27;
  --teal: #06bebe;
  --alt-bg: #007d7d;
  --divider: #B7C7C8;
  --feature-ring: #1F2527;
  --sidebar-text: #2D2F31;
  --inner-bg: #effcfc;
  --alert-red: #D75B4B;
  --heading-gap-above: 2rem;
  --heading-gap-below: 1rem;
}

body {
  background-color: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  margin: 0;
  padding: 0;
  /* The full-bleed footer band uses width: 100vw, which can overshoot the
     layout viewport by the classic-scrollbar width — clip it instead of
     growing a horizontal scrollbar */
  overflow-x: clip;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar mirrors the article-layout grid (280px sidebar + content, 3rem gap).
   Its width is synchronized to the content panel by menu.js. */
.topbar {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--divider);
  width: var(--topbar-width, auto);
}

.topbar-main {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

/* margin-left keeps the actions right-aligned even when the
   logo is absent (start page) — no placeholder element needed */
.topbar-main .actions {
  margin-left: auto;
  flex-wrap: wrap;
}

.brand-logo {
  display: inline-block;
  line-height: 0;
}

.brand-logo img {
  display: block;
  height: 2.5rem;
  width: auto;
}

/* Home page: logo hidden on wide screens (redundant with the big logo
   heading in the content), visible again in narrow view */
.brand-logo--hidden-wide {
  display: none;
}

.site-title {
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.back-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.cta {
  background-color: var(--cta);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.cta:hover {
  background-color: var(--cta-hover);
}

.lang {
  color: var(--text);
  font-size: 0.9rem;
}

.lang a {
  color: var(--text);
  text-decoration: underline;
}

/* Burger button: only shown in narrow view (see the 900px breakpoint),
   where the sidebar navigation collapses into a dropdown panel it toggles.
   Sized to match the CTA's hit area; the bars morph into an X when open. */
.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--divider);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.menu-toggle:hover .menu-toggle__bar {
  background-color: var(--teal);
}

.menu-toggle__bar {
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background-color: var(--text);
  transition: transform 0.2s, background-color 0.2s;
}

body.menu-open .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.menu-open .menu-toggle__bar:nth-child(2) {
  transform: scaleX(0);
}

body.menu-open .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  padding: 2rem 0;
}

.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 1rem;
}

.sidebar-nav a {
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  display: block;
  padding: 0.5rem 0;
}

.sidebar-nav a:hover {
  color: var(--teal);
}

.sidebar-nav a.active {
  color: var(--teal);
  font-weight: 600;
}

.topic-item {
  margin-bottom: 1.5rem;
}

.topic-title {
  font-weight: 600;
  color: var(--text);
  display: block;
  padding: 0.5rem 0;
  cursor: default;
}

a.topic-title {
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

a.topic-title:hover {
  color: var(--teal);
}

.topic-pages {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 1rem;
}

.topic-pages li {
  margin-bottom: 0.5rem;
}

.topic-pages a {
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 400;
  display: block;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.topic-pages a:hover {
  color: var(--teal);
}

.topic-pages a.active {
  color: var(--teal);
  font-weight: 600;
}

.content {
  background-color: var(--panel-bg);
  padding: 3rem;
  border-radius: 8px;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  /* Let the panel wrap around its widest content instead of filling the
     remaining grid track. Text blocks are capped below to keep the measure
     readable; the panel then adds its padding around that text. */
}

.content a,
.content .page-list a {
  color: var(--alt-bg);
  text-decoration-color: transparent;
  text-underline-offset: 0.15em;
}

/* Flush start: no top gap for the first element in the panel */
.content > :first-child {
  margin-top: 0;
}

/* Prose measure: text-first blocks stop at ~85 characters per line so
   the measure stays readable inside the panel. The ch unit
   follows each element's own font size (lead paragraphs run at 1.1rem,
   text blocks come in size variants). Media and layout blocks — images,
   rows, code, horizontal rules — keep the full panel width (capping
   figures would also override the image block's own partial-width
   max-width). Covers blocks at every nesting level: page blocks (in
   .lead), toggle content, row columns and template-level elements. */
:is(.content, .lead, .toggle__content, .row-block__column) > :is(h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, .text-block, .toggle, .icon-text, .icon-text__text, .topic-pages-list) {
  max-width: 85ch;
}

.content h1 {
  margin: 0 0 var(--heading-gap-below) 0;
  font-size: 2.5rem;
  font-family:merriweather;
  line-height: 1.2;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--cta);
}

/* Logo heading on the start page: replaces the h1 title text.
   Width chosen so the logo's visual height (~6rem) clearly dominates the panel. */
.content .logo-heading {
  margin-bottom: 2rem;
}

.logo-heading img {
  display: block;
  width: 33rem;
  max-width: 100%;
  height: auto;
}

.content h2 {
  margin: var(--heading-gap-above) 0 var(--heading-gap-below) 0;
  font-size: 1.5rem;
  font-family:merriweather;
  color: var(--text);
  font-weight: 400;
  color: var(--cta);
}

.content h3 {
  margin: var(--heading-gap-above) 0 var(--heading-gap-below) 0;
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 600;
}

.lead {
  margin-bottom: 2rem;
}

.lead p {
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.content li > p {
  margin-bottom: 0;
}

.lead img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Text block: symbolic size variants
   (.lead p sets font-size on the paragraphs directly, so the size
   must target the descendants, not only the wrapper) */

.text-block--small,
.text-block--small p {
  font-size: 0.9rem;
}

.text-block--smaller,
.text-block--smaller p {
  font-size: 0.8rem;
}

.text-block--large,
.text-block--large p {
  font-size: 1.25rem;
}

.text-block--larger,
.text-block--larger p {
  font-size: 1.5rem;
}

.text-block--small,
.text-block--small p,
.text-block--smaller,
.text-block--smaller p,
.text-block--large,
.text-block--large p,
.text-block--larger,
.text-block--larger p {
  line-height: 1.5;
}

.text-block--small p,
.text-block--smaller p,
.text-block--large p,
.text-block--larger p {
  margin: 0 0 1rem 0;
}

.topic-pages-list {
  margin-top: 2rem;
}

.page-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-list li {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--inner-bg);
  border-radius: 4px;
  border-left: 3px solid var(--teal);
}

.page-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.page-list .subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
}

/* Footer band: full-bleed white strip closing the page. The negative
   margins + 100vw width break the band out of the .page-shell padding so it
   spans the whole viewport while staying a flex child of the shell (margin-
   top: auto keeps it flush to the bottom on short pages; the gap to the
   content panel comes from .article-layout's bottom padding). The 100vw/
   scrollbar mismatch is absorbed by overflow-x: clip on the body. */
.footer-band {
  margin-top: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  box-sizing: border-box;
  background-color: var(--panel-bg);
  border-top: 1px solid var(--divider);
  padding: 1.5rem 0 0 0;
}

/* Inner container mirrors .page-shell (1400px + 2rem padding) so the footer
   content aligns with the topbar and article grid. The 1fr/auto/1fr grid
   keeps the notice column in the true centre of the band while the cables
   occupy the right track; the empty left track balances the centre. */
.footer-band__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  column-gap: 2rem;
  box-sizing: border-box;
}

.footer-band__notice {
  grid-column: 2;
  text-align: center;
  /* Keeps the notice clear of the band's bottom edge while the cable
     illustration next to it sits flush */
  padding-bottom: 1.5rem;
}

.footer-band__notice > :last-child {
  margin-bottom: 0;
}

/* Footer link mirrors the linked topic style from the sidebar navigation */
.footer-band__link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.footer-band__link:hover {
  color: var(--teal);
}

/* Funding notice (wide variant, 1561x245): 700px wide → ~110px tall.
   The PNG has an opaque white background and merges seamlessly with the
   white band; aspect ratio preserved via the width/height attributes. */
.footer-band__funding {
  display: block;
  width: 700px;
  max-width: 100%;
  height: auto;
  margin: 1rem auto 0;
}

/* Cable illustration: mirrored, flush with the band's bottom-right edge */
.footer-band__cables {
  grid-column: 3;
  justify-self: end;
  display: block;
  height: 150px;
  width: auto;
  transform: scaleX(-1);
}

/* Narrow footer: the 700px notice and the cables (192px + gaps) no longer
   fit side by side below ~1020px viewport — stack instead, with the
   notice centred full-width on top and the cables below at the bottom-right */
@media (max-width: 1020px) {
  .footer-band__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .footer-band__notice {
    padding-bottom: 0;
  }

  .footer-band__cables {
    height: 90px;
    align-self: flex-end;
  }
}

/* Narrow view: the sidebar navigation collapses into a dropdown panel below
   the topbar, toggled by the burger button next to the CTA (opens pushing
   the content down, like the former stacked menu). Without JavaScript the
   panel stays closed — all navigation remains reachable via in-page links.
   The content panel goes edge-to-edge: no spacing at all outside it (shell
   padding, article frame and dropdown gap all drop to zero), 1rem padding
   inside. */
@media (max-width: 900px) {
  .page-shell {
    padding: 0.5rem 0.2rem;
  }

  .article-layout {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }

  .content {
    padding: 1rem;
  }

  .sidebar {
    display: none;
    position: static;
    margin-bottom: 0;
  }

  body.menu-open .sidebar {
    display: block;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-left: 0.2rem;
  }

  .topbar-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .topbar-main .actions {
    margin-left: 0;
    /* The long German CTA plus burger and lang switch may not fit one
       row on narrow phones — wrap instead of overflowing */
    flex-wrap: wrap;
    gap: 1rem;
  }

  .site-title {
    font-size: 1.1rem;
  }

  /* Show the brand logo in the topbar even on the home page */
  .brand-logo--hidden-wide {
    display: inline-block;
  }
}

/* Toggle block */

.toggle {
  margin: 1.5rem 0;
}

.toggle__summary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
}

.toggle__summary::-webkit-details-marker {
  display: none;
}

.toggle__triangle {
  flex: none;
  width: 0;
  height: 0;
  border-left: 0.45rem solid var(--teal);
  border-top: 0.3rem solid transparent;
  border-bottom: 0.3rem solid transparent;
  transform: translateY(-0.15rem);
  transition: transform 0.15s ease-in-out;
}

.toggle[open] > .toggle__summary > .toggle__triangle {
  transform: translateY(-0.15rem) rotate(90deg);
}

.toggle--empty > .toggle__summary {
  cursor: default;
}

.toggle .toggle__headline {
  margin: 0;
}

.toggle__content {
  margin-top: 0.75rem;
  padding-left: 0.95rem; /* triangle width (0.45rem) + summary gap (0.5rem) */
}

.toggle__content > :first-child {
  margin-top: 0;
}

/* Image block */

.image-block {
  width: min(var(--image-block-width, 85ch), 100%);
  margin: 1.5rem auto;
}

.image-block img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.image-block figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
}

/* Click-to-zoom trigger (see assets/lightbox.js) */

.image-block img[data-zoom] {
  cursor: zoom-in;
}

/* Icon-text block: fixed-size icon left, paragraphs right; stacks
   vertically in narrow content panels. */

.icon-text {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 1.5rem 0;
}

.icon-text__icon {
  flex: none;
  width: 48px; /* ~2 lines of text (2 × 1.6 line-height × 1rem) */
  height: 48px;
  object-fit: contain;
}

.icon-text__text {
  flex: 1;
  min-width: 0;
}

.icon-text__text > :last-child {
  margin-bottom: 0;
}

.content--narrow .icon-text {
  flex-direction: column;
  gap: 0.75rem;
}

/* Row block: columns of nested blocks side by side. Columns share
   the row equally (200px basis + grow) and wrap onto further rows
   when the panel gets too narrow — the min-width floor is what
   triggers the wrap, and min(…, 100%) keeps very narrow panels
   from overflowing. A wrapping column always takes its nested
   blocks (e.g. image + text) along. */

.row-block {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.row-block__column {
  flex: 1 1 200px;
  min-width: min(200px, 100%);
}

.row-block__column > :first-child {
  margin-top: 0;
}

.row-block__column > :last-child {
  margin-bottom: 0;
}

/* Content alignment inside the cards (row block's align field).
   The class is always emitted; text-align inherits into the columns,
   partial-width images override their default auto margins. */

.row-block--center {
  text-align: center;
}

.row-block--right {
  text-align: right;
}

.row-block--left .row-block__column .image-block {
  margin-left: 0;
  margin-right: auto;
}

.row-block--right .row-block__column .image-block {
  margin-left: auto;
  margin-right: 0;
}

/* Vertical alignment of the columns against each other (row block's
   valign field; the class is always emitted). top replaces the flex
   default stretch and looks the same (columns have no background);
   middle/bottom move shorter columns within the row. */

.row-block--top {
  align-items: flex-start;
}

.row-block--middle {
  align-items: center;
}

.row-block--bottom {
  align-items: flex-end;
}

/* Lightbox: full-size image view in a native <dialog>, opened by
   assets/lightbox.js. The dialog element provides centering,
   Esc-to-close and the inert ::backdrop natively. The +/−/× toolbar
   scales the image in steps; the viewport scrolls the oversized
   image natively (pan without drag code). */

.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--page-bg);
  /* The UA stylesheet makes modal dialogs scroll containers
     (dialog:modal { overflow: auto }), which clips the toolbar that
     floats above the dialog box. Scrolling happens in
     .lightbox__viewport instead. */
  overflow: visible;
}

.lightbox::backdrop {
  background-color: rgb(0 0 0 / 0.85);
}

.lightbox__viewport {
  overflow: auto;
  max-width: min(1200px, calc(100vw - 4rem));
  max-height: calc(100vh - 10rem);
}

.lightbox img {
  display: block;
  max-width: min(1200px, calc(100vw - 4rem));
  max-height: calc(100vh - 10rem);
  border-radius: 8px;
  /* White backing for transparent images on the dark backdrop; opaque
     images cover it entirely, so only transparent ones show it */
  background-color: var(--panel-bg);
}

/* Leave room for the caption below the image (margin + ~2 lines) */

.lightbox--caption img {
  max-height: calc(100vh - 13.5rem);
}

/* Zoomed: drop the fit caps, let the viewport scroll */

.lightbox--zoomed img {
  max-width: none;
  max-height: none;
}

/* Toolbar is pinned to the screen (fixed descendants of a plain modal
   dialog position against the viewport, while rendering in the
   dialog's top layer above the backdrop). Anchoring it to the
   dialog box instead would move the buttons whenever zooming resizes
   the box. */

.lightbox__toolbar {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  gap: 0.5rem;
}

.lightbox__btn {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 2rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.lightbox__btn:hover:not(:disabled) {
  color: var(--teal);
}

.lightbox__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.lightbox__caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.lightbox__caption a {
  color: inherit;
}

.lightbox__caption:empty {
  display: none;
}
