/* Farben, Schriften und Breite kommen aus dem Theme in cms/config.php. */

@font-face {
  font-family: Lexend;
  src: url("fonts/lexend-700-900.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}
/* Nur Stärke 500 und ohne Code-Ligaturen, damit Adressen wie https:// unverändert aussehen. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --gutter: clamp(1rem, 4vw, 3rem);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Weicher Wechsel des Farbschemas, site.js setzt die Klasse nur kurz */
@media (prefers-reduced-motion: no-preference) {
  .theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease, text-decoration-color .3s ease, filter .3s ease;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--width); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -999px; top: .5rem;
  background: var(--paper); color: var(--ink); padding: .5rem 1rem; z-index: 2;
}
.skip:focus { left: .5rem; }

/* Dunkles Band: Kopfzeile und Seitentitel */

.band { background: var(--band); color: var(--band-ink); }
.band a { color: inherit; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .25rem 2rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 500 1rem var(--mono);
  text-decoration: none;
}
.brand::before { content: ""; width: .7rem; height: .7rem; background: var(--accent); }
.brand b { font-weight: inherit; }
.brand span { color: var(--band-muted); }

/* Blinkender Cursor hinter dem Logo. Der leere Text hinter dem "/" hält ihn von Screenreadern fern. */
.brand b::after { content: "_"; content: "_" / ""; }
@media (prefers-reduced-motion: no-preference) {
  .brand b::after { animation: cursor-blink 1s step-end infinite; }
}
@keyframes cursor-blink {
  50% { opacity: 0; }
}

.topnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 0; padding: 0; }
.topnav a {
  display: inline-block; padding-block: .35rem;
  text-decoration: none; color: var(--band-muted);
  border-bottom: 2px solid transparent;
}
.topnav a:hover { color: var(--band-ink); }
.topnav a[aria-current] { color: var(--band-ink); border-bottom-color: var(--accent); }

.theme-toggle {
  order: 1; margin-left: auto; min-width: 5.5em;
  padding: .2rem .55rem;
  font: .8125rem var(--mono);
  background: transparent; color: var(--band-muted);
  border: 1px solid var(--band-line); border-radius: var(--radius);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--band-ink); border-color: var(--band-muted); }
.theme-toggle[hidden] { display: none; }
.topnav { order: 2; flex-basis: 100%; }

@media (min-width: 52rem) {
  .topnav { order: 1; flex-basis: auto; margin-left: auto; }
  .theme-toggle { order: 2; margin-left: 0; }
}

.pagehead { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); }

h1 {
  margin: 0;
  font: 900 clamp(2.25rem, 7vw, 4.75rem)/1.06 var(--display);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
h1 em { font-style: normal; color: var(--accent); }

/* Dachzeile über dem Titel */
.eyebrow {
  display: flex; align-items: center; gap: .6rem;
  margin: 0 0 1rem;
  font: 700 .8125rem/1.3 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; flex: none; width: 1.75rem; height: 2px; background: currentColor; }
.pagehead .sub { margin: 1rem 0 0; max-width: 40rem; color: var(--band-muted); font-size: 1.125rem; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* Startseite */

.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid {
  display: grid; gap: 2rem clamp(2rem, 6vw, 5rem);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
.hero-grid p { margin: 0; font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.5; max-width: 36rem; }

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-title {
  margin: 0 0 1.25rem;
  font: 700 .8125rem/1.3 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--link);
}

/* Hostnamen-Liste */

.hosts { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.host {
  display: grid; gap: .1rem 2rem; align-items: baseline;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
}
.host-name {
  font: 500 clamp(1.3rem, 2.6vw, 1.7rem)/1.3 var(--mono);
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.host-name .dim { color: var(--muted); }
.host-name:hover, .host-name:hover .dim { color: var(--link); }
.host p { margin: 0; color: var(--muted); }
.host-alt { display: flex; flex-wrap: wrap; gap: .1rem 1rem; font: .875rem var(--mono); white-space: nowrap; }

@media (min-width: 52rem) {
  .host { grid-template-columns: 19rem minmax(0, 1fr) auto; }
}

/* Kacheln: die ganze Fläche ist klickbar */

.tiles {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  border-bottom: 0;
}
.tiles .host {
  position: relative;
  display: block;
  padding: 1.25rem;
  background: var(--code-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-tile);
}
.tiles .host:hover { border-color: var(--accent); }
.tiles .host:focus-within { border-color: var(--accent); }
.tiles .host-name { display: block; margin-bottom: .4rem; font: 700 1.25rem/1.3 var(--display); letter-spacing: 0; }
.tiles .host-name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tiles .host-name:focus-visible { outline: 0; }
.tiles .host-name:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.tiles .host-alt, .tiles .host p a { position: relative; z-index: 1; }

.hosts + .prose { margin-top: 1.25rem; color: var(--muted); }
.content > .prose:last-child > :last-child { margin-bottom: 0; }
.content > .prose + .section-title, .content > .prose + .hosts, .content > .prose + .stats { margin-top: 2.5rem; }

/* Fließtext */

.prose { max-width: 44rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.75rem 0 .6rem; font: 800 1.5rem/1.25 var(--display); letter-spacing: -.01em; }
.prose h3 { margin: 2rem 0 .4rem; font: 700 1.1875rem/1.3 var(--display); }
.prose h4 { margin: 1.5rem 0 .3rem; font: 650 1.0625rem/1.35 var(--sans); }
.prose p, .prose ul { margin-block: 0 1rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--accent); }
.prose li > p { margin: 0; }
.prose code, .endpoint code { font-family: var(--mono); font-size: .92em; }
.prose code { background: var(--code-bg); padding: .1em .35em; border-radius: 3px; }

.prose { overflow-wrap: break-word; }
.prose blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 2px solid var(--accent); color: var(--muted); }
.prose pre { margin-block: 0 1rem; padding: 1rem; overflow-x: auto; background: var(--code-bg); border-radius: var(--radius); line-height: 1.45; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2rem; }
.prose .table { overflow-x: auto; margin-block: 0 1rem; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { padding: .35rem 1rem .35rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

/* Bilder behalten auch im Dark Mode ihren hellen Grund */

.plate { display: inline-block; background: #fff; padding: .75rem; border-radius: var(--radius); line-height: 0; filter: var(--plate-filter); }
.plate img { display: block; }

.logos { display: flex; flex-wrap: wrap; gap: 1rem; margin-block: 2rem; }
.logos a { display: block; }
.logos .plate { display: block; }
.logos img { width: 112px; height: 112px; }

/* Verbindungsdaten */

.endpoints { display: grid; gap: .5rem; margin-block: 0 2.25rem; max-width: 44rem; }
.endpoint {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .1rem 1rem;
  padding: .7rem 1rem;
  background: var(--code-bg);
  border-radius: var(--radius);
}
.endpoint .label { grid-column: 1 / -1; font: .8125rem var(--mono); color: var(--muted); }
.endpoint code { font-size: clamp(1rem, 2.4vw, 1.2rem); overflow-wrap: anywhere; }

.copy, .button {
  font: .875rem var(--mono);
  padding: .3rem .7rem;
  background: transparent; color: var(--ink);
  border: 1px solid var(--muted); border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
}
.copy:hover, .button:hover { border-color: var(--link); color: var(--link); }
.button { display: inline-block; margin-block: 0 2.25rem; padding: .55rem 1rem; }

/* Statistik */

.stats { display: grid; gap: 2.5rem 2rem; }
.stats section { min-width: 0; }
.stats h2 { margin: 0 0 .75rem; font: 500 .875rem var(--mono); color: var(--muted); }
.stats .plate { max-width: 100%; }
.stats p { margin: 0 0 .75rem; }
@media (min-width: 72rem) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Fußzeile */

.foot { border-top: 1px solid var(--line); padding-block: 1.5rem; color: var(--muted); font-size: .9375rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.render-time { font-family: var(--mono); font-size: .8125rem; }
.foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; padding: 0; }
.foot a { color: inherit; }
.foot a:hover { color: var(--link); }
