/*
 * Theme für die Browser-Seite von ip.rbn.gr, im Stil von robingroppe.de. Der Dienst steht für sich,
 * deshalb gibt es kein Menü der Webseite. Die Fußzeile verlinkt nur Status, Impressum und Datenschutz.
 *
 * Die Farben sind eine Kopie der Werte aus public/cms/config.php. Ändern sie sich dort,
 * müssen sie auch hier angepasst werden. curl, JSON und die übrigen Formate betrifft das nicht.
 */

@font-face {
  font-family: Lexend;
  src: url("fonts/lexend-700-900.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}
@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;
}

/* Farben und Schriften: erst die für beide Modi, dann hell, dann zwei Wege zu dunkel */

:root {
  color-scheme: light dark;
  --accent: #e46b25;
  --band: #262422;
  --band-line: #454139;
  --band-ink: #f7f4ee;
  --band-muted: #b9b2a7;
  --radius: 4px;
  --width: 72rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --display: Lexend, "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;

  --paper: #f7f4ee;
  --ink: #1d1b18;
  --muted: #6a645b;
  --line: #d9d3c8;
  --link: #b3470c;
  --code-bg: #ece7dd;
  --ok: #1a7f37;
  --bad: #b23b3b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1816;
    --ink: #f0ebe2;
    --muted: #b9b2a7;
    --line: #38342f;
    --link: #f08a4b;
    --code-bg: #2b2926;
    --ok: #3fb950;
    --bad: #f0655c;
  }
}
:root[data-theme="dark"] {
  --paper: #1a1816;
  --ink: #f0ebe2;
  --muted: #b9b2a7;
  --line: #38342f;
  --link: #f08a4b;
  --code-bg: #2b2926;
  --ok: #3fb950;
  --bad: #f0655c;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

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

/* Grundlagen */

*, *::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;
}

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

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

code { font-family: var(--mono); font-size: .92em; background: var(--code-bg); padding: .1em .35em; border-radius: 3px; }

.muted { color: var(--muted); }

/* Dunkles Band: Kopfzeile und Titel */

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

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

#theme-toggle {
  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; }

/* Ohne Menü wäre die Kopfzeile flacher, am Desktop bleibt sie so hoch wie auf der Webseite. */
@media (min-width: 52rem) {
  .topbar { min-height: 4.76rem; }
}

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

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

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

/* Inhalt */

main { flex: 1; padding-block: clamp(2rem, 5vw, 3.5rem); }

.note { margin: 1.5rem 0 0; color: var(--muted); }

main ul { padding-left: 1.2rem; }
main li::marker { color: var(--accent); }

/* Tabelle der Adressen */

#dual { width: 100%; border-collapse: collapse; }

#dual th {
  padding: 0 1rem .6rem 0;
  text-align: left;
  font: 700 .8125rem/1.3 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--link);
  border-bottom: 1px solid var(--line);
}

/* Die erste Spalte jeder Zeile nennt die Adressfamilie */
#dual tr + tr th { padding-block: .9rem; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--line); }
#dual th:first-child { width: 4.5rem; }

#dual td {
  padding: .9rem 1rem .9rem 0;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  font: 500 1.0625rem/1.4 var(--mono);
  overflow-wrap: anywhere;
}
#dual td + td { font-size: .9375rem; color: var(--muted); }
#dual .muted { font-family: var(--sans); font-weight: 400; font-size: .9375rem; }

.copy-btn {
  margin-left: .5rem;
  padding: .15rem .55rem;
  font: .8125rem var(--mono);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--muted); border-radius: 3px;
  cursor: pointer;
  vertical-align: middle;
}
.copy-btn:hover { color: var(--link); border-color: var(--link); }
.copy-btn[hidden] { display: none; }

.verify { font: .875rem/1 "Segoe UI Symbol", "Apple Symbols", system-ui, sans-serif; font-variant-emoji: text; }
.verify.ok { color: var(--ok); }
.verify.bad { color: var(--bad); }

/* Die Adresse bleibt einzeilig, auch eine volle IPv6-Adresse. Umbrechen darf nur der Reverse-DNS-Name. */
#dual td:nth-of-type(1) { white-space: nowrap; }

/* Auf schmalen Bildschirmen steht jede Adresse als eigener Block untereinander.
   Die Schrift wächst mit der Breite, damit 39 Zeichen IPv6 auch auf dem Handy in eine Zeile passen. */
@media (max-width: 62rem) {
  #dual, #dual tbody, #dual tr, #dual th, #dual td { display: block; width: auto; }
  #dual tr:first-child { display: none; }
  #dual tr { padding-block: .9rem; border-bottom: 1px solid var(--line); }
  #dual tr + tr th { padding: 0 0 .25rem; border: 0; }
  #dual td { padding: .1rem 0; border: 0; }
  #dual td:nth-of-type(1) { white-space: normal; font-size: clamp(.75rem, 3.8vw, 1.0625rem); }
}

/* 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: flex-end; gap: .5rem 2rem; }
.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); }
