/* ==========================================================================
   domcloud.ch – "VS Code Dark Modern" look
   Einbinden im <head> von index.html:
     <link rel="stylesheet" href="style.css">
   Keine externen Schriften, kein Tracking: es werden nur Schriften
   verwendet, die auf dem Gerät des Besuchers schon installiert sind.
   ========================================================================== */

:root {
  /* Flächen */
  --bg:          #1f1f1f;   /* Editor */
  --bg-bar:      #181818;   /* Tab-Leiste, Statusleiste */
  --bg-hover:    #2a2d2e;   /* aktuelle Zeile */
  --bg-code:     #2b2b2b;
  --line:        #2b2b2b;   /* Trennlinien */
  --accent:      #0078d4;   /* VS-Code-Blau */

  /* Schrift */
  --fg:          #cccccc;
  --fg-dim:      #6e7681;   /* Zeilennummern, Nebensächliches */

  /* Syntax-Farben (Dark+) */
  --blue:        #569cd6;   /* Keywords, Markdown-Überschriften */
  --lightblue:   #9cdcfe;   /* Variablen */
  --link:        #4fc1ff;
  --yellow:      #dcdcaa;   /* Funktionen */
  --teal:        #4ec9b0;   /* Typen */
  --orange:      #ce9178;   /* Strings */
  --green:       #6a9955;   /* Kommentare */
  --number:      #b5cea8;   /* Zahlen */
  --purple:      #c586c0;   /* Kontrollfluss */
  --marker:      #6796e6;   /* Listenpunkte */

  --mono: 'Cascadia Code', 'Cascadia Mono', Consolas, 'JetBrains Mono',
          'Fira Code', 'DejaVu Sans Mono', 'Courier New', monospace;
  --gutter: 56px;
}

/* --------------------------------------------------------------------------
   Grundgerüst
   -------------------------------------------------------------------------- */

html {
  background: var(--bg);
  scrollbar-color: #424242 var(--bg);
}

body {
  margin: 0 auto;
  max-width: 920px;
  padding: 56px 24px 64px calc(var(--gutter) + 16px);
  font: 13px/1.6 var(--mono);
  color: var(--fg);
  background: var(--bg);
  counter-reset: zeile;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #264f78;
}

/* --------------------------------------------------------------------------
   Fensterrahmen: Tab-Leiste oben, Statusleiste unten (reine Dekoration)
   -------------------------------------------------------------------------- */

/* Leiste oben über die ganze Breite */
html::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 35px;
  background: var(--bg-bar);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

/* aktiver Tab */
body::before {
  content: '<>  index.html  ×';
  position: fixed;
  top: 0;
  left: 0;
  height: 35px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  font: 12px var(--mono);
  color: #ffffff;
  background: var(--bg);
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--line);
  z-index: 11;
}

/* Statusleiste unten, links das blaue Remote-Feld */
body::after {
  content: ' ><  WSL: Ubuntu    ⎇ main    ⊗ 0  ⚠ 0          UTF-8   LF   HTML';
  position: fixed;
  inset: auto 0 0 0;
  height: 22px;
  display: flex;
  align-items: center;
  white-space: pre;
  overflow: hidden;
  font: 12px var(--mono);
  color: #ffffff;
  background: linear-gradient(90deg, var(--accent) 0 17ch, var(--bg-bar) 17ch);
  border-top: 1px solid var(--line);
  z-index: 10;
}

/* --------------------------------------------------------------------------
   Zeilennummern im linken Rand
   -------------------------------------------------------------------------- */

h1, h2, body > p, section > p, footer p {
  position: relative;
  counter-increment: zeile;
}

h1::before, h2::after, body > p::before, section > p::before, footer p::after {
  content: counter(zeile);
  position: absolute;
  left: calc(-1 * var(--gutter) - 16px);
  width: var(--gutter);
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  line-height: inherit;
  color: var(--fg-dim);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Überschriften: Markdown-Stil (# / ##), blau und fett
   -------------------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--blue);
  line-height: 1.4;
}

h1 {
  font-size: 18px;
  margin: 0 0 0.3em;
}

h1 {
  display: flex;
  align-items: baseline;
  gap: 1ch;
}

h1::after {
  content: '▍';
  color: #aeafad;
  font-weight: 400;
  animation: cursor 1.1s steps(1) infinite;
}

h2 {
  font-size: 14px;
  margin: 2.2em 0 0.6em;
  padding-top: 0.6em;
  border-top: 1px solid var(--line);
  scroll-margin-top: 45px;        /* Sprungziel (#journal usw.) nicht unter der Tab-Leiste */
}

hr + h2,
hr + section > h2:first-child {
  border-top: 0;
  margin-top: 1em;
  padding-top: 0;
}

h2::before {
  content: '## ';
  color: var(--blue);
  opacity: 0.6;
}

@keyframes cursor {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  h1::after { animation: none; }
}

/* --------------------------------------------------------------------------
   Text
   -------------------------------------------------------------------------- */

p {
  margin: 0 0 0.9em;
}

/* Untertitel direkt nach h1: wie ein Kommentar */
h1 + p {
  color: var(--green);
  font-style: italic;
}

strong, b {
  color: var(--yellow);
  font-weight: 600;
}

em, i {
  color: var(--orange);
}

code, kbd {
  font: 12px var(--mono);
  color: var(--orange);
  background: var(--bg-code);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 1.4em 0;
}

/* --------------------------------------------------------------------------
   Navigation: wie Breadcrumbs / Tabs
   -------------------------------------------------------------------------- */

nav {
  color: var(--fg-dim);           /* die | dazwischen werden grau */
  font-size: 12px;
  line-height: 2;
}

nav a {
  color: var(--purple);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

nav a:hover {
  text-decoration: none;
  background: var(--bg-hover);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Listen
   -------------------------------------------------------------------------- */

ul {
  list-style: none;
  padding-left: 2ch;
  margin: 0 0 1em;
}

li {
  position: relative;
  margin: 0.15em 0;
  padding-left: 2ch;
}

li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: var(--marker);
}

li:hover {
  background: var(--bg-hover);
}

/* --------------------------------------------------------------------------
   Tabellen: Journal und Forum
   -------------------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4em 0 1.2em;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--teal);
  padding: 0.35em 0.8em;
  border-bottom: 1px solid #3c3c3c;
  white-space: nowrap;
}

td {
  padding: 0.3em 0.8em;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

/* erste Spalte (Datum, Forumsname) farbig */
td:first-child {
  color: var(--number);
  white-space: nowrap;
}

/* Zahlen-Spalten (Tabellen mit 3+ Spalten, z.B. Forum) */
tr:has(td:nth-child(3)) td:not(:first-child) {
  color: var(--lightblue);
}

tr:hover td {
  background: var(--bg-hover);
}

/* --------------------------------------------------------------------------
   Journal nach Kalenderwochen: einklappbar wie eine Region im Editor
   -------------------------------------------------------------------------- */

details {
  margin: 0 0 0.2em;
}

summary {
  cursor: pointer;
  padding: 0.2em 0.4em;
  color: var(--teal);
  font-size: 12.5px;
  border-radius: 3px;
}

summary::marker {
  color: var(--fg-dim);
}

summary:hover {
  background: var(--bg-hover);
  color: #ffffff;
}

summary:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

details > table {
  margin: 0.2em 0 0.8em;
}

/* Höhepunkte über dem Journal: ruhig, wie ein Hinweis im Editor */
.hoehepunkte {
  margin: 0.4em 0 1em;
  padding: 0.5em 0.9em;
  background: var(--bg-bar);
  border-left: 2px solid var(--accent);
}

.hoehepunkte p {
  margin: 0 0 0.2em;
}

.hoehepunkte ul {
  margin: 0;
  padding-left: 0;
}

/* --------------------------------------------------------------------------
   Footer: als Code-Kommentar
   -------------------------------------------------------------------------- */

footer {
  margin-top: 1.5em;
  color: var(--green);
  font-style: italic;
  font-size: 12px;
}

footer p::before {
  content: '// ';
}

footer a {
  color: var(--green);
  text-decoration: underline dotted;
}

/* --------------------------------------------------------------------------
   Kleine Bildschirme: Zeilennummern und Fensterrahmen weglassen
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  :root { --gutter: 0px; }

  body {
    padding: 16px 14px 32px;
    font-size: 13px;
  }

  html::before,
  body::before,
  body::after,
  h1::before, h2::after, body > p::before, section > p::before, footer p::after {
    display: none;
  }

  table, thead, tbody, tr { display: block; }
  th { display: none; }
  tr { padding: 0.4em 0; border-bottom: 1px solid var(--line); }
  td { display: block; border: 0; padding: 0.1em 0; }
}

/* --------------------------------------------------------------------------
   Drucken: hell und schlicht
   -------------------------------------------------------------------------- */

@media print {
  html, body { background: #fff; color: #000; }
  html::before, body::before, body::after,
  h1::before, h2::after, body > p::before, section > p::before, footer p::after,
  h1::after { display: none; }
  body { padding: 0; max-width: none; }
  h1, h2, th, td:first-child, strong, a, nav a, footer, footer a { color: #000; }
}

/* --------------------------------------------------------------------------
   Umschalter OG / CSS: oben rechts in der Tab-Leiste
   -------------------------------------------------------------------------- */

#ansicht {
  position: fixed;
  top: 0;
  right: 16px;
  height: 35px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6ch;
  font-size: 12px;
  color: var(--fg-dim);
  z-index: 12;
  counter-increment: none;
}

#ansicht::before,
#ansicht::after {
  content: none;
}

#ansicht a {
  color: var(--fg-dim);
  padding: 0.1em 0.5em;
  border-radius: 3px;
}

#ansicht a:hover {
  color: #ffffff;
  background: var(--bg-hover);
  text-decoration: none;
}

#ansicht a[aria-current] {
  color: #ffffff;
  background: var(--accent);
}

@media (max-width: 640px) {
  #ansicht {
    position: static;
    height: auto;
    justify-content: flex-end;
    margin-bottom: 0.5em;
  }
}

@media print {
  #ansicht { display: none; }
}

/* --------------------------------------------------------------------------
   Klassen aus dem bestehenden HTML von domcloud.ch
   -------------------------------------------------------------------------- */

/* .nav: Navigationszeile als Absatz */
.nav {
  color: var(--fg-dim);
  font-size: 12px;
  line-height: 2;
  counter-increment: none;
}

.nav::before {
  content: none;
}

.nav a {
  color: var(--purple);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.nav a:hover {
  text-decoration: none;
  background: var(--bg-hover);
  color: #ffffff;
}

/* .klein: Kleingedrucktes, als Kommentar */
.klein {
  font-size: 12px;
  color: var(--green);
  font-style: italic;
}

.klein a {
  color: var(--green);
}

/* besuchte Links nicht violett färben */
a:visited {
  color: var(--link);
}

.nav a:visited {
  color: var(--purple);
}
