:root {
    --my-gray: #D8D8E0;
    --my-light-yellow: #FFFFCC;
    --my-yellow: #FFFF00;
    --my-dark-blue: #00008B;
    --my-blue: #0080FF;
    --my-background: white;
    --my-color: black;
    --my-alt-color: white;
    --my-box-margins: 4px;
    --my-border-radius: 12px;
    --my-font-size: 15px;
}
body, html {
    margin: 0;
    height: 100%;
    overflow: hidden;
    /*font-family: Arial, Helvetica, sans-serif;*/
    font-family: ui-sans-serif,-apple-system,BlinkMacSystemFont,system-ui; /* von Obsidan übernommen */
    font-size: var(--my-font-size);
    line-height: 1.5;
}
h1 { font-weight: 700; font-size: 1.618em; }
h2 { font-weight: 680; font-size: 1.462em; }
h3 { font-weight: 660; font-size: 1.318em; }
h4 { font-weight: 640; font-size: 1.188em; }
h5 { font-weight: 620; font-size: 1.026em; }
h6 { font-weight: 600; font-size: 1em; }
.container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background-color: var(--my-background);
    color: var(--my-color);
    margin: 0;
}
#navbar {
	display: flex;
	justify-content: space-between;
    flex-shrink: 0; /* Verhindert, dass die Nav schrumpft */
    box-sizing: border-box;
    height: auto;
    background-color: var(--my-dark-blue);
	background-image: linear-gradient(to top, var(--my-dark-blue), var(--my-blue));
    color: var(--my-alt-color); 
    padding: 7.5px 15px;
    border-radius: var(--my-border-radius); 
    margin: var(--my-box-margins);
}
#navbar a {
    color: var(--my-alt-color);
}
.horizontal {
    display: flex;
    flex-grow: 1;
    overflow: hidden; /* Wichtig: Das Layout selbst scrollt nicht */
}
.sidebar {
    flex: 0 1 250px;
    overflow-y: auto;
    /*min-width: min(20em, 20vw);
    max-width: min(20em, 20vw);*/
    min-width: calc(250px - 2*15px);
    max-width: 20%;
    /* wenn Sidebars immer überblendet werden: 85vw important! */
    background-color: var(--my-gray);
    padding: 15px;
    border-radius: var(--my-border-radius);
    margin: var(--my-box-margins);
    transition: all 0.3s ease;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    vertical-align: center;
}
.hw-logo {
    max-width: 100%;
}
.btn {
    font-size: 20px;
    font-weight: bold;
    vertical-align: center;
    cursor: pointer;    
}
.btn.open-left {
    grid-column: 1;
    justify-self: start; /* Ganz nach links */
    padding-left: 15px;
    color: var(--my-alt-color);
}
.btn.open-right {
    grid-column: 3;
    justify-self: end; /* Ganz nach rechts */
    padding-right: 15px;
    color: var(--my-dark-blue);
}
/* Button-Anzeige steuern */
.btn.open-left, .btn.open-right { display: none; }
#toggle-left:checked ~ .container .open-left { display: inline-block; }
#toggle-right:checked ~ .container .open-right { display: inline-block; }
/* Logik zum Ausblenden */
#toggle-left:checked ~ .container #left-sidebar,
#toggle-right:checked ~ .container #right-sidebar {
    flex: 0 0 0;
    min-width: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden; /* Verhindert Interaktion mit versteckten Elementen */
}
/* Das Overlay (Standard: Versteckt) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}
@media (max-width: 1023px) {
    /* TOC permanent ausblenden */
    .btn.open-right { display: none; }
    #right-sidebar {
        flex: 0 0 0;
        min-width: 0;
        padding: 0;
        margin: 0;
        opacity: 0;
        visibility: hidden; /* Verhindert Interaktion mit versteckten Elementen */
    }
}
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 80%;
        min-width: 260px;
        z-index: 100;
    }
    #left-sidebar { left: 0; } /* transform: translateX(-100%); */
    /* Overlay einblenden, wenn eine Sidebar offen ist */
    #toggle-left:not(:checked) ~ .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }
}
/* Styling für das Banner über dem Inhaltsbereich */
#banner {
    position: sticky;
    height: 100px;
    margin: var(--my-box-margins);
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Links/Rechts flexibel, Mitte passt sich an */
    align-items: center;
    text-align: center;
    color: var(--my-alt-color);
    box-sizing: border-box;
    border-radius: var(--my-border-radius);
    --dynamic-banner: url('_files/HW-Banner.jpg');
    background-image: linear-gradient(to right, var(--my-blue), color-mix(in srgb, var(--my-gray), transparent 70%)), var(--dynamic-banner);
    background-position: right center;
    background-repeat: repeat-x;
    background-size: auto 100%;
    transition: all 0.3s ease-in-out;
    z-index: 90;
}
/* Diese Klasse wird beim Rollen des Inhalts gesetzt oder wieder gelöscht. */
#banner.shrunk {
    height: 64px;
}
#banner h1 {
    grid-column: 2;
    justify-self: center;
    margin: 0;
}
.content-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}
#scrollContainer {
    flex: 1;           /* Nimmt den restlichen Platz ein */
    overflow-y: auto;  /* Hier entsteht die Scrollbar */
    padding: calc(2*var(--my-box-margins));
    padding-top: 0;
}
.content {
    max-width: 80em;
    margin: auto;
    margin-top: 0;
}
.content img {
    max-width: 100%;
    height: auto;
    display: block; /* Verhindert kleine Abstände unter Bildern */
}
/* Styling für den Footer im Inhaltsbereich der Seite */
.article-footer {
    display: flex;
    justify-content: space-between;
    color: var(--my-dark-blue);
    background-color: var(--my-background);
    line-height: 1.3; 
    font-size: 14px;
    padding: .5em .5em;
    border-radius: var(--my-border-radius);
    border-color: var(--my-dark-blue);
    border-width: 2px;
    border-style: solid;
    margin-top: 15px;
}
.article-footer a {
    color:  var(--my-dark-blue);
}
@media (max-width: 767px) {
    .article-footer {
        flex-direction: column; /* Zwingt Elemente untereinander */
    }
}
/* ---- Sidebar left ---- */
.file-explorer {
    margin: 0;
    margin-top: 15px;
    padding: 0;
    color: var(--my-dark-blue);
    list-style-type: none; /* Entfernt Standard-Punkte */
}
.file-explorer ul {
    padding-left: 15px;
    list-style-type: none; /* Entfernt Standard-Punkte */
}
/* Styling der Ordner-Überschriften */
li.file-explorer-header {
    padding-left: 15px; /* Platz für ein Icon lassen */
    margin-top: 5px;
    font-size: 1.188em;
    font-weight: 640;
}
summary {
    cursor: pointer;    
    padding-left: 20px;
    margin-top: 5px;
    user-select: none; /* Verhindert Textmarkierung beim Klicken */
}
summary:hover {
    color: var(--my-blue);
    background-color: var(--my-light-yellow);
    font-weight: bold;
}
/* Styling der Dateien */
li.file {
    padding-left: 20px; /* Platz für ein Icon lassen */
    margin-top: 5px;
    cursor: pointer;
}
li.file a {
    display: block;
    color: var(--my-dark-blue);
    text-decoration: none;
}
li.file:hover {
    color: var(--my-blue);
    background-color: var(--my-light-yellow);
    font-weight: bold;
}
li.file a:hover {
    color: var(--my-blue);
}
li.file.active-page {
    color: var(--my-dark-blue);
    background-color: var(--my-yellow);
}
.table-of-contents {
    margin-left: -15px;
    color: var(--my-dark-blue);
}
div.table-of-contents-header {
    padding-left: 15px; /* Platz für ein Icon lassen */
    margin-top: 15px;
    margin-bottom: 0;
    font-size: 1.188em; 
    font-weight: 640;
}
.table-of-contents ul {
    list-style-type: none; /* Entfernt Standard-Punkte */
    padding-left: 15px;
    margin: 0;
}
.table-of-contents li {
    margin-top: 5px;
    cursor: pointer;
}
.table-of-contents li a {
    display: block;
    color: var(--my-dark-blue);
    text-decoration: none;
    padding-left: 15px;
}
.table-of-contents li a:hover {
    color: var(--my-blue);
    background-color: var(--my-light-yellow);
    font-weight: bold;
}
.table-of-contents li a::before {
    content: "\2022"; /* Das ist der Unicode für einen dicken Punkt (Bullet) */
    margin-right: 5px; /* Abstand zum Text des Links */
}
article table, thead, tbody, th, td {
    border-collapse: collapse;
    border: 2px solid var(--my-gray);
    font-size: var(--my-font-size);
    padding: 4px 8px;
    min-width: 4ch;
    vertical-align: top;
    line-height: 1.3;
    text-align: left;
}
article table col {
    width: auto !important;
}
article thead, th {
    font-weight: bold !important;
}
/* ---------- MathJax --------------- */
.math.inline mjx-container {
    font-size: 100% !important;
}
mjx-container[jax="CHTML"][display="true"] {
    text-align: left !important;
    text-indent: 2em;
}
/* ---------- MathML --------------- */
/* Zentrierung von Display-Formeln (die mit $$ ... $$) */
math[display="block"] {
    display: block;
    margin: 1em 0 1em 2em;
    text-align: left;
}
/* Schriftgröße an Fließtext anpassen */
math {
    font-size: 1.1em;
}
.gross {
	font-size: 1.6em;
    text-indent: 1.25em !important;
}
/* ---------- Lightbox Image --------------- */
/* Das Overlay-Grundgerüst */
.lightbox-overlay {
  display: none; /* Wird per JS auf 'flex' gesetzt */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.0); /* Startet transparent */
  z-index: 10000;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  transition: background-color 0.3s ease; /* Hintergrund blendet ein */
}
/* Wenn aktiv (Klasse wird per JS hinzugefügt) */
.lightbox-overlay.active {
  display: flex;
  background-color: rgba(0, 0, 0, 0.5);
}
/* Das Bild im Overlay */
.lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.8); /* Startet etwas kleiner */
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), 
              opacity 0.3s ease;
}
/* Animation des Bildes, wenn das Overlay aktiv ist */
.lightbox-overlay.active img {
  transform: scale(1); /* Zoomt auf Originalgröße */
  opacity: 1;
}
/* Wählt alle Links aus, die mit http beginnen */
a[href^="http"]::after {
    content: "\2197"; /* Hex-Code für den Pfeil */
    margin-left: 3px;  
    display: inline-block; 
    text-decoration: none;
}
