:root {
  --bg: #f7f7f7;
  --ink: #111;
  --line: #111;
  --panel: #fff;
  --muted: #444;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0 1.4rem;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      #ededed 39px,
      #ededed 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      #ededed 39px,
      #ededed 40px
    ),
    var(--bg);
  background-size:
    40px 40px,
    40px 40px,
    auto;
  color: var(--ink);
  font-family:
    "IBM Plex Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  line-height: 1.55;
}

/* ── Outer centering wrapper ── */

body > .page-shell {
  max-width: 1100px;
  margin: 1.4rem auto;
  border: 5px solid var(--line);
  background: var(--panel);
  padding: clamp(1rem, 2.5vw, 2rem);
}

/* ── Top bar (shared header) ── */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--line);
  width: 100%; /* ← neu */
  box-sizing: border-box; /* ← neu */
}

.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid #fff;
  display: inline-block;
  padding: 0.2rem 0.45rem;
  background: #1000dc;
  color: #fff;
  text-decoration: none;
}

.eyebrow:hover,
.eyebrow:focus-visible {
  background: #000;
  color: #fff;
}

.top-nav {
  display: flex;
  gap: 1.2rem;
}

.top-nav a {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: var(--ink);
  color: #fff;
}

/* ── Inner two-column layout ── */

.wrap {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 1.2rem;
  width: 100%;
}

@media (width <= 900px) {
  .wrap {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .top-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* ── Panel (sidebar + content) ── */

.panel {
  border: 3px solid var(--line);
  background: var(--panel);
  padding: 0.9rem;
  min-width: 0; /* ← das ist der eigentliche Fix */
}

/* ── Sidebar ── */

.back-to-main {
  display: block;
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
}

.back-to-main:hover,
.back-to-main:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  background: none;
}

.sidebar h2 {
  margin: 0 0 0.7rem;
  text-transform: uppercase;
  font-size: 0.95rem;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.35rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.sidebar li a {
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid var(--line);
}

.sidebar li a:hover,
.sidebar li a:focus-visible,
.sidebar li a[aria-current="page"] {
  background: #000;
  color: #fff;
}

.sidebar-footer {
  margin-top: 1rem;
  border-top: 2px solid var(--line);
  padding-top: 0.5rem;
}

.sidebar-media {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.sidebar-media a {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--line);
  background: #fff;
}

.sidebar-media a:hover,
.sidebar-media a:focus-visible {
  background: #000;
  color: #fff;
}

.sidebar-media a svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentcolor;
}

/* ── Content ── */

.content h1,
.content h2,
.content h3,
.content h4 {
  text-transform: uppercase;
  line-height: 1.2;
  margin-top: 1.2rem;
  margin-bottom: 0.7rem;
}

.content h1 {
  margin-top: 0;
  border-bottom: 3px solid var(--line);
  padding-bottom: 0.5rem;
}

.content p,
.content li,
.content blockquote {
  color: #1a1a1a;
  margin: 0 0 0.8rem;
}

.content a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--line);
}

.content a:hover,
.content a:focus-visible {
  background: #000;
  color: #fff;
}

.content code {
  background: #ececec;
  border: 1px solid #ccc;
  padding: 0.05rem 0.25rem;
  font-size: 0.92em;
}

.content pre {
  background: #fafafa;
  border: 2px solid var(--line);
  padding: 0.75rem;
  overflow-x: auto;
}

.content pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.content th,
.content td {
  border: 2px solid var(--line);
  padding: 0.45rem;
  text-align: left;
  vertical-align: top;
}

/* ── Utilities ── */

.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;
}

/* ── Site footer ── */

.site-footer {
  max-width: 1100px;
  margin: 0 auto 1.4rem;
  border: 3px solid var(--line);
  background: var(--panel);
  padding: 0.9rem;
  font-size: 0.92rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.site-footer p {
  margin: 0;
  flex: 1 1 340px;
}

.site-footer .footer-media {
  display: inline-flex;
  gap: 0.45rem;
}

.site-footer .footer-media a {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--line);
  border-bottom: 2px solid var(--line); /* override global a */
  background: #fff;
}

.site-footer .footer-media a svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentcolor;
}

.site-footer .footer-media a:hover,
.site-footer .footer-media a:focus-visible {
  background: #000;
  color: #fff;
}

.site-footer .footer-legal {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.site-footer .footer-legal a {
  font-size: 0.7rem;
  opacity: 0.45;
  text-decoration: none;
  color: inherit;
  border-bottom: none; /* override global a */
  transition: opacity 0.2s;
}

.site-footer .footer-legal a:hover {
  opacity: 1;
  background: none;
  color: inherit;
}
