/* =========================================
   STYLESHEET – Prof. Dr. Hofmann
   Stand: 17.08.2025 (clean)
   ========================================= */

/* ---------- Variablen ---------- */
:root {
 --farbe-blau-grau: #1e3d64;
 --farbe-hellgrau: #f4f4f4;
 --farbe-akzent: #007acc;
 --orange: #e47128;
 --text: #222;
 --bg: #fff;
 --radius: 0.375rem;
 --shadow: 0 0 0.625rem rgba(0, 0, 0, 0.08);
}

/* ---------- Reset & Grundlayout ---------- */
* {
 box-sizing: border-box;
}
html {
 scroll-behavior: smooth;
}
body {
 margin: 0;
 padding: 0;
 font-family:
  system-ui,
  -apple-system,
  "Segoe UI",
  Roboto,
  sans-serif;
 font-size: 18px;
 line-height: 1.6;
 color: var(--text);
 background: var(--bg);
}

/* ---------- Layout-Container ---------- */
/* Gesamtseite begrenzen & zentrieren */
.page-container {
 max-width: 1100px;
 margin: 24px auto;
 padding: 0 24px;
}

/* Lesespalte für Inhaltsseiten (schmaler & gut lesbar) */
.content-container-Inhalt {
 max-width: 1000px;
 margin: 40px auto;
 padding: 0 16px;
}

/* ---------- Typografie ---------- */
p {
 margin: 0 0 1.2em;
}
ul,
ol {
 margin: 0 0 1.2em 1.5em;
 padding: 0;
}
h1 {
 font-size: 2rem;
 line-height: 1.3;
 margin: 1.5em 0 0.5em;
}
h2 {
 font-size: 1.5rem;
 line-height: 1.4;
 margin: 1.2em 0 0.5em;
}
h3 {
 font-size: 1.25rem;
 line-height: 1.4;
 margin: 1em 0 0.5em;
}

/* Abschnittsüberschrift mit zusätzlichem Abstand */
.abstandUeberschrift {
 margin-top: 3rem;
 margin-bottom: 1.5rem;
 padding-left: 1rem;
}

/* ---------- Content-Links (nicht Navigation) ---------- */
main a,
p a,
article a {
 color: #444; /* dunkelgrau */
 text-decoration: none;
 font-weight: 500;
}
main a:hover,
p a:hover,
article a:hover {
 color: var(--orange); /* Hover Orange */
}
main a:focus-visible,
p a:focus-visible,
article a:focus-visible {
 outline: 2px solid #66b2ff;
 outline-offset: 2px;
 border-radius: 3px;
}

/* ---------- Text-Links   ---------- */
.textlink {
 color: #0055aa;
 font-weight: 500;
 text-decoration: none;
 background-color: rgba(0, 85, 170, 0.06); /* sanftes Blau */
 padding: 2px 6px;
 border-radius: 4px;
 transition:
  background-color 0.3s ease,
  color 0.3s ease;
}
.textlink:hover {
 background-color: rgba(0, 85, 170, 0.12);
 color: #003377;
}

/* ---------- Text-Links   ---------- */
.textlink2 {
 color: white;
 font-weight: 500;
 text-decoration: none;
 background-color: rgba(0, 85, 170, 0.06); /* sanftes Blau */
 padding: 2px 6px;
 border-radius: 4px;
 transition:
  background-color 0.3s ease,
  color 0.3s ease;
}
.textlink2:hover {
 background-color: rgba(0, 85, 170, 0.12);
 color: var(--orange);
}

/* sanfter Rahmen
.textlink {
  color: #0055aa;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(0, 85, 170, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}
.textlink:hover {
  border-color: rgba(0, 85, 170, 0.4);
  color: #003377;
}
*/

/* „Zurück“-Link  */
.zurueck-link {
 display: inline-block;
 color: var(--farbe-akzent);
 background: #eaeaea;
 padding: 0.5rem 1rem;
 border-radius: 0.375rem;
 text-decoration: none;
 font-weight: 600;
 margin-bottom: 1rem; /* Abstand nach unten */
}
.zurueck-link:hover {
 background: #f0f0f0;
 color: var(--orange);
}

/* =========================================
   HEADER / LOGO / HOME-BUTTON
   ========================================= */
.site-header {
 position: relative;
 display: flex;
 justify-content: center; /* H1 mittig */
 align-items: center;
 padding: 1rem 0;
}
.site-header h1 {
 margin: 0;
}

/* Logo (falls im Header genutzt) */
header .logo,
.site-header .logo {
 height: 200px; /* Größe hier steuern */
 width: auto;
 max-width: 100%;
 display: block;
}

/* Runder Home-Button links vom Header */
.home-link {
 position: absolute;
 left: 1rem;
 top: 50%;
 transform: translateY(-50%);
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 40px;
 height: 40px;
 border-radius: 50%;
 background: var(--farbe-blau-grau);
 color: #fff;
 text-decoration: none;
 transition:
  background 0.2s ease,
  transform 0.1s ease;
}
.home-link:hover {
 background: var(--farbe-akzent);
}
.home-link:active {
 transform: translateY(-50%) scale(0.98);
}
.icon-home {
 width: 22px;
 height: 22px;
 display: block;
 fill: currentColor;
}

/* Mobile Anpassungen Header */
@media (max-width: 600px) {
 .home-link {
  width: 36px;
  height: 36px;
  left: 0.75rem;
 }
 .icon-home {
  width: 20px;
  height: 20px;
 }
 header .logo,
 .site-header .logo {
  height: 120px;
 }
}

/* =========================================
   TOP-NAVIGATION (Startseite)
   ========================================= */
.topnav {
 display: flex;
 flex-wrap: wrap;
 justify-content: center;
 gap: 0.5rem;
 background: var(--farbe-blau-grau);
 padding: 0.5rem;
}
.topnav a {
 color: #fff;
 text-decoration: none;
 padding: 10px 14px;
 border-radius: var(--radius);
 font-size: 17px;
 font-weight: 600;
}
.topnav a:hover,
.topnav a.active {
 background: var(--farbe-akzent);
}

/* =========================================
   STARTSEITE: Karten/Artikel-Layout
   ========================================= */
section {
 display: flex;
 flex-wrap: wrap;
 gap: 1.25rem;
 align-items: stretch;
 padding: 1rem;
}
article {
 flex: 1 1 calc(50% - 1.25rem);
 max-width: calc(50% - 1.25rem);
 min-width: 320px;
 display: flex;
 flex-direction: column;
 gap: 0.5rem;
 background: #fafafa;
 border: 1px solid #ddd;
 border-radius: var(--radius);
 padding: 1rem;
 box-shadow: var(--shadow);
}
@media (max-width: 720px) {
 article {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
 }
}

/* Karten-Inhalt (Bild + Text nebeneinander) */
.container {
 display: flex;
 gap: 1rem;
 align-items: flex-start;
}
.image-wrapper {
 flex: 4;
 max-height: 18.75rem;
 min-width: 0;
}
.image-wrapper img {
 width: 100%;
 height: auto;
 max-height: 12.5rem;
 object-fit: cover;
 display: block;
 border-radius: 0.25rem;
}
.text-wrapper {
 flex: 6;
 padding-left: 1rem;
 min-width: 0;
}

/* =========================================
   BILDER
   ========================================= */
img {
 max-width: 100%;
 height: auto;
 display: block;
}

/* Bilder in Leseseiten: zentriert & begrenzt */
/* werden mit der Angabe der Klasse bildblock erstellt */
.content-container-Inhalt img,
.bildblock img {
 width: 100%;
 max-width: 900px;
 height: auto;
 margin: 1.5rem auto;
 border-radius: 8px;
}
.bildblock {
 text-align: center;
 margin: 1rem auto;
}
.bildblock figcaption {
 font-size: 0.95rem;
 color: #666;
 margin-top: 0.5rem;
}

/* =========Kleine Bilder====================*/
/* werden mit der Angabe der Klasse bildblockSmall erstellt */

/* Bilder in Leseseiten: zentriert & begrenzt */
.content-container-Inhalt img,
.bildblockSmall img {
 width: 80%;
 max-width: 600px;
 height: auto;
 margin: 1.5rem auto;
 border-radius: 8px;
}
.bildblockSmall {
 text-align: center;
 margin: 1rem auto;
}
.bildblockSmall figcaption {
 font-size: 0.95rem;
 color: #666;
 margin-top: 0.5rem;
}

/* === 📊 Tabellen-Styling === */
/* erzeugt eine Klasse...die im HTML dann Anwendung findet */
/* hier in der Tabelle:    <table class="tabelle">         */
.tabelle {
 margin: 1rem auto;
 border-collapse: collapse;
 line-height: 1.2;
 width: auto;
 border: 1px solid #999;
}

.tabelle caption {
 caption-side: bottom;
 padding-top: 0.5rem;
 font-style: italic;
 font-size: 0.95rem;
 color: #444;
 text-align: center;
}

/* Nur Kopfzeilen th = header */
.tabelle th {
 background-color: #f0f0f0;
 font-weight: bold;
 padding: 0.5rem;
 border: 1px solid #ccc;
 text-align: left;
}

/* Nur Datenzellen  td = data cell*/
.tabelle td {
 padding: 0.5rem;
 border: 1px solid #ccc;
 font-weight: normal;
 background-color: white;
}

/* Zebra-Streifen für Datenzeilen tr = row gruppiert */
.tabelle tr:nth-child(even) td {
 background-color: #f9f9f9;
}
.tabelle td,
.tabelle th {
 font-size: 0.9rem; /* kleiner als body (1.1rem) */
}

/* =========================================
   CODE / PRISM
   ========================================= */
p code {
 font-family:
  "JetBrains Mono", "Fira Code", "Source Code Pro", Menlo,
  Monaco, "Courier New", monospace;
 background: var(--farbe-hellgrau);
 padding: 2px 4px;
 border-radius: 4px;
 font-size: 0.95em;
 white-space: break-spaces; /* darf umbrechen, behält Leerzeichen */
}
pre[class*="language-"],
code[class*="language-"] {
 font-family:
  "JetBrains Mono", "Fira Code", "Source Code Pro", Menlo,
  Monaco, "Courier New", monospace !important;
}
pre[class*="language-"] {
 padding: 0.1em 0.8em 0.2em 0.8em;
 margin-top: 0;
 background: #f2f2f2 !important;
 border-radius: 4px;
 overflow-x: auto;
 white-space: pre;
 word-wrap: normal;
}
code[class*="language-"] {
 font-size: 15px;
 line-height: 1.4; /* ZeilenAbstand */
 margin: 0;
 padding: 0;
 background: transparent !important;
 border-radius: 4px;
 box-shadow: none;
 text-shadow: none;
}
pre::selection,
code::selection {
 background: #cce8ff;
}

/* ============================= */
/* Prism.js Custom Token Styles */
/* ============================= */
.token.operator,
.token.punctuation,
.token.symbol {
 color: inherit; /* gleiche Textfarbe wie Umgebung */
 background-color: #f2f2f2 !important; /* exakt wie Codeblock */
 padding: 0 2px;
 border-radius: 2px;
}

/* =========================================
   TABELLEN
   ========================================= */
.tabelle {
 margin: 1rem auto;
 border-collapse: collapse;
 line-height: 1.2;
 width: auto;
 border: 1px solid #999;
}
.tabelle th {
 background: #f0f0f0;
 font-weight: 700;
 padding: 0.5rem;
 border: 1px solid #ccc;
 text-align: left;
}
.tabelle td {
 padding: 0.5rem;
 border: 1px solid #ccc;
 background: #fff;
}
.tabelle tr:nth-child(even) td {
 background: #f9f9f9;
}
.tabelle caption {
 caption-side: bottom;
 padding-top: 0.5rem;
 font-style: italic;
 font-size: 0.95rem;
 color: #444;
 text-align: center;
}

/* =========================================
   TOC – Inhaltsverzeichnis (schlicht)
   ========================================= */

nav.toc {
 background: #fafafa;
 border: 1px solid #ddd;
 border-radius: 8px;
 padding: 1rem 1.5rem;
 margin: 2rem 0;
 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* leichte Schatten */
}
nav.toc h2 {
 font-size: 1.2rem;
 font-weight: 700;
 margin-bottom: 0.75rem;
 color: #1e3d64;
}

nav.toc ul {
 list-style: none;
 margin: 0;
 padding-left: 0;
}
nav.toc li {
 margin: 0.1rem 0;
}
nav.toc li ul {
 margin-top: 0.25rem;
 padding-left: 1.5rem;
 font-weight: 400;
}
/* Links im TOC */
nav.toc a,
nav.toc a:link,
nav.toc a:visited {
 color: #444;
 text-decoration: none;
 font-weight: 500;
}
nav.toc a:hover,
nav.toc a:focus {
 color: var(--orange);
 text-decoration: none;
}
/* angenehmes Ankerscrollen + Optional-Highlight */
.content-container-Inhalt h2[id],
.content-container-Inhalt h3[id],
.content-container-Inhalt h4[id] {
 scroll-margin-top: 80px;
}
.content-container-Inhalt :target {
 animation: tocTargetFlash 1.2s ease-out 1;
}
@keyframes tocTargetFlash {
 0% {
  background: rgba(228, 113, 40, 0.14);
 }
 100% {
  background: transparent;
 }
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
 text-align: center;
 padding: 1rem;
 background: var(--farbe-blau-grau);
 color: #fff;
 margin-top: 2rem;
}

/* =========================================
   SONSTIGES
   ========================================= */
hr {
 border: none;
 height: 2px;
 background: #ccc;
 margin: 1rem 0;
}
hr.linie {
 height: 2px;
 background: gray;
 margin: 20px 0;
}

/* Hervorhebung einzelner Wörter  */

/* text ...xcth <span class="highlightWord"> W O R T </span> ) abcText ... */
.highlightWord {
 color: var(--orange);
 font-weight: bold;
}
/*<span class="highlightCode"> W O R T </span> */
/* Anwendung in HTML: <span class="highlightCode">writeRegister(uint8_t reg, uint8_t value)</span>*/
.highlightCode {
 font-family:
  "JetBrains Mono", "Fira Code", "Source Code Pro", Menlo,
  Monaco, "Courier New", monospace;
 color: var(--text);
 font-size: 0.95em;
 /*font-weight: bold;*/
}

/* =========================================
   STARTSEITE kompakter (optional via <body class="home">)
   ========================================= */
.home .page-container {
 max-width: 1200px;
 padding: 0 24px;
}
.home section {
 padding: 0.5rem;
 gap: 1rem;
}
.home article {
 padding: 0.875rem;
}
.home .container {
 gap: 0.75rem;
}

/* Optional: 3 Spalten ab großem Desktop */
@media (min-width: 1280px) {
 .home article {
  flex: 1 1 calc(33.333% - 1rem);
  max-width: calc(33.333% - 1rem);
 }
}
@media (min-width: 1400px) {
 .home .page-container {
  max-width: 1280px;
  padding: 0 28px;
 }
}

/* Optional: Zitat Formatierung */
.inspirational-quote {
 font-family: "Georgia", serif;
 font-size: 1.2rem;
 line-height: 1.6;
 color: #333;
 background: #f9f9f9;
 border-left: 6px solid #007aff;
 padding: 1.5em 2em;
 margin: 2em auto;
 max-width: 700px;
 box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.inspirational-quote p {
 line-height: 1.4;
 margin-bottom: 1em;
}

.inspirational-quote footer {
 margin-top: 1em;
 font-size: 0.95rem;
 color: #555;
 text-align: right;
}

.inspirational-quote cite {
 font-style: italic;
 color: #007aff;
}
